gridviz 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gridviz.js +10 -9
- package/dist/gridviz.min.js +1 -1
- package/package.json +1 -1
- package/src/core/Legend.js +6 -6
- package/src/dataset/JSGrid.js +3 -2
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.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:()=>Pu,BackgroundLayerWMS:()=>Cu,CSVGrid:()=>po,ColorCategoryLegend:()=>yc,ColorDiscreteLegend:()=>cc,ColorLegend:()=>nc,CompositionStyle:()=>Vo,DotDensityStyle:()=>Ni,GeoCanvas:()=>Br,GeoJSONLayer:()=>Xu,GridLayer:()=>xu,ImageStyle:()=>pu,IsoFenceStyle:()=>uu,JSGrid:()=>xo,JoyPlotStyle:()=>Bo,LabelLayer:()=>Du,Layer:()=>_n,LegoStyle:()=>_a,Map:()=>ln,MosaicStyle:()=>Da,MultiResolutionDataset:()=>En,NinjaStarStyle:()=>Ya,OrientationLegend:()=>Rc,PillarStyle:()=>hi,SegmentStyle:()=>Qo,ShapeColorSizeStyle:()=>ko,SideCategoryStyle:()=>_i,SideStyle:()=>mi,SizeLegend:()=>Oc,SquareColorCategoryWebGLStyle:()=>Yi,SquareColorWebGLStyle:()=>La,StrokeStyle:()=>Ro,Style:()=>gn,TanakaStyle:()=>va,TextStyle:()=>ii,TiledGrid:()=>oo,TimeSeriesStyle:()=>Qa,TrivariateLegend:()=>Bc,circularInverseScale:()=>Yc,circularScale:()=>Hc,classifier:()=>sa,colorClassifier:()=>fa,discreteColors:()=>ha,exponentialScale:()=>Gc,getParameterByName:()=>Rl,loadChernoffFacesImages:()=>gl,loadImage:()=>dc,logarithmicScale:()=>Wc,nice:()=>vc,orientationLegend:()=>Lc,powerInverseScale:()=>$c,powerScale:()=>Uc,sizeDiscreteLegend:()=>Pc,sizeDiscreteViewScaleLegend:()=>kc,sizeLegend:()=>_c,sizeLegendViewScale:()=>jc,trivariateClassifier:()=>pl,trivariateColorClassifier:()=>vl,viewScale:()=>ia,viewScaleColor:()=>ua,viewScaleColorQuantile:()=>ca,viewScaleCombination:()=>la,viewScaleQuantile:()=>aa});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 L(t,e){return function(){this[t]=e}}function z(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function I(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function B(t,e){for(var r=F(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function D(t,e){for(var r=F(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?z:L)(t,e)):this.node()[t]},classed:function(t,e){var r=I(t+"");if(arguments.length<2){for(var n=F(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,Lt=0,zt="object"==typeof performance&&performance.now?performance:Date,It="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ft(){return Rt||(It(Nt),Rt=zt.now()+Lt)}function Nt(){Rt=0}function Bt(){this._call=this._time=this._next=null}function Dt(t,e,r){var n=new Bt;return n.restart(t,e,r),n}function Gt(){Rt=(Mt=zt.now())+Lt,Et=Tt=0;try{!function(){Ft(),++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=zt.now(),e=t-Mt;e>Ct&&(Lt-=e,Mt=t)}function Ut(t){Et||(Tt&&(Tt=clearTimeout(Tt)),t-Rt>24?(t<1/0&&(Tt=setTimeout(Gt,t-zt.now()-Lt)),At&&(At=clearInterval(At))):(At||(Mt=zt.now(),At=setInterval(Wt,Ct)),Et=1,It(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?Ft():+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?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=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))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ke.exec(t))?Ue(e[1],e[2]/100,e[3]/100,1):(e=Ee.exec(t))?Ue(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 Le(t,e,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function ze(t){return t instanceof de||(t=Me(t)),t?new Fe((t=t.rgb()).r,t.g,t.b,t.opacity):new Fe}function Ie(t,e,r,n){return 1===arguments.length?ze(t):new Fe(t,e,r,null==n?1:n)}function Fe(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Ne(){return`#${We(this.r)}${We(this.g)}${We(this.b)}`}function Be(){const t=De(this.opacity);return`${1===t?"rgb(":"rgba("}${Ge(this.r)}, ${Ge(this.g)}, ${Ge(this.b)}${1===t?")":`, ${t})`}`}function De(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ge(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function We(t){return((t=Ge(t))<16?"0":"")+t.toString(16)}function Ue(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new He(t,e,r,n)}function $e(t){if(t instanceof He)return new He(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new He;if(t instanceof He)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 He(a,u,c,t.opacity)}function He(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Ye(t){return(t=(t||0)%360)<0?t+360:t}function Ve(t){return Math.max(0,Math.min(1,t||0))}function qe(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Xe(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ae,formatHex:Ae,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $e(this).formatHsl()},formatRgb:Ce,toString:Ce}),pe(Fe,Ie,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(Ge(this.r),Ge(this.g),Ge(this.b),De(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:Ne,formatHex:Ne,formatHex8:function(){return`#${We(this.r)}${We(this.g)}${We(this.b)}${We(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Be,toString:Be})),pe(He,(function(t,e,r,n){return 1===arguments.length?$e(t):new He(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?me:Math.pow(me,t),new He(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?be:Math.pow(be,t),new He(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(qe(t>=240?t-240:t+120,o,n),qe(t,o,n),qe(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new He(Ye(this.h),Ve(this.s),Ve(this.l),De(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=De(this.opacity);return`${1===t?"hsl(":"hsla("}${Ye(this.h)}, ${100*Ve(this.s)}%, ${100*Ve(this.l)}%${1===t?")":`, ${t})`}`}}));const Ze=t=>()=>t;function Je(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Ze(isNaN(t)?e:t)}const Ke=function t(e){var r=function(t){return 1==(t=+t)?Je: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):Ze(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Ie(t)).r,(e=Ie(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=Je(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 Qe(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=Ie(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+""}}}Qe((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=n<e-1?t[n+2]:2*i-o;return Xe((r-n/e)*e,a,o,i,u)}})),Qe((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),o=t[(n+e-1)%e],i=t[n%e],a=t[(n+1)%e],u=t[(n+2)%e];return Xe((r-n/e)*e,o,i,a,u)}}));var tr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,er=new RegExp(tr.source,"g");function rr(t,e){var r,n,o,i=tr.lastIndex=er.lastIndex=0,a=-1,u=[],c=[];for(t+="",e+="";(r=tr.exec(t))&&(n=er.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=er.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 nr(t,e){var r;return("number"==typeof e?ne:e instanceof Me?Ke:(r=Me(e))?(e=r,Ke):rr)(t,e)}function or(t){return function(){this.removeAttribute(t)}}function ir(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ar(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 ur(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 cr(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 lr(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 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.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,o)),r}return o._value=e,o}function fr(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 hr(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function yr(t,e){return e=+e,function(){Qt(this,t).delay=e}}function pr(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function vr(t,e){return e=+e,function(){te(this,t).duration=e}}var dr=yt.prototype.constructor;function br(t){return function(){this.style.removeProperty(t)}}var mr=0;function gr(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function wr(){return++mr}var xr=yt.prototype;gr.prototype=function(t){return yt().transition(t)}.prototype={constructor:gr,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 gr(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 gr(a,u,e,r)},selectChild:xr.selectChild,selectChildren:xr.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 gr(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 gr(a,this._parents,this._name,this._id)},selection:function(){return new dr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=wr(),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 gr(n,this._parents,t,r)},call:xr.call,nodes:xr.nodes,node:xr.node,size:xr.size,empty:xr.empty,each:xr.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:nr;return this.attrTween(t,"function"==typeof e?(r.local?lr:cr)(r,n,ye(this,"attr."+t,e)):null==e?(r.local?ir:or)(r):(r.local?ur:ar)(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?sr:fr)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?le:nr;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,br(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=br(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?hr:yr)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?pr:vr)(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]:xr[Symbol.iterator]};var Sr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Or(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 gr?(e=t._id,t=t._name):(e=wr(),(r=Sr).time=Ft(),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||Or(a,e));return new gr(n,this._parents,t,e)};const _r=t=>()=>t;function jr(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 Pr(t,e,r){this.k=t,this.x=e,this.y=r}Pr.prototype={constructor:Pr,scale:function(t){return 1===t?this:new Pr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Pr(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 kr=new Pr(1,0,0);function Er(t){t.stopImmediatePropagation()}function Tr(t){t.preventDefault(),t.stopImmediatePropagation()}function Ar(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Cr(){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 Mr(){return this.__zoom||kr}function Rr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Lr(){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 Ir(t){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(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 Nr(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"!==Ir(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ir(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ir(o)?o:String(o)),n)}var o}Pr.prototype;var Br=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=kr;(function(){var t,e,r,n=Ar,o=Cr,i=zr,a=Rr,u=Lr,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",Mr).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 Pr(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 Pr(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 Pr(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()}Tr(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(Tr(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),Tr(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),Er(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);Tr(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(Er(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(Tr(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(Er(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",Mr),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(kr.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 jr(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:_r(+t),b):a},b.filter=function(t){return arguments.length?(n="function"==typeof t?t:_r(!!t),b):n},b.touchable=function(t){return arguments.length?(u="function"==typeof t?t:_r(!!t),b):u},b.extent=function(t){return arguments.length?(o="function"==typeof t?t:_r([[+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&&Nr(e.prototype,r),n&&Nr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Dr(t){return Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(t)}function Gr(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,Wr(n.key),n)}}function Wr(t){var e=function(t,e){if("object"!==Dr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Dr(e)?e:String(e)}var Ur=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=Wr(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&&Gr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $r(t){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(t)}function 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"!==$r(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==$r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===$r(o)?o:String(o)),n)}var o}var Yr=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}}])&&Hr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function qr(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"!==Vr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Vr(o)?o:String(o)),n)}var o}function Xr(t,e){return Xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xr(t,e)}function Zr(t){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zr(t)}var Jr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xr(t,e)}(a,t);var e,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=Zr(n);if(o){var r=Zr(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){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)}}])&&qr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Yr);function Kr(t){return Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kr(t)}function Qr(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,nn(n.key),n)}}function tn(t,e){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tn(t,e)}function en(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rn(t){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rn(t)}function nn(t){var e=function(t,e){if("object"!==Kr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Kr(e)?e:String(e)}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&&tn(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=rn(n);if(o){var r=rn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Kr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return en(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=en(e=i.call(this,t)),!1,(n=nn(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()}}])&&Qr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Yr);function an(t){return an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},an(t)}function un(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 cn(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"!==an(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==an(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===an(o)?o:String(o)),n)}var o}var ln=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 Br(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 Ur(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 un(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)?un(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,n.blendOperation&&(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;if(o.mixedResolution){var a=o.mixedResolution(i),u=n.cellInfoHTML(i,a);if(!u)return;return{cell:i,html:u,resolution:a}}var c=n.cellInfoHTML(i,o.getResolution());if(!c)return;return{cell:i,html:c,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 Jr({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 on({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&&cn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function sn(t){return sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sn(t)}function fn(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"!==sn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==sn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===sn(o)?o:String(o)),n)}var o}var hn=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))}}}])&&fn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 pn(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 vn(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)?vn(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 vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dn(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 bn(t,e){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bn(t,e)}function mn(t){return mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mn(t)}var gn=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&&bn(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=mn(o);if(i){var r=mn(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 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.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=u,n=[{key:"updateLegendsRecursive",value:function(t,e){if(Array.isArray(t)){var r,n=pn(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.updateLegendsRecursive(o,e)}}catch(t){n.e(t)}finally{n.f()}}else t.update(e)}}],(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){return u.updateLegendsRecursive(this.legends,t),this}},{key:"addLegends",value:function(t){var e,r=pn(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.legends.push(n)}}catch(t){r.e(t)}finally{r.f()}return this}}])&&dn(e.prototype,r),n&&dn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(hn);function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==wn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==wn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===wn(o)?o:String(o)),n)}var o}function Sn(t,e){return Sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sn(t,e)}function On(t){return On=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},On(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&&Sn(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=On(n);if(o){var r=On(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===wn(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.")}}])&&xn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(hn);function jn(t){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(t)}function Pn(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 kn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==jn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===jn(o)?o:String(o)),n)}var o}var En=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 Pn(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)?Pn(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}}])&&kn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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){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 Cn(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)?Cn(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 Cn(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}var Rn=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.mixedResolution=o.mixedResolution,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){if(this.mixedResolution){var r,n=An(e);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=this.mixedResolution(o);if(!(t.x<o.x||o.x+i<t.x||t.y<o.y||o.y+i<t.y))return o}}catch(t){n.e(t)}finally{n.f()}}else{var a,u=this.getResolution(),c=An(e);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(!(t.x<l.x||l.x+u<t.x||t.y<l.y||l.y+u<t.y))return l}}catch(t){c.e(t)}finally{c.f()}}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}},{key:"getDataset",value:function(t,e){return this}}])&&Mn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ln(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function zn(t,e){return fetch(t,e).then(Ln)}var In={},Fn={};function Nn(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Bn(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 Dn(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function Gn(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 Fn;if(l)return l=!1,In;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())!==Fn;){for(var f=[];n!==In&&n!==Fn;)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?"-"+Dn(-n,6):n>9999?"+"+Dn(n,6):Dn(n,4))+"-"+Dn(r.getUTCMonth()+1,2)+"-"+Dn(r.getUTCDate(),2)+(u?"T"+Dn(o,2)+":"+Dn(i,2)+":"+Dn(a,2)+"."+Dn(u,3)+"Z":a?"T"+Dn(o,2)+":"+Dn(i,2)+":"+Dn(a,2)+"Z":i||o?"T"+Dn(o,2)+":"+Dn(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=Nn(t);return function(n,o){return e(r(n),o,t)}}(t,e):Nn(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=Bn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=Bn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Wn=Gn(","),Un=Wn.parse,$n=(Wn.parseRows,Wn.format,Wn.formatBody,Wn.formatRows,Wn.formatRow,Wn.formatValue,Gn("\t")),Hn=$n.parse;function Yn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Vn(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(Yn)}(e,r).then((function(e){return t(e,n)}))}}$n.parseRows,$n.format,$n.formatBody,$n.formatRows,$n.formatRow,$n.formatValue;var qn=Vn(Un);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 Zn(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}}}}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 Kn(){Kn=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"==Xn(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 Qn(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 to(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Qn(i,n,o,a,u,"next",t)}function u(t){Qn(i,n,o,a,u,"throw",t)}a(void 0)}))}}function eo(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}function ro(t,e){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ro(t,e)}function no(t){return no=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},no(t)}Vn(Hn);var oo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ro(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=no(n);if(o){var r=no(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Xn(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():to(Kn().mark((function e(){var r;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zn(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",to(Kn().mark((function n(){var o,i,a,u,c,l,s,f,h,y,p,v,d;return Kn().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,qn(e.url+t+"/"+r+".csv");case 3:if(i=n.sent,!e.preprocess){n.next=27;break}o=[],a=Zn(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=io(o,t,r,e.info),e.cache[t][r]=l,e.map.redraw(),s=!1,f=e.map.getZoom(),h=Zn(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=Zn(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()}}}}}}])&&eo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Rn);function io(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=Zn(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 ao(t){return ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ao(t)}function uo(){uo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function y(){}function p(){}var v={};c(v,i,(function(){return this}));var d=Object.getPrototypeOf,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"==ao(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function 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 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 lo(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)?lo(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 lo(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 so(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 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}function ho(t,e){return ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ho(t,e)}function yo(t){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yo(t)}var po=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ho(t,e)}(a,t);var e,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=yo(n);if(o){var r=yo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ao(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,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=uo().mark((function t(){var e,n,o,i,a,u,c;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,qn(r.url);case 3:e=t.sent,n=co(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=co(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){so(i,n,o,a,u,"next",t)}function u(t){so(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=co(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&&fo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Rn);function vo(t){return vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vo(t)}function bo(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 mo(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"!==vo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==vo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===vo(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 wo(t){return wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wo(t)}var xo=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=wo(n);if(o){var r=wo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vo(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 bo(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)?bo(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()}}}}])&&mo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Rn);function So(t){return So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},So(t)}function Oo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==So(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==So(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===So(o)?o:String(o)),n)}var o}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){return Po=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(t)}var ko=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=Po(n);if(o){var r=Po(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===So(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 Oo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(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){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()}else if("triangle_up"===f){var b=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-b,c.y-b),e.ctx.lineTo(c.x+a,c.y+r+b),e.ctx.lineTo(c.x+r+b,c.y-b),e.ctx.fill()}else if("triangle_down"===f){var m=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-m,c.y+r+m),e.ctx.lineTo(c.x+a,c.y-m),e.ctx.lineTo(c.x+r+m,c.y+r+m),e.ctx.fill()}else if("triangle_left"===f){var g=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x+r+g,c.y+r+g),e.ctx.lineTo(c.x-g,c.y+a),e.ctx.lineTo(c.x+r+g,c.y-g),e.ctx.fill()}else{if("triangle_right"!==f)throw new Error("Unexpected shape:"+f);var w=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-w,c.y-w),e.ctx.lineTo(c.x+r+w,c.y+a),e.ctx.lineTo(c.x-w,c.y+r+w),e.ctx.fill()}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({viewScale:i,resolution:r,z:o,cells:t})}}],r&&_o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Eo(t){return Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eo(t)}function To(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 Ao(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"!==Eo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Eo(o)?o:String(o)),n)}var o}function Co(t,e){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Co(t,e)}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}var Ro=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Co(t,e)}(a,t);var e,r,n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mo(n);if(o){var r=Mo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Eo(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 To(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)?To(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)console.error("Not implemented");else if("triangle_up"===h){var d=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-d,c.y-d),e.ctx.lineTo(c.x+a,c.y+r+d),e.ctx.lineTo(c.x+r+d,c.y-d),e.ctx.closePath(),e.ctx.stroke()}else if("triangle_down"===h){var b=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-b,c.y+r+b),e.ctx.lineTo(c.x+a,c.y-b),e.ctx.lineTo(c.x+r+b,c.y+r+b),e.ctx.closePath(),e.ctx.stroke()}else if("triangle_left"===h){var m=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x+r+m,c.y+r+m),e.ctx.lineTo(c.x-m,c.y+a),e.ctx.lineTo(c.x+r+m,c.y-m),e.ctx.closePath(),e.ctx.stroke()}else{if("triangle_right"!==h)throw new Error("Unexpected shape:"+h);var g=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-g,c.y-g),e.ctx.lineTo(c.x+r+g,c.y+a),e.ctx.lineTo(c.x-g,c.y+r+g),e.ctx.closePath(),e.ctx.stroke()}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:i})}}],r&&Ao(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Io(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==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}function Fo(t,e){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fo(t,e)}function No(t){return No=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},No(t)}var Bo=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&&Fo(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=No(n);if(o){var r=No(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Lo(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 zo(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)?zo(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&&Io(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Do(t){return Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(t)}function Go(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)||Wo(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 Wo(t,e){if(t){if("string"==typeof t)return Uo(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)?Uo(t,e):void 0}}function Uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Do(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Do(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Do(o)?o:String(o)),n)}var o}function Ho(t,e){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ho(t,e)}function Yo(t){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yo(t)}var Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ho(t,e)}(a,t);var e,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=Yo(n);if(o){var r=Yo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Do(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=Wo(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=Go(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 L=+c[R[M]];L&&(C+=L)}if(!C||isNaN(C))continue;for(var z=0,I=r*(1-l/r)*.5,F=this.stripesOrientation(c,r,o,i),N=0,B=Object.entries(this.color);N<B.length;N++){var D=Go(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==F?e.ctx.fillRect(c.x+I+s.dx,c.y+I+z*l+s.dy,l,U*l):e.ctx.fillRect(c.x+I+z*l+s.dx,c.y+I+s.dy,U*l,l);else if("piechart"===f){var $=2*z*Math.PI,H=2*(z+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-z)*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==F?e.ctx.fillRect(c.x+s.dx,c.y+(r-Y)/2+z*Y+s.dy,r,U*Y):e.ctx.fillRect(c.x+z*r+s.dx,c.y+(r-Y)/2+s.dy,U*r,Y)}z+=U}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:i})}}],r&&$o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function qo(t){return qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qo(t)}function Xo(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 Zo(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"!==qo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==qo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===qo(o)?o:String(o)),n)}var o}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jo(t,e)}function Ko(t){return Ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ko(t)}var Qo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&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"===qo(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 Xo(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)?Xo(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&&Zo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 ei(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 ri(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 ni(t,e){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ni(t,e)}function oi(t){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oi(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&&ni(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=oi(o);if(i){var r=oi(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 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 ei(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)?ei(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&&ri(e.prototype,r),n&&ri(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(gn);function ai(t){return ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ai(t)}function ui(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 li(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"!==ai(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ai(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ai(o)?o:String(o)),n)}var o}function si(t,e){return si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},si(t,e)}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}var hi=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&&si(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=fi(n);if(o){var r=fi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ai(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=ui(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=ui(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&&li(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function yi(t){return yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yi(t)}function pi(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"!==yi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===yi(o)?o:String(o)),n)}var o}function di(t,e){return di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},di(t,e)}function bi(t){return bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bi(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&&di(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=bi(o);if(i){var r=bi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===yi(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.diamond=e.diamond,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 pi(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)?pi(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)if(this.diamond){e.ctx.fillStyle=f;var h=s.x,y=s.y;e.ctx.beginPath(),e.ctx.moveTo(h-c,y),e.ctx.lineTo(h,y+c),e.ctx.lineTo(h+c,y),e.ctx.lineTo(h,y-c),e.ctx.closePath(),e.ctx.fill()}else{var p=this.width?this.width(s,r,n,i):void 0;if(!p||p<=0)continue;var v=this.length?this.length(s,r,n,i):void 0;if(!v||v<=0)continue;var d=.5*v;e.ctx.lineWidth=p,e.ctx.strokeStyle=f;var b=s.x,m=s.y;e.ctx.beginPath(),"v"===s.or?(e.ctx.moveTo(b,m-d),e.ctx.lineTo(b,m+d)):(e.ctx.moveTo(b-d,m),e.ctx.lineTo(b+d,m)),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]?0:e/2;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&&vi(e.prototype,r),n&&vi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(gn);function gi(t){return gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gi(t)}function wi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function 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"!==gi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==gi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===gi(o)?o:String(o)),n)}var o}function Si(t,e){return Si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Si(t,e)}function Oi(t){return Oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oi(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&&Si(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=Oi(n);if(o){var r=Oi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===gi(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=mi.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 wi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(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&&xi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(mi);const ji=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 Pi(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 ki(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 Ei(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 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){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}var Ci=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=ki(e,Ei(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 "),Ei(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)}}])&&Ai(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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){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 Li(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)?Li(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 Li(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 Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function Fi(t){return Fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fi(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&&Ii(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=Fi(n);if(o){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 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=ji(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=Pi(e.w+"",e.h+"");if(!c)return void console.error("No webGL");var l,s=new Ci(c.gl,i/n),f=r/2,h=Ri(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=Ri(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&&zi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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){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}var Gi=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=ki(t,Ei(t,t.VERTEX_SHADER,this.vshString),Ei(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&&Di(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wi(t){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi(t)}function Ui(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"!==Wi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Wi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Wi(o)?o:String(o)),n)}var o}function $i(t,e){return $i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$i(t,e)}function Hi(t){return Hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hi(t)}var Yi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$i(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=Hi(n);if(o){var r=Hi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Wi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;!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 Gi(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++){n=t[l];var s=this.code(n);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=Pi(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")}}])&&Ui(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Vi(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 qi(t){return null===t?NaN:+t}function Xi(t,e,r=qi){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 Zi(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ji(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ki(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=Zi,r=(e,r)=>Zi(t(e),r),n=(e,r)=>t(e)-r):(e=t===Zi||t===Ji?t:Qi,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 Qi(){return 0}const ta=Ki(Zi),ea=ta.right,ra=(ta.left,Ki(qi).center,ea);function na(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function oa(){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]=Xi(e,t/o);return i}function i(e){return null==e||isNaN(e=+e)?t:r[ra(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(Zi),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 oa().domain(e).range(r).unknown(t)},na.apply(i,arguments)}var ia=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,Vi(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}}},aa=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.minSizePix||1,o=t.maxSizeFactor||1,i=oa();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}},ua=function(t){var e,r=t.valueFunction,n=t.stretching,o=t.colorScale||function(){return"purple"},i=null===(e=t.colors)||void 0===e?void 0:e.length;return t.colors&&i&&(o=function(e){return t.colors[1==e?i-1:Math.floor(e*i)]}),function(e){if(0!=e.length&&e){var a=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]}(e,r);if(null!=a[0]){var u=a[1]-a[0],c=function(t){return t=(t-a[0])/u,n&&(t=n(t)),o(t)};if(c.invert=function(t){return n&&(t=n.invert(t)),a[0]+t*u},t.colors&&i){c.breaks=[];for(var l=1;l<i;l++)c.breaks.push(c.invert(l/i))}return c}}}},ca=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.colors;t.colorScale&&(n=ha(t.colorScale,r)),n=n||Array.from({length:r},(function(t,e){return"rgb("+Math.floor(255*e/(r-1))+",150,150)"}));var o=oa().range(n);return function(t){return o.domain(t.map(e)),o.breaks=o.quantiles(),o.colors=n,o}},la=function(t){return function(e,r,n){var o={};for(var i in t)o[i]=t[i](e,r,n);return o}};function sa(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 fa(t,e){var r=sa(t),n=function(t){return e[r(t)]};return n.breaks=t,n.colors=e,n}function ha(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 ya(t){return ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ya(t)}function pa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ya(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ya(o)?o:String(o)),n)}var o}var va=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,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.colorDark=n.colorDark||"#111",n.colorBright=n.colorBright||"#ddd",n.width=n.width||function(t,e,r){var n=1*r,o=4*r,i=(o-n)/3;return Math.min(n+(t-1)*i,o)};for(var o=sa(e),i={},a=0;a<r.length;a++)i[a+""]=r[a];var u=new Yi({code:function(e){return o(t(e))},color:i}),c=function(e){return(e.c1?o(t(e.c1)):-1)-(e.c2?o(t(e.c2)):-1)};return[u,new mi({color:function(t){var e=c(t);if(0!==e)return"v"===t.or?e<0?n.colorBright:n.colorDark:e<0?n.colorDark:n.colorBright},width:function(t,e,r){return n.width(Math.abs(c(t)),e,r)}})]}}],null&&pa(e.prototype,null),r&&pa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function da(t){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},da(t)}function ba(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 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)}function xa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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"!==da(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===da(o)?o:String(o)),n)}var o}function Oa(t,e,r){return e&&Sa(t.prototype,e),r&&Sa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var _a=function(){function t(){xa(this,t)}return Oa(t,null,[{key:"get",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(n=n||{}).colDark=n.colDark||"#333",n.colBright=n.colBright||"#aaa",n.widthFactor=n.widthFactor||.12;var o=va.get(t,e,r,n),i=new Ro({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r},filter:n.filter});return[o[0],i,o[1],new ja({colDark:n.colDark,colBright:n.colBright,filter:n.filter})]}},{key:"getCategory",value:function(t,e,r){return(r=r||{}).colDark=r.colDark||"#333",r.colBright=r.colBright||"#aaa",[new Yi({code:t,color:e}),new Ro({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r}}),new ja({colDark:r.colDark,colBright:r.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&&ga(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=wa(e);if(r){var o=wa(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return function(t,e){if(e&&("object"===da(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 xa(this,o),e=n.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return Oa(o,[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter)),e.ctx.lineWidth=.6*e.view.z,e.ctx.strokeStyle=this.colDark;var n,o=ba(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;e.ctx.beginPath(),e.ctx.arc(i.x+.5*r,i.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!0),e.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}e.ctx.strokeStyle=this.colBright;var a,u=ba(t);try{for(u.s();!(a=u.n()).done;){var c=a.value;e.ctx.beginPath(),e.ctx.arc(c.x+.5*r,c.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!1),e.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(gn);function Pa(t){return Pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pa(t)}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"!==Pa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Pa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Pa(o)?o:String(o)),n)}var o}var Ea=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=Ei(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=Ei(e,e.FRAGMENT_SHADER,u);this.program=ki(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)}}])&&ka(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ta(t){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(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 Ca(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ta(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ta(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ta(o)?o:String(o)),n)}var o}function Ma(t,e){return Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ma(t,e)}function Ra(t){return Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(t)}var La=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ma(t,e)}(a,t);var e,r,n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ra(n);if(o){var r=Ra(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ta(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=Pi(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 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(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 Ea(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&&Ca(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fa(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 Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Na(t,e)}function Ba(t){return Ba=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ba(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=Ba(n);if(o){var r=Ba(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===za(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.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 Ia(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(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&&Fa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Ga(t){return Ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ga(t)}function Wa(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"!==Ga(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ga(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ga(o)?o:String(o)),n)}var o}function $a(t,e){return $a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$a(t,e)}function Ha(t){return Ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ha(t)}var Ya=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&&$a(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=Ha(n);if(o){var r=Ha(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ga(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 Wa(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)?Wa(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}(gn);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 qa(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 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}}(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 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 Za(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 Ja(t,e){return Ja=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ja(t,e)}function Ka(t){return Ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ka(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ja(t,e)}(a,t);var e,r,n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ka(n);if(o){var r=Ka(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===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.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=qa(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=qa(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=qa(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=qa(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=qa(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=qa(this.ts);try{for(R.s();!(A=R.n()).done;){var L=p[A.value];null!=L&&((null==C||L<C)&&(C=L),(null==M||L>M)&&(M=L))}}catch(t){R.e(t)}finally{R.f()}S=.5*(+M+ +C),O=r/2}var z=m/(f-1),I=p[this.ts[0]];this.noData(I)||(e.ctx.beginPath(),e.ctx.moveTo(p.x+b,p.y+O+(I-S)*w/o+g));for(var F=void 0,N=1;N<f;N++)F=p[this.ts[N]],this.noData(I)&&this.noData(F)||(!this.noData(I)&&this.noData(F)?e.ctx.stroke():this.noData(I)&&!this.noData(F)?(e.ctx.beginPath(),e.ctx.moveTo(p.x+N*z+b,p.y+O+(F-S)*w/o+g)):(e.ctx.lineTo(p.x+N*z+b,p.y+O+(F-S)*w/o+g),N==f-1&&e.ctx.stroke())),I=F}}}}}}}}}catch(t){y.e(t)}finally{y.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:u})}}}],r&&Za(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 eu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ru(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 ru(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}}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"!==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 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)}(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=au(n);if(o){var r=au(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.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=mi.buildSides(t,r,this.angle%180!=90&&this.sVert,this.angle%180!=0&&this.sHor);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=eu(y);try{for(x.s();!(w=x.n()).done;){var S=w.value,O=S.c1,_=S.c2,j=S.x,P=S.y,k=O?this.height(O,r,a,u):0,E=_?this.height(_,r,a,u):0,T=cu(O,c),A=cu(_,c);if(0!=T||0!=A)for(var C=0,M=0,R=0,L=Object.entries(this.color);R<L.length;R++){var z=(o=L[R],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)||ru(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.")}()),I=z[0],F=z[1],N=O?+O[I]:0,B=_?+_[I]:0;if(0!=N||0!=B){var D=k*C/T||0,G=k*(C+N)/T||0,W=E*M/A||0,U=E*(M+B)/A||0;e.ctx.beginPath(),"h"==S.or?(e.ctx.moveTo(j+D*v+f,P-l+D*d+h),e.ctx.lineTo(j+W*v+f,P+l+W*d+h),e.ctx.lineTo(j+U*v+f,P+l+U*d+h),e.ctx.lineTo(j+G*v+f,P-l+G*d+h)):(e.ctx.moveTo(j-l+D*v+f,P+D*d+h),e.ctx.lineTo(j+l+W*v+f,P+W*d+h),e.ctx.lineTo(j+l+U*v+f,P+U*d+h),e.ctx.lineTo(j-l+G*v+f,P+G*d+h)),e.ctx.fillStyle=F,e.ctx.fill(),C+=N,M+=B,g(O),g(_)}}}}catch(t){x.e(t)}finally{x.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:u})}}}],r&&ou(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn),cu=function(t,e){if(!t)return 0;var r,n=0,o=eu(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 lu(t){return lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lu(t)}function su(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 fu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==lu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==lu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===lu(o)?o:String(o)),n)}var o}function hu(t,e){return hu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hu(t,e)}function yu(t){return yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yu(t)}var pu=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&&hu(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=yu(n);if(o){var r=yu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===lu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.imageCode=t.imageCode||function(){return""},e.images=t.images||{},e.size=t.size||function(t,e){return e},e}return e=a,r=[{key:"draw",value:function(t,e,r){var n=e.view.z,o=r/n,i=this.viewScale?this.viewScale(t,r,n):void 0;e.initCanvasTransform();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 su(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)?su(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();!(a=u.n()).done;){var c=a.value,l=this.imageCode(c,r,n,i),s=this.images[l];if(s){var f=this.size(c,r,n,i)/n;if(f){var h=(o-f)/2;try{e.ctx.drawImage(s,e.geoToPixX(c.x)+h,e.geoToPixY(c.y)+h-o,f,f)}catch(t){console.error(t)}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}],r&&fu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function vu(t){return vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(t)}function du(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 bu(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)?bu(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 bu(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"!==vu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==vu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===vu(o)?o:String(o)),n)}var o}function gu(t,e){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gu(t,e)}function wu(t){return wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wu(t)}var xu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gu(t,e)}(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=wu(o);if(i){var r=wu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vu(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=du(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,a.blendOperation&&(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 c,l=du(this.styles);try{for(l.s();!(c=l.n()).done;){var s=c.value;if((!s.visible||s.visible(r))&&(u.addLegends(e,s.legends),s.styles)){var f,h=du(s.styles);try{for(h.s();!(f=h.n()).done;){var y=f.value;y.visible&&!y.visible(r)||u.addLegends(e,y.legends)}}catch(t){h.e(t)}finally{h.f()}}}}catch(t){l.e(t)}finally{l.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:"addLegends",value:function(t,e){if(Array.isArray(e)){var r,n=du(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.addLegends(t,o)}}catch(t){n.e(t)}finally{n.f()}}else t.node().append(e.div.node())}},{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&&mu(e.prototype,r),n&&mu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(_n);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 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"!==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 _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_u(t,e)}function ju(t){return ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ju(t)}var Pu=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&&_u(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=ju(n);if(o){var r=ju(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;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")}}])&&Ou(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(_n);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 Eu(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 Tu(t,e){return Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tu(t,e)}function Au(t){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Au(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&&Tu(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=Au(n);if(o){var r=Au(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.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}}}])&&Eu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(_n);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 Ru(){Ru=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"==Mu(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 Lu(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 zu(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}}}}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 Fu(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 Nu(t,e){return Nu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nu(t,e)}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bu(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&&Nu(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=Bu(i);if(a){var r=Bu(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 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=zu(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=Ru().mark((function t(e){var r,n,o,i;return Ru().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,qn(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=zu(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){Lu(i,r,o,a,u,"next",t)}function u(t){Lu(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&Fu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(_n);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(){Wu=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"==Gu(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 Uu(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 $u(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"!==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 Vu(t,e){return Vu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vu(t,e)}function qu(t){return qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qu(t)}var Xu=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&&Vu(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=qu(i);if(a){var r=qu(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 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=$u(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=Wu().mark((function t(e){var r,n,o,i,a;return Wu().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,zn(this.url);case 11:if(r=t.sent,n=r.features,!this.preprocess){t.next=36;break}this.fs=[],o=$u(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){Uu(i,r,o,a,u,"next",t)}function u(t){Uu(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&Yu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(_n);function Zu(t){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zu(t)}function Ju(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Zu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Zu(o)?o:String(o)),n)}var o}var Ku=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.")}}])&&Ju(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qu(t){return Qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(t)}function tc(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"!==Qu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Qu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Qu(o)?o:String(o)),n)}var o}function ec(t,e){return ec=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ec(t,e)}function rc(t){return rc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rc(t)}var nc=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&&ec(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=rc(n);if(o){var r=rc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Qu(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)}}}])&&tc(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function oc(t){return oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(t)}function ic(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"!==oc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==oc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===oc(o)?o:String(o)),n)}var o}function ac(t,e){return ac=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ac(t,e)}function uc(t){return uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},uc(t)}var cc=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&&ac(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=uc(n);if(o){var r=uc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===oc(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);if(r){var 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)}}}}}])&&ic(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function lc(t){return lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(t)}function sc(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"!==lc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==lc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===lc(o)?o:String(o)),n)}var o}function fc(t,e){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fc(t,e)}function hc(t){return hc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hc(t)}var yc=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&&fc(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=hc(n);if(o){var r=hc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===lc(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])}}}])&&sc(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function pc(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 vc(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 pc(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)?pc(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 dc(t){return new Promise((function(e,r){var n=new Image;n.onload=function(){e(n)},n.onerror=function(){r(new Error("Error loading image"))},n.src=t}))}function bc(t){return bc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(t)}function mc(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 gc(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)?gc(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 gc(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 wc(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"!==bc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==bc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===bc(o)?o:String(o)),n)}var o}function xc(t,e){return xc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xc(t,e)}function Sc(t){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sc(t)}var Oc=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&&xc(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=Sc(n);if(o){var r=Sc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===bc(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,t.resolution,t.z);if(r=this.size?this.size(t.viewScale,t.resolution,t.z)/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)}}}])&&wc(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function _c(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],i=mc(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 Oc(n))};for(i.s();!(r=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function jc(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.k||[.9,.5,.2,.05],o=[],i=mc(n);try{var a=function(){var i=e.value;r.title=i==n[0]?r.title:void 0,r.label=function(e,r){return vc(i*Vi(r,t))},o.push(new Oc(r))};for(i.s();!(e=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function Pc(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.labelFormat||function(t){return t},o=r.labelText||Ec(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 Oc(r))},u=e.length-1;u>=0;u--)a(u);return i}function kc(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.labelFormat||function(t){return t},n=e.labelText||Ec(r),o=[],i=e.viewScaleFun||function(t){return t},a=function(r){e.title=r==t-1?e.title:void 0,e.size=function(t){return i(t).values[r]},e.label=function(t){return n(i(t).breaks[r-1],i(t).breaks[r])},o.push(new Oc(e))},u=t-1;u>=0;u--)a(u);return o}function Ec(t){return function(e,r){return null==e&&null==r?"":null==r?"> "+t(e):null==e?"< "+t(r):t(e)+" - "+t(r)}}function Tc(t){return Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(t)}function Ac(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"!==Tc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Tc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Tc(o)?o:String(o)),n)}var o}function Cc(t,e){return Cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cc(t,e)}function Mc(t){return Mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mc(t)}var Rc=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&&Cc(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=Mc(n);if(o){var r=Mc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Tc(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&&Ac(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function Lc(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 Rc(r));return n}function zc(t){return zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(t)}function Ic(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"!==zc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==zc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===zc(o)?o:String(o)),n)}var o}function Fc(t,e){return Fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fc(t,e)}function Nc(t){return Nc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nc(t)}var Bc=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&&Fc(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=Nc(n);if(o){var r=Nc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===zc(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.classifier=t.classifier,e.width=t.width||150,e.selectionColor=e.selectionColor||"red",e.tooltip=t.tooltip,e.texts=t.texts,e.leftText=t.leftText||"Category 0",e.topText=t.topText||"Category 1",e.rightText=t.rightText||"Category 2",e.centerCoefficient=t.centerCoefficient||e.classifier.centerCoefficient,e}return e=a,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.width,r=.866025*e,n=this.classifier,o=this.selectionColor,i=this.tooltip,a=this.texts||{},u=this.div.append("svg").attr("width",e+0).attr("height",r+8+24);u.append("text").attr("x",e/2).attr("y",14).text(this.topText).attr("font-size",12).attr("text-anchor","middle"),u.append("text").attr("x",0).attr("y",30+r).text(this.leftText).attr("font-size",12).attr("text-anchor","start"),u.append("text").attr("x",e).attr("y",30+r).text(this.rightText).attr("font-size",12).attr("text-anchor","end");var c=u.append("g").attr("transform","translate(0 16)"),l=function(t,e,r){t.attr("fill",e).on("mouseover",(function(t){pt(this).attr("fill",o),i&&r&&(i.html(r),i.setPosition(t),i.show())})).on("mouseout",(function(){pt(this).attr("fill",e),i&&i.hide()})),i&&r&&t.on("mousemove",(function(t){i.setPosition(t)}))};l(c.append("polygon").attr("points","0,"+r+" "+e/3+","+r+" "+e/2+","+2*r/3+" "+e/6+","+2*r/3),n.colors[0],a[0]),l(c.append("polygon").attr("points",e/2+",0 "+2*e/3+","+r/3+" "+e/2+","+2*r/3+" "+e/3+","+r/3),n.colors[1],a[1]),l(c.append("polygon").attr("points",e+","+r+" "+5*e/6+","+2*r/3+" "+e/2+","+2*r/3+" "+2*e/3+","+r),n.colors[2],a[2]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+5*e/6+","+2*r/3+" "+2*e/3+","+r/3),n.mixColors[0],a[12]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/3+","+r+" "+2*e/3+","+r),n.mixColors[1],a["02"]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/6+","+2*r/3+" "+e/3+","+r/3),n.mixColors[2],a["01"]),this.centerCoefficient&&l(c.append("circle").attr("cx",e/2).attr("cy",2*r/3).attr("r",this.centerCoefficient*r/3),n.centerColor,a.center)}}],r&&Ic(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku),Dc=function(t){return t};Dc.invert=Dc;var Gc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return Dc;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},Wc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return Dc;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},Uc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return Dc;var e=function(e){return Math.pow(e,t)},r=1/t;return e.invert=function(t){return Math.pow(t,r)},e},$c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return Dc;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},Hc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return Dc;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}},Yc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return Dc;var e=Hc(t);return function(t){return 1-e(1-t)}};const Vc=Math.PI/180,qc=180/Math.PI,Xc=.96422,Zc=1,Jc=.82521,Kc=4/29,Qc=6/29,tl=3*Qc*Qc,el=Qc*Qc*Qc;function rl(t){if(t instanceof ol)return new ol(t.l,t.a,t.b,t.opacity);if(t instanceof ll)return sl(t);t instanceof Fe||(t=ze(t));var e,r,n=cl(t.r),o=cl(t.g),i=cl(t.b),a=il((.2225045*n+.7168786*o+.0606169*i)/Zc);return n===o&&o===i?e=r=a:(e=il((.4360747*n+.3850649*o+.1430804*i)/Xc),r=il((.0139322*n+.0971045*o+.7141733*i)/Jc)),new ol(116*a-16,500*(e-a),200*(a-r),t.opacity)}function nl(t,e,r,n){return 1===arguments.length?rl(t):new ol(t,e,r,null==n?1:n)}function ol(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function il(t){return t>el?Math.pow(t,1/3):t/tl+Kc}function al(t){return t>Qc?t*t*t:tl*(t-Kc)}function ul(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function cl(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ll(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function sl(t){if(isNaN(t.h))return new ol(t.l,0,0,t.opacity);var e=t.h*Vc;return new ol(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function fl(t,e){var r=Je((t=nl(t)).l,(e=nl(e)).l),n=Je(t.a,e.a),o=Je(t.b,e.b),i=Je(t.opacity,e.opacity);return function(e){return t.l=r(e),t.a=n(e),t.b=o(e),t.opacity=i(e),t+""}}function hl(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)||function(t,e){if(t){if("string"==typeof t)return yl(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)?yl(t,e):void 0}}(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 yl(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}pe(ol,nl,ve(de,{brighter(t){return new ol(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new ol(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new Fe(ul(3.1338561*(e=Xc*al(e))-1.6168667*(t=Zc*al(t))-.4906146*(r=Jc*al(r))),ul(-.9787684*e+1.9161415*t+.033454*r),ul(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),pe(ll,(function(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof ll)return new ll(t.h,t.c,t.l,t.opacity);if(t instanceof ol||(t=rl(t)),0===t.a&&0===t.b)return new ll(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*qc;return new ll(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ll(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return new ll(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new ll(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return sl(this).rgb()}}));var pl=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t[0],o=t[1],i=t[2],a=hl(r.center||[1/3,1/3,1/3],3),u=a[0],c=a[1],l=a[2],s=null==r.withMixedClasses||r.withMixedClasses,f=r.centerCoefficient?1-r.centerCoefficient:void 0,h=function(t){var r=e(t);if(r){var a=+t[n]/r,h=+t[o]/r,y=+t[i]/r;return a>=u&&h<=c&&y<=l?null!=f&&(y-l)*(c-f*c)>=(h-f*c)*(f*l-l)?"center":"0":a<=u&&h>=c&&y<=l?null!=f&&(y-l)*(u-f*u)>=(a-f*u)*(f*l-l)?"center":"1":a<=u&&h<=c&&y>=l?null!=f&&(h-c)*(u-f*u)>=(a-f*u)*(f*c-c)?"center":"2":a<=u&&h>=c&&y>=l?null!=f&&a>f*u?"center":s?"m0":h>y?"1":"2":a>=u&&h<=c&&y>=l?null!=f&&h>f*c?"center":s?"m1":a>y?"0":"2":a>=u&&h>=c&&y<=l?null!=f&&y>f*l?"center":s?"m2":h>a?"1":"0":"unknown"}};return h.center=[u,c,l],h.centerCoefficient=r.centerCoefficient,h},vl=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=hl(r||["red","green","blue"],3),i=o[0],a=o[1],u=o[2],c=n.colorInterpolation||fl,l=null==n.withMixedClasses||n.withMixedClasses,s=function(t,e){return c(t,e)(.5)},f=hl(n.mixedColors||l?[s(a,u),s(i,u),s(i,a)]:[],3),h=f[0],y=f[1],p=f[2],v=n.centerColor||c(s(i,a),u)(.333),d=pl(t,e,n),b=function(t){var e=d(t);return"0"==e?i:"1"==e?a:"2"==e?u:"m0"==e?h:"m1"==e?y:"m2"==e?p:"center"==e?v:n.defaultColor||"black"};return b.center=d.center,b.centerCoefficient=n.centerCoefficient,b.colors=[i,a,u],b.mixColors=[h,y,p],b.centerColor=v,b};function dl(t){return dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(t)}function bl(){bl=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"==dl(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 ml(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 gl(t,e){return wl.apply(this,arguments)}function wl(){var t;return t=bl().mark((function t(e,r){var n,o,i,a,u,c,l,s,f=arguments;return bl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=f.length>2&&void 0!==f[2]?f[2]:void 0,e=e||{},o=0,i=["f","m"];case 3:if(!(o<i.length)){t.next=22;break}a=i[o],u=0,c=["y","m","o"];case 6:if(!(u<c.length)){t.next=19;break}l=c[u],s=0;case 9:if(!(s<=2)){t.next=16;break}return t.next=12,dc(r+(a+l+s)+".png");case 12:e[a+l+s]=t.sent;case 13:s++,t.next=9;break;case 16:u++,t.next=6;break;case 19:o++,t.next=3;break;case 22:return n&&n(),t.abrupt("return",e);case 24:case"end":return t.stop()}}),t)})),wl=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ml(i,n,o,a,u,"next",t)}function u(t){ml(i,n,o,a,u,"throw",t)}a(void 0)}))},wl.apply(this,arguments)}function xl(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 Sl,Ol=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _l(t){if(!(e=Ol.exec(t)))throw new Error("invalid format: "+t);var e;return new jl({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 jl(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 Pl(t,e){var r=xl(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")}_l.prototype=jl.prototype,jl.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 kl={"%":(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)=>Pl(100*t,e),r:Pl,s:function(t,e){var r=xl(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Sl=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")+xl(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function El(t){return t}var Tl,Al=Array.prototype.map,Cl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ml(t){return Tl=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?El:(e=Al.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?El:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Al.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=_l(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"):kl[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=kl[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?Cl[8+Sl/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=_l(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=xl(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=Cl[8+o/3];return function(t){return n(i*t)+a}}}}(t),Tl.format,Tl.formatPrefix,Tl}Ml({thousands:",",grouping:[3],currency:["$",""]});var Rl=Br.getParameterByName;return Ml({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:()=>Pu,BackgroundLayerWMS:()=>Cu,CSVGrid:()=>po,ColorCategoryLegend:()=>yc,ColorDiscreteLegend:()=>cc,ColorLegend:()=>nc,CompositionStyle:()=>Vo,DotDensityStyle:()=>Ni,GeoCanvas:()=>Br,GeoJSONLayer:()=>Xu,GridLayer:()=>xu,ImageStyle:()=>pu,IsoFenceStyle:()=>uu,JSGrid:()=>xo,JoyPlotStyle:()=>Bo,LabelLayer:()=>Du,Layer:()=>_n,LegoStyle:()=>_a,Map:()=>ln,MosaicStyle:()=>Da,MultiResolutionDataset:()=>En,NinjaStarStyle:()=>Ya,OrientationLegend:()=>Rc,PillarStyle:()=>hi,SegmentStyle:()=>Qo,ShapeColorSizeStyle:()=>ko,SideCategoryStyle:()=>_i,SideStyle:()=>mi,SizeLegend:()=>Oc,SquareColorCategoryWebGLStyle:()=>Yi,SquareColorWebGLStyle:()=>La,StrokeStyle:()=>Ro,Style:()=>gn,TanakaStyle:()=>va,TextStyle:()=>ii,TiledGrid:()=>oo,TimeSeriesStyle:()=>Qa,TrivariateLegend:()=>Bc,circularInverseScale:()=>Yc,circularScale:()=>Hc,classifier:()=>sa,colorClassifier:()=>fa,discreteColors:()=>ha,exponentialScale:()=>Gc,getParameterByName:()=>Rl,loadChernoffFacesImages:()=>gl,loadImage:()=>dc,logarithmicScale:()=>Wc,nice:()=>vc,orientationLegend:()=>Lc,powerInverseScale:()=>$c,powerScale:()=>Uc,sizeDiscreteLegend:()=>Pc,sizeDiscreteViewScaleLegend:()=>kc,sizeLegend:()=>_c,sizeLegendViewScale:()=>jc,trivariateClassifier:()=>pl,trivariateColorClassifier:()=>vl,viewScale:()=>ia,viewScaleColor:()=>ua,viewScaleColorQuantile:()=>ca,viewScaleCombination:()=>la,viewScaleQuantile:()=>aa});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 L(t,e){return function(){this[t]=e}}function z(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function I(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new N(t)}function N(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function B(t,e){for(var r=F(t),n=-1,o=e.length;++n<o;)r.add(e[n])}function D(t,e){for(var r=F(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?z:L)(t,e)):this.node()[t]},classed:function(t,e){var r=I(t+"");if(arguments.length<2){for(var n=F(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,Lt=0,zt="object"==typeof performance&&performance.now?performance:Date,It="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ft(){return Rt||(It(Nt),Rt=zt.now()+Lt)}function Nt(){Rt=0}function Bt(){this._call=this._time=this._next=null}function Dt(t,e,r){var n=new Bt;return n.restart(t,e,r),n}function Gt(){Rt=(Mt=zt.now())+Lt,Et=Tt=0;try{!function(){Ft(),++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=zt.now(),e=t-Mt;e>Ct&&(Lt-=e,Mt=t)}function Ut(t){Et||(Tt&&(Tt=clearTimeout(Tt)),t-Rt>24?(t<1/0&&(Tt=setTimeout(Gt,t-zt.now()-Lt)),At&&(At=clearInterval(At))):(At||(Mt=zt.now(),At=setInterval(Wt,Ct)),Et=1,It(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?Ft():+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?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Le(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=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))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ke.exec(t))?Ue(e[1],e[2]/100,e[3]/100,1):(e=Ee.exec(t))?Ue(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 Le(t,e,r,n){return n<=0&&(t=e=r=NaN),new Fe(t,e,r,n)}function ze(t){return t instanceof de||(t=Me(t)),t?new Fe((t=t.rgb()).r,t.g,t.b,t.opacity):new Fe}function Ie(t,e,r,n){return 1===arguments.length?ze(t):new Fe(t,e,r,null==n?1:n)}function Fe(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Ne(){return`#${We(this.r)}${We(this.g)}${We(this.b)}`}function Be(){const t=De(this.opacity);return`${1===t?"rgb(":"rgba("}${Ge(this.r)}, ${Ge(this.g)}, ${Ge(this.b)}${1===t?")":`, ${t})`}`}function De(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ge(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function We(t){return((t=Ge(t))<16?"0":"")+t.toString(16)}function Ue(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new He(t,e,r,n)}function $e(t){if(t instanceof He)return new He(t.h,t.s,t.l,t.opacity);if(t instanceof de||(t=Me(t)),!t)return new He;if(t instanceof He)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 He(a,u,c,t.opacity)}function He(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function Ye(t){return(t=(t||0)%360)<0?t+360:t}function Ve(t){return Math.max(0,Math.min(1,t||0))}function qe(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function Xe(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}pe(de,Me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ae,formatHex:Ae,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $e(this).formatHsl()},formatRgb:Ce,toString:Ce}),pe(Fe,Ie,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(Ge(this.r),Ge(this.g),Ge(this.b),De(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:Ne,formatHex:Ne,formatHex8:function(){return`#${We(this.r)}${We(this.g)}${We(this.b)}${We(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Be,toString:Be})),pe(He,(function(t,e,r,n){return 1===arguments.length?$e(t):new He(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return t=null==t?me:Math.pow(me,t),new He(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?be:Math.pow(be,t),new He(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(qe(t>=240?t-240:t+120,o,n),qe(t,o,n),qe(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new He(Ye(this.h),Ve(this.s),Ve(this.l),De(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=De(this.opacity);return`${1===t?"hsl(":"hsla("}${Ye(this.h)}, ${100*Ve(this.s)}%, ${100*Ve(this.l)}%${1===t?")":`, ${t})`}`}}));const Ze=t=>()=>t;function Je(t,e){var r=e-t;return r?function(t,e){return function(r){return t+r*e}}(t,r):Ze(isNaN(t)?e:t)}const Ke=function t(e){var r=function(t){return 1==(t=+t)?Je: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):Ze(isNaN(e)?r:e)}}(e);function n(t,e){var n=r((t=Ie(t)).r,(e=Ie(e)).r),o=r(t.g,e.g),i=r(t.b,e.b),a=Je(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 Qe(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=Ie(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+""}}}Qe((function(t){var e=t.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=n<e-1?t[n+2]:2*i-o;return Xe((r-n/e)*e,a,o,i,u)}})),Qe((function(t){var e=t.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*e),o=t[(n+e-1)%e],i=t[n%e],a=t[(n+1)%e],u=t[(n+2)%e];return Xe((r-n/e)*e,o,i,a,u)}}));var tr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,er=new RegExp(tr.source,"g");function rr(t,e){var r,n,o,i=tr.lastIndex=er.lastIndex=0,a=-1,u=[],c=[];for(t+="",e+="";(r=tr.exec(t))&&(n=er.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=er.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 nr(t,e){var r;return("number"==typeof e?ne:e instanceof Me?Ke:(r=Me(e))?(e=r,Ke):rr)(t,e)}function or(t){return function(){this.removeAttribute(t)}}function ir(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ar(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 ur(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 cr(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 lr(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 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.setAttributeNS(t.space,t.local,e.call(this,r))}}(t,o)),r}return o._value=e,o}function fr(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 hr(t,e){return function(){Qt(this,t).delay=+e.apply(this,arguments)}}function yr(t,e){return e=+e,function(){Qt(this,t).delay=e}}function pr(t,e){return function(){te(this,t).duration=+e.apply(this,arguments)}}function vr(t,e){return e=+e,function(){te(this,t).duration=e}}var dr=yt.prototype.constructor;function br(t){return function(){this.style.removeProperty(t)}}var mr=0;function gr(t,e,r,n){this._groups=t,this._parents=e,this._name=r,this._id=n}function wr(){return++mr}var xr=yt.prototype;gr.prototype=function(t){return yt().transition(t)}.prototype={constructor:gr,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 gr(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 gr(a,u,e,r)},selectChild:xr.selectChild,selectChildren:xr.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 gr(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 gr(a,this._parents,this._name,this._id)},selection:function(){return new dr(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,r=wr(),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 gr(n,this._parents,t,r)},call:xr.call,nodes:xr.nodes,node:xr.node,size:xr.size,empty:xr.empty,each:xr.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:nr;return this.attrTween(t,"function"==typeof e?(r.local?lr:cr)(r,n,ye(this,"attr."+t,e)):null==e?(r.local?ir:or)(r):(r.local?ur:ar)(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?sr:fr)(n,e))},style:function(t,e,r){var n="transform"==(t+="")?le:nr;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,br(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=br(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?hr:yr)(e,t)):ee(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?pr:vr)(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]:xr[Symbol.iterator]};var Sr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Or(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 gr?(e=t._id,t=t._name):(e=wr(),(r=Sr).time=Ft(),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||Or(a,e));return new gr(n,this._parents,t,e)};const _r=t=>()=>t;function jr(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 Pr(t,e,r){this.k=t,this.x=e,this.y=r}Pr.prototype={constructor:Pr,scale:function(t){return 1===t?this:new Pr(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Pr(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 kr=new Pr(1,0,0);function Er(t){t.stopImmediatePropagation()}function Tr(t){t.preventDefault(),t.stopImmediatePropagation()}function Ar(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Cr(){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 Mr(){return this.__zoom||kr}function Rr(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Lr(){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 Ir(t){return Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ir(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 Nr(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"!==Ir(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ir(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ir(o)?o:String(o)),n)}var o}Pr.prototype;var Br=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=kr;(function(){var t,e,r,n=Ar,o=Cr,i=zr,a=Rr,u=Lr,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",Mr).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 Pr(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 Pr(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 Pr(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()}Tr(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(Tr(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),Tr(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),Er(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);Tr(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(Er(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(Tr(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(Er(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",Mr),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(kr.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 jr(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:_r(+t),b):a},b.filter=function(t){return arguments.length?(n="function"==typeof t?t:_r(!!t),b):n},b.touchable=function(t){return arguments.length?(u="function"==typeof t?t:_r(!!t),b):u},b.extent=function(t){return arguments.length?(o="function"==typeof t?t:_r([[+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&&Nr(e.prototype,r),n&&Nr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Dr(t){return Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dr(t)}function Gr(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,Wr(n.key),n)}}function Wr(t){var e=function(t,e){if("object"!==Dr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Dr(e)?e:String(e)}var Ur=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=Wr(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&&Gr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function $r(t){return $r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$r(t)}function 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"!==$r(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==$r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===$r(o)?o:String(o)),n)}var o}var Yr=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}}])&&Hr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function qr(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"!==Vr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Vr(o)?o:String(o)),n)}var o}function Xr(t,e){return Xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xr(t,e)}function Zr(t){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Zr(t)}var Jr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xr(t,e)}(a,t);var e,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=Zr(n);if(o){var r=Zr(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){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)}}])&&qr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Yr);function Kr(t){return Kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kr(t)}function Qr(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,nn(n.key),n)}}function tn(t,e){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tn(t,e)}function en(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function rn(t){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rn(t)}function nn(t){var e=function(t,e){if("object"!==Kr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Kr(e)?e:String(e)}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&&tn(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=rn(n);if(o){var r=rn(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Kr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return en(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=en(e=i.call(this,t)),!1,(n=nn(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()}}])&&Qr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Yr);function an(t){return an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},an(t)}function un(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 cn(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"!==an(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==an(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===an(o)?o:String(o)),n)}var o}var ln=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 Br(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 Ur(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 un(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)?un(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,n.blendOperation&&(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;if(o.mixedResolution){var a=o.mixedResolution(i),u=n.cellInfoHTML(i,a);if(!u)return;return{cell:i,html:u,resolution:a}}var c=n.cellInfoHTML(i,o.getResolution());if(!c)return;return{cell:i,html:c,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 Jr({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 on({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&&cn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function sn(t){return sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sn(t)}function fn(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"!==sn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==sn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===sn(o)?o:String(o)),n)}var o}var hn=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))}}}])&&fn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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 pn(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 vn(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)?vn(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 vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dn(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 bn(t,e){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bn(t,e)}function mn(t){return mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mn(t)}var gn=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&&bn(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=mn(o);if(i){var r=mn(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 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.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=u,n=[{key:"updateLegendsRecursive",value:function(t,e){if(Array.isArray(t)){var r,n=pn(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.updateLegendsRecursive(o,e)}}catch(t){n.e(t)}finally{n.f()}}else t.update(e)}}],(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){return u.updateLegendsRecursive(this.legends,t),this}},{key:"addLegends",value:function(t){var e,r=pn(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.legends.push(n)}}catch(t){r.e(t)}finally{r.f()}return this}}])&&dn(e.prototype,r),n&&dn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(hn);function wn(t){return wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(t)}function xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==wn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==wn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===wn(o)?o:String(o)),n)}var o}function Sn(t,e){return Sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sn(t,e)}function On(t){return On=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},On(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&&Sn(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=On(n);if(o){var r=On(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===wn(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.")}}])&&xn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(hn);function jn(t){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jn(t)}function Pn(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 kn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==jn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===jn(o)?o:String(o)),n)}var o}var En=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 Pn(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)?Pn(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}}])&&kn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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){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 Cn(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)?Cn(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 Cn(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}var Rn=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.mixedResolution=o.mixedResolution,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){if(this.mixedResolution){var r,n=An(e);try{for(n.s();!(r=n.n()).done;){var o=r.value,i=this.mixedResolution(o);if(!(t.x<o.x||o.x+i<t.x||t.y<o.y||o.y+i<t.y))return o}}catch(t){n.e(t)}finally{n.f()}}else{var a,u=this.getResolution(),c=An(e);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(!(t.x<l.x||l.x+u<t.x||t.y<l.y||l.y+u<t.y))return l}}catch(t){c.e(t)}finally{c.f()}}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}},{key:"getDataset",value:function(t,e){return this}}])&&Mn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ln(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function zn(t,e){return fetch(t,e).then(Ln)}var In={},Fn={};function Nn(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Bn(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 Dn(t,e){var r=t+"",n=r.length;return n<e?new Array(e-n+1).join(0)+r:r}function Gn(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 Fn;if(l)return l=!1,In;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())!==Fn;){for(var f=[];n!==In&&n!==Fn;)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?"-"+Dn(-n,6):n>9999?"+"+Dn(n,6):Dn(n,4))+"-"+Dn(r.getUTCMonth()+1,2)+"-"+Dn(r.getUTCDate(),2)+(u?"T"+Dn(o,2)+":"+Dn(i,2)+":"+Dn(a,2)+"."+Dn(u,3)+"Z":a?"T"+Dn(o,2)+":"+Dn(i,2)+":"+Dn(a,2)+"Z":i||o?"T"+Dn(o,2)+":"+Dn(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=Nn(t);return function(n,o){return e(r(n),o,t)}}(t,e):Nn(t)}));return i.columns=o||[],i},parseRows:n,format:function(e,r){return null==r&&(r=Bn(e)),[r.map(a).join(t)].concat(o(e,r)).join("\n")},formatBody:function(t,e){return null==e&&(e=Bn(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Wn=Gn(","),Un=Wn.parse,$n=(Wn.parseRows,Wn.format,Wn.formatBody,Wn.formatRows,Wn.formatRow,Wn.formatValue,Gn("\t")),Hn=$n.parse;function Yn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Vn(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(Yn)}(e,r).then((function(e){return t(e,n)}))}}$n.parseRows,$n.format,$n.formatBody,$n.formatRows,$n.formatRow,$n.formatValue;var qn=Vn(Un);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 Zn(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}}}}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 Kn(){Kn=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"==Xn(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 Qn(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 to(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Qn(i,n,o,a,u,"next",t)}function u(t){Qn(i,n,o,a,u,"throw",t)}a(void 0)}))}}function eo(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}function ro(t,e){return ro=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ro(t,e)}function no(t){return no=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},no(t)}Vn(Hn);var oo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ro(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=no(n);if(o){var r=no(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Xn(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():to(Kn().mark((function e(){var r;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zn(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",to(Kn().mark((function n(){var o,i,a,u,c,l,s,f,h,y,p,v,d;return Kn().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,qn(e.url+t+"/"+r+".csv");case 3:if(i=n.sent,!e.preprocess){n.next=27;break}o=[],a=Zn(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=io(o,t,r,e.info),e.cache[t][r]=l,e.map.redraw(),s=!1,f=e.map.getZoom(),h=Zn(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=Zn(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()}}}}}}])&&eo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Rn);function io(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=Zn(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 ao(t){return ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ao(t)}function uo(){uo=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function y(){}function p(){}var v={};c(v,i,(function(){return this}));var d=Object.getPrototypeOf,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"==ao(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=S(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function 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 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 lo(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)?lo(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 lo(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 so(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 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}function ho(t,e){return ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ho(t,e)}function yo(t){return yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yo(t)}var po=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ho(t,e)}(a,t);var e,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=yo(n);if(o){var r=yo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ao(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,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=uo().mark((function t(){var e,n,o,i,a,u,c;return uo().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,qn(r.url);case 3:e=t.sent,n=co(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=co(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){so(i,n,o,a,u,"next",t)}function u(t){so(i,n,o,a,u,"throw",t)}a(void 0)}))})()),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,r=co(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&&fo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Rn);function vo(t){return vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vo(t)}function bo(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 mo(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"!==vo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==vo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===vo(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 wo(t){return wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wo(t)}var xo=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=wo(n);if(o){var r=wo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vo(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,void 0,"",t,n)).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 bo(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)?bo(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()}}}}])&&mo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Rn);function So(t){return So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},So(t)}function Oo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==So(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==So(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===So(o)?o:String(o)),n)}var o}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){return Po=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Po(t)}var ko=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=Po(n);if(o){var r=Po(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===So(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 Oo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Oo(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(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){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()}else if("triangle_up"===f){var b=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-b,c.y-b),e.ctx.lineTo(c.x+a,c.y+r+b),e.ctx.lineTo(c.x+r+b,c.y-b),e.ctx.fill()}else if("triangle_down"===f){var m=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-m,c.y+r+m),e.ctx.lineTo(c.x+a,c.y-m),e.ctx.lineTo(c.x+r+m,c.y+r+m),e.ctx.fill()}else if("triangle_left"===f){var g=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x+r+g,c.y+r+g),e.ctx.lineTo(c.x-g,c.y+a),e.ctx.lineTo(c.x+r+g,c.y-g),e.ctx.fill()}else{if("triangle_right"!==f)throw new Error("Unexpected shape:"+f);var w=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-w,c.y-w),e.ctx.lineTo(c.x+r+w,c.y+a),e.ctx.lineTo(c.x-w,c.y+r+w),e.ctx.fill()}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({viewScale:i,resolution:r,z:o,cells:t})}}],r&&_o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Eo(t){return Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eo(t)}function To(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 Ao(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"!==Eo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Eo(o)?o:String(o)),n)}var o}function Co(t,e){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Co(t,e)}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}var Ro=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Co(t,e)}(a,t);var e,r,n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mo(n);if(o){var r=Mo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Eo(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 To(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)?To(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)console.error("Not implemented");else if("triangle_up"===h){var d=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-d,c.y-d),e.ctx.lineTo(c.x+a,c.y+r+d),e.ctx.lineTo(c.x+r+d,c.y-d),e.ctx.closePath(),e.ctx.stroke()}else if("triangle_down"===h){var b=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-b,c.y+r+b),e.ctx.lineTo(c.x+a,c.y-b),e.ctx.lineTo(c.x+r+b,c.y+r+b),e.ctx.closePath(),e.ctx.stroke()}else if("triangle_left"===h){var m=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x+r+m,c.y+r+m),e.ctx.lineTo(c.x-m,c.y+a),e.ctx.lineTo(c.x+r+m,c.y-m),e.ctx.closePath(),e.ctx.stroke()}else{if("triangle_right"!==h)throw new Error("Unexpected shape:"+h);var g=(s-r)/2;e.ctx.beginPath(),e.ctx.moveTo(c.x-g,c.y-g),e.ctx.lineTo(c.x+r+g,c.y+a),e.ctx.lineTo(c.x-g,c.y+r+g),e.ctx.closePath(),e.ctx.stroke()}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:i})}}],r&&Ao(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 zo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Io(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==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}function Fo(t,e){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fo(t,e)}function No(t){return No=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},No(t)}var Bo=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&&Fo(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=No(n);if(o){var r=No(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Lo(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 zo(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)?zo(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&&Io(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Do(t){return Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(t)}function Go(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)||Wo(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 Wo(t,e){if(t){if("string"==typeof t)return Uo(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)?Uo(t,e):void 0}}function Uo(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Do(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Do(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Do(o)?o:String(o)),n)}var o}function Ho(t,e){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ho(t,e)}function Yo(t){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yo(t)}var Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ho(t,e)}(a,t);var e,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=Yo(n);if(o){var r=Yo(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Do(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=Wo(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=Go(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 L=+c[R[M]];L&&(C+=L)}if(!C||isNaN(C))continue;for(var z=0,I=r*(1-l/r)*.5,F=this.stripesOrientation(c,r,o,i),N=0,B=Object.entries(this.color);N<B.length;N++){var D=Go(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==F?e.ctx.fillRect(c.x+I+s.dx,c.y+I+z*l+s.dy,l,U*l):e.ctx.fillRect(c.x+I+z*l+s.dx,c.y+I+s.dy,U*l,l);else if("piechart"===f){var $=2*z*Math.PI,H=2*(z+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-z)*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==F?e.ctx.fillRect(c.x+s.dx,c.y+(r-Y)/2+z*Y+s.dy,r,U*Y):e.ctx.fillRect(c.x+z*r+s.dx,c.y+(r-Y)/2+s.dy,U*r,Y)}z+=U}}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:o,viewScale:i})}}],r&&$o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function qo(t){return qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qo(t)}function Xo(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 Zo(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"!==qo(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==qo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===qo(o)?o:String(o)),n)}var o}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jo(t,e)}function Ko(t){return Ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ko(t)}var Qo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&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"===qo(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 Xo(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)?Xo(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&&Zo(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 ei(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 ri(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 ni(t,e){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ni(t,e)}function oi(t){return oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oi(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&&ni(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=oi(o);if(i){var r=oi(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 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 ei(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)?ei(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&&ri(e.prototype,r),n&&ri(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(gn);function ai(t){return ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ai(t)}function ui(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 li(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"!==ai(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ai(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ai(o)?o:String(o)),n)}var o}function si(t,e){return si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},si(t,e)}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}var hi=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&&si(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=fi(n);if(o){var r=fi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ai(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=ui(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=ui(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&&li(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function yi(t){return yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yi(t)}function pi(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"!==yi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===yi(o)?o:String(o)),n)}var o}function di(t,e){return di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},di(t,e)}function bi(t){return bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bi(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&&di(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=bi(o);if(i){var r=bi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===yi(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.diamond=e.diamond,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 pi(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)?pi(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)if(this.diamond){e.ctx.fillStyle=f;var h=s.x,y=s.y;e.ctx.beginPath(),e.ctx.moveTo(h-c,y),e.ctx.lineTo(h,y+c),e.ctx.lineTo(h+c,y),e.ctx.lineTo(h,y-c),e.ctx.closePath(),e.ctx.fill()}else{var p=this.width?this.width(s,r,n,i):void 0;if(!p||p<=0)continue;var v=this.length?this.length(s,r,n,i):void 0;if(!v||v<=0)continue;var d=.5*v;e.ctx.lineWidth=p,e.ctx.strokeStyle=f;var b=s.x,m=s.y;e.ctx.beginPath(),"v"===s.or?(e.ctx.moveTo(b,m-d),e.ctx.lineTo(b,m+d)):(e.ctx.moveTo(b-d,m),e.ctx.lineTo(b+d,m)),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]?0:e/2;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&&vi(e.prototype,r),n&&vi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(gn);function gi(t){return gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gi(t)}function wi(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function 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"!==gi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==gi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===gi(o)?o:String(o)),n)}var o}function Si(t,e){return Si=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Si(t,e)}function Oi(t){return Oi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Oi(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&&Si(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=Oi(n);if(o){var r=Oi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===gi(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=mi.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 wi(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(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&&xi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(mi);const ji=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 Pi(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 ki(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 Ei(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 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){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}var Ci=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=ki(e,Ei(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 "),Ei(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)}}])&&Ai(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();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){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 Li(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)?Li(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 Li(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 Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}function Fi(t){return Fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fi(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&&Ii(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=Fi(n);if(o){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 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=ji(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=Pi(e.w+"",e.h+"");if(!c)return void console.error("No webGL");var l,s=new Ci(c.gl,i/n),f=r/2,h=Ri(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=Ri(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&&zi(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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){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}var Gi=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=ki(t,Ei(t,t.VERTEX_SHADER,this.vshString),Ei(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&&Di(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wi(t){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi(t)}function Ui(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"!==Wi(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Wi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Wi(o)?o:String(o)),n)}var o}function $i(t,e){return $i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$i(t,e)}function Hi(t){return Hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hi(t)}var Yi=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$i(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=Hi(n);if(o){var r=Hi(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Wi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;!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 Gi(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++){n=t[l];var s=this.code(n);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=Pi(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")}}])&&Ui(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Vi(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 qi(t){return null===t?NaN:+t}function Xi(t,e,r=qi){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 Zi(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ji(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ki(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=Zi,r=(e,r)=>Zi(t(e),r),n=(e,r)=>t(e)-r):(e=t===Zi||t===Ji?t:Qi,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 Qi(){return 0}const ta=Ki(Zi),ea=ta.right,ra=(ta.left,Ki(qi).center,ea);function na(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function oa(){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]=Xi(e,t/o);return i}function i(e){return null==e||isNaN(e=+e)?t:r[ra(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(Zi),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 oa().domain(e).range(r).unknown(t)},na.apply(i,arguments)}var ia=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,Vi(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}}},aa=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.minSizePix||1,o=t.maxSizeFactor||1,i=oa();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}},ua=function(t){var e,r=t.valueFunction,n=t.stretching,o=t.colorScale||function(){return"purple"},i=null===(e=t.colors)||void 0===e?void 0:e.length;return t.colors&&i&&(o=function(e){return t.colors[1==e?i-1:Math.floor(e*i)]}),function(e){if(0!=e.length&&e){var a=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]}(e,r);if(null!=a[0]){var u=a[1]-a[0],c=function(t){return t=(t-a[0])/u,n&&(t=n(t)),o(t)};if(c.invert=function(t){return n&&(t=n.invert(t)),a[0]+t*u},t.colors&&i){c.breaks=[];for(var l=1;l<i;l++)c.breaks.push(c.invert(l/i))}return c}}}},ca=function(t){var e=t.valueFunction,r=t.classNumber||12,n=t.colors;t.colorScale&&(n=ha(t.colorScale,r)),n=n||Array.from({length:r},(function(t,e){return"rgb("+Math.floor(255*e/(r-1))+",150,150)"}));var o=oa().range(n);return function(t){return o.domain(t.map(e)),o.breaks=o.quantiles(),o.colors=n,o}},la=function(t){return function(e,r,n){var o={};for(var i in t)o[i]=t[i](e,r,n);return o}};function sa(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 fa(t,e){var r=sa(t),n=function(t){return e[r(t)]};return n.breaks=t,n.colors=e,n}function ha(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 ya(t){return ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ya(t)}function pa(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==ya(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===ya(o)?o:String(o)),n)}var o}var va=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,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n.colorDark=n.colorDark||"#111",n.colorBright=n.colorBright||"#ddd",n.width=n.width||function(t,e,r){var n=1*r,o=4*r,i=(o-n)/3;return Math.min(n+(t-1)*i,o)};for(var o=sa(e),i={},a=0;a<r.length;a++)i[a+""]=r[a];var u=new Yi({code:function(e){return o(t(e))},color:i}),c=function(e){return(e.c1?o(t(e.c1)):-1)-(e.c2?o(t(e.c2)):-1)};return[u,new mi({color:function(t){var e=c(t);if(0!==e)return"v"===t.or?e<0?n.colorBright:n.colorDark:e<0?n.colorDark:n.colorBright},width:function(t,e,r){return n.width(Math.abs(c(t)),e,r)}})]}}],null&&pa(e.prototype,null),r&&pa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function da(t){return da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},da(t)}function ba(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 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)}function xa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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"!==da(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==da(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===da(o)?o:String(o)),n)}var o}function Oa(t,e,r){return e&&Sa(t.prototype,e),r&&Sa(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var _a=function(){function t(){xa(this,t)}return Oa(t,null,[{key:"get",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};(n=n||{}).colDark=n.colDark||"#333",n.colBright=n.colBright||"#aaa",n.widthFactor=n.widthFactor||.12;var o=va.get(t,e,r,n),i=new Ro({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r},filter:n.filter});return[o[0],i,o[1],new ja({colDark:n.colDark,colBright:n.colBright,filter:n.filter})]}},{key:"getCategory",value:function(t,e,r){return(r=r||{}).colDark=r.colDark||"#333",r.colBright=r.colBright||"#aaa",[new Yi({code:t,color:e}),new Ro({strokeColor:function(){return"#666"},strokeWidth:function(t,e,r){return.2*r}}),new ja({colDark:r.colDark,colBright:r.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&&ga(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=wa(e);if(r){var o=wa(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return function(t,e){if(e&&("object"===da(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 xa(this,o),e=n.call(this,t),t=t||{},e.colDark=t.colDark||"#333",e.colBright=t.colBright||"#aaa",e}return Oa(o,[{key:"draw",value:function(t,e,r){this.filter&&(t=t.filter(this.filter)),e.ctx.lineWidth=.6*e.view.z,e.ctx.strokeStyle=this.colDark;var n,o=ba(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;e.ctx.beginPath(),e.ctx.arc(i.x+.5*r,i.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!0),e.ctx.stroke()}}catch(t){o.e(t)}finally{o.f()}e.ctx.strokeStyle=this.colBright;var a,u=ba(t);try{for(u.s();!(a=u.n()).done;){var c=a.value;e.ctx.beginPath(),e.ctx.arc(c.x+.5*r,c.y+.5*r,.55*r*.5,Math.PI/4,-Math.PI*(3/4),!1),e.ctx.stroke()}}catch(t){u.e(t)}finally{u.f()}}}]),o}(gn);function Pa(t){return Pa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pa(t)}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"!==Pa(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Pa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Pa(o)?o:String(o)),n)}var o}var Ea=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=Ei(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=Ei(e,e.FRAGMENT_SHADER,u);this.program=ki(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)}}])&&ka(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ta(t){return Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ta(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 Ca(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Ta(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ta(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ta(o)?o:String(o)),n)}var o}function Ma(t,e){return Ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ma(t,e)}function Ra(t){return Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ra(t)}var La=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ma(t,e)}(a,t);var e,r,n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ra(n);if(o){var r=Ra(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ta(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=Pi(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 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(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 Ea(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&&Ca(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 Ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Fa(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 Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Na(t,e)}function Ba(t){return Ba=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ba(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=Ba(n);if(o){var r=Ba(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===za(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.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 Ia(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ia(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(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&&Fa(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function Ga(t){return Ga="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ga(t)}function Wa(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"!==Ga(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Ga(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Ga(o)?o:String(o)),n)}var o}function $a(t,e){return $a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$a(t,e)}function Ha(t){return Ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ha(t)}var Ya=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&&$a(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=Ha(n);if(o){var r=Ha(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ga(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 Wa(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)?Wa(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}(gn);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 qa(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 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}}(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 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 Za(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 Ja(t,e){return Ja=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ja(t,e)}function Ka(t){return Ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ka(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ja(t,e)}(a,t);var e,r,n,o,i=(n=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ka(n);if(o){var r=Ka(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===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.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=qa(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=qa(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=qa(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=qa(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=qa(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=qa(this.ts);try{for(R.s();!(A=R.n()).done;){var L=p[A.value];null!=L&&((null==C||L<C)&&(C=L),(null==M||L>M)&&(M=L))}}catch(t){R.e(t)}finally{R.f()}S=.5*(+M+ +C),O=r/2}var z=m/(f-1),I=p[this.ts[0]];this.noData(I)||(e.ctx.beginPath(),e.ctx.moveTo(p.x+b,p.y+O+(I-S)*w/o+g));for(var F=void 0,N=1;N<f;N++)F=p[this.ts[N]],this.noData(I)&&this.noData(F)||(!this.noData(I)&&this.noData(F)?e.ctx.stroke():this.noData(I)&&!this.noData(F)?(e.ctx.beginPath(),e.ctx.moveTo(p.x+N*z+b,p.y+O+(F-S)*w/o+g)):(e.ctx.lineTo(p.x+N*z+b,p.y+O+(F-S)*w/o+g),N==f-1&&e.ctx.stroke())),I=F}}}}}}}}}catch(t){y.e(t)}finally{y.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:u})}}}],r&&Za(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);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 eu(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ru(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 ru(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}}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"!==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 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)}(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=au(n);if(o){var r=au(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.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=mi.buildSides(t,r,this.angle%180!=90&&this.sVert,this.angle%180!=0&&this.sHor);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=eu(y);try{for(x.s();!(w=x.n()).done;){var S=w.value,O=S.c1,_=S.c2,j=S.x,P=S.y,k=O?this.height(O,r,a,u):0,E=_?this.height(_,r,a,u):0,T=cu(O,c),A=cu(_,c);if(0!=T||0!=A)for(var C=0,M=0,R=0,L=Object.entries(this.color);R<L.length;R++){var z=(o=L[R],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)||ru(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.")}()),I=z[0],F=z[1],N=O?+O[I]:0,B=_?+_[I]:0;if(0!=N||0!=B){var D=k*C/T||0,G=k*(C+N)/T||0,W=E*M/A||0,U=E*(M+B)/A||0;e.ctx.beginPath(),"h"==S.or?(e.ctx.moveTo(j+D*v+f,P-l+D*d+h),e.ctx.lineTo(j+W*v+f,P+l+W*d+h),e.ctx.lineTo(j+U*v+f,P+l+U*d+h),e.ctx.lineTo(j+G*v+f,P-l+G*d+h)):(e.ctx.moveTo(j-l+D*v+f,P+D*d+h),e.ctx.lineTo(j+l+W*v+f,P+W*d+h),e.ctx.lineTo(j+l+U*v+f,P+U*d+h),e.ctx.lineTo(j-l+G*v+f,P+G*d+h)),e.ctx.fillStyle=F,e.ctx.fill(),C+=N,M+=B,g(O),g(_)}}}}catch(t){x.e(t)}finally{x.f()}this.updateLegends({style:this,resolution:r,z:a,viewScale:u})}}}],r&&ou(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn),cu=function(t,e){if(!t)return 0;var r,n=0,o=eu(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 lu(t){return lu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lu(t)}function su(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 fu(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==lu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==lu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===lu(o)?o:String(o)),n)}var o}function hu(t,e){return hu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hu(t,e)}function yu(t){return yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yu(t)}var pu=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&&hu(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=yu(n);if(o){var r=yu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===lu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=i.call(this,t),t=t||{},e.imageCode=t.imageCode||function(){return""},e.images=t.images||{},e.size=t.size||function(t,e){return e},e}return e=a,r=[{key:"draw",value:function(t,e,r){var n=e.view.z,o=r/n,i=this.viewScale?this.viewScale(t,r,n):void 0;e.initCanvasTransform();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 su(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)?su(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();!(a=u.n()).done;){var c=a.value,l=this.imageCode(c,r,n,i),s=this.images[l];if(s){var f=this.size(c,r,n,i)/n;if(f){var h=(o-f)/2;try{e.ctx.drawImage(s,e.geoToPixX(c.x)+h,e.geoToPixY(c.y)+h-o,f,f)}catch(t){console.error(t)}}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,resolution:r,z:n,viewScale:i})}}],r&&fu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(gn);function vu(t){return vu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vu(t)}function du(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 bu(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)?bu(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 bu(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"!==vu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==vu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===vu(o)?o:String(o)),n)}var o}function gu(t,e){return gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gu(t,e)}function wu(t){return wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wu(t)}var xu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gu(t,e)}(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=wu(o);if(i){var r=wu(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===vu(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=du(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,a.blendOperation&&(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 c,l=du(this.styles);try{for(l.s();!(c=l.n()).done;){var s=c.value;if((!s.visible||s.visible(r))&&(u.addLegends(e,s.legends),s.styles)){var f,h=du(s.styles);try{for(h.s();!(f=h.n()).done;){var y=f.value;y.visible&&!y.visible(r)||u.addLegends(e,y.legends)}}catch(t){h.e(t)}finally{h.f()}}}}catch(t){l.e(t)}finally{l.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:"addLegends",value:function(t,e){if(Array.isArray(e)){var r,n=du(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;this.addLegends(t,o)}}catch(t){n.e(t)}finally{n.f()}}else t.node().append(e.div.node())}},{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&&mu(e.prototype,r),n&&mu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(_n);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 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"!==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 _u(t,e){return _u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_u(t,e)}function ju(t){return ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ju(t)}var Pu=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&&_u(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=ju(n);if(o){var r=ju(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;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")}}])&&Ou(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(_n);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 Eu(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 Tu(t,e){return Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tu(t,e)}function Au(t){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Au(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&&Tu(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=Au(n);if(o){var r=Au(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.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}}}])&&Eu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(_n);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 Ru(){Ru=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"==Mu(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 Lu(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 zu(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}}}}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 Fu(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 Nu(t,e){return Nu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nu(t,e)}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bu(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&&Nu(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=Bu(i);if(a){var r=Bu(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 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=zu(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=Ru().mark((function t(e){var r,n,o,i;return Ru().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,qn(this.url);case 11:if(r=t.sent,!this.preprocess){t.next=35;break}this.labels=[],n=zu(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){Lu(i,r,o,a,u,"next",t)}function u(t){Lu(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&Fu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(_n);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(){Wu=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"==Gu(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 Uu(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 $u(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"!==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 Vu(t,e){return Vu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vu(t,e)}function qu(t){return qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qu(t)}var Xu=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&&Vu(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=qu(i);if(a){var r=qu(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 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=$u(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=Wu().mark((function t(e){var r,n,o,i,a;return Wu().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,zn(this.url);case 11:if(r=t.sent,n=r.features,!this.preprocess){t.next=36;break}this.fs=[],o=$u(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){Uu(i,r,o,a,u,"next",t)}function u(t){Uu(i,r,o,a,u,"throw",t)}a(void 0)}))},function(t){return o.apply(this,arguments)})}],r&&Yu(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(_n);function Zu(t){return Zu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zu(t)}function Ju(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==Zu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Zu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Zu(o)?o:String(o)),n)}var o}var Ku=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.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.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 1==arguments.length?this.div.style(t):(this.div.style(t,e),this)}},{key:"update",value:function(){console.error("Legend update not implemented yet.")}}],r&&Ju(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qu(t){return Qu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(t)}function tc(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"!==Qu(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Qu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Qu(o)?o:String(o)),n)}var o}function ec(t,e){return ec=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ec(t,e)}function rc(t){return rc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rc(t)}var nc=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&&ec(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=rc(n);if(o){var r=rc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Qu(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)}}}])&&tc(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function oc(t){return oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(t)}function ic(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"!==oc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==oc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===oc(o)?o:String(o)),n)}var o}function ac(t,e){return ac=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ac(t,e)}function uc(t){return uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},uc(t)}var cc=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&&ac(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=uc(n);if(o){var r=uc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===oc(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);if(r){var 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)}}}}}])&&ic(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function lc(t){return lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(t)}function sc(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"!==lc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==lc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===lc(o)?o:String(o)),n)}var o}function fc(t,e){return fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fc(t,e)}function hc(t){return hc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hc(t)}var yc=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&&fc(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=hc(n);if(o){var r=hc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===lc(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])}}}])&&sc(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function pc(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 vc(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 pc(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)?pc(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 dc(t){return new Promise((function(e,r){var n=new Image;n.onload=function(){e(n)},n.onerror=function(){r(new Error("Error loading image"))},n.src=t}))}function bc(t){return bc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(t)}function mc(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 gc(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)?gc(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 gc(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 wc(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"!==bc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==bc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===bc(o)?o:String(o)),n)}var o}function xc(t,e){return xc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xc(t,e)}function Sc(t){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sc(t)}var Oc=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&&xc(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=Sc(n);if(o){var r=Sc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===bc(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,t.resolution,t.z);if(r=this.size?this.size(t.viewScale,t.resolution,t.z)/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)}}}])&&wc(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function _c(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[],i=mc(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 Oc(n))};for(i.s();!(r=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function jc(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.k||[.9,.5,.2,.05],o=[],i=mc(n);try{var a=function(){var i=e.value;r.title=i==n[0]?r.title:void 0,r.label=function(e,r){return vc(i*Vi(r,t))},o.push(new Oc(r))};for(i.s();!(e=i.n()).done;)a()}catch(t){i.e(t)}finally{i.f()}return o}function Pc(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.labelFormat||function(t){return t},o=r.labelText||Ec(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 Oc(r))},u=e.length-1;u>=0;u--)a(u);return i}function kc(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.labelFormat||function(t){return t},n=e.labelText||Ec(r),o=[],i=e.viewScaleFun||function(t){return t},a=function(r){e.title=r==t-1?e.title:void 0,e.size=function(t){return i(t).values[r]},e.label=function(t){return n(i(t).breaks[r-1],i(t).breaks[r])},o.push(new Oc(e))},u=t-1;u>=0;u--)a(u);return o}function Ec(t){return function(e,r){return null==e&&null==r?"":null==r?"> "+t(e):null==e?"< "+t(r):t(e)+" - "+t(r)}}function Tc(t){return Tc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(t)}function Ac(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"!==Tc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==Tc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===Tc(o)?o:String(o)),n)}var o}function Cc(t,e){return Cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cc(t,e)}function Mc(t){return Mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mc(t)}var Rc=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&&Cc(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=Mc(n);if(o){var r=Mc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Tc(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&&Ac(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku);function Lc(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 Rc(r));return n}function zc(t){return zc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(t)}function Ic(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"!==zc(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==zc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n.key),"symbol"===zc(o)?o:String(o)),n)}var o}function Fc(t,e){return Fc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fc(t,e)}function Nc(t){return Nc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nc(t)}var Bc=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&&Fc(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=Nc(n);if(o){var r=Nc(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===zc(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.classifier=t.classifier,e.width=t.width||150,e.selectionColor=e.selectionColor||"red",e.tooltip=t.tooltip,e.texts=t.texts,e.leftText=t.leftText||"Category 0",e.topText=t.topText||"Category 1",e.rightText=t.rightText||"Category 2",e.centerCoefficient=t.centerCoefficient||e.classifier.centerCoefficient,e}return e=a,r=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.makeTitle();var e=this.width,r=.866025*e,n=this.classifier,o=this.selectionColor,i=this.tooltip,a=this.texts||{},u=this.div.append("svg").attr("width",e+0).attr("height",r+8+24);u.append("text").attr("x",e/2).attr("y",14).text(this.topText).attr("font-size",12).attr("text-anchor","middle"),u.append("text").attr("x",0).attr("y",30+r).text(this.leftText).attr("font-size",12).attr("text-anchor","start"),u.append("text").attr("x",e).attr("y",30+r).text(this.rightText).attr("font-size",12).attr("text-anchor","end");var c=u.append("g").attr("transform","translate(0 16)"),l=function(t,e,r){t.attr("fill",e).on("mouseover",(function(t){pt(this).attr("fill",o),i&&r&&(i.html(r),i.setPosition(t),i.show())})).on("mouseout",(function(){pt(this).attr("fill",e),i&&i.hide()})),i&&r&&t.on("mousemove",(function(t){i.setPosition(t)}))};l(c.append("polygon").attr("points","0,"+r+" "+e/3+","+r+" "+e/2+","+2*r/3+" "+e/6+","+2*r/3),n.colors[0],a[0]),l(c.append("polygon").attr("points",e/2+",0 "+2*e/3+","+r/3+" "+e/2+","+2*r/3+" "+e/3+","+r/3),n.colors[1],a[1]),l(c.append("polygon").attr("points",e+","+r+" "+5*e/6+","+2*r/3+" "+e/2+","+2*r/3+" "+2*e/3+","+r),n.colors[2],a[2]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+5*e/6+","+2*r/3+" "+2*e/3+","+r/3),n.mixColors[0],a[12]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/3+","+r+" "+2*e/3+","+r),n.mixColors[1],a["02"]),l(c.append("polygon").attr("points",e/2+","+2*r/3+" "+e/6+","+2*r/3+" "+e/3+","+r/3),n.mixColors[2],a["01"]),this.centerCoefficient&&l(c.append("circle").attr("cx",e/2).attr("cy",2*r/3).attr("r",this.centerCoefficient*r/3),n.centerColor,a.center)}}],r&&Ic(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ku),Dc=function(t){return t};Dc.invert=Dc;var Gc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return Dc;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},Wc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(0==t)return Dc;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},Uc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return Dc;var e=function(e){return Math.pow(e,t)},r=1/t;return e.invert=function(t){return Math.pow(t,r)},e},$c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(1==t)return Dc;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},Hc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return Dc;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}},Yc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.8;if(0==t)return Dc;var e=Hc(t);return function(t){return 1-e(1-t)}};const Vc=Math.PI/180,qc=180/Math.PI,Xc=.96422,Zc=1,Jc=.82521,Kc=4/29,Qc=6/29,tl=3*Qc*Qc,el=Qc*Qc*Qc;function rl(t){if(t instanceof ol)return new ol(t.l,t.a,t.b,t.opacity);if(t instanceof ll)return sl(t);t instanceof Fe||(t=ze(t));var e,r,n=cl(t.r),o=cl(t.g),i=cl(t.b),a=il((.2225045*n+.7168786*o+.0606169*i)/Zc);return n===o&&o===i?e=r=a:(e=il((.4360747*n+.3850649*o+.1430804*i)/Xc),r=il((.0139322*n+.0971045*o+.7141733*i)/Jc)),new ol(116*a-16,500*(e-a),200*(a-r),t.opacity)}function nl(t,e,r,n){return 1===arguments.length?rl(t):new ol(t,e,r,null==n?1:n)}function ol(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function il(t){return t>el?Math.pow(t,1/3):t/tl+Kc}function al(t){return t>Qc?t*t*t:tl*(t-Kc)}function ul(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function cl(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ll(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function sl(t){if(isNaN(t.h))return new ol(t.l,0,0,t.opacity);var e=t.h*Vc;return new ol(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function fl(t,e){var r=Je((t=nl(t)).l,(e=nl(e)).l),n=Je(t.a,e.a),o=Je(t.b,e.b),i=Je(t.opacity,e.opacity);return function(e){return t.l=r(e),t.a=n(e),t.b=o(e),t.opacity=i(e),t+""}}function hl(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)||function(t,e){if(t){if("string"==typeof t)return yl(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)?yl(t,e):void 0}}(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 yl(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}pe(ol,nl,ve(de,{brighter(t){return new ol(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new ol(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return new Fe(ul(3.1338561*(e=Xc*al(e))-1.6168667*(t=Zc*al(t))-.4906146*(r=Jc*al(r))),ul(-.9787684*e+1.9161415*t+.033454*r),ul(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}})),pe(ll,(function(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof ll)return new ll(t.h,t.c,t.l,t.opacity);if(t instanceof ol||(t=rl(t)),0===t.a&&0===t.b)return new ll(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*qc;return new ll(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new ll(t,e,r,null==n?1:n)}),ve(de,{brighter(t){return new ll(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new ll(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return sl(this).rgb()}}));var pl=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t[0],o=t[1],i=t[2],a=hl(r.center||[1/3,1/3,1/3],3),u=a[0],c=a[1],l=a[2],s=null==r.withMixedClasses||r.withMixedClasses,f=r.centerCoefficient?1-r.centerCoefficient:void 0,h=function(t){var r=e(t);if(r){var a=+t[n]/r,h=+t[o]/r,y=+t[i]/r;return a>=u&&h<=c&&y<=l?null!=f&&(y-l)*(c-f*c)>=(h-f*c)*(f*l-l)?"center":"0":a<=u&&h>=c&&y<=l?null!=f&&(y-l)*(u-f*u)>=(a-f*u)*(f*l-l)?"center":"1":a<=u&&h<=c&&y>=l?null!=f&&(h-c)*(u-f*u)>=(a-f*u)*(f*c-c)?"center":"2":a<=u&&h>=c&&y>=l?null!=f&&a>f*u?"center":s?"m0":h>y?"1":"2":a>=u&&h<=c&&y>=l?null!=f&&h>f*c?"center":s?"m1":a>y?"0":"2":a>=u&&h>=c&&y<=l?null!=f&&y>f*l?"center":s?"m2":h>a?"1":"0":"unknown"}};return h.center=[u,c,l],h.centerCoefficient=r.centerCoefficient,h},vl=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=hl(r||["red","green","blue"],3),i=o[0],a=o[1],u=o[2],c=n.colorInterpolation||fl,l=null==n.withMixedClasses||n.withMixedClasses,s=function(t,e){return c(t,e)(.5)},f=hl(n.mixedColors||l?[s(a,u),s(i,u),s(i,a)]:[],3),h=f[0],y=f[1],p=f[2],v=n.centerColor||c(s(i,a),u)(.333),d=pl(t,e,n),b=function(t){var e=d(t);return"0"==e?i:"1"==e?a:"2"==e?u:"m0"==e?h:"m1"==e?y:"m2"==e?p:"center"==e?v:n.defaultColor||"black"};return b.center=d.center,b.centerCoefficient=n.centerCoefficient,b.colors=[i,a,u],b.mixColors=[h,y,p],b.centerColor=v,b};function dl(t){return dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dl(t)}function bl(){bl=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"==dl(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 ml(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 gl(t,e){return wl.apply(this,arguments)}function wl(){var t;return t=bl().mark((function t(e,r){var n,o,i,a,u,c,l,s,f=arguments;return bl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=f.length>2&&void 0!==f[2]?f[2]:void 0,e=e||{},o=0,i=["f","m"];case 3:if(!(o<i.length)){t.next=22;break}a=i[o],u=0,c=["y","m","o"];case 6:if(!(u<c.length)){t.next=19;break}l=c[u],s=0;case 9:if(!(s<=2)){t.next=16;break}return t.next=12,dc(r+(a+l+s)+".png");case 12:e[a+l+s]=t.sent;case 13:s++,t.next=9;break;case 16:u++,t.next=6;break;case 19:o++,t.next=3;break;case 22:return n&&n(),t.abrupt("return",e);case 24:case"end":return t.stop()}}),t)})),wl=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ml(i,n,o,a,u,"next",t)}function u(t){ml(i,n,o,a,u,"throw",t)}a(void 0)}))},wl.apply(this,arguments)}function xl(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 Sl,Ol=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _l(t){if(!(e=Ol.exec(t)))throw new Error("invalid format: "+t);var e;return new jl({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 jl(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 Pl(t,e){var r=xl(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")}_l.prototype=jl.prototype,jl.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 kl={"%":(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)=>Pl(100*t,e),r:Pl,s:function(t,e){var r=xl(t,e);if(!r)return t+"";var n=r[0],o=r[1],i=o-(Sl=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")+xl(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function El(t){return t}var Tl,Al=Array.prototype.map,Cl=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ml(t){return Tl=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?El:(e=Al.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?El:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Al.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=_l(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"):kl[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=kl[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?Cl[8+Sl/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=_l(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((r=e,((r=xl(Math.abs(r)))?r[1]:NaN)/3)))),i=Math.pow(10,-o),a=Cl[8+o/3];return function(t){return n(i*t)+a}}}}(t),Tl.format,Tl.formatPrefix,Tl}Ml({thousands:",",grouping:[3],currency:["$",""]});var Rl=Br.getParameterByName;return Ml({decimal:".",thousands:" ",grouping:[3],currency:["","€"]}),e})()));
|