/*! For license information please see main~253ae210.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([["main~253ae210"],[,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"p",(function(){return u})),n.d(e,"i",(function(){return l})),n.d(e,"m",(function(){return c})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return f})),n.d(e,"j",(function(){return p})),n.d(e,"n",(function(){return d})),n.d(e,"a",(function(){return g})),n.d(e,"o",(function(){return y})),n.d(e,"q",(function(){return v})),n.d(e,"r",(function(){return m})),n.d(e,"s",(function(){return b})),n.d(e,"g",(function(){return x})),n.d(e,"f",(function(){return E}));n(35);var r="http://www.w3.org/2001/XMLSchema-instance";function i(t,e){return E().createElementNS(t,e)}function o(t,e){return function t(e,n,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)n?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{var i=void 0;for(i=e.firstChild;i;i=i.nextSibling)t(i,n,r)}return r}(t,e,[]).join("")}function a(t){return"documentElement"in t}function s(t,e,n){return t.getAttributeNS(e,n)||""}function u(t){return(new DOMParser).parseFromString(t,"application/xml")}function l(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&r[r.length-1].push(i)}}function c(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&(r[r.length-1]=i)}}function h(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);if(void 0!==o){var a=i[i.length-1],s=void 0!==e?e:r.localName,u=void 0;s in a?u=a[s]:(u=[],a[s]=u),u.push(o)}}}function f(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);void 0!==o&&(i[i.length-1][void 0!==e?e:r.localName]=o)}}function p(t,e){return function(n,r,i){t.call(void 0!==e?e:this,n,r,i),i[i.length-1].node.appendChild(n)}}function d(t,e){var n=t;return function(t,r,o){var a=r[r.length-1].node,s=n;return void 0===s&&(s=o),i(void 0!==e?e:a.namespaceURI,s)}}var g=d();function y(t,e,n){var r,i,o=void 0!==n?n:{};for(r=0,i=t.length;ro&&(l|=i.a.RIGHT),ua&&(l|=i.a.ABOVE),l===i.a.UNKNOWN&&(l=i.a.INTERSECTING),l}function d(){return[1/0,1/0,-1/0,-1/0]}function g(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function y(t){return g(1/0,1/0,-1/0,-1/0,t)}function v(t,e){var n=t[0],r=t[1];return g(n,r,n,r,e)}function m(t,e,n,r,i){return x(y(i),t,e,n,r)}function _(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function b(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function w(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function x(t,e,n,r,i){for(;ne[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function F(t){return t[2]=s&&v<=l),r||!(a&i.a.RIGHT)||o&i.a.RIGHT||(r=(m=g-(d-l)*y)>=u&&m<=c),r||!(a&i.a.BELOW)||o&i.a.BELOW||(r=(v=d-(g-u)/y)>=s&&v<=l),r||!(a&i.a.LEFT)||o&i.a.LEFT||(r=(m=g-(d-s)*y)>=u&&m<=c)}return r}function q(t,e,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s=n[2])){var i=T(n),o=Math.floor((r[0]-n[0])/i)*i;t[0]-=o,t[2]-=o}return t}},,function(t,e,n){var r=n(336);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},,function(t,e,n){var r=n(422),i=n(423),o=n(338),a=n(424);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return i.a})),n.d(e,"l",(function(){return P})),n.d(e,"g",(function(){return C})),n.d(e,"h",(function(){return k})),n.d(e,"b",(function(){return L})),n.d(e,"c",(function(){return I})),n.d(e,"j",(function(){return A})),n.d(e,"i",(function(){return T})),n.d(e,"p",(function(){return R})),n.d(e,"q",(function(){return F})),n.d(e,"k",(function(){return z})),n.d(e,"m",(function(){return U})),n.d(e,"d",(function(){return V})),n.d(e,"n",(function(){return Y})),n.d(e,"e",(function(){return W})),n.d(e,"o",(function(){return X})),n.d(e,"f",(function(){return H}));var r,i=n(63),o=n(157),a=n(25),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=6378137*Math.PI,l=[-u,-u,u,u],c=[-180,-85,180,85],h=6378137*Math.log(Math.tan(Math.PI/2)),f=function(t){function e(e){return t.call(this,{code:e,units:i.b.METERS,extent:l,global:!0,worldExtent:c,getPointResolution:function(t,e){return t/Object(a.b)(e[1]/6378137)}})||this}return s(e,t),e}(o.a),p=[new f("EPSG:3857"),new f("EPSG:102100"),new f("EPSG:102113"),new f("EPSG:900913"),new f("http://www.opengis.net/def/crs/EPSG/0/3857"),new f("http://www.opengis.net/gml/srs/epsg.xml#3857")];function d(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var a=0;ah?s=h:s<-h&&(s=-h),o[a+1]=s}return o}function g(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var a=0;a1?(n=i,r=o):l>0&&(n+=a*l,r+=u*l)}return s(t,e,n,r)}function s(t,e,n,r){var i=n-t,o=r-e;return i*i+o*o}function u(t){for(var e=t.length,n=0;ni&&(i=a,r=o)}if(0===i)return null;var s=t[r];t[r]=t[n],t[n]=s;for(var u=n+1;u=0;f--){h[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*h[f]}return h}function l(t){return 180*t/Math.PI}function c(t){return t*Math.PI/180}function h(t,e){var n=t%e;return n*e<0?n+e:n}function f(t,e,n){return t+n*(e-t)}},function(t,e,n){var r=n(441),i=n(442),o=n(338),a=n(443);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a}));var r=n(24);function i(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var a={target:t,type:e,listener:n};return t.addEventListener(e,n),a}function o(t,e,n,r){return i(t,e,n,r,!0)}function a(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Object(r.b)(t))}},function(t,e,n){"use strict";e.a={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i,o,a,s){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;(u=new Error(e.replace(/%s/g,(function(){return l[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return f})),n.d(e,"f",(function(){return p})),n.d(e,"g",(function(){return d})),n.d(e,"i",(function(){return g})),n.d(e,"k",(function(){return y})),n.d(e,"l",(function(){return v})),n.d(e,"m",(function(){return m})),n.d(e,"j",(function(){return _})),n.d(e,"h",(function(){return b})),n.d(e,"a",(function(){return w})),n.d(e,"r",(function(){return M})),n.d(e,"p",(function(){return P})),n.d(e,"o",(function(){return k})),n.d(e,"q",(function(){return j})),n.d(e,"n",(function(){return L}));var r=n(86),i=n(140),o=n(81),a=n(24),s=n(58),u=n(65),l="10px sans-serif",c="#000",h="round",f=[],p=0,d="round",g=10,y="#000",v="center",m="middle",_=[0,0,0,0],b=1,w=new r.a;(new i.a).setSize=function(){console.warn("labelCache is deprecated.")};var x,O,E=null,S={},M=function(){var t,e,n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";function o(t,o,a){for(var s=!0,u=0;u2?n-2:0),i=2;i>1)],e))<0?s=r+1:(u=r,l=!o);return l?s:~s}function i(t,e){return t>e?1:t=0}function a(t,e,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i0?i-1:i:t[i-1]-e0||n&&0===o)}))}n.d(e,"a",(function(){return r})),n.d(e,"g",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"h",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"b",(function(){return l})),n.d(e,"e",(function(){return c}))},function(t,e,n){"use strict";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})(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c}));var r,i,o=n(82),a=n(0),s=(n(170),n(221),n(222)),u=(n(287),n(102),n(213),n(113),function(t,e){var n=arguments;if(null==e||!o.f.call(e,"css"))return a.createElement.apply(void 0,n);var r=n.length,i=new Array(r);i[0]=o.b,i[1]=Object(o.e)(t,e);for(var s=2;s0){o[u]={_content_:o[u]};for(var c=0;c=1?(n=c,r=h):(n=u+d*f,r=l+d*p),[n,r]}function l(t,e,n){var r=Object(i.e)(e+180,360)-180,a=Math.abs(3600*r),s=n||0,u=Math.pow(10,s),l=Math.floor(a/3600),c=Math.floor((a-3600*l)/60),h=a-3600*l-60*c;return(h=Math.ceil(h*u)/u)>=60&&(h=0,c+=1),c>=60&&(c=0,l+=1),l+"° "+Object(o.b)(c,2)+"′ "+Object(o.b)(h,2,s)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function c(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function h(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function f(t,e){return t[0]*=e,t[1]*=e,t}function p(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function d(t,e){return Math.sqrt(p(t,e))}function g(t,e){return p(t,u(t,e))}function y(t,e){return t?l("NS",t[1],e)+" "+l("EW",t[0],e):""}function v(t,e){if(e.canWrapX()){var n=Object(r.D)(e.getExtent()),i=m(t,e,n);i&&(t[0]-=i*n)}return t}function m(t,e,n){var i=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]i[2])){var a=n||Object(r.D)(i);o=Math.floor((t[0]-i[0])/a)}return o}},,function(t,e,n){"use strict";var r=n(28);e.a={SINGLECLICK:"singleclick",CLICK:r.a.CLICK,DBLCLICK:r.a.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s}));var r=n(35);function i(){return!0}function o(){return!1}function a(){}function s(t){var e,n,i,o=!1;return function(){var a=Array.prototype.slice.call(arguments);return o&&this===i&&Object(r.b)(a,n)||(o=!0,i=this,n=a,e=t.apply(this,arguments)),e}}},function(t,e,n){"use strict";var r,i=n(181),o=n(43),a=n(55),s=n(132),u=n(154),l=n(156),c=n(74),h=n(2),f=n(24),p=n(8),d=n(35),g=n(13),y=n(19),v=n(115),m=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=o.a+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",b={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},w=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,r)||this).surface_=void 0!==r.surface&&r.surface,n.curve_=void 0!==r.curve&&r.curve,n.multiCurve_=void 0===r.multiCurve||r.multiCurve,n.multiSurface_=void 0===r.multiSurface||r.multiSurface,n.schemaLocation=r.schemaLocation?r.schemaLocation:_,n.hasZ=void 0!==r.hasZ&&r.hasZ,n}return m(e,t),e.prototype.readMultiCurve=function(t,e){var n=Object(h.r)([],this.MULTICURVE_PARSERS,t,e,this);return n?new u.a(n):void 0},e.prototype.readMultiSurface=function(t,e){var n=Object(h.r)([],this.MULTISURFACE_PARSERS,t,e,this);if(n)return new l.a(n)},e.prototype.curveMemberParser=function(t,e){Object(h.q)(this.CURVEMEMBER_PARSERS,t,e,this)},e.prototype.surfaceMemberParser=function(t,e){Object(h.q)(this.SURFACEMEMBER_PARSERS,t,e,this)},e.prototype.readPatch=function(t,e){return Object(h.r)([null],this.PATCHES_PARSERS,t,e,this)},e.prototype.readSegment=function(t,e){return Object(h.r)([null],this.SEGMENTS_PARSERS,t,e,this)},e.prototype.readPolygonPatch=function(t,e){return Object(h.r)([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)},e.prototype.readLineStringSegment=function(t,e){return Object(h.r)([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.interiorParser=function(t,e){var n=Object(h.r)(void 0,this.RING_PARSERS,t,e,this);n&&e[e.length-1].push(n)},e.prototype.exteriorParser=function(t,e){var n=Object(h.r)(void 0,this.RING_PARSERS,t,e,this);n&&(e[e.length-1][0]=n)},e.prototype.readSurface=function(t,e){var n=Object(h.r)([null],this.SURFACE_PARSERS,t,e,this);if(n&&n[0]){var r,i=n[0],o=[i.length],s=void 0;for(s=1,r=n.length;s=4;++r,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},d=n(257),g=n(258),y=/[A-Z]|^ms/g,v=/_EMO_([^_]+?)_([^]*?)_EMO_/g,m=function(t){return 45===t.charCodeAt(1)},_=function(t){return null!=t&&"boolean"!=typeof t},b=Object(g.a)((function(t){return m(t)?t:t.replace(y,"-$&").toLowerCase()})),w=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(v,(function(t,e,n){return O={name:e,styles:n,next:O},e}))}return 1===d.a[t]||m(t)||"number"!=typeof e||0===e?e:e+"px"};function x(t,e,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return O={name:n.name,styles:n.styles,next:O},n.name;if(void 0!==n.styles){var i=n.next;if(void 0!==i)for(;void 0!==i;)O={name:i.name,styles:i.styles,next:O},i=i.next;return n.styles+";"}return function(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i0&&t[1]>0}function o(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function a(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return f}));var r=n(123),i=n(108),o=n(16),a=n(69),s=n(31),u=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=p,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=p,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();function l(t){var e;if("function"==typeof t)e=t;else{var n;if(Array.isArray(t))n=t;else Object(s.a)("function"==typeof t.getZIndex,41),n=[t];e=function(){return n}}return e}var c=null;function h(t,e){if(!c){var n=new i.a({color:"rgba(255,255,255,0.4)"}),o=new a.a({color:"#3399CC",width:1.25});c=[new u({image:new r.a({fill:n,stroke:o,radius:5}),fill:n,stroke:o})]}return c}function f(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t[o.a.POLYGON]=[new u({fill:new i.a({color:[255,255,255,.5]})})],t[o.a.MULTI_POLYGON]=t[o.a.POLYGON],t[o.a.LINE_STRING]=[new u({stroke:new a.a({color:e,width:5})}),new u({stroke:new a.a({color:n,width:3})})],t[o.a.MULTI_LINE_STRING]=t[o.a.LINE_STRING],t[o.a.CIRCLE]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING]),t[o.a.POINT]=[new u({image:new r.a({radius:6,fill:new i.a({color:n}),stroke:new a.a({color:e,width:1.5})}),zIndex:1/0})],t[o.a.MULTI_POINT]=t[o.a.POINT],t[o.a.GEOMETRY_COLLECTION]=t[o.a.POLYGON].concat(t[o.a.LINE_STRING],t[o.a.POINT]),t}function p(t){return t.getGeometry()}e.c=u},function(t,e,n){"use strict";var r=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}();e.a=r},,function(t,e,n){"use strict";e.a={ANIMATING:0,INTERACTING:1}},,function(t,e,n){"use strict";var r=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}();e.a=r},function(t,e,n){"use strict";n.d(e,"c",(function(){return O})),n.d(e,"b",(function(){return E})),n.d(e,"d",(function(){return S}));var r,i=n(55),o=n(16),a=n(232),s=n(120),u=n(96),l=n(122),c=n(8),h=n(114),f=n(35),p=n(265),d=n(84),g=n(177),y=n(186),v=n(206),m=n(143),_=n(25),b=n(141),w=(n(226),r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),x=function(t){function e(e,n,r){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==n&&r?(i.setFlatCoordinates(n,e),i.ends_=r):i.setCoordinates(e,n),i}return w(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?Object(f.c)(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,n,r){return r0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e0}}else if(t.type==o.a.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==o.a.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===o.a.POINTERDOWN||e===o.a.POINTERDRAG||e===o.a.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==o.a.POINTERUP?delete this.trackedPointers_[n]:(t.type==o.a.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=Object(a.c)(this.trackedPointers_)}},e}(i.a);function l(t){for(var e=t.length,n=0,r=0,i=0;i=200&&s.status<300){var r=e.getType(),u=void 0;r==b.a.JSON||r==b.a.TEXT?u=s.responseText:r==b.a.XML?(u=s.responseXML)||(u=(new DOMParser).parseFromString(s.responseText,"application/xml")):r==b.a.ARRAY_BUFFER&&(u=s.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):a()}else a()},s.onerror=a,s.send()}(t,e,n,r,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||f.c)}}var O,E=(O=function(t,e){return(O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return E(e,t),e}(o.a),M=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,projection:void 0,state:c.a.READY,wrapX:void 0===i.wrapX||i.wrapX})||this).on,n.once,n.un,n.loader_=f.c,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(Object(d.a)(n.format_,7),n.loader_=x(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:p.a;var o,a,s=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=s?new u.a:null,n.loadedExtentsRtree_=new u.a,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?a=i.features:i.features&&(a=(o=i.features).getArray()),s||void 0!==o||(o=new r.a(a)),void 0!==a&&n.addFeaturesInternal(a),void 0!==o&&n.bindFeaturesCollection_(o),n}return E(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Object(v.c)(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var r=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new S(h.a.ADDFEATURE,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Object(_.a)(e,a.a.CHANGE,this.handleFeatureChange_,this),Object(_.a)(e,s.a.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(Object(d.a)(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],r=[],i=0,o=t.length;i0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,n=this.loadedExtentsRtree_;n.forEachInExtent(t,(function(n){if(Object(g.o)(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){var e=Object(v.c)(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=Object(v.c)(t);this.featureChangeKeys_[e].forEach(_.c),delete this.featureChangeKeys_[e];var n=t.getId();void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new S(h.a.REMOVEFEATURE,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Object(d.a)(this.format_,7),this.url_=t,this.setLoader(x(t,this.format_))},e}(l.a);e.a=M},function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=void 0!==i?i:[],a=0,s=e;sn||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}n.d(e,"a",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"e",(function(){return s})),n.d(e,"f",(function(){return u}))},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=.5,i=!0},function(t,e){function n(){return t.exports=n=Object.assign?Object.assign.bind():function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,t),this.init(e,n)}return Object(a.a)(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||h,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),r=1;r-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}for(var o="string"!=typeof e?[].concat(e):e.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!t[a]&&n&&(t[a]=new n),t=Object.prototype.hasOwnProperty.call(t,a)?t[a]:{}}return i()?{}:{obj:t,k:r(o.shift())}}function m(t,e,n){var r=v(t,e,Object);r.obj[r.k]=n}function _(t,e){var n=v(t,e),r=n.obj,i=n.k;if(r)return r[i]}function b(t,e,n){var r=_(t,n);return void 0!==r?r:_(e,n)}function w(t,e,n){for(var r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):w(t[r],e[r],n):t[r]=e[r]);return t}function x(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var O={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function E(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return O[t]})):t}var S="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,M=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Object(o.a)(this,e),n=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(n)),n.data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return Object(c.a)(e,t),Object(a.a)(e,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[t,e];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(o=t.split(".")),_(this.data,o)}},{key:"addResource",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[t,e];n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(r=e,e=(a=t.split("."))[1]),this.addNamespaces(e),m(this.data,a,r),i.silent||this.emit("added",t,e,n,r)}},{key:"addResources",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(t,e,i,n[i],{silent:!0});r.silent||this.emit("added",t,e,n)}},{key:"addResourceBundle",value:function(t,e,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[t,e];t.indexOf(".")>-1&&(r=n,n=e,e=(s=t.split("."))[1]),this.addNamespaces(e);var u=_(this.data,s)||{};r?w(u,n,o):u=Object(i.a)({},u,n),m(this.data,s,u),a.silent||this.emit("added",t,e,n)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Object(i.a)({},{},this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"toJSON",value:function(){return this.data}}]),e}(p),P={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,i){var o=this;return t.forEach((function(t){o.processors[t]&&(e=o.processors[t].process(e,n,r,i))})),e}},N={},C=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(o.a)(this,e),n=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(n)),y(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,Object(l.a)(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=f.create("translator"),n}return Object(c.a)(e,t),Object(a.a)(e,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(t,e);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,e){var n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,i=e.ns||this.options.defaultNS;if(n&&t.indexOf(n)>-1){var o=t.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:t,namespaces:i};var a=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),t=a.join(r)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}},{key:"translate",value:function(t,n,o){var a=this;if("object"!==Object(r.a)(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(t[t.length-1],n),l=u.key,c=u.namespaces,h=c[c.length-1],f=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(p){var d=n.nsSeparator||this.options.nsSeparator;return h+d+l}return l}var g=this.resolve(t,n),y=g&&g.res,v=g&&g.usedKey||l,m=g&&g.exactUsedKey||l,_=Object.prototype.toString.apply(y),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O="string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y;if(x&&y&&O&&b.indexOf(_)<0&&("string"!=typeof w||"[object Array]"!==_)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,n):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");if(s){var E="[object Array]"===_,S=E?[]:{},M=E?m:v;for(var P in y)if(Object.prototype.hasOwnProperty.call(y,P)){var N="".concat(M).concat(s).concat(P);S[P]=this.translate(N,Object(i.a)({},n,{joinArrays:!1,ns:c})),S[P]===N&&(S[P]=y[P])}y=S}}else if(x&&"string"==typeof w&&"[object Array]"===_)(y=y.join(w))&&(y=this.extendTranslation(y,t,n,o));else{var C=!1,k=!1,j=void 0!==n.count&&"string"!=typeof n.count,L=e.hasDefaultValue(n),I=j?this.pluralResolver.getSuffix(f,n.count):"",A=n["defaultValue".concat(I)]||n.defaultValue;!this.isValidLookup(y)&&L&&(C=!0,y=A),this.isValidLookup(y)||(k=!0,y=l);var T=L&&A!==y&&this.options.updateMissing;if(k||C||T){if(this.logger.log(T?"updateKey":"missingKey",f,h,l,T?A:y),s){var R=this.resolve(l,Object(i.a)({},n,{keySeparator:!1}));R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&D&&D[0])for(var G=0;G1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!a.isValidLookup(e)){var u=a.extractFromKey(t,s),l=u.key;n=l;var c=u.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var h=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach((function(t){a.isValidLookup(e)||(o=t,!N["".concat(p[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(N["".concat(p[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(e)){i=n;var o,u,c=l,p=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(p,l,n,t,s);else h&&(o=a.pluralResolver.getSuffix(n,s.count)),h&&f&&p.push(c+o),f&&p.push(c+="".concat(a.options.contextSeparator).concat(s.context)),h&&p.push(c+=o);for(;u=p.pop();)a.isValidLookup(e)||(r=u,e=a.getResource(n,t,u,s))}})))}))}})),{res:e,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}}],[{key:"hasDefaultValue",value:function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,"defaultValue".length)&&void 0!==t[e])return!0;return!1}}]),e}(p);function k(t){return t.charAt(0).toUpperCase()+t.slice(1)}var j=function(){function t(e){Object(o.a)(this,t),this.options=e,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=f.create("languageUtils")}return Object(a.a)(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=k(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=k(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=k(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isWhitelisted",value:function(t){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(t)}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,n=this;return t?(t.forEach((function(t){if(!e){var r=n.formatLanguageCode(t);n.options.supportedLngs&&!n.isSupportedCode(r)||(e=r)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var r=n.getLanguagePartFromCode(t);if(n.isSupportedCode(r))return e=r;e=n.options.supportedLngs.find((function(t){if(0===t.indexOf(r))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,e){var n=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),i=[],o=function(t){t&&(n.isSupportedCode(t)?i.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):"string"==typeof t&&o(this.formatLanguageCode(t)),r.forEach((function(t){i.indexOf(t)<0&&o(n.formatLanguageCode(t))})),i}}]),t}(),L=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],I={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};function A(){var t={};return L.forEach((function(e){e.lngs.forEach((function(n){t[n]={numbers:e.nr,plurals:I[e.fc]}}))})),t}var T=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(o.a)(this,t),this.languageUtils=e,this.options=n,this.logger=f.create("pluralResolver"),this.rules=A()}return Object(a.a)(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=this.getRule(t);return e&&e.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){return this.getSuffixes(t).map((function(t){return e+t}))}},{key:"getSuffixes",value:function(t){var e=this,n=this.getRule(t);return n?n.numbers.map((function(n){return e.getSuffix(t,n)})):[]}},{key:"getSuffix",value:function(t,e){var n=this,r=this.getRule(t);if(r){var i=r.noAbs?r.plurals(e):r.plurals(Math.abs(e)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(t)),""}}]),t}(),R=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(o.a)(this,t),this.logger=f.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return Object(a.a)(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:E,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?x(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?x(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?x(e.nestingPrefix):e.nestingPrefixEscaped||x("$t("),this.nestingSuffix=e.nestingSuffix?x(e.nestingSuffix):e.nestingSuffixEscaped||x(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,e,n,r){var i,o,a,s=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(t){return t.replace(/\$/g,"$$$$")}var c=function(t){if(t.indexOf(s.formatSeparator)<0){var i=b(e,u,t);return s.alwaysFormat?s.format(i,void 0,n):i}var o=t.split(s.formatSeparator),a=o.shift().trim(),l=o.join(s.formatSeparator).trim();return s.format(b(e,u,a),l,n,r)};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return l(t)}},{regex:this.regexp,safeValue:function(t){return s.escapeValue?l(s.escape(t)):l(t)}}].forEach((function(e){for(a=0;i=e.regex.exec(t);){if(void 0===(o=c(i[1].trim())))if("function"==typeof h){var n=h(t,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(t)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=g(o));if(t=t.replace(i[0],e.safeValue(o)),e.regex.lastIndex=0,++a>=s.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var n,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=Object(i.a)({},a);function u(t,e){var n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;var r=t.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);t=r[0],o=(o=this.interpolate(o,s)).replace(/'/g,'"');try{s=JSON.parse(o),e&&(s=Object(i.a)({},e,s))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(n).concat(o)}return delete s.defaultValue,t}for(s.applyPostProcessor=!1,delete s.defaultValue;n=this.nestingRegexp.exec(t);){var l=[],c=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(t){return t.trim()}));n[1]=h.shift(),l=h,c=!0}if((r=e(u.call(this,n[1].trim(),s),s))&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=g(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),r=""),c&&(r=l.reduce((function(t,e){return o.format(t,e,a.lng,a)}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}]),t}();var F=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Object(o.a)(this,e),i=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(i)),i.backend=t,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=a,i.logger=f.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,a.backend,a),i}return Object(c.a)(e,t),Object(a.a)(e,[{key:"queueLoad",value:function(t,e,n,r){var i=this,o=[],a=[],s=[],u=[];return t.forEach((function(t){var r=!0;e.forEach((function(e){var s="".concat(t,"|").concat(e);!n.reload&&i.store.hasResourceBundle(t,e)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),o.indexOf(s)<0&&o.push(s),u.indexOf(e)<0&&u.push(e)))})),r||s.push(t)})),(o.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:o,pending:a,toLoadLanguages:s,toLoadNamespaces:u}}},{key:"loaded",value:function(t,e,n){var r=t.split("|"),i=r[0],o=r[1];e&&this.emit("failedLoading",i,o,e),n&&this.store.addResourceBundle(i,o,n),this.state[t]=e?-1:2;var a={};this.queue.forEach((function(n){var r,s,u,l,c,h;r=n.loaded,s=o,l=v(r,[i],Object),c=l.obj,h=l.k,c[h]=c[h]||[],u&&(c[h]=c[h].concat(s)),u||c[h].push(s),function(t,e){for(var n=t.indexOf(e);-1!==n;)t.splice(n,1),n=t.indexOf(e)}(n.pending,t),e&&n.errors.push(e),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(t){a[t]||(a[t]=[]),n.loaded[t].length&&n.loaded[t].forEach((function(e){a[t].indexOf(e)<0&&a[t].push(e)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return t.length?this.backend[n](t,e,(function(s,u){s&&u&&i<5?setTimeout((function(){r.read.call(r,t,e,n,i+1,2*o,a)}),o):a(s,u)})):a(null,{})}},{key:"prepareLoading",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var o=this.queueLoad(t,e,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(t){n.loadOne(t)}))}},{key:"load",value:function(t,e,n){this.prepareLoading(t,e,{},n)}},{key:"reload",value:function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}},{key:"loadOne",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,a){r&&e.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&a&&e.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),a),e.loaded(t,r,a)}))}},{key:"saveMissing",value:function(t,e,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,e,n,r,null,Object(i.a)({},a,{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],e,n,r))}}]),e}(p);function D(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===Object(r.a)(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===Object(r.a)(t[2])||"object"===Object(r.a)(t[3])){var n=t[3]||t[2];Object.keys(n).forEach((function(t){e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,n,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function G(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.whitelist&&(t.whitelist&&t.whitelist.indexOf("cimode")<0&&(t.whitelist=t.whitelist.concat(["cimode"])),t.supportedLngs=t.whitelist),t.nonExplicitWhitelist&&(t.nonExplicitSupportedLngs=t.nonExplicitWhitelist),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function B(){}var q=new(function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(Object(o.a)(this,e),t=Object(s.a)(this,Object(u.a)(e).call(this)),S&&p.call(Object(l.a)(t)),t.options=G(n),t.services={},t.logger=f,t.modules={external:[]},r&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,r),Object(s.a)(t,Object(l.a)(t));setTimeout((function(){t.init(n,r)}),0)}return t}return Object(c.a)(e,t),Object(a.a)(e,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(t){return t?"function"==typeof t?new t:t:null}if("function"==typeof e&&(n=e,e={}),e.whitelist&&!e.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),e.nonExplicitWhitelist&&!e.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=Object(i.a)({},D(),this.options,G(e)),this.format=this.options.interpolation.format,n||(n=B),!this.options.isClone){this.modules.logger?f.init(r(this.modules.logger),this.options):f.init(null,this.options);var o=new j(this.options);this.store=new M(this.options.resources,this.options);var a=this.services;a.logger=f,a.resourceStore=this.store,a.languageUtils=o,a.pluralResolver=new T(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new R(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new F(r(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}}));var l=["addResource","addResources","addResourceBundle","removeResourceBundle"];l.forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var c=d(),h=function(){var e=function(e,r){t.isInitialized&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),c.resolve(r),n(e,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return e(null,t.t.bind(t));t.changeLanguage(t.options.lng,e)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),c}},{key:"loadResources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B,r=n,i="string"==typeof t?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],a=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){o.indexOf(t)<0&&o.push(t)}))};if(i)a(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(t){return a(t)}))}this.options.preload&&this.options.preload.forEach((function(t){return a(t)})),this.services.backendConnector.load(o,this.options.ns,r)}else r(null)}},{key:"reloadResources",value:function(t,e,n){var r=d();return t||(t=this.languages),e||(e=this.options.ns),n||(n=B),this.services.backendConnector.reload(t,e,(function(t){r.resolve(),n(t)})),r}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&P.addPostProcessor(t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"changeLanguage",value:function(t,e){var n=this;this.isLanguageChangingTo=t;var r=d();this.emit("languageChanging",t);var i=function(t){var i="string"==typeof t?t:n.services.languageUtils.getBestMatchFromCodes(t);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(t){!function(t,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),e&&e(t,(function(){return n.t.apply(n,arguments)}))}(t,i)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(t):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,e){var n=this,o=function t(e,o){var a;if("object"!==Object(r.a)(o)){for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(t,n){var r=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,t)||(!this.services.backendConnector.backend||!(!a(r,t)||i&&!a(o,t)))}},{key:"loadNamespaces",value:function(t,e){var n=this,r=d();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources((function(t){r.resolve(),e&&e(t)})),r):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var n=d();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],i=t.filter((function(t){return r.indexOf(t)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){if(t||(t=this.languages&&this.languages.length>0?this.languages[0]:this.language),!t)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new e(t,n)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B,o=Object(i.a)({},this.options,n,{isClone:!0}),a=new e(o),s=["store","services","language"];return s.forEach((function(e){a[e]=t[e]})),a.services=Object(i.a)({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new C(a.services,a.options),a.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1)u=n;else{if(p>0){for(var d=0;do&&(o=c),a=u,s=l}return o}function a(t,e,n,r,i){for(var a=0,s=n.length;ap&&(p=f=(p+f)/2),d>g&&(g=d=(g+d)/2);var v=Object(y.a)(r[0],f,p),m=Object(y.a)(r[1],d,g),_=30*i;return a&&n&&(v+=-_*Math.log(1+Math.max(0,f-r[0])/_)+_*Math.log(1+Math.max(0,r[0]-p)/_),m+=-_*Math.log(1+Math.max(0,d-r[1])/_)+_*Math.log(1+Math.max(0,r[1]-g)/_)),[v,m]}}}function m(t){return t}var _=n(8),b=n(35);function w(t,e,n,r){var i=Object(_.D)(e)/n[0],o=Object(_.z)(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function x(t,e,n){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/t-1))/50+1),Object(y.a)(r,n/2,2*e)}function O(t,e,n,r,i){return function(o,a,s,u){if(void 0!==o){var l=r?w(t,r,s,i):t;return(void 0===n||n)&&u?x(o,l,e):Object(y.a)(o,e,l)}}}var E,S=n(161),M=n(104),P=n(74),N=(E=function(t,e){return(E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}E(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),C=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(g.a)({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=Object(h.b)(r.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.nextCenter_=null,n.nextResolution_,n.nextRotation_,n.cancelAnchor_=void 0,r.center&&(r.center=Object(h.d)(r.center,n.projection_)),r.extent&&(r.extent=Object(h.e)(r.extent,n.projection_)),n.applyOptions_(r),n}return N(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,n,r,i=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,u=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,f=void 0!==t.showFullExtent&&t.showFullExtent,p=Object(h.b)(t.projection,"EPSG:3857"),d=p.getExtent(),g=t.constrainOnlyCenter,v=t.extent;u||v||!p.isGlobal()||(g=!1,v=d);if(void 0!==t.resolutions){var m=t.resolutions;n=m[i],r=void 0!==m[a]?m[a]:m[m.length-1],e=t.constrainResolution?function(t,e,n,r){return function(i,o,a,s){if(void 0!==i){var u=t[0],l=t[t.length-1],c=n?w(u,n,a,r):u;if(s)return void 0===e||e?x(i,c,l):Object(y.a)(i,l,c);var h=Math.min(c,i),f=Math.floor(Object(b.f)(t,h,o));return t[f]>c&&f1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n);for(var r=0;r0},e.prototype.getInteracting=function(){return this.hints_[a.a.INTERACTING]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(a.a.ANIMATING,-this.hints_[a.a.ANIMATING]);for(var e=0,n=this.animations_.length;e=0;--n){for(var r=this.animations_[n],i=!0,o=0,s=r.length;o0?l/u.duration:1;c>=1?(u.complete=!0,c=1):i=!1;var h=u.easing(c);if(u.sourceCenter){var f=u.sourceCenter[0],p=u.sourceCenter[1],d=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var v=f+h*(d-f),m=p+h*(g-p);this.targetCenter_=[v,m]}if(u.sourceResolution&&u.targetResolution){var _=1===h?u.targetResolution:u.sourceResolution+h*(u.targetResolution-u.sourceResolution);if(u.anchor){var b=this.getViewportSize_(this.getRotation()),w=this.constraints_.resolution(_,0,b,!0);this.targetCenter_=this.calculateCenterZoom(w,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==u.sourceRotation&&void 0!==u.targetRotation){var x=1===h?Object(y.e)(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+h*(u.targetRotation-u.sourceRotation);if(u.anchor){var O=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(O,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!u.complete)break}}if(i){this.animations_[n]=null,this.setHint(a.a.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var E=r[0].callback;E&&k(E,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var n,r=this.getCenterInternal();return void 0!==r&&(n=[r[0]-e[0],r[1]-e[1]],Object(p.g)(n,t-this.getRotation()),Object(p.a)(n,e)),n},e.prototype.calculateCenterZoom=function(t,e){var n,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(n=[e[0]-t*(e[0]-r[0])/i,e[1]-t*(e[1]-r[1])/i]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],r=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(r*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Object(h.m)(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(s)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return Object(h.n)(e,this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();Object(d.a)(n,1);var r=this.getResolution();Object(d.a)(void 0!==r,2);var i=this.getRotation();return Object(d.a)(void 0!==i,3),Object(_.y)(n,r,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(u)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Object(h.e)(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),r=Object(_.D)(t)/n[0],i=Object(_.z)(t)/n[1];return Math.max(r,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/Math.log(e);return function(t){return n/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(l)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/e;return function(t){return Math.log(n/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=L(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,n)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,n,r=this.minZoom_||0;if(this.resolutions_){var i=Object(b.f)(this.resolutions_,t,1);r=i,e=this.resolutions_[i],n=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,n=this.zoomFactor_;return r+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Object(y.a)(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Object(y.a)(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(Object(d.a)(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){Object(d.a)(!Object(_.G)(t),25);var r=Object(h.e)(t,this.getProjection());n=Object(P.c)(r)}else if(t.getType()===i.a.CIRCLE){r=Object(h.e)(t.getExtent(),this.getProjection());(n=Object(P.c)(r)).rotate(this.getRotation(),Object(_.w)(r))}else{var o=Object(h.k)();n=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),r=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),a=1/0,s=1/0,u=-1/0,l=-1/0,c=0,h=i.length;c=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}e.a=p},function(t,e,n){"use strict";function r(t,e,n){var r=void 0!==n?t.toFixed(n):""+t,i=r.indexOf(".");return(i=-1===i?r.length:i)>e?r:new Array(1+e-i).join("0")+r}function i(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;ia)return 1;if(a>o)return-1}return 0}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";var r,i=n(284),o=n(182),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=e||{},r=void 0!==n.projection?n.projection:"EPSG:3857",i=void 0!==n.tileGrid?n.tileGrid:Object(o.a)({extent:Object(o.b)(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,opaque:n.opaque,projection:r,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this}return a(e,t),e}(i.a);e.a=s},,function(t,e,n){var r=n(398);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i0)},e.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var r=n.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=a.c,++this.pendingRemovals_[t]):(n.splice(r,1),0===n.length&&delete this.listeners_[t]))}},e}(i.a);e.a=l},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return l}));var r=n(25);function i(t,e,n,i,o,a,s){var u=(n-e)/i;if(u<3){for(;e0;){for(var f=c.pop(),p=c.pop(),d=0,g=t[p],y=t[p+1],v=t[f],m=t[f+1],_=p+i;_d&&(h=_,d=x)}d>o&&(l[(h-e)/i]=1,p+i0&&y>d)&&(g<0&&v0&&v>g)?(u=f,l=p):(o[s++]=u,o[s++]=l,c=u,h=l,u=f,l=p)}}return o[s++]=u,o[s++]=l,s}function u(t,e,n,r,i,o,a,u){for(var l=0,c=n.length;lo&&(l-s)*(o-u)-(i-s)*(c-u)>0&&a++:c<=o&&(l-s)*(o-u)-(i-s)*(c-u)<0&&a--,s=l,u=c}return 0!==a}function a(t,e,n,r,i,a){if(0===n.length)return!1;if(!o(t,e,n[0],r,i,a))return!1;for(var s=1,u=n.length;st.length)&&(e=t.length);for(var n=0,r=Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function u(t,e,n){return(e=y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(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&&p(t,e)}function h(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function f(){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 p(t,e){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function d(t,e){return n(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||m(t,e)||f()}function g(t){return function(t){if(Array.isArray(t))return e(t)}(t)||h(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.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)?e(t,n):void 0}}var _=6371008.8,b={centimeters:100*_,centimetres:100*_,degrees:360/(2*Math.PI),feet:3.28084*_,inches:39.37*_,kilometers:_/1e3,kilometres:_/1e3,meters:_,metres:_,miles:_/1609.344,millimeters:1e3*_,millimetres:1e3*_,nauticalmiles:_/1852,radians:1,yards:1.0936*_},w={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function x(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function O(t,e){switch(t){case"Point":return E(e).geometry;case"LineString":return N(e).geometry;case"Polygon":return M(e).geometry;case"MultiPoint":return L(e).geometry;case"MultiLineString":return j(e).geometry;case"MultiPolygon":return I(e).geometry;default:throw new Error(t+" is invalid")}}function E(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Y(t[0])||!Y(t[1]))throw new Error("coordinates must contain numbers");return x({type:"Point",coordinates:t},e,n)}function S(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k(t.map((function(t){return E(t,e)})),n)}function M(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=s(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1].length!==o[0].length)throw new Error("First and last Position are not equivalent.");for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:{};return k(t.map((function(t){return M(t,e)})),n)}function N(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return x({type:"LineString",coordinates:t},e,n)}function C(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k(t.map((function(t){return N(t,e)})),n)}function k(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function j(t,e){return x({type:"MultiLineString",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function L(t,e){return x({type:"MultiPoint",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function I(t,e){return x({type:"MultiPolygon",coordinates:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function A(t,e){return x({type:"GeometryCollection",geometries:t},e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function T(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=b[e];if(!n)throw new Error(e+" units is invalid");return t*n}function F(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=b[e];if(!n)throw new Error(e+" units is invalid");return t/n}function D(t,e){return q(F(t,e))}function G(t){var e=t%360;return e<0&&(e+=360),e}function B(t){return(t%=360)>180?t-360:t<-180?t+360:t}function q(t){return t%(2*Math.PI)*180/Math.PI}function z(t){return t%360*Math.PI/180}function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("length must be a positive number");return R(F(t,e),n)}function V(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(t>=0))throw new Error("area must be a positive number");var r=w[e];if(!r)throw new Error("invalid original units");var i=w[n];if(!i)throw new Error("invalid final units");return t/r*i}function Y(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function W(t){return null!==t&&"object"===v(t)&&!Array.isArray(t)}function X(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!Y(t))throw new Error("bbox must only contain numbers")}))}function H(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(v(t)))throw new Error("id must be a number or a string")}var Z=Object.freeze({__proto__:null,areaFactors:w,azimuthToBearing:B,bearingToAzimuth:G,convertArea:V,convertLength:U,degreesToRadians:z,earthRadius:_,factors:b,feature:x,featureCollection:k,geometry:O,geometryCollection:A,isNumber:Y,isObject:W,lengthToDegrees:D,lengthToRadians:F,lineString:N,lineStrings:C,multiLineString:j,multiPoint:L,multiPolygon:I,point:E,points:S,polygon:M,polygons:P,radiansToDegrees:q,radiansToLength:R,round:T,validateBBox:X,validateId:H});function K(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return g(t.geometry.coordinates);if("Point"===t.type)return g(t.coordinates)}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return g(t);throw new Error("coord must be GeoJSON Point or an Array of numbers")}function J(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function $(t){if(t.length>1&&Y(t[0])&&Y(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return $(t[0]);throw new Error("coordinates must only contain numbers")}function Q(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function tt(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function et(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");var r,i=s(t.features);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(!o||"Feature"!==o.type||!o.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!o.geometry||o.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type)}}catch(t){i.e(t)}finally{i.f()}}function nt(t){return"Feature"===t.type?t.geometry:t}function rt(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}var it=Object.freeze({__proto__:null,collectionOf:et,containsNumber:$,featureOf:tt,geojsonType:Q,getCoord:K,getCoords:J,getGeom:nt,getType:rt});function ot(t,e){if(!0===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final)return function(t,e){var n=ot(e,t);return(n+180)%360}(t,e);var n=K(t),r=K(e),i=z(n[0]),o=z(r[0]),a=z(n[1]),s=z(r[1]),u=Math.sin(o-i)*Math.cos(s),l=Math.cos(a)*Math.sin(s)-Math.sin(a)*Math.cos(s)*Math.cos(o-i);return q(Math.atan2(u,l))}function at(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=K(t),o=z(i[0]),a=z(i[1]),s=z(n),u=F(e,r.units),l=Math.asin(Math.sin(a)*Math.cos(u)+Math.cos(a)*Math.sin(u)*Math.cos(s));return E([q(o+Math.atan2(Math.sin(s)*Math.sin(u)*Math.cos(a),Math.cos(u)-Math.sin(a)*Math.sin(l))),q(l)],r.properties)}function st(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=K(t),i=K(e),o=z(i[1]-r[1]),a=z(i[0]-r[0]),s=z(r[1]),u=z(i[1]),l=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(u);return R(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n.units)}function ut(t,e){var n;return(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final?lt(K(e),K(t)):lt(K(t),K(e)))>180?-(360-n):n}function lt(t,e){var n=z(t[1]),r=z(e[1]),i=z(e[0]-t[0]);i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(q(Math.atan2(i,o))+360)%360}function ct(t,e,n){if(null!==t)for(var r,i,o,a,s,u,l,c,h=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;vs||f>u||p>l)return a=o,s=n,u=f,l=p,void(i=0);var d=N([a,o],t.properties);if(!1===e(d,n,r,p,i))return!1;i++,a=o}))&&void 0}}}))}function xt(t,e,n){var r=n,i=!1;return wt(t,(function(t,o,a,s,u){r=!1===i&&void 0===n?t:e(r,t,o,a,s,u),i=!0})),r}function Ot(t,e){if(!t)throw new Error("geojson is required");_t(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var a=0;a0){e+=Math.abs(jt(t[0]));for(var n=1;n=e?(r+2)%e:r+2],s=i[0]*kt,u=o[1]*kt;n+=(a[0]*kt-s)*Math.sin(u),r++}return 20294876564838.72*n}function Lt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t.bbox&&!0!==e.recompute)return t.bbox;var n=[1/0,1/0,-1/0,-1/0];return ct(t,(function(t){n[0]>t[0]&&(n[0]=t[0]),n[1]>t[1]&&(n[1]=t[1]),n[2]e[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function Rt(t,e){var n,r=[],i=s(t);try{for(i.s();!(n=i.n()).done;){var o=It(n.value,e);o.length>0&&(o[0][0]===o[o.length-1][0]&&o[0][1]===o[o.length-1][1]||o.push(o[0]),o.length>=4&&r.push(o))}}catch(t){i.e(t)}finally{i.f()}return r}function Ft(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[n,r];return M([[a,[i,r],[i,o],[n,o],a]],e.properties,{bbox:t,id:e.id})}var Dt=a((function t(e){i(this,t),this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length,this.delay=0;for(var n=0;nt&&(e.push(r),n=i)}return e}},{key:"vector",value:function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}}},{key:"pos",value:function(t){var e=t-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*n);return function(t,e,n,r,i){var o=function(t){var e=t*t;return[e*t,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}(t);return{x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]}}((this.length-1)*n-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])}}]);function Gt(t){for(var e,n,r=J(t),i=0,o=1;o0}function Bt(t,e){for(var n=0,r=0,i=0,o=0,a=0,s=0,u=0,l=0,c=null,h=null,f=t[0],p=t[1],d=e.length;n0&&l>0)s=l,a=(c=h)[0]-f;else{if(u=h[0]-t[0],l>0&&s<=0){if((o=a*l-u*s)>0)i+=1;else if(0===o)return 0}else if(s>0&&l<=0){if((o=a*l-u*s)<0)i+=1;else if(0===o)return 0}else if(0===l&&s<0){if(0==(o=a*l-u*s))return 0}else if(0===s&&l<0){if(0==(o=a*l-u*s))return 0}else if(0===s&&0===l){if(u<=0&&a>=0)return 0;if(a<=0&&u>=0)return 0}c=h,s=l,a=u}}return i%2!=0}function qt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=K(t),i=nt(e),o=i.type,a=e.bbox,s=i.coordinates;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(r,a))return!1;"Polygon"===o&&(s=[s]);for(var u=!1,l=0;l2&&void 0!==arguments[2]?arguments[2]:{},r=K(t),i=J(e),o=0;oi)return!1}else if(0!==p)return!1;return Math.abs(h)===Math.abs(f)&&0===Math.abs(h)?!r&&n[0]===t[0]&&n[1]===t[1]:r?"start"===r?Math.abs(h)>=Math.abs(f)?h>0?s0?u=Math.abs(f)?h>0?s<=o&&o0?u<=a&&a=Math.abs(f)?h>0?s0?u=Math.abs(f)?h>0?s<=o&&o<=l:l<=o&&o<=s:f>0?u<=a&&a<=c:c<=a&&a<=u}function Vt(t,e){if("Feature"===t.type&&null===t.geometry)return!1;if("Feature"===e.type&&null===e.geometry)return!1;if(!Yt(Lt(t),Lt(e)))return!1;var n,r=s(nt(e).coordinates);try{for(r.s();!(n=r.n()).done;){var i,o=s(n.value);try{for(o.s();!(i=o.n()).done;)if(!qt(i.value,t))return!1}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}return!0}function Yt(t,e){return!(t[0]>e[0]||t[2]e[1]||t[3]0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt;if(i(this,t),this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}),[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}},{key:"_down",value:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}}]);function Zt(t,e){return te?1:0}function Kt(t,e){return t.p.x>e.p.x?1:t.p.xe.p.y?1:-1:1}function Jt(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x0?(c.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,c.isLeftEndpoint=!1),e.push(l),e.push(c),a=s,ee+=1}}Qt+=1}var re=a((function t(e){i(this,t),this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}));function ie(t,e){if(null===t||null===e)return!1;if(t.leftSweepEvent.ringId===e.leftSweepEvent.ringId&&(t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.rightSweepEvent)||t.leftSweepEvent.isSamePoint(e.leftSweepEvent)||t.leftSweepEvent.isSamePoint(e.rightSweepEvent)))return!1;var n=t.leftSweepEvent.p.x,r=t.leftSweepEvent.p.y,i=t.rightSweepEvent.p.x,o=t.rightSweepEvent.p.y,a=e.leftSweepEvent.p.x,s=e.leftSweepEvent.p.y,u=e.rightSweepEvent.p.x,l=e.rightSweepEvent.p.y,c=(l-s)*(i-n)-(u-a)*(o-r);if(0===c)return!1;var h=((u-a)*(r-s)-(l-s)*(n-a))/c,f=((i-n)*(r-s)-(o-r)*(n-a))/c;return h>=0&&h<=1&&f>=0&&f<=1&&[n+h*(i-n),r+h*(o-r)]}var oe=function(t,e){var n=new Ht([],Kt);return function(t,e){if("FeatureCollection"===t.type)for(var n=t.features,r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=n.removeDuplicates,i=void 0===r||r,o=n.ignoreSelfIntersections,a=void 0===o||o,s=[];"FeatureCollection"===t.type?s=s.concat(t.features):"Feature"===t.type?s.push(t):"LineString"!==t.type&&"Polygon"!==t.type&&"MultiLineString"!==t.type&&"MultiPolygon"!==t.type||s.push(x(t)),"FeatureCollection"===e.type?s=s.concat(e.features):"Feature"===e.type?s.push(e):"LineString"!==e.type&&"Polygon"!==e.type&&"MultiLineString"!==e.type&&"MultiPolygon"!==e.type||s.push(x(e));var u=oe(k(s),a),l=[];if(i){var c={};u.forEach((function(t){var e=t.join(",");c[e]||(c[e]=!0,l.push(t))}))}else l=u;return k(l.map((function(t){return E(t)})))}function se(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=nt(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=nt(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{};return ue(r,i)}(n,e);case"MultiPolygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=nt(t),r=n.coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{},o=[];return r.forEach((function(t){o.push(ue(t,i))})),k(o)}(n,e);default:throw new Error("invalid poly")}}function ue(t,e){return t.length>1?j(t,e):N(t[0],e)}function le(t,e){var n=nt(t),r=nt(e),i=n.type,o=r.type;switch(i){case"MultiPoint":switch(o){case"LineString":return ce(n,r);case"Polygon":return fe(n,r);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"MultiPoint":return ce(r,n);case"LineString":return function(t,e){if(ae(t,e).features.length>0)for(var n=0;n0}function fe(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o=Math.abs(s)?a>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:s>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1]:Math.abs(a)>=Math.abs(s)?a>0?t[0]0?t[1]2&&void 0!==arguments[2]?arguments[2]:{ignoreSelfIntersections:!0}).ignoreSelfIntersections,r=void 0===n||n,i=!0;return _t(t,(function(t){_t(e,(function(e){if(!1===i)return!1;i=function(t,e,n){switch(t.type){case"Point":switch(e.type){case"Point":return r=t.coordinates,i=e.coordinates,!(r[0]===i[0]&&r[1]===i[1]);case"LineString":return!ge(e,t);case"Polygon":return!qt(t,e)}break;case"LineString":switch(e.type){case"Point":return!ge(t,e);case"LineString":return!function(t,e,n){return ae(t,e,{ignoreSelfIntersections:n}).features.length>0}(t,e,n);case"Polygon":return!ye(e,t,n)}break;case"Polygon":switch(e.type){case"Point":return!qt(e,t);case"LineString":return!ye(t,e,n);case"Polygon":return!function(t,e,n){var r,i=s(t.coordinates[0]);try{for(i.s();!(r=i.n()).done;)if(qt(r.value,e))return!0}catch(t){i.e(t)}finally{i.f()}var o,a=s(e.coordinates[0]);try{for(a.s();!(o=a.n()).done;)if(qt(o.value,t))return!0}catch(t){a.e(t)}finally{a.f()}return ae(se(t),se(e),{ignoreSelfIntersections:n}).features.length>0}(e,t,n)}}var r,i;return!1}(t.geometry,e.geometry,r)}))})),i}function ge(t,e){for(var n=0;n0}function ve(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],a=e[1]-t[1];return 0==r*a-i*o&&(Math.abs(o)>=Math.abs(a)?o>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var me=Object.defineProperty,_e=function(t,e){return me(t,"name",{value:e,configurable:!0})},be=a((function t(e){var n,r,o;i(this,t),this.direction=!1,this.compareProperties=!0,this.precision=Math.pow(10,-(null!=(n=null==e?void 0:e.precision)?n:17)),this.direction=null!=(r=null==e?void 0:e.direction)&&r,this.compareProperties=null==(o=null==e?void 0:e.compareProperties)||o}),[{key:"compare",value:function(t,e){var n=this;if(t.type!==e.type)return!1;if(!xe(t,e))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,e.coordinates);case"LineString":return this.compareLine(t.coordinates,e.coordinates);case"Polygon":return this.comparePolygon(t,e);case"GeometryCollection":return this.compareGeometryCollection(t,e);case"Feature":return this.compareFeature(t,e);case"FeatureCollection":return this.compareFeatureCollection(t,e);default:if(t.type.startsWith("Multi")){var r=Oe(t),i=Oe(e);return r.every((function(t){return i.some((function(e){return n.compare(t,e)}))}))}}return!1}},{key:"compareCoord",value:function(t,e){var n=this;return t.length===e.length&&t.every((function(t,r){return Math.abs(t-e[r])2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!xe(t,e))return!1;var i=t,o=e;if(r&&!this.compareCoord(i[0],o[0])){var a=this.fixStartIndex(o,i);if(!a)return!1;o=a}var s=this.compareCoord(i[n],o[n]);return this.direction||s?this.comparePath(i,o):!!this.compareCoord(i[n],o[o.length-(1+n)])&&this.comparePath(i.slice().reverse(),o)}},{key:"fixStartIndex",value:function(t,e){for(var n,r=-1,i=0;i=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n}},{key:"comparePath",value:function(t,e){var n=this;return t.every((function(t,r){return n.compareCoord(t,e[r])}))}},{key:"comparePolygon",value:function(t,e){var n=this;if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var r=t.coordinates.slice(1,t.coordinates.length),i=e.coordinates.slice(1,e.coordinates.length);return r.every((function(t){return i.some((function(e){return n.compareLine(t,e,1,!0)}))}))}return!1}},{key:"compareGeometryCollection",value:function(t,e){var n=this;return xe(t.geometries,e.geometries)&&this.compareBBox(t,e)&&t.geometries.every((function(t,r){return n.compare(t,e.geometries[r])}))}},{key:"compareFeature",value:function(t,e){return t.id===e.id&&(!this.compareProperties||Se(t.properties,e.properties))&&this.compareBBox(t,e)&&this.compare(t.geometry,e.geometry)}},{key:"compareFeatureCollection",value:function(t,e){var n=this;return xe(t.features,e.features)&&this.compareBBox(t,e)&&t.features.every((function(t,r){return n.compare(t,e.features[r])}))}},{key:"compareBBox",value:function(t,e){return Boolean(!t.bbox&&!e.bbox)||!(!t.bbox||!e.bbox)&&this.compareCoord(t.bbox,e.bbox)}}]);_e(be,"GeojsonEquality");var we=be;function xe(t,e){return t.coordinates?t.coordinates.length===e.coordinates.length:t.length===e.length}function Oe(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function Ee(t,e,n){return new we(n).compare(t,e)}function Se(t,e){if(null===t&&null===e)return!0;if(null===t||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var i=0,o=n;i1&&void 0!==arguments[1]?arguments[1]:{},n="object"===v(e)?e.mutate:e;if(!t)throw new Error("geojson is required");var r=rt(t),i=[];switch(r){case"LineString":i=Ne(t,r);break;case"MultiLineString":case"Polygon":J(t).forEach((function(t){i.push(Ne(t,r))}));break;case"MultiPolygon":J(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(Ne(t,r))})),i.push(e)}));break;case"Point":return t;case"MultiPoint":var o={};J(t).forEach((function(t){var e=t.join("-");Object.prototype.hasOwnProperty.call(o,e)||(i.push(t),o[e]=!0)}));break;default:throw new Error(r+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=i,t):{type:r,coordinates:i}:!0===n?(t.geometry.coordinates=i,t):x({type:r,coordinates:i},t.properties,{bbox:t.bbox,id:t.id})}function Ne(t,e){var n=J(t);if(2===n.length&&!Ce(n[0],n[1]))return n;var r=[],i=n.length-1,o=r.length;r.push(n[0]);for(var a=1;a2&&ke(r[o-3],r[o-1],r[o-2])&&r.splice(r.length-2,1))}if(r.push(n[n.length-1]),o=r.length,("Polygon"===e||"MultiPolygon"===e)&&Ce(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return"LineString"===e&&o<3||ke(r[o-3],r[o-1],r[o-2])&&r.splice(r.length-2,1),r}function Ce(t,e){return t[0]===e[0]&&t[1]===e[1]}function ke(t,e,n){var r=n[0],i=n[1],o=t[0],a=t[1],s=e[0],u=e[1],l=s-o,c=u-a;return 0==(r-o)*c-(i-a)*l&&(Math.abs(l)>=Math.abs(c)?l>0?o<=r&&r<=s:s<=r&&r<=o:c>0?a<=i&&i<=u:u<=i&&i<=a)}function je(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).ignoreSelfIntersections,r=void 0===n||n,i=!1;return _t(t,(function(t){_t(e,(function(e){if(!0===i)return!0;i=!de(t.geometry,e.geometry,{ignoreSelfIntersections:r})}))})),i}function Le(t,e,n,r,i){!function t(e,n,r,i,o){for(;i>r;){if(i-r>600){var a=i-r+1,s=n-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*l/a+c)),Math.min(i,Math.floor(n+(a-s)*l/a+c)),o)}var h=e[n],f=r,p=i;for(Ie(e,r,n),o(e[i],h)>0&&Ie(e,r,i);f0;)p--}0===o(e[r],h)?Ie(e,r,p):Ie(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,n||0,r||t.length-1,i||Ae)}function Ie(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Ae(t,e){return te?1:0}var Te=a((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;i(this,t),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}),[{key:"all",value:function(){return this._all(this.data,[])}},{key:"search",value:function(t){var e=this.data,n=[];if(!Ye(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}},{key:"_split",value:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),a=We(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Fe(n,this.toBBox),Fe(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}},{key:"_splitRoot",value:function(t,e){this.data=We([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Fe(this.data,this.toBBox)}},{key:"_chooseSplitIndex",value:function(t,e,n){for(var r,i,o,a,s,u,l,c=1/0,h=1/0,f=e;f<=n-e;f++){var p=De(t,0,f,this.toBBox),d=De(t,f,n,this.toBBox),g=(i=p,o=d,a=Math.max(i.minX,o.minX),s=Math.max(i.minY,o.minY),u=Math.min(i.maxX,o.maxX),l=Math.min(i.maxY,o.maxY),Math.max(0,u-a)*Math.max(0,l-s)),y=ze(p)+ze(d);g=e;c--){var h=t.children[c];Ge(a,t.leaf?i(h):h),s+=Ue(a)}return s}},{key:"_adjustParentBBoxes",value:function(t,e,n){for(var r=n;r>=0;r--)Ge(e[r],t)}},{key:"_condense",value:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():Fe(t[n],this.toBBox)}}]);function Re(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function We(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Xe(t,e,n,r,i){for(var o=[e,n];o.length;)if(!((n=o.pop())-(e=o.pop())<=r)){var a=e+Math.ceil((n-e)/r/2)*r;Le(t,a,e,n,i),o.push(e,a,a,n)}}var He=Object.freeze({__proto__:null,default:Te});function Ze(t){var e=new Te(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Lt(t),Te.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:Lt(t),e.push(t)})):dt(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:Lt(t),e.push(t)})),Te.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:Lt(t),Te.prototype.remove.call(this,t,e)},e.clear=function(){return Te.prototype.clear.call(this)},e.search=function(t){return k(Te.prototype.search.call(this,this.toBBox(t)))},e.collides=function(t){return Te.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return k(Te.prototype.all.call(this))},e.toJSON=function(){return Te.prototype.toJSON.call(this)},e.fromJSON=function(t){return Te.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=Lt(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=Lt(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function Ke(t){if(!t)throw new Error("geojson is required");var e=[];return _t(t,(function(t){!function(t,e){var n=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":n=J(r);break;case"LineString":n=[J(r)]}n.forEach((function(n){(function(t,e){var n=[];return t.reduce((function(t,r){var i=N([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[ni?n:i,r>o?r:o]}(t,r),n.push(i),r})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),k(e)}var Je,$e,Qe=Object.defineProperty,tn=Object.defineProperties,en=Object.getOwnPropertyDescriptors,nn=Object.getOwnPropertySymbols,rn=Object.prototype.hasOwnProperty,on=Object.prototype.propertyIsEnumerable,an=function(t,e,n){return e in t?Qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},sn=function(t,e){for(var n in e||(e={}))rn.call(e,n)&&an(t,n,e[n]);if(nn){var r,i=s(nn(e));try{for(i.s();!(r=i.n()).done;)n=r.value,on.call(e,n)&&an(t,n,e[n])}catch(t){i.e(t)}finally{i.f()}}return t},un=function(t,e){return tn(t,en(e))};function ln(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)throw new Error("lines and pt are required arguments");var r=K(e),i=E([1/0,1/0],{dist:1/0,index:-1,multiFeatureIndex:-1,location:-1}),o=0;return _t(t,(function(t,a,s){for(var u=J(t),l=0;lA||hn(g,f)>A?st(pn(f),pn(p))<=st(pn(f),pn(g))?[pn(p),!0,!1]:[pn(g),!1,!0]:[pn(f),!1,!1]}function gn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yn(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var vn=gn(($e||($e=1,Je=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==v(e)&&"object"==v(n)){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!=i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!=e&&n!=n}),Je));function mn(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!W(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],a=Ze(),s=Ke(t);a.load(s);var u=[];return wt(e,(function(t){var e=!1;t&&(dt(a.search(t),(function(n){if(!1===e){var o=J(t).sort(),a=J(n).sort();if(vn(o,a))e=!0,r=r?_n(r,t)||r:t;else if(0===i?zt(o[0],n)&&zt(o[1],n):ln(n,o[0]).properties.dist<=i&&ln(n,o[1]).properties.dist<=i)e=!0,r=r?_n(r,t)||r:t;else if(0===i?zt(a[0],t)&&zt(a[1],t):ln(t,a[0]).properties.dist<=i&&ln(t,a[1]).properties.dist<=i)if(r){var s=_n(r,n);s?r=s:u.push(n)}else r=n}})),!1===e&&r&&(o.push(r),u.length&&(o=o.concat(u),u=[]),r=void 0))})),r&&o.push(r),k(o)}function _n(t,e){var n=J(e),r=J(t),i=r[0],o=r[r.length-1],a=t.geometry.coordinates;if(vn(n[0],i))a.unshift(n[1]);else if(vn(n[0],o))a.push(n[1]);else if(vn(n[1],i))a.unshift(n[0]);else{if(!vn(n[1],o))return;a.push(n[0])}return t}function bn(t,e){var n=G(ut(t[0],t[1])),r=G(ut(e[0],e[1]));return n===r||(r-n)%180==0}function wn(t,e){if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("Invalid GeoJSON object for "+e)}function xn(t,e){return!!On(e.coordinates[0],t.coordinates)||!!On(e.coordinates[e.coordinates.length-1],t.coordinates)}function On(t,e){return t[0]===e[0]&&t[1]===e[1]}function En(t){return t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]}function Sn(t){for(var e=0;ee[0]||t[2]e[1]||t[3]1&&void 0!==arguments[1]?arguments[1]:{},n=Lt(t);return E([(n[0]+n[2])/2,(n[1]+n[3])/2],e.properties,e)}var Ln,In={exports:{}},An=(Ln||(Ln=1,function(t,e){t.exports=function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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 o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var m=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getEndCapStyle",value:function(){return this._endCapStyle}},{key:"isSingleSided",value:function(){return this._isSingleSided}},{key:"setQuadrantSegments",value:function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=e.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=e.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==e.JOIN_ROUND&&(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS)}},{key:"getJoinStyle",value:function(){return this._joinStyle}},{key:"setJoinStyle",value:function(t){this._joinStyle=t}},{key:"setSimplifyFactor",value:function(t){this._simplifyFactor=t<0?0:t}},{key:"getSimplifyFactor",value:function(){return this._simplifyFactor}},{key:"getQuadrantSegments",value:function(){return this._quadrantSegments}},{key:"setEndCapStyle",value:function(t){this._endCapStyle=t}},{key:"getMitreLimit",value:function(){return this._mitreLimit}},{key:"setMitreLimit",value:function(t){this._mitreLimit=t}},{key:"setSingleSided",value:function(t){this._isSingleSided=t}}],[{key:"constructor_",value:function(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}}},{key:"bufferDistanceError",value:function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)}}]),e}();m.CAP_ROUND=1,m.CAP_FLAT=2,m.CAP_SQUARE=3,m.JOIN_ROUND=1,m.JOIN_MITRE=2,m.JOIN_BEVEL=3,m.DEFAULT_QUADRANT_SEGMENTS=8,m.DEFAULT_MITRE_LIMIT=5,m.DEFAULT_SIMPLIFY_FACTOR=.01;var _=function(e){r(o,e);var i=h(o);function o(e){var n;return t(this,o),(n=i.call(this,e)).name=Object.keys({Exception:o})[0],n}return n(o,[{key:"toString",value:function(){return this.message}}]),o}(u(Error)),b=function(e){r(i,e);var n=h(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({IllegalArgumentException:i})[0],r}return i}(_),w=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}();function x(){}function O(){}function E(){}var S,M,P,N,C,k,j,L=function(){function e(){t(this,e)}return n(e,null,[{key:"equalsWithTolerance",value:function(t,e,n){return Math.abs(t-e)<=n}}]),e}(),I=function(){function e(n,r){t(this,e),this.low=r||0,this.high=n||0}return n(e,null,[{key:"toBinaryString",value:function(t){var e,n="";for(e=2147483648;e>0;e>>>=1)n+=(t.high&e)===e?"1":"0";for(e=2147483648;e>0;e>>>=1)n+=(t.low&e)===e?"1":"0";return n}}]),e}();function A(){}function T(){}A.NaN=NaN,A.isNaN=function(t){return Number.isNaN(t)},A.isInfinite=function(t){return!Number.isFinite(t)},A.MAX_VALUE=Number.MAX_VALUE,A.POSITIVE_INFINITY=Number.POSITIVE_INFINITY,A.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,"function"==typeof Float64Array&&"function"==typeof Int32Array?(C=2146435072,k=new Float64Array(1),j=new Int32Array(k.buffer),A.doubleToLongBits=function(t){k[0]=t;var e=0|j[0],n=0|j[1];return(n&C)===C&&0!=(1048575&n)&&0!==e&&(e=0,n=2146959360),new I(n,e)},A.longBitsToDouble=function(t){return j[0]=t.low,j[1]=t.high,k[0]}):(S=Math.log2,M=Math.floor,P=Math.pow,N=function(){for(var t=53;t>0;t--){var e=P(2,t)-1;if(M(S(e))+1===t)return e}return 0}(),A.doubleToLongBits=function(t){var e,n,r,i,o,a,s,u,l;if(t<0||1/t===Number.NEGATIVE_INFINITY?(a=1<<31,t=-t):a=0,0===t)return new I(u=a,l=0);if(t===1/0)return new I(u=2146435072|a,l=0);if(t!=t)return new I(u=2146959360,l=0);if(i=0,l=0,(e=M(t))>1)if(e<=N)(i=M(S(e)))<=20?(l=0,u=e<<20-i&1048575):(l=e%(n=P(2,r=i-20))<<32-r,u=e/n&1048575);else for(r=e,l=0;0!==(r=M(n=r/2));)i++,l>>>=1,l|=(1&u)<<31,u>>>=1,n!==r&&(u|=524288);if(s=i+1023,o=0===e,e=t-e,i<52&&0!==e)for(r=0;;){if((n=2*e)>=1?(e=n-1,o?(s--,o=!1):(r<<=1,r|=1,i++)):(e=n,o?0==--s&&(i++,o=!1):(r<<=1,i++)),20===i)u|=r,r=0;else if(52===i){l|=r;break}if(1===n){i<20?u|=r<<20-i:i<52&&(l|=r<<52-i);break}}return u|=s<<20,new I(u|=a,l)},A.longBitsToDouble=function(t){var e,n,r,i,o=t.high,a=t.low,s=o&1<<31?-1:1;for(r=((2146435072&o)>>20)-1023,i=0,n=1<<19,e=1;e<=20;e++)o&n&&(i+=P(2,-e)),n>>>=1;for(n=1<<31,e=21;e<=52;e++)a&n&&(i+=P(2,-e)),n>>>=1;if(-1023===r){if(0===i)return 0*s;r=-1022}else{if(1024===r)return 0===i?s/0:NaN;i+=1}return s*i*P(2,r)});var R=function(e){r(i,e);var n=h(i);function i(e){var r;return t(this,i),(r=n.call(this,e)).name=Object.keys({RuntimeException:i})[0],r}return i}(_),F=function(e){r(o,e);var i=h(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){if(0===arguments.length)R.constructor_.call(this);else if(1===arguments.length){var t=arguments[0];R.constructor_.call(this,t)}}}]),o}(R),D=function(){function e(){t(this,e)}return n(e,null,[{key:"shouldNeverReachHere",value:function(){if(0===arguments.length)e.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new F("Should never reach here"+(null!==t?": "+t:""))}}},{key:"isTrue",value:function(){if(1===arguments.length){var t=arguments[0];e.isTrue(t,null)}else if(2===arguments.length){var n=arguments[1];if(!arguments[0])throw null===n?new F:new F(n)}}},{key:"equals",value:function(){if(2===arguments.length){var t=arguments[0],n=arguments[1];e.equals(t,n,null)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(!i.equals(r))throw new F("Expected "+r+" but encountered "+i+(null!==o?": "+o:""))}}}]),e}(),G=new ArrayBuffer(8),B=new Float64Array(G),q=new Int32Array(G),z=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getM",value:function(){return A.NaN}},{key:"setOrdinate",value:function(t,n){switch(t){case e.X:this.x=n;break;case e.Y:this.y=n;break;case e.Z:this.setZ(n);break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"equals2D",value:function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!L.equalsWithTolerance(this.x,e.x,n)&&!!L.equalsWithTolerance(this.y,e.y,n)}}},{key:"setM",value:function(t){throw new b("Invalid ordinate index: "+e.M)}},{key:"getZ",value:function(){return this.z}},{key:"getOrdinate",value:function(t){switch(t){case e.X:return this.x;case e.Y:return this.y;case e.Z:return this.getZ()}throw new b("Invalid ordinate index: "+t)}},{key:"equals3D",value:function(t){return this.x===t.x&&this.y===t.y&&(this.getZ()===t.getZ()||A.isNaN(this.getZ())&&A.isNaN(t.getZ()))}},{key:"equals",value:function(t){return t instanceof e&&this.equals2D(t)}},{key:"equalInZ",value:function(t,e){return L.equalsWithTolerance(this.getZ(),t.getZ(),e)}},{key:"setX",value:function(t){this.x=t}},{key:"compareTo",value:function(t){var e=t;return this.xe.x?1:this.ye.y?1:0}},{key:"getX",value:function(){return this.x}},{key:"setZ",value:function(t){this.z=t}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return D.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+")"}},{key:"distance3D",value:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.getZ()-t.getZ();return Math.sqrt(e*e+n*n+r*r)}},{key:"getY",value:function(){return this.y}},{key:"setY",value:function(t){this.y=t}},{key:"distance",value:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*t+e.hashCode(this.x))+e.hashCode(this.y)}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}},{key:"interfaces_",get:function(){return[x,O,E]}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)e.constructor_.call(this,0,0);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.x,t.y,t.getZ())}else if(2===arguments.length){var n=arguments[0],r=arguments[1];e.constructor_.call(this,n,r,e.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];this.x=i,this.y=o,this.z=a}}},{key:"hashCode",value:function(t){return B[0]=t,q[0]^q[1]}}]),e}(),U=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compare",value:function(t,n){var r=e.compare(t.x,n.x);if(0!==r)return r;var i=e.compare(t.y,n.y);return 0!==i?i:this._dimensionsToTest<=2?0:e.compare(t.getZ(),n.getZ())}},{key:"interfaces_",get:function(){return[T]}}],[{key:"constructor_",value:function(){if(this._dimensionsToTest=2,0===arguments.length)e.constructor_.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new b("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}},{key:"compare",value:function(t,e){return te?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0}}]),e}();z.DimensionalComparator=U,z.NULL_ORDINATE=A.NaN,z.X=0,z.Y=1,z.Z=2,z.M=3;var V=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getArea",value:function(){return this.getWidth()*this.getHeight()}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.isNull()?n.isNull():this._maxx===n.getMaxX()&&this._maxy===n.getMaxY()&&this._minx===n.getMinX()&&this._miny===n.getMinY()}},{key:"intersection",value:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new e;var n=this._minx>t._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny;return new e(n,this._maxx=this._minx&&n.getMaxX()<=this._maxx&&n.getMinY()>=this._miny&&n.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&i>=this._miny&&i<=this._maxy}}},{key:"intersects",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||(r.x>i.x?r.x:i.x)this._maxy||(r.y>i.y?r.y:i.y)this._maxx||othis._maxy||athis._maxx&&(this._maxx=n._maxx),n._minythis._maxy&&(this._maxy=n._maxy))}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=i,this._maxy=i):(rthis._maxx&&(this._maxx=r),ithis._maxy&&(this._maxy=i))}}},{key:"minExtent",value:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0}},{key:"translate",value:function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)}},{key:"copy",value:function(){return new e(this)}},{key:"toString",value:function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"}},{key:"setToNull",value:function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1}},{key:"disjoint",value:function(t){return!(!this.isNull()&&!t.isNull())||t._minx>this._maxx||t._maxxthis._maxy||t._maxye?t:e}},{key:"expandBy",value:function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}}},{key:"contains",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof z){var n=arguments[0];return this.covers(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return this.covers(r,i)}}},{key:"centre",value:function(){return this.isNull()?null:new z((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)}},{key:"init",value:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];this._minx=n._minx,this._maxx=n._maxx,this._miny=n._miny,this._maxy=n._maxy}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],u=arguments[3];ot._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)}},{key:"hashCode",value:function(){var t=17;return 37*(t=37*(t=37*(t=37*t+z.hashCode(this._minx))+z.hashCode(this._maxx))+z.hashCode(this._miny))+z.hashCode(this._maxy)}},{key:"interfaces_",get:function(){return[x,E]}}],[{key:"constructor_",value:function(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],a=arguments[1],s=arguments[2],u=arguments[3];this.init(o,a,s,u)}}},{key:"intersects",value:function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||cu||c=this.size())throw new et;return this.array[t]}},{key:"push",value:function(t){return this.array.push(t),t}},{key:"pop",value:function(){if(0===this.array.length)throw new tt;return this.array.pop()}},{key:"peek",value:function(){if(0===this.array.length)throw new tt;return this.array[this.array.length-1]}},{key:"empty",value:function(){return 0===this.array.length}},{key:"isEmpty",value:function(){return this.empty()}},{key:"search",value:function(t){return this.array.indexOf(t)}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}}]),o}(nt);function it(t,e){return t.interfaces_&&t.interfaces_.indexOf(e)>-1}var ot=function(){function e(n){t(this,e),this.str=n}return n(e,[{key:"append",value:function(t){this.str+=t}},{key:"setCharAt",value:function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)}},{key:"toString",value:function(){return this.str}}]),e}(),at=function(){function e(n){t(this,e),this.value=n}return n(e,[{key:"intValue",value:function(){return this.value}},{key:"compareTo",value:function(t){return this.valuet?1:0}}],[{key:"compare",value:function(t,e){return te?1:0}},{key:"isNan",value:function(t){return Number.isNaN(t)}},{key:"valueOf",value:function(t){return new e(t)}}]),e}(),st=function(){function e(){t(this,e)}return n(e,null,[{key:"isWhitespace",value:function(t){return t<=32&&t>=0||127===t}},{key:"toUpperCase",value:function(t){return t.toUpperCase()}}]),e}(),ut=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"le",value:function(t){return this._hi9?(h=!0,f="9"):f="0"+c,s.append(f),r=r.subtract(e.valueOf(c)).multiply(e.TEN),h&&r.selfAdd(e.TEN);var p=!0,d=e.magnitude(r._hi);if(d<0&&Math.abs(d)>=u-l&&(p=!1),!p)break}return n[0]=i,s.toString()}},{key:"sqr",value:function(){return this.multiply(this)}},{key:"doubleValue",value:function(){return this._hi+this._lo}},{key:"subtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var n=arguments[0];return this.add(-n)}}},{key:"equals",value:function(){if(1===arguments.length&&arguments[0]instanceof e){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}}},{key:"isZero",value:function(){return 0===this._hi&&0===this._lo}},{key:"selfSubtract",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.isNaN()?this:this.selfAdd(-n,0)}}},{key:"getSpecialNumberString",value:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null}},{key:"min",value:function(t){return this.le(t)?this:t}},{key:"selfDivide",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfDivide(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,a=null,s=null,u=null,l=null,c=null,h=null,f=null;return l=this._hi/r,f=(o=(c=e.SPLIT*l)-(o=c-l))*(s=(f=e.SPLIT*r)-(s=f-r))-(h=l*r)+o*(u=r-s)+(a=l-o)*s+a*u,f=l+(c=(this._hi-h-f+this._lo-l*i)/r),this._hi=f,this._lo=l-f+c,this}}},{key:"dump",value:function(){return"DD<"+this._hi+", "+this._lo+">"}},{key:"divide",value:function(){if(arguments[0]instanceof e){var t=arguments[0],n=null,r=null,i=null,o=null,a=null,s=null,u=null,l=null;return r=(a=this._hi/t._hi)-(n=(s=e.SPLIT*a)-(n=s-a)),l=n*(i=(l=e.SPLIT*t._hi)-(i=l-t._hi))-(u=a*t._hi)+n*(o=t._hi-i)+r*i+r*o,new e(l=a+(s=(this._hi-u-l+this._lo-a*t._lo)/t._hi),a-l+s)}if("number"==typeof arguments[0]){var c=arguments[0];return A.isNaN(c)?e.createNaN():e.copy(this).selfDivide(c,0)}}},{key:"ge",value:function(t){return this._hi>t._hi||this._hi===t._hi&&this._lo>=t._lo}},{key:"pow",value:function(t){if(0===t)return e.valueOf(1);var n=new e(this),r=e.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&r.selfMultiply(n),(i/=2)>0&&(n=n.sqr());else r=n;return t<0?r.reciprocal():r}},{key:"ceil",value:function(){if(this.isNaN())return e.NaN;var t=Math.ceil(this._hi),n=0;return t===this._hi&&(n=Math.ceil(this._lo)),new e(t,n)}},{key:"compareTo",value:function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0}},{key:"rint",value:function(){return this.isNaN()?this:this.add(.5).floor()}},{key:"setValue",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var n=arguments[0];return this.init(n),this}}},{key:"max",value:function(t){return this.ge(t)?this:t}},{key:"sqrt",value:function(){if(this.isZero())return e.valueOf(0);if(this.isNegative())return e.NaN;var t=1/Math.sqrt(this._hi),n=this._hi*t,r=e.valueOf(n),i=this.subtract(r.sqr())._hi*(.5*t);return r.add(i)}},{key:"selfAdd",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0],r=null,i=null,o=null,a=null,s=null,u=null;return a=(o=this._hi+n)-(s=o-this._hi),i=(u=(a=n-s+(this._hi-a))+this._lo)+(o-(r=o+u)),this._hi=r+i,this._lo=i+(r-this._hi),this}}else if(2===arguments.length){var l=arguments[0],c=arguments[1],h=null,f=null,p=null,d=null,g=null,y=null,v=null;d=this._hi+l,f=this._lo+c,g=d-(y=d-this._hi),p=f-(v=f-this._lo);var m=(h=d+(y=(g=l-y+(this._hi-g))+f))+(y=(p=c-v+(this._lo-p))+(y+(d-h))),_=y+(h-m);return this._hi=m,this._lo=_,this}}},{key:"selfMultiply",value:function(){if(1===arguments.length){if(arguments[0]instanceof e){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var n=arguments[0];return this.selfMultiply(n,0)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1],o=null,a=null,s=null,u=null,l=null,c=null;o=(l=e.SPLIT*this._hi)-this._hi,c=e.SPLIT*r,o=l-o,a=this._hi-o,s=c-r;var h=(l=this._hi*r)+(c=o*(s=c-s)-l+o*(u=r-s)+a*s+a*u+(this._hi*i+this._lo*r)),f=c+(o=l-h);return this._hi=h,this._lo=f,this}}},{key:"selfSqr",value:function(){return this.selfMultiply(this)}},{key:"floor",value:function(){if(this.isNaN())return e.NaN;var t=Math.floor(this._hi),n=0;return t===this._hi&&(n=Math.floor(this._lo)),new e(t,n)}},{key:"negate",value:function(){return this.isNaN()?this:new e(-this._hi,-this._lo)}},{key:"clone",value:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}}},{key:"multiply",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return t.isNaN()?e.createNaN():e.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var n=arguments[0];return A.isNaN(n)?e.createNaN():e.copy(this).selfMultiply(n,0)}}},{key:"isNaN",value:function(){return A.isNaN(this._hi)}},{key:"intValue",value:function(){return Math.trunc(this._hi)}},{key:"toString",value:function(){var t=e.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()}},{key:"toStandardNotation",value:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!0,n),i=n[0]+1,o=r;if("."===r.charAt(0))o="0"+r;else if(i<0)o="0."+e.stringOfChar("0",-i)+r;else if(-1===r.indexOf(".")){var a=i-r.length;o=r+e.stringOfChar("0",a)+".0"}return this.isNegative()?"-"+o:o}},{key:"reciprocal",value:function(){var t,n,r,i,o=null,a=null,s=null,u=null;t=(r=1/this._hi)-(o=(s=e.SPLIT*r)-(o=s-r)),a=(u=e.SPLIT*this._hi)-this._hi;var l=r+(s=(1-(i=r*this._hi)-(u=o*(a=u-a)-i+o*(n=this._hi-a)+t*a+t*n)-r*this._lo)/this._hi);return new e(l,r-l+s)}},{key:"toSciNotation",value:function(){if(this.isZero())return e.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var n=new Array(1).fill(null),r=this.extractSignificantDigits(!1,n),i=e.SCI_NOT_EXPONENT_CHAR+n[0];if("0"===r.charAt(0))throw new IllegalStateException("Found leading zero: "+r);var o="";r.length>1&&(o=r.substring(1));var a=r.charAt(0)+"."+o;return this.isNegative()?"-"+a+i:a+i}},{key:"abs",value:function(){return this.isNaN()?e.NaN:this.isNegative()?this.negate():new e(this)}},{key:"isPositive",value:function(){return this._hi>0||0===this._hi&&this._lo>0}},{key:"lt",value:function(t){return this._hit._hi||this._hi===t._hi&&this._lo>t._lo}},{key:"isNegative",value:function(){return this._hi<0||0===this._hi&&this._lo<0}},{key:"trunc",value:function(){return this.isNaN()?e.NaN:this.isPositive()?this.floor():this.ceil()}},{key:"signum",value:function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0}},{key:"interfaces_",get:function(){return[E,x,O]}}],[{key:"constructor_",value:function(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];e.constructor_.call(this,e.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}},{key:"determinant",value:function(){if("number"==typeof arguments[3]&&"number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];return e.determinant(e.valueOf(t),e.valueOf(n),e.valueOf(r),e.valueOf(i))}if(arguments[3]instanceof e&&arguments[2]instanceof e&&arguments[0]instanceof e&&arguments[1]instanceof e){var o=arguments[1],a=arguments[2],s=arguments[3];return arguments[0].multiply(s).selfSubtract(o.multiply(a))}}},{key:"sqr",value:function(t){return e.valueOf(t).selfMultiply(t)}},{key:"valueOf",value:function(){if("string"==typeof arguments[0]){var t=arguments[0];return e.parse(t)}if("number"==typeof arguments[0])return new e(arguments[0])}},{key:"sqrt",value:function(t){return e.valueOf(t).sqrt()}},{key:"parse",value:function(t){for(var n=0,r=t.length;st.isWhitespace(t.charAt(n));)n++;var i=!1;if(n=r);){var h=t.charAt(n);if(n++,st.isDigit(h)){var f=h-"0";a.selfMultiply(e.TEN),a.selfAdd(f),s++}else{if("."!==h){if("e"===h||"E"===h){var p=t.substring(n);try{l=at.parseInt(p)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+p+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+h+"' at position "+n+" in string "+t)}u=s,c=!0}}var d=a;c||(u=s);var g=s-u-l;if(0===g)d=a;else if(g>0){var y=e.TEN.pow(g);d=a.divide(y)}else if(g<0){var v=e.TEN.pow(-g);d=a.multiply(v)}return i?d.negate():d}},{key:"createNaN",value:function(){return new e(A.NaN,A.NaN)}},{key:"copy",value:function(t){return new e(t)}},{key:"magnitude",value:function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r}},{key:"stringOfChar",value:function(t,e){for(var n=new ot,r=0;r0){if(a<=0)return e.signum(s);i=o+a}else{if(!(o<0))return e.signum(s);if(a>=0)return e.signum(s);i=-o-a}var u=e.DP_SAFE_EPSILON*i;return s>=u||-s>=u?e.signum(s):2}},{key:"signum",value:function(t){return t>0?1:t<0?-1:0}}]),e}();lt.DP_SAFE_EPSILON=1e-15;var ct=function(){function e(){t(this,e)}return n(e,[{key:"getM",value:function(t){if(this.hasM()){var e=this.getDimension()-this.getMeasures();return this.getOrdinate(t,e)}return A.NaN}},{key:"setOrdinate",value:function(t,e,n){}},{key:"getZ",value:function(t){return this.hasZ()?this.getOrdinate(t,2):A.NaN}},{key:"size",value:function(){}},{key:"getOrdinate",value:function(t,e){}},{key:"getCoordinate",value:function(){}},{key:"getCoordinateCopy",value:function(t){}},{key:"createCoordinate",value:function(){}},{key:"getDimension",value:function(){}},{key:"hasM",value:function(){return this.getMeasures()>0}},{key:"getX",value:function(t){}},{key:"hasZ",value:function(){return this.getDimension()-this.getMeasures()>2}},{key:"getMeasures",value:function(){return 0}},{key:"expandEnvelope",value:function(t){}},{key:"copy",value:function(){}},{key:"getY",value:function(t){}},{key:"toCoordinateArray",value:function(){}},{key:"interfaces_",get:function(){return[O]}}]),e}();ct.X=0,ct.Y=1,ct.Z=2,ct.M=3;var ht=function(){function e(){t(this,e)}return n(e,null,[{key:"index",value:function(t,e,n){return lt.orientationIndex(t,e,n)}},{key:"isCCW",value:function(){if(arguments[0]instanceof Array){var t=arguments[0],n=t.length-1;if(n<3)throw new b("Ring has fewer than 4 points, so orientation cannot be determined");for(var r=t[0],i=0,o=1;o<=n;o++){var a=t[o];a.y>r.y&&(r=a,i=o)}var s=i;do{(s-=1)<0&&(s=n)}while(t[s].equals2D(r)&&s!==i);var u=i;do{u=(u+1)%n}while(t[u].equals2D(r)&&u!==i);var l=t[s],c=t[u];if(l.equals2D(r)||c.equals2D(r)||l.equals2D(c))return!1;var h=e.index(l,r,c);return 0===h?l.x>c.x:h>0}if(it(arguments[0],ct)){var f=arguments[0],p=f.size()-1;if(p<3)throw new b("Ring has fewer than 4 points, so orientation cannot be determined");for(var d=f.getCoordinate(0),g=0,y=1;y<=p;y++){var v=f.getCoordinate(y);v.y>d.y&&(d=v,g=y)}var m=null,_=g;do{(_-=1)<0&&(_=p),m=f.getCoordinate(_)}while(m.equals2D(d)&&_!==g);var w=null,x=g;do{x=(x+1)%p,w=f.getCoordinate(x)}while(w.equals2D(d)&&x!==g);if(m.equals2D(d)||w.equals2D(d)||m.equals2D(w))return!1;var O=e.index(m,d,w);return 0===O?m.x>w.x:O>0}}}]),e}();ht.CLOCKWISE=-1,ht.RIGHT=ht.CLOCKWISE,ht.COUNTERCLOCKWISE=1,ht.LEFT=ht.COUNTERCLOCKWISE,ht.COLLINEAR=0,ht.STRAIGHT=ht.COLLINEAR;var ft=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this._minCoord}},{key:"getRightmostSide",value:function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n}},{key:"findRightmostEdgeAtVertex",value:function(){var t=this._minDe.getEdge().getCoordinates();D.isTrue(this._minIndex>0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===ht.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)}},{key:"getRightmostSideOfSegment",value:function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Q.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])}},{key:"findRightmostEdgeAtNode",value:function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)}},{key:"findEdge",value:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}D.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Q.LEFT&&(this._orientedDe=this._minDe.getSym())}}],[{key:"constructor_",value:function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}}]),e}(),pt=function(e){r(o,e);var i=h(o);function o(e,n){var r;return t(this,o),(r=i.call(this,n?e+" [ "+n+" ]":e)).pt=n?new z(n):void 0,r.name=Object.keys({TopologyException:o})[0],r}return n(o,[{key:"getCoordinate",value:function(){return this.pt}}]),o}(R),dt=function(){function e(){t(this,e),this.array=[]}return n(e,[{key:"addLast",value:function(t){this.array.push(t)}},{key:"removeFirst",value:function(){return this.array.shift()}},{key:"isEmpty",value:function(){return 0===this.array.length}}]),e}(),gt=function(e,i){r(a,e);var o=h(a);function a(e){var n;return t(this,a),(n=o.call(this)).array=[],e instanceof X&&n.addAll(e),n}return n(a,[{key:"interfaces_",get:function(){return[nt,X]}},{key:"ensureCapacity",value:function(){}},{key:"add",value:function(t){return 1===arguments.length?this.array.push(t):this.array.splice(arguments[0],0,arguments[1]),!0}},{key:"clear",value:function(){this.array=[]}},{key:"addAll",value:function(t){var e,n=y(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.array.push(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"set",value:function(t,e){var n=this.array[t];return this.array[t]=e,n}},{key:"iterator",value:function(){return new yt(this)}},{key:"get",value:function(t){if(t<0||t>=this.size())throw new et;return this.array[t]}},{key:"isEmpty",value:function(){return 0===this.array.length}},{key:"sort",value:function(t){t?this.array.sort((function(e,n){return t.compare(e,n)})):this.array.sort()}},{key:"size",value:function(){return this.array.length}},{key:"toArray",value:function(){return this.array.slice()}},{key:"remove",value:function(t){for(var e=0,n=this.array.length;e=1&&e.getDepth(Q.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}}},{key:"computeDepths",value:function(t){var e=new J,n=new dt,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(n.addLast(s),e.add(s))}}}}},{key:"compareTo",value:function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0}},{key:"getEnvelope",value:function(){if(null===this._env){for(var t=new V,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;re.x?t.x:e.x,s=t.y>e.y?t.y:e.y,u=n.xr.x?n.x:r.x,h=n.y>r.y?n.y:r.y,f=((i>u?i:u)+(al?o:l)+(sn?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}}},{key:"wrap",value:function(t,e){return t<0?e- -t%e:t%e}},{key:"max",value:function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],a=arguments[0];return r>a&&(a=r),i>a&&(a=i),o>a&&(a=o),a}}},{key:"average",value:function(t,e){return(t+e)/2}}]),e}();bt.LOG_10=Math.log(10);var wt=function(){function e(){t(this,e)}return n(e,null,[{key:"segmentToSegment",value:function(t,n,r,i){if(t.equals(n))return e.pointToSegment(t,r,i);if(r.equals(i))return e.pointToSegment(i,t,n);var o=!1;if(V.intersects(t,n,r,i)){var a=(n.x-t.x)*(i.y-r.y)-(n.y-t.y)*(i.x-r.x);if(0===a)o=!0;else{var s=(t.y-r.y)*(i.x-r.x)-(t.x-r.x)*(i.y-r.y),u=((t.y-r.y)*(n.x-t.x)-(t.x-r.x)*(n.y-t.y))/a,l=s/a;(l<0||l>1||u<0||u>1)&&(o=!0)}}else o=!0;return o?bt.min(e.pointToSegment(t,r,i),e.pointToSegment(n,r,i),e.pointToSegment(r,t,n),e.pointToSegment(i,t,n)):0}},{key:"pointToSegment",value:function(t,e,n){if(e.x===n.x&&e.y===n.y)return t.distance(e);var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;if(i<=0)return t.distance(e);if(i>=1)return t.distance(n);var o=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(o)*Math.sqrt(r)}},{key:"pointToLinePerpendicular",value:function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)}},{key:"pointToSegmentString",value:function(t,n){if(0===n.length)throw new b("Line array must contain at least one vertex");for(var r=t.distance(n[0]),i=0;i0)&&(o=s,i=a)}return i}}},{key:"extend",value:function(t,n,r){var i=t.create(r,n.getDimension()),o=n.size();if(e.copy(n,0,i,0,o),o>0)for(var a=o;a0)&&(e=r)}return e}}]),e}(),Pt=function(){function e(){t(this,e)}return n(e,null,[{key:"toDimensionSymbol",value:function(t){switch(t){case e.FALSE:return e.SYM_FALSE;case e.TRUE:return e.SYM_TRUE;case e.DONTCARE:return e.SYM_DONTCARE;case e.P:return e.SYM_P;case e.L:return e.SYM_L;case e.A:return e.SYM_A}throw new b("Unknown dimension value: "+t)}},{key:"toDimensionValue",value:function(t){switch(st.toUpperCase(t)){case e.SYM_FALSE:return e.FALSE;case e.SYM_TRUE:return e.TRUE;case e.SYM_DONTCARE:return e.DONTCARE;case e.SYM_P:return e.P;case e.SYM_L:return e.L;case e.SYM_A:return e.A}throw new b("Unknown dimension symbol: "+t)}}]),e}();Pt.P=0,Pt.L=1,Pt.A=2,Pt.FALSE=-1,Pt.TRUE=-2,Pt.DONTCARE=-3,Pt.SYM_FALSE="F",Pt.SYM_TRUE="T",Pt.SYM_DONTCARE="*",Pt.SYM_P="0",Pt.SYM_L="1",Pt.SYM_A="2";var Nt=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t){}}]),e}(),Ct=function(){function e(){t(this,e)}return n(e,[{key:"filter",value:function(t,e){}},{key:"isDone",value:function(){}},{key:"isGeometryChanged",value:function(){}}]),e}(),kt=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"computeEnvelopeInternal",value:function(){return this.isEmpty()?new V:this._points.expandEnvelope(new V)}},{key:"isRing",value:function(){return this.isClosed()&&this.isSimple()}},{key:"getCoordinates",value:function(){return this._points.toCoordinateArray()}},{key:"copyInternal",value:function(){return new a(this._points.copy(),this._factory)}},{key:"equalsExact",value:function(){if(2===arguments.length&&"number"==typeof arguments[1]&&arguments[0]instanceof Y){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this._points.size()!==n._points.size())return!1;for(var r=0;r0){var n=this._points.copy();Mt.reverse(n),this._points=n}return null}}}},{key:"getCoordinate",value:function(){return this.isEmpty()?null:this._points.getCoordinate(0)}},{key:"getBoundaryDimension",value:function(){return this.isClosed()?Pt.FALSE:0}},{key:"isClosed",value:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))}},{key:"reverseInternal",value:function(){var t=this._points.copy();return Mt.reverse(t),this.getFactory().createLineString(t)}},{key:"getEndPoint",value:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)}},{key:"getTypeCode",value:function(){return Y.TYPECODE_LINESTRING}},{key:"getDimension",value:function(){return 1}},{key:"getLength",value:function(){return Et.ofLine(this._points)}},{key:"getNumPoints",value:function(){return this._points.size()}},{key:"compareToSameClass",value:function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e= 2)");this._points=t}},{key:"isCoordinate",value:function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")}},{key:"getGeometryType",value:function(){return Y.TYPENAME_LINEARRING}}],[{key:"constructor_",value:function(){var t=arguments[0],e=arguments[1];kt.constructor_.call(this,t,e),this.validateConstruction()}}]),a}(kt);qt.MINIMUM_VALID_SIZE=4;var zt=function(e){r(o,e);var i=h(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"getZ",value:function(){return z.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y}throw new b("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new b("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ()}}],[{key:"constructor_",value:function(){if(0===arguments.length)z.constructor_.call(this);else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];z.constructor_.call(this,t.x,t.y)}else if(arguments[0]instanceof z){var e=arguments[0];z.constructor_.call(this,e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];z.constructor_.call(this,n,r,z.NULL_ORDINATE)}}}]),o}(z);zt.X=0,zt.Y=1,zt.Z=-1,zt.M=-1;var Ut=function(e){r(o,e);var i=h(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case o.X:this.x=e;break;case o.Y:this.y=e;break;case o.M:this._m=e;break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getZ",value:function(){return z.NULL_ORDINATE}},{key:"getOrdinate",value:function(t){switch(t){case o.X:return this.x;case o.Y:return this.y;case o.M:return this._m}throw new b("Invalid ordinate index: "+t)}},{key:"setZ",value:function(t){throw new b("CoordinateXY dimension 2 does not support z-ordinate")}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)z.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];z.constructor_.call(this,t.x,t.y),this._m=t._m}else if(arguments[0]instanceof z){var e=arguments[0];z.constructor_.call(this,e.x,e.y),this._m=this.getM()}}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];z.constructor_.call(this,n,r,z.NULL_ORDINATE),this._m=i}}}]),o}(z);Ut.X=0,Ut.Y=1,Ut.Z=-1,Ut.M=2;var Vt=function(e){r(o,e);var i=h(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"getM",value:function(){return this._m}},{key:"setOrdinate",value:function(t,e){switch(t){case z.X:this.x=e;break;case z.Y:this.y=e;break;case z.Z:this.z=e;break;case z.M:this._m=e;break;default:throw new b("Invalid ordinate index: "+t)}}},{key:"setM",value:function(t){this._m=t}},{key:"getOrdinate",value:function(t){switch(t){case z.X:return this.x;case z.Y:return this.y;case z.Z:return this.getZ();case z.M:return this.getM()}throw new b("Invalid ordinate index: "+t)}},{key:"copy",value:function(){return new o(this)}},{key:"toString",value:function(){return"("+this.x+", "+this.y+", "+this.getZ()+" m="+this.getM()+")"}},{key:"setCoordinate",value:function(t){this.x=t.x,this.y=t.y,this.z=t.getZ(),this._m=t.getM()}}],[{key:"constructor_",value:function(){if(this._m=null,0===arguments.length)z.constructor_.call(this),this._m=0;else if(1===arguments.length){if(arguments[0]instanceof o){var t=arguments[0];z.constructor_.call(this,t),this._m=t._m}else if(arguments[0]instanceof z){var e=arguments[0];z.constructor_.call(this,e),this._m=this.getM()}}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],a=arguments[3];z.constructor_.call(this,n,r,i),this._m=a}}}]),o}(z),Yt=function(){function e(){t(this,e)}return n(e,null,[{key:"measures",value:function(t){return t instanceof zt?0:t instanceof Ut||t instanceof Vt?1:0}},{key:"dimension",value:function(t){return t instanceof zt?2:t instanceof Ut?3:t instanceof Vt?4:3}},{key:"create",value:function(){if(1===arguments.length){var t=arguments[0];return e.create(t,0)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return 2===n?new zt:3===n&&0===r?new z:3===n&&1===r?new Ut:4===n&&1===r?new Vt:new z}}}]),e}(),Wt=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"getCoordinate",value:function(t){return this.get(t)}},{key:"addAll",value:function(){if(2===arguments.length&&"boolean"==typeof arguments[1]&&it(arguments[0],X)){for(var t=arguments[1],e=!1,n=arguments[0].iterator();n.hasNext();)this.add(n.next(),t),e=!0;return e}return f(i(a.prototype),"addAll",this).apply(this,arguments)}},{key:"clone",value:function(){for(var t=f(i(a.prototype),"clone",this).call(this),e=0;e=1&&this.get(this.size()-1).equals2D(r))return null;f(i(a.prototype),"add",this).call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1];if(arguments[2])for(var c=0;c=0;h--)this.add(u[h],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof z){var p=arguments[0],d=arguments[1];if(!arguments[2]){var g=this.size();if(g>0){if(p>0&&this.get(p-1).equals2D(d))return null;if(p_&&(b=-1);for(var w=m;w!==_;w+=b)this.add(y[w],v);return!0}}},{key:"closeRing",value:function(){if(this.size()>0){var t=this.get(0).copy();this.add(t,!1)}}}],[{key:"constructor_",value:function(){if(0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}}]),a}(gt);Wt.coordArrayType=new Array(0).fill(null);var Xt=function(){function e(){t(this,e)}return n(e,null,[{key:"isRing",value:function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))}},{key:"ptNotInList",value:function(t,n){for(var r=0;r=t?e:[]}},{key:"indexOf",value:function(t,e){for(var n=0;n0)&&(e=t[n]);return e}},{key:"extract",value:function(t,e,n){e=bt.clamp(e,0,t.length);var r=(n=bt.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=Xt.compare(n,r);return Xt.isEqualReversed(n,r)?0:i}},{key:"OLDcompare",value:function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=Xt.increasingDirection(n),o=Xt.increasingDirection(r),a=i>0?0:n.length-1,s=o>0?0:n.length-1,u=0;u0){var t=new Kt(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(t=3),t<2&&(t=2),new Jt(arguments[0],t)}if(3===arguments.length){var e=arguments[2],n=arguments[1]-e;return e>1&&(e=1),n>3&&(n=3),n<2&&(n=2),new Jt(arguments[0],n+e,e)}}}},{key:"interfaces_",get:function(){return[xt,E]}}],[{key:"instance",value:function(){return e.instanceObject}}]),e}();$t.instanceObject=new $t;var Qt=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e=0?t:e}}]),e}(),re=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"readResolve",value:function(){return e.nameToTypeMap.get(this._name)}},{key:"toString",value:function(){return this._name}},{key:"interfaces_",get:function(){return[E]}}],[{key:"constructor_",value:function(){this._name=null;var t=arguments[0];this._name=t,e.nameToTypeMap.put(t,this)}}]),e}();re.nameToTypeMap=new ee,ne.Type=re,ne.FIXED=new re("FIXED"),ne.FLOATING=new re("FLOATING"),ne.FLOATING_SINGLE=new re("FLOATING SINGLE"),ne.maximumPreciseValue=9007199254740992;var ie=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"copyInternal",value:function(){for(var t=new Array(this._geometries.length).fill(null),e=0;e1){if(u instanceof Rt)return this.createMultiPolygon(e.toPolygonArray(t));if(u instanceof kt)return this.createMultiLineString(e.toLineStringArray(t));if(u instanceof Lt)return this.createMultiPoint(e.toPointArray(t));D.shouldNeverReachHere("Unhandled geometry type: "+u.getGeometryType())}return u}},{key:"createMultiPointFromCoords",value:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}},{key:"createPoint",value:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(it(arguments[0],ct))return new Lt(arguments[0],this)}}},{key:"getCoordinateSequenceFactory",value:function(){return this._coordinateSequenceFactory}},{key:"createPolygon",value:function(){if(0===arguments.length)return this.createPolygon(null,null);if(1===arguments.length){if(it(arguments[0],ct)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof qt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Rt(arguments[0],arguments[1],this)}},{key:"getSRID",value:function(){return this._SRID}},{key:"createGeometryCollection",value:function(){return 0===arguments.length?new Gt(null,this):1===arguments.length?new Gt(arguments[0],this):void 0}},{key:"getPrecisionModel",value:function(){return this._precisionModel}},{key:"createLinearRing",value:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(it(arguments[0],ct))return new qt(arguments[0],this)}}},{key:"createMultiPolygon",value:function(){return 0===arguments.length?new Qt(null,this):1===arguments.length?new Qt(arguments[0],this):void 0}},{key:"createMultiPoint",value:function(){if(0===arguments.length)return new Bt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new Bt(arguments[0],this);if(it(arguments[0],ct)){var t=arguments[0];if(null===t)return this.createMultiPoint(new Array(0).fill(null));for(var e=new Array(t.size()).fill(null),n=0;n="a"&&t<="z"||t>="A"&&t<="Z"}},{key:"isNumeric_",value:function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)}},{key:"isWhiteSpace_",value:function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t}},{key:"nextChar_",value:function(){return this.wkt.charAt(++this.index_)}},{key:"nextToken",value:function(){var t,e=this.nextChar_(),n=this.index_,r=e;if("("==e)t=2;else if(","==e)t=5;else if(")"==e)t=3;else if(this.isNumeric_(e)||"-"==e)t=4,r=this.readNumber_();else if(this.isAlpha_(e))t=1,r=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=6}return{position:n,value:r,type:t}}},{key:"readNumber_",value:function(){var t,e=this.index_,n=!1,r=!1;do{"."==t?n=!0:"e"!=t&&"E"!=t||(r=!0),t=this.nextChar_()}while(this.isNumeric_(t,n)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))}},{key:"readText_",value:function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}]),e}(),le=function(){function e(n,r){t(this,e),this.lexer_=n,this.token_,this.layout_="XY",this.factory=r}return n(e,[{key:"consume_",value:function(){this.token_=this.lexer_.nextToken()}},{key:"isTokenType",value:function(t){return this.token_.type==t}},{key:"match",value:function(t){var e=this.isTokenType(t);return e&&this.consume_(),e}},{key:"parse",value:function(){return this.consume_(),this.parseGeometry_()}},{key:"parseGeometryLayout_",value:function(){var t="XY",e=this.token_;if(this.isTokenType(1)){var n=e.value;"Z"===n?t="XYZ":"M"===n?t="XYM":"ZM"===n&&(t="XYZM"),"XY"!==t&&this.consume_()}return t}},{key:"parseGeometryCollectionText_",value:function(){if(this.match(2)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(5));if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePointText_",value:function(){if(this.match(2)){var t=this.parsePoint_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())}},{key:"parseLineStringText_",value:function(){if(this.match(2)){var t=this.parsePointList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePolygonText_",value:function(){if(this.match(2)){var t=this.parseLineStringTextList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPointText_",value:function(){var t;if(this.match(2)){if(t=2==this.token_.type?this.parsePointTextList_():this.parsePointList_(),this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiLineStringText_",value:function(){if(this.match(2)){var t=this.parseLineStringTextList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parseMultiPolygonText_",value:function(){if(this.match(2)){var t=this.parsePolygonTextList_();if(this.match(3))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())}},{key:"parsePoint_",value:function(){for(var t=[],e=this.layout_.length,n=0;n1?t.createPolygon(r[0],r.slice(1)):t.createPolygon(r[0])},r=this.token_;if(this.match(1)){var i=r.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==i){var o=this.parseGeometryCollectionText_();return t.createGeometryCollection(o)}switch(i){case"POINT":var a=this.parsePointText_();return a?t.createPoint(s(z,p(a))):t.createPoint();case"LINESTRING":var u=this.parseLineStringText_().map(e);return t.createLineString(u);case"LINEARRING":var l=this.parseLineStringText_().map(e);return t.createLinearRing(l);case"POLYGON":var c=this.parsePolygonText_();return c&&0!==c.length?n(c):t.createPolygon();case"MULTIPOINT":var h=this.parseMultiPointText_();if(!h||0===h.length)return t.createMultiPoint();var f=h.map(e).map((function(e){return t.createPoint(e)}));return t.createMultiPoint(f);case"MULTILINESTRING":var d=this.parseMultiLineStringText_().map((function(n){return t.createLineString(n.map(e))}));return t.createMultiLineString(d);case"MULTIPOLYGON":var g=this.parseMultiPolygonText_();if(!g||0===g.length)return t.createMultiPolygon();var y=g.map(n);return t.createMultiPolygon(y);default:throw new Error("Invalid geometry type: "+i)}}throw new Error(this.formatErrorMessage_())}}]),e}();function ce(t){if(t.isEmpty())return"";var e=t.getCoordinate(),n=[e.x,e.y];return void 0===e.z||Number.isNaN(e.z)||n.push(e.z),void 0===e.m||Number.isNaN(e.m)||n.push(e.m),n.join(" ")}function he(t){for(var e=t.getCoordinates().map((function(t){var e=[t.x,t.y];return void 0===t.z||Number.isNaN(t.z)||e.push(t.z),void 0===t.m||Number.isNaN(t.m)||e.push(t.m),e})),n=[],r=0,i=e.length;r0&&(e+=" "+r),t.isEmpty()?e+" EMPTY":e+" ("+n(t)+")"}var ge=function(){function e(n){t(this,e),this.geometryFactory=n||new oe,this.precisionModel=this.geometryFactory.getPrecisionModel()}return n(e,[{key:"read",value:function(t){var e=new ue(t);return new le(e,this.geometryFactory).parse()}},{key:"write",value:function(t){return de(t)}}]),e}(),ye=function(){function e(n){t(this,e),this.parser=new ge(n)}return n(e,[{key:"write",value:function(t){return this.parser.write(t)}}],[{key:"toLineString",value:function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}]),e}(),ve=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getIndexAlongSegment",value:function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]}},{key:"getTopologySummary",value:function(){var t=new Kt;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()}},{key:"computeIntersection",value:function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)}},{key:"getIntersectionNum",value:function(){return this._result}},{key:"computeIntLineIndex",value:function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}}},{key:"isProper",value:function(){return this.hasIntersection()&&this._isProper}},{key:"setPrecisionModel",value:function(t){this._precisionModel=t}},{key:"isInteriorIntersection",value:function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?r:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=r>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return D.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o}},{key:"nonRobustComputeEdgeDistance",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return D.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o}}]),e}();ve.DONT_INTERSECT=0,ve.DO_INTERSECT=1,ve.COLLINEAR=2,ve.NO_INTERSECTION=0,ve.POINT_INTERSECTION=1,ve.COLLINEAR_INTERSECTION=2;var me=function(e){r(a,e);var o=h(a);function a(){return t(this,a),o.call(this)}return n(a,[{key:"isInSegmentEnvelopes",value:function(t){var e=new V(this._inputLines[0][0],this._inputLines[0][1]),n=new V(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)}},{key:"computeIntersection",value:function(){if(3!==arguments.length)return f(i(a.prototype),"computeIntersection",this).apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,V.intersects(e,n,t)&&0===ht.index(e,n,t)&&0===ht.index(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this._result=ve.POINT_INTERSECTION,null;this._result=ve.NO_INTERSECTION}},{key:"intersection",value:function(t,e,n,r){var i=this.intersectionSafe(t,e,n,r);return this.isInSegmentEnvelopes(i)||(i=new z(a.nearestEndpoint(t,e,n,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(i),i}},{key:"checkDD",value:function(t,e,n,r,i){var o=lt.intersection(t,e,n,r),a=this.isInSegmentEnvelopes(o);_t.out.println("DD in env = "+a+" --------------------- "+o),i.distance(o)>1e-4&&_t.out.println("Distance = "+i.distance(o))}},{key:"intersectionSafe",value:function(t,e,n,r){var i=mt.intersection(t,e,n,r);return null===i&&(i=a.nearestEndpoint(t,e,n,r)),i}},{key:"computeCollinearIntersection",value:function(t,e,n,r){var i=V.intersects(t,e,n),o=V.intersects(t,e,r),a=V.intersects(n,r,t),s=V.intersects(n,r,e);return i&&o?(this._intPt[0]=n,this._intPt[1]=r,ve.COLLINEAR_INTERSECTION):a&&s?(this._intPt[0]=t,this._intPt[1]=e,ve.COLLINEAR_INTERSECTION):i&&a?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||s?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):i&&s?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||a?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||i||s?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||i||a?ve.COLLINEAR_INTERSECTION:ve.POINT_INTERSECTION):ve.NO_INTERSECTION}},{key:"computeIntersect",value:function(t,e,n,r){if(this._isProper=!1,!V.intersects(t,e,n,r))return ve.NO_INTERSECTION;var i=ht.index(t,e,n),o=ht.index(t,e,r);if(i>0&&o>0||i<0&&o<0)return ve.NO_INTERSECTION;var a=ht.index(n,r,t),s=ht.index(n,r,e);return a>0&&s>0||a<0&&s<0?ve.NO_INTERSECTION:0===i&&0===o&&0===a&&0===s?this.computeCollinearIntersection(t,e,n,r):(0===i||0===o||0===a||0===s?(this._isProper=!1,t.equals2D(n)||t.equals2D(r)?this._intPt[0]=t:e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:0===i?this._intPt[0]=new z(n):0===o?this._intPt[0]=new z(r):0===a?this._intPt[0]=new z(t):0===s&&(this._intPt[0]=new z(e))):(this._isProper=!0,this._intPt[0]=this.intersection(t,e,n,r)),ve.POINT_INTERSECTION)}}],[{key:"nearestEndpoint",value:function(t,e,n,r){var i=t,o=wt.pointToSegment(t,n,r),a=wt.pointToSegment(e,n,r);return ar&&(n=e.x,r=t.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=ht.index(t,e,this._p);if(i===ht.COLLINEAR)return this._isPointOnSegment=!0,null;e.ythis.location.length){var e=new Array(3).fill(null);e[Q.ON]=this.location[Q.ON],e[Q.LEFT]=W.NONE,e[Q.RIGHT]=W.NONE,this.location=e}for(var n=0;n1&&t.append(W.toLocationSymbol(this.location[Q.LEFT])),t.append(W.toLocationSymbol(this.location[Q.ON])),this.location.length>1&&t.append(W.toLocationSymbol(this.location[Q.RIGHT])),t.toString()}},{key:"setLocations",value:function(t,e,n){this.location[Q.ON]=t,this.location[Q.LEFT]=e,this.location[Q.RIGHT]=n}},{key:"get",value:function(t){return t1}},{key:"isAnyNull",value:function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2}},{key:"addPoints",value:function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=0;s--)this._pts.add(r[s])}}},{key:"isHole",value:function(){return this._isHole}},{key:"setInResult",value:function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)}},{key:"containsPoint",value:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!be.isInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0}},{key:"addHole",value:function(t){this._holes.add(t)}},{key:"isShell",value:function(){return null===this._shell}},{key:"getLabel",value:function(){return this._label}},{key:"getEdges",value:function(){return this._edges}},{key:"getMaxNodeDegree",value:function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree}},{key:"getShell",value:function(){return this._shell}},{key:"mergeLabel",value:function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Q.RIGHT);if(n===W.NONE)return null;if(this._label.getLocation(e)===W.NONE)return this._label.setLocation(e,n),null}}},{key:"setShell",value:function(t){this._shell=t,null!==t&&t.addHole(this)}},{key:"toPolygon",value:function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)}},{key:"isInResult",value:function(){return this._isInResult}},{key:"isVisited",value:function(){return this._isVisited}}],[{key:"constructor_",value:function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}}}]),e}(),Pe=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"isIncidentEdgeInResult",value:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1}},{key:"isIsolated",value:function(){return 1===this._label.getGeometryCount()}},{key:"getCoordinate",value:function(){return this._coord}},{key:"print",value:function(t){t.println("node "+this._coord+" lbl: "+this._label)}},{key:"computeIM",value:function(t){}},{key:"computeMergedLocation",value:function(t,e){var n=W.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==W.BOUNDARY&&(n=r)}return n}},{key:"setLabel",value:function(){if(2!==arguments.length||!Number.isInteger(arguments[1])||!Number.isInteger(arguments[0]))return f(i(a.prototype),"setLabel",this).apply(this,arguments);var t=arguments[0],e=arguments[1];null===this._label?this._label=new xe(t,e):this._label.setLocation(t,e)}},{key:"getEdges",value:function(){return this._edges}},{key:"mergeLabel",value:function(){if(arguments[0]instanceof a){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof xe)for(var e=arguments[0],n=0;n<2;n++){var r=this.computeMergedLocation(e,n);this._label.getLocation(n)===W.NONE&&this._label.setLocation(n,r)}}},{key:"add",value:function(t){this._edges.insert(t),t.setNode(this)}},{key:"setLabelBoundary",value:function(t){if(null===this._label)return null;var e=W.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case W.BOUNDARY:n=W.INTERIOR;break;case W.INTERIOR:default:n=W.BOUNDARY}this._label.setLocation(t,n)}}],[{key:"constructor_",value:function(){this._coord=null,this._edges=null;var t=arguments[0],e=arguments[1];this._coord=t,this._edges=e,this._label=new xe(0,W.NONE)}}]),a}(Me);function Ne(t){return null==t?0:t.color}function Ce(t){return null==t?null:t.parent}function ke(t,e){null!==t&&(t.color=e)}function je(t){return null==t?null:t.left}function Le(t){return null==t?null:t.right}var Ie=function(e){r(o,e);var i=h(o);function o(){var e;return t(this,o),(e=i.call(this)).root_=null,e.size_=0,e}return n(o,[{key:"get",value:function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null}},{key:"put",value:function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:n,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null}},{key:"fixAfterInsertion",value:function(t){var e;for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)Ce(t)===je(Ce(Ce(t)))?1===Ne(e=Le(Ce(Ce(t))))?(ke(Ce(t),0),ke(e,0),ke(Ce(Ce(t)),1),t=Ce(Ce(t))):(t===Le(Ce(t))&&(t=Ce(t),this.rotateLeft(t)),ke(Ce(t),0),ke(Ce(Ce(t)),1),this.rotateRight(Ce(Ce(t)))):1===Ne(e=je(Ce(Ce(t))))?(ke(Ce(t),0),ke(e,0),ke(Ce(Ce(t)),1),t=Ce(Ce(t))):(t===je(Ce(t))&&(t=Ce(t),this.rotateRight(t)),ke(Ce(t),0),ke(Ce(Ce(t)),1),this.rotateLeft(Ce(Ce(t))));this.root_.color=0}},{key:"values",value:function(){var t=new gt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=o.successor(e));)t.add(e.value);return t}},{key:"entrySet",value:function(){var t=new J,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=o.successor(e));)t.add(e);return t}},{key:"rotateLeft",value:function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}}},{key:"rotateRight",value:function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}}},{key:"getFirstEntry",value:function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t}},{key:"size",value:function(){return this.size_}},{key:"containsKey",value:function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return!0;e=e.right}}return!1}}],[{key:"successor",value:function(t){var e;if(null===t)return null;if(null!==t.right){for(e=t.right;null!==e.left;)e=e.left;return e}e=t.parent;for(var n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e}}]),o}(function(e){r(i,e);var n=h(i);function i(){return t(this,i),n.apply(this,arguments)}return i}(te)),Ae=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"find",value:function(t){return this.nodeMap.get(t)}},{key:"addNode",value:function(){if(arguments[0]instanceof z){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Pe){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}}},{key:"print",value:function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this.nodeMap.values().iterator()}},{key:"values",value:function(){return this.nodeMap.values()}},{key:"getBoundaryNodes",value:function(t){for(var e=new gt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===W.BOUNDARY&&e.add(r)}return e}},{key:"add",value:function(t){var e=t.getCoordinate();this.addNode(e).add(t)}}],[{key:"constructor_",value:function(){this.nodeMap=new Ie,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}}]),e}(),Te=function(){function e(){t(this,e)}return n(e,null,[{key:"isNorthern",value:function(t){return t===e.NE||t===e.NW}},{key:"isOpposite",value:function(t,e){return t!==e&&2==(t-e+4)%4}},{key:"commonHalfPlane",value:function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=te?t:e)?3:n}},{key:"isInHalfPlane",value:function(t,n){return n===e.SE?t===e.SE||t===e.SW:t===n||t===n+1}},{key:"quadrant",value:function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],n=arguments[1];if(0===t&&0===n)throw new b("Cannot compute the quadrant for point ( "+t+", "+n+" )");return t>=0?n>=0?e.NE:e.SE:n>=0?e.NW:e.SW}if(arguments[0]instanceof z&&arguments[1]instanceof z){var r=arguments[0],i=arguments[1];if(i.x===r.x&&i.y===r.y)throw new b("Cannot compute the quadrant for two identical points "+r);return i.x>=r.x?i.y>=r.y?e.NE:e.SE:i.y>=r.y?e.NW:e.SW}}}]),e}();Te.NE=0,Te.NW=1,Te.SW=2,Te.SE=3;var Re=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareDirection",value:function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):n.addAll(a)}else r.add(o)}return r}},{key:"buildMaximalEdgeRings",value:function(t){for(var e=new gt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Se(r,this._geometryFactory);e.add(i),i.setInResult()}}return e}},{key:"placePolygonHoles",value:function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}}},{key:"getPolygons",value:function(){return this.computePolygons(this._shellList)}},{key:"findShell",value:function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return D.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n}},{key:"add",value:function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Ge.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new gt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}}}],[{key:"constructor_",value:function(){this._geometryFactory=null,this._shellList=new gt;var t=arguments[0];this._geometryFactory=t}},{key:"findEdgeRingContaining",value:function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();if(!c.equals(r)&&c.contains(r)){i=Xt.ptNotInList(n.getCoordinates(),l.getCoordinates());var h=!1;be.isInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||a.contains(c))&&(a=(o=u).getLinearRing().getEnvelopeInternal())}}return o}}]),e}(),qe=function(){function e(){t(this,e)}return n(e,[{key:"getBounds",value:function(){}}]),e}(),ze=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getItem",value:function(){return this._item}},{key:"getBounds",value:function(){return this._bounds}},{key:"interfaces_",get:function(){return[qe,E]}}],[{key:"constructor_",value:function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}}]),e}(),Ue=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"poll",value:function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t}},{key:"size",value:function(){return this._size}},{key:"reorder",value:function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)}},{key:"clear",value:function(){this._size=0,this._items.clear()}},{key:"peek",value:function(){return this.isEmpty()?null:this._items.get(1)}},{key:"isEmpty",value:function(){return 0===this._size}},{key:"add",value:function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)}}],[{key:"constructor_",value:function(){this._size=null,this._items=null,this._size=0,this._items=new gt,this._items.add(null)}}]),e}(),Ve=function(){function e(){t(this,e)}return n(e,[{key:"insert",value:function(t,e){}},{key:"remove",value:function(t,e){}},{key:"query",value:function(){}}]),e}(),Ye=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLevel",value:function(){return this._level}},{key:"size",value:function(){return this._childBoundables.size()}},{key:"getChildBoundables",value:function(){return this._childBoundables}},{key:"addChildBoundable",value:function(t){D.isTrue(null===this._bounds),this._childBoundables.add(t)}},{key:"isEmpty",value:function(){return this._childBoundables.isEmpty()}},{key:"getBounds",value:function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds}},{key:"interfaces_",get:function(){return[qe,E]}}],[{key:"constructor_",value:function(){if(this._childBoundables=new gt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}}}]),e}(),We={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return We.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?At.sort(n,e):At.sort(n);for(var r=t.iterator(),i=0,o=n.length;ie.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,!1,t,n),null):(this.expand(this._boundable2,this._boundable1,!0,t,n),null);if(r)return this.expand(this._boundable1,this._boundable2,!1,t,n),null;if(i)return this.expand(this._boundable2,this._boundable1,!0,t,n),null;throw new b("neither boundable is composite")}},{key:"isLeaves",value:function(){return!(e.isComposite(this._boundable1)||e.isComposite(this._boundable2))}},{key:"compareTo",value:function(t){var e=t;return this._distancee._distance?1:0}},{key:"expand",value:function(t,n,r,i,o){for(var a=t.getChildBoundables().iterator();a.hasNext();){var s=a.next(),u=null;(u=r?new e(n,s,this._itemDistance):new e(s,n,this._itemDistance)).getDistance()-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Ye?this.boundablesAtLevel(n,a,i):(D.isTrue(a instanceof ze),-1===n&&i.add(a))}return null}}},{key:"query",value:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new gt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.queryInternal(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.queryInternal(n,this._root,r)}}},{key:"build",value:function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0}},{key:"getRoot",value:function(){return this.build(),this._root}},{key:"remove",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var a=null,s=r.getChildBoundables().iterator();s.hasNext();){var u=s.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Ye&&(o=this.remove(n,u,i))){a=u;break}}return null!==a&&a.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(a),o}}},{key:"createHigherLevels",value:function(t,e){D.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)}},{key:"depth",value:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Ye){var r=this.depth(n);r>t&&(t=r)}}return t+1}}},{key:"createParentBoundables",value:function(t,e){D.isTrue(!t.isEmpty());var n=new gt;n.add(this.createNode(e));var r=new gt(t);We.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n}},{key:"isEmpty",value:function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()}},{key:"interfaces_",get:function(){return[E]}}],[{key:"constructor_",value:function(){if(this._root=null,this._built=!1,this._itemBoundables=new gt,this._nodeCapacity=null,0===arguments.length)e.constructor_.call(this,e.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];D.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t}}},{key:"compareDoubles",value:function(t,e){return t>e?1:t0);for(var n=new gt,r=0;r=0;){var u=o.poll(),l=u.getDistance();if(l>=i)break;u.isLeaves()?s.size()l&&(s.poll(),s.add(u)),i=s.peek().getDistance()):u.expandToQueue(o,i)}return a.getItems(s)}}},{key:"createNode",value:function(t){return new Qe(t)}},{key:"size",value:function(){return 0===arguments.length?f(i(a.prototype),"size",this).call(this):f(i(a.prototype),"size",this).apply(this,arguments)}},{key:"insert",value:function(){if(!(2===arguments.length&&arguments[1]instanceof Object&&arguments[0]instanceof V))return f(i(a.prototype),"insert",this).apply(this,arguments);var t=arguments[0],e=arguments[1];if(t.isNull())return null;f(i(a.prototype),"insert",this).call(this,t,e)}},{key:"getIntersectsOp",value:function(){return a.intersectsOp}},{key:"verticalSlices",value:function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o0;){var a=o.poll(),s=a.getDistance();if(s>=r)break;a.isLeaves()?(r=s,i=a):a.expandToQueue(o,r)}return null===i?null:[i.getBoundable(0).getItem(),i.getBoundable(1).getItem()]}}else{if(2===arguments.length){var u=arguments[0],l=arguments[1];if(this.isEmpty()||u.isEmpty())return null;var c=new He(this.getRoot(),u.getRoot(),l);return this.nearestNeighbour(c)}if(3===arguments.length){var h=arguments[2],f=new ze(arguments[0],arguments[1]),p=new He(this.getRoot(),f,h);return this.nearestNeighbour(p)[0]}if(4===arguments.length){var d=arguments[2],g=arguments[3],y=new ze(arguments[0],arguments[1]),v=new He(this.getRoot(),y,d);return this.nearestNeighbourK(v,g)}}}},{key:"isWithinDistance",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=A.POSITIVE_INFINITY,r=new Ue;for(r.add(t);!r.isEmpty();){var i=r.poll(),o=i.getDistance();if(o>e)return!1;if(i.maximumDistance()<=e)return!0;if(i.isLeaves()){if((n=o)<=e)return!0}else i.expandToQueue(r,n)}return!1}if(3===arguments.length){var a=arguments[0],s=arguments[1],u=arguments[2],l=new He(this.getRoot(),a.getRoot(),s);return this.isWithinDistance(l,u)}}},{key:"interfaces_",get:function(){return[Ve,E]}}],[{key:"constructor_",value:function(){if(0===arguments.length)a.constructor_.call(this,a.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];Ke.constructor_.call(this,t)}}},{key:"centreX",value:function(t){return a.avg(t.getMinX(),t.getMaxX())}},{key:"avg",value:function(t,e){return(t+e)/2}},{key:"getItems",value:function(t){for(var e=new Array(t.size()).fill(null),n=0;!t.isEmpty();){var r=t.poll();e[n]=r.getBoundable(0).getItem(),n++}return e}},{key:"centreY",value:function(t){return a.avg(t.getMinY(),t.getMaxY())}}]),a}(Ke),Qe=function(e){r(o,e);var i=h(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,[{key:"computeBounds",value:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new V(n.getBounds()):t.expandToInclude(n.getBounds())}return t}}],[{key:"constructor_",value:function(){var t=arguments[0];Ye.constructor_.call(this,t)}}]),o}(Ye);$e.STRtreeNode=Qe,$e.xComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[T]}},{key:"compare",value:function(t,e){return Ke.compareDoubles($e.centreX(t.getBounds()),$e.centreX(e.getBounds()))}}]),e}()),$e.yComparator=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[T]}},{key:"compare",value:function(t,e){return Ke.compareDoubles($e.centreY(t.getBounds()),$e.centreY(e.getBounds()))}}]),e}()),$e.intersectsOp=new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[IntersectsOp]}},{key:"intersects",value:function(t,e){return t.intersects(e)}}]),e}()),$e.DEFAULT_NODE_CAPACITY=10;var tn=function(){function e(){t(this,e)}return n(e,null,[{key:"relativeSign",value:function(t,e){return te?1:0}},{key:"compare",value:function(t,n,r){if(n.equals2D(r))return 0;var i=e.relativeSign(n.x,r.x),o=e.relativeSign(n.y,r.y);switch(t){case 0:return e.compareValue(i,o);case 1:return e.compareValue(o,i);case 2:return e.compareValue(o,-i);case 3:return e.compareValue(-i,o);case 4:return e.compareValue(-i,-o);case 5:return e.compareValue(-o,-i);case 6:return e.compareValue(-o,i);case 7:return e.compareValue(i,-o)}return D.shouldNeverReachHere("invalid octant value"),0}},{key:"compareValue",value:function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0}}]),e}(),en=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinate",value:function(){return this.coord}},{key:"print",value:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)}},{key:"compareTo",value:function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:this._isInterior?e._isInterior?tn.compare(this._segmentOctant,this.coord,e.coord):1:-1}},{key:"isEndPoint",value:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t}},{key:"toString",value:function(){return this.segmentIndex+":"+this.coord.toString()}},{key:"isInterior",value:function(){return this._isInterior}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new z(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}}]),e}(),nn=function(){function e(){t(this,e)}return n(e,[{key:"hasNext",value:function(){}},{key:"next",value:function(){}},{key:"remove",value:function(){}}]),e}(),rn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getSplitCoordinates",value:function(){var t=new Wt;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()}},{key:"addCollapsedNodes",value:function(){var t=new gt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}}},{key:"createSplitEdgePts",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2;if(2===n)return[new z(t.coord),new z(e.coord)];var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new z(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this._edge.getCoordinate(s);return i&&(o[a]=new z(e.coord)),o}},{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"findCollapsesFromExistingVertices",value:function(t){for(var e=0;e=0?n>=0?r>=i?0:1:r>=i?7:6:n>=0?r>=i?3:2:r>=i?4:5}if(arguments[0]instanceof z&&arguments[1]instanceof z){var o=arguments[0],a=arguments[1],s=a.x-o.x,u=a.y-o.y;if(0===s&&0===u)throw new b("Cannot compute the octant for two identical points "+o);return e.octant(s,u)}}}]),e}(),an=function(){function e(){t(this,e)}return n(e,[{key:"getCoordinates",value:function(){}},{key:"size",value:function(){}},{key:"getCoordinate",value:function(t){}},{key:"isClosed",value:function(){}},{key:"setData",value:function(t){}},{key:"getData",value:function(){}}]),e}(),sn=function(){function e(){t(this,e)}return n(e,[{key:"addIntersection",value:function(t,e){}},{key:"interfaces_",get:function(){return[an]}}]),e}(),un=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getCoordinates",value:function(){return this._pts}},{key:"size",value:function(){return this._pts.length}},{key:"getCoordinate",value:function(t){return this._pts[t]}},{key:"isClosed",value:function(){return this._pts[0].equals(this._pts[this._pts.length-1])}},{key:"getSegmentOctant",value:function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))}},{key:"setData",value:function(t){this._data=t}},{key:"safeOctant",value:function(t,e){return t.equals2D(e)?0:on.octant(t,e)}},{key:"getData",value:function(){return this._data}},{key:"addIntersection",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new z(arguments[0].getIntersection(r));this.addIntersection(i,n)}}},{key:"toString",value:function(){return ye.toLineString(new Jt(this._pts))}},{key:"getNodeList",value:function(){return this._nodeList}},{key:"addIntersectionNode",value:function(t,e){var n=e,r=n+1;if(r=0&&r>=0||n<=0&&r<=0?Math.max(n,r):0}if(arguments[0]instanceof z){var i=arguments[0];return ht.index(this.p0,this.p1,i)}}},{key:"toGeometry",value:function(t){return t.createLineString([this.p0,this.p1])}},{key:"isVertical",value:function(){return this.p0.x===this.p1.x}},{key:"equals",value:function(t){if(!(t instanceof e))return!1;var n=t;return this.p0.equals(n.p0)&&this.p1.equals(n.p1)}},{key:"intersection",value:function(t){var e=new me;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null}},{key:"project",value:function(){if(arguments[0]instanceof z){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new z(t);var n=this.projectionFactor(t),r=new z;return r.x=this.p0.x+n*(this.p1.x-this.p0.x),r.y=this.p0.y+n*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof e){var i=arguments[0],o=this.projectionFactor(i.p0),a=this.projectionFactor(i.p1);if(o>=1&&a>=1)return null;if(o<=0&&a<=0)return null;var s=this.project(i.p0);o<0&&(s=this.p0),o>1&&(s=this.p1);var u=this.project(i.p1);return a<0&&(u=this.p0),a>1&&(u=this.p1),new e(s,u)}}},{key:"normalize",value:function(){this.p1.compareTo(this.p0)<0&&this.reverse()}},{key:"angle",value:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)}},{key:"getCoordinate",value:function(t){return 0===t?this.p0:this.p1}},{key:"distancePerpendicular",value:function(t){return wt.pointToLinePerpendicular(t,this.p0,this.p1)}},{key:"minY",value:function(){return Math.min(this.p0.y,this.p1.y)}},{key:"midPoint",value:function(){return e.midPoint(this.p0,this.p1)}},{key:"projectionFactor",value:function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?A.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r}},{key:"closestPoints",value:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=A.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||A.isNaN(e))&&(e=1),e}},{key:"toString",value:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"}},{key:"isHorizontal",value:function(){return this.p0.y===this.p1.y}},{key:"reflect",value:function(t){var e=this.p1.getY()-this.p0.getY(),n=this.p0.getX()-this.p1.getX(),r=this.p0.getY()*(this.p1.getX()-this.p0.getX())-this.p0.getX()*(this.p1.getY()-this.p0.getY()),i=e*e+n*n,o=e*e-n*n,a=t.getX(),s=t.getY();return new z((-o*a-2*e*n*s-2*e*r)/i,(o*s-2*e*n*a-2*n*r)/i)}},{key:"distance",value:function(){if(arguments[0]instanceof e){var t=arguments[0];return wt.segmentToSegment(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof z){var n=arguments[0];return wt.pointToSegment(n,this.p0,this.p1)}}},{key:"pointAlong",value:function(t){var e=new z;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e}},{key:"hashCode",value:function(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=A.doubleToLongBits(this.p1.x);return n^=31*A.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)}},{key:"interfaces_",get:function(){return[x,E]}}],[{key:"constructor_",value:function(){if(this.p0=null,this.p1=null,0===arguments.length)e.constructor_.call(this,new z,new z);else if(1===arguments.length){var t=arguments[0];e.constructor_.call(this,t.p0,t.p1)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.p0=n,this.p1=r}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];e.constructor_.call(this,new z(i,o),new z(a,s))}}},{key:"midPoint",value:function(t,e){return new z((t.x+e.x)/2,(t.y+e.y)/2)}}]),e}(),cn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"overlap",value:function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}}}],[{key:"constructor_",value:function(){this._overlapSeg1=new ln,this._overlapSeg2=new ln}}]),e}(),hn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getLineSegment",value:function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]}},{key:"computeSelect",value:function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(n-e==1)return r.select(this,e),null;if(!t.intersects(i,o))return null;var a=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=Te.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}}}],[{key:"constructor_",value:function(){if(this._monoChains=new gt,this._index=new $e,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];dn.constructor_.call(this,t)}}}]),o}(dn),yn=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"overlap",value:function(){if(4!==arguments.length)return f(i(a.prototype),"overlap",this).apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(),o=e.getContext();this._si.processIntersections(r,t,o,n)}}],[{key:"constructor_",value:function(){this._si=null;var t=arguments[0];this._si=t}}]),a}(cn);gn.SegmentOverlapAction=yn;var vn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isDeletable",value:function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[n];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,r)&&this.isShallowSampled(i,o,t,n,r)}},{key:"deleteShallowConcavities",value:function(){for(var t=1,n=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(n),i=!1;r=0;r--)this.addPt(t[r])}},{key:"isRedundant",value:function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=e.PI_TIMES_2;for(;t<=-Math.PI;)t+=e.PI_TIMES_2;return t}},{key:"angle",value:function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}}},{key:"isAcute",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0}},{key:"isObtuse",value:function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0}},{key:"interiorAngle",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return Math.abs(o-i)}},{key:"normalizePositive",value:function(t){if(t<0){for(;t<0;)t+=e.PI_TIMES_2;t>=e.PI_TIMES_2&&(t=0)}else{for(;t>=e.PI_TIMES_2;)t-=e.PI_TIMES_2;t<0&&(t=0)}return t}},{key:"angleBetween",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r);return e.diff(i,o)}},{key:"diff",value:function(t,e){var n=null;return(n=tMath.PI&&(n=2*Math.PI-n),n}},{key:"toRadians",value:function(t){return t*Math.PI/180}},{key:"getTurn",value:function(t,n){var r=Math.sin(n-t);return r>0?e.COUNTERCLOCKWISE:r<0?e.CLOCKWISE:e.NONE}},{key:"angleBetweenOriented",value:function(t,n,r){var i=e.angle(n,t),o=e.angle(n,r)-i;return o<=-Math.PI?o+e.PI_TIMES_2:o>Math.PI?o-e.PI_TIMES_2:o}}]),e}();_n.PI_TIMES_2=2*Math.PI,_n.PI_OVER_2=Math.PI/2,_n.PI_OVER_4=Math.PI/4,_n.COUNTERCLOCKWISE=ht.COUNTERCLOCKWISE,_n.CLOCKWISE=ht.CLOCKWISE,_n.NONE=ht.COLLINEAR;var bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addNextSegment",value:function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=ht.index(this._s0,this._s1,this._s2),r=n===ht.CLOCKWISE&&this._side===Q.LEFT||n===ht.COUNTERCLOCKWISE&&this._side===Q.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)}},{key:"addLineEndCap",value:function(t,e){var n=new ln(t,e),r=new ln;this.computeOffsetSegment(n,Q.LEFT,this._distance,r);var i=new ln;this.computeOffsetSegment(n,Q.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case m.CAP_ROUND:this._segList.addPt(r.p1),this.addDirectedFillet(e,s+Math.PI/2,s-Math.PI/2,ht.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case m.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case m.CAP_SQUARE:var u=new z;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var l=new z(r.p1.x+u.x,r.p1.y+u.y),c=new z(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}}},{key:"getCoordinates",value:function(){return this._segList.getCoordinates()}},{key:"addMitreJoin",value:function(t,e,n,r){var i=mt.intersection(e.p0,e.p1,n.p0,n.p1);if(null!==i&&(r<=0?1:i.distance(t)/Math.abs(r))<=this._bufParams.getMitreLimit())return this._segList.addPt(i),null;this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())}},{key:"addOutsideTurn",value:function(t,n){if(this._offset0.p1.distance(this._offset1.p0)=c&&(s-=2*Math.PI),this._segList.addPt(e),this.addDirectedFillet(t,s,c,r,i),this._segList.addPt(n)}},{key:"addLastSegment",value:function(){this._segList.addPt(this._offset1.p1)}},{key:"initSideSegments",value:function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)}},{key:"addLimitedMitreJoin",value:function(t,e,n,r){var i=this._seg0.p1,o=_n.angle(i,this._seg0.p0),a=_n.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,s=_n.normalize(o+a),u=_n.normalize(s+Math.PI),l=r*n,c=n-l*Math.abs(Math.sin(a)),h=i.x+l*Math.cos(u),f=i.y+l*Math.sin(u),p=new z(h,f),d=new ln(i,p),g=d.pointAlongOffset(1,c),y=d.pointAlongOffset(1,-c);this._side===Q.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))}},{key:"addDirectedFillet",value:function(t,e,n,r,i){var o=r===ht.CLOCKWISE?-1:1,a=Math.abs(e-n),s=Math.trunc(a/this._filletAngleQuantum+.5);if(s<1)return null;for(var u=a/s,l=new z,c=0;c0){var r=new z((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var i=new z((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}}},{key:"createCircle",value:function(t){var e=new z(t.x+this._distance,t.y);this._segList.addPt(e),this.addDirectedFillet(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()}},{key:"addBevelJoin",value:function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)}},{key:"init",value:function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new mn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*e.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)}},{key:"addCollinear",value:function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===m.JOIN_BEVEL||this._bufParams.getJoinStyle()===m.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addCornerFillet(this._s1,this._offset0.p1,this._offset1.p0,ht.CLOCKWISE,this._distance))}},{key:"closeRing",value:function(){this._segList.closeRing()}},{key:"hasNarrowConcaveAngle",value:function(){return this._hasNarrowConcaveAngle}}],[{key:"constructor_",value:function(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new ln,this._seg1=new ln,this._offset0=new ln,this._offset1=new ln,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=n,this._li=new me,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===m.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}}]),e}();bn.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,bn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,bn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,bn.MAX_CLOSING_SEG_LEN_FACTOR=80;var wn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getOffsetCurve",value:function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&Xt.reverse(o),o}},{key:"computeSingleSidedBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=vn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Q.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{n.addSegments(t,!1);var s=vn.simplify(t,r),u=s.length-1;n.initSideSegments(s[0],s[1],Q.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(s[l],!0)}n.addLastSegment(),n.closeRing()}},{key:"computeRingBufferCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Q.RIGHT&&(r=-r);var i=vn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;n.addNextSegment(i[a],s)}n.closeRing()}},{key:"computeLineBufferCurve",value:function(t,e){var n=this.simplifyTolerance(this._distance),r=vn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Q.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var a=vn.simplify(t,-n),s=a.length-1;e.initSideSegments(a[s],a[s-1],Q.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()}},{key:"computePointCurve",value:function(t,e){switch(this._bufParams.getEndCapStyle()){case m.CAP_ROUND:e.createCircle(t);break;case m.CAP_SQUARE:e.createSquare(t)}}},{key:"getLineCurve",value:function(t,e){if(this._distance=e,this.isLineOffsetEmpty(e))return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()}},{key:"getBufferParameters",value:function(){return this._bufParams}},{key:"simplifyTolerance",value:function(t){return t*this._bufParams.getSimplifyFactor()}},{key:"getRingCurve",value:function(t,n,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return e.copyCoordinates(t);var i=this.getSegGen(r);return this.computeRingBufferCurve(t,n,i),i.getCoordinates()}},{key:"computeOffsetCurve",value:function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=vn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Q.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{var s=vn.simplify(t,r),u=s.length-1;n.initSideSegments(s[0],s[1],Q.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(s[l],!0)}n.addLastSegment()}},{key:"isLineOffsetEmpty",value:function(t){return 0===t||t<0&&!this._bufParams.isSingleSided()}},{key:"getSegGen",value:function(t){return new bn(this._precisionModel,this._bufParams,t)}}],[{key:"constructor_",value:function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}},{key:"copyCoordinates",value:function(t){for(var e=new Array(t.length).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(it(arguments[2],nt)&&arguments[0]instanceof z&&arguments[1]instanceof Fe){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||ht.index(this._seg.p0,this._seg.p1,o)===ht.RIGHT)){var c=a.getDepth(Q.LEFT);this._seg.p0.equals(u[l])||(c=a.getDepth(Q.RIGHT));var h=new On(this._seg,c);s.add(h)}}else if(it(arguments[2],nt)&&arguments[0]instanceof z&&it(arguments[1],nt))for(var f=arguments[0],p=arguments[2],d=arguments[1].iterator();d.hasNext();){var g=d.next();g.isForward()&&this.findStabbedSegments(f,g,p)}}},{key:"getDepth",value:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:We.min(e)._leftDepth}}],[{key:"constructor_",value:function(){this._subgraphs=null,this._seg=new ln;var t=arguments[0];this._subgraphs=t}}]),e}(),On=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"compareTo",value:function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)}},{key:"compareX",value:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)}},{key:"toString",value:function(){return this._upwardSeg.toString()}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new ln(t),this._leftDepth=e}}]),e}();xn.DepthSegment=On;var En=function(e){r(o,e);var i=h(o);function o(){var e;return t(this,o),e=i.call(this),o.constructor_.apply(l(e),arguments),e}return n(o,null,[{key:"constructor_",value:function(){_.constructor_.call(this,"Projective point not representable on the Cartesian plane.")}}]),o}(_),Sn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getY",value:function(){var t=this.y/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new En;return t}},{key:"getX",value:function(){var t=this.x/this.w;if(A.isNaN(t)||A.isInfinite(t))throw new En;return t}},{key:"getCoordinate",value:function(){var t=new z;return t.x=this.getX(),t.y=this.getY(),t}}],[{key:"constructor_",value:function(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof z&&arguments[1]instanceof z){var a=arguments[0],s=arguments[1];this.x=a.y-s.y,this.y=s.x-a.x,this.w=a.x*s.y-s.x*a.y}}else if(3===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(4===arguments.length){var h=arguments[0],f=arguments[1],p=arguments[2],d=arguments[3],g=h.y-f.y,y=f.x-h.x,v=h.x*f.y-f.x*h.y,m=p.y-d.y,_=d.x-p.x,b=p.x*d.y-d.x*p.y;this.x=y*b-_*v,this.y=m*v-g*b,this.w=g*_-m*y}}}]),e}(),Mn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"area",value:function(){return e.area(this.p0,this.p1,this.p2)}},{key:"signedArea",value:function(){return e.signedArea(this.p0,this.p1,this.p2)}},{key:"interpolateZ",value:function(t){if(null===t)throw new b("Supplied point is null.");return e.interpolateZ(t,this.p0,this.p1,this.p2)}},{key:"longestSideLength",value:function(){return e.longestSideLength(this.p0,this.p1,this.p2)}},{key:"isAcute",value:function(){return e.isAcute(this.p0,this.p1,this.p2)}},{key:"circumcentre",value:function(){return e.circumcentre(this.p0,this.p1,this.p2)}},{key:"area3D",value:function(){return e.area3D(this.p0,this.p1,this.p2)}},{key:"centroid",value:function(){return e.centroid(this.p0,this.p1,this.p2)}},{key:"inCentre",value:function(){return e.inCentre(this.p0,this.p1,this.p2)}}],[{key:"constructor_",value:function(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}},{key:"area",value:function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)}},{key:"signedArea",value:function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2}},{key:"det",value:function(t,e,n,r){return t*r-e*n}},{key:"interpolateZ",value:function(t,e,n,r){var i=e.x,o=e.y,a=n.x-i,s=r.x-i,u=n.y-o,l=r.y-o,c=a*l-s*u,h=t.x-i,f=t.y-o,p=(l*h-s*f)/c,d=(-u*h+a*f)/c;return e.getZ()+p*(n.getZ()-e.getZ())+d*(r.getZ()-e.getZ())}},{key:"longestSideLength",value:function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),a=r;return i>a&&(a=i),o>a&&(a=o),a}},{key:"circumcentreDD",value:function(t,e,n){var r=ut.valueOf(t.x).subtract(n.x),i=ut.valueOf(t.y).subtract(n.y),o=ut.valueOf(e.x).subtract(n.x),a=ut.valueOf(e.y).subtract(n.y),s=ut.determinant(r,i,o,a).multiply(2),u=r.sqr().add(i.sqr()),l=o.sqr().add(a.sqr()),c=ut.determinant(i,u,a,l),h=ut.determinant(r,u,o,l),f=ut.valueOf(n.x).subtract(c.divide(s)).doubleValue(),p=ut.valueOf(n.y).add(h.divide(s)).doubleValue();return new z(f,p)}},{key:"isAcute",value:function(t,e,n){return!!_n.isAcute(t,e,n)&&!!_n.isAcute(e,n,t)&&!!_n.isAcute(n,t,e)}},{key:"circumcentre",value:function(t,n,r){var i=r.x,o=r.y,a=t.x-i,s=t.y-o,u=n.x-i,l=n.y-o,c=2*e.det(a,s,u,l),h=e.det(s,a*a+s*s,l,u*u+l*l),f=e.det(a,a*a+s*s,u,u*u+l*l);return new z(i-h/c,o+f/c)}},{key:"perpendicularBisector",value:function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Sn(t.x+n/2,t.y+r/2,1),o=new Sn(t.x-r+n/2,t.y+n+r/2,1);return new Sn(i,o)}},{key:"angleBisector",value:function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,a=n.y-t.y;return new z(t.x+i*o,t.y+i*a)}},{key:"area3D",value:function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.getZ()-t.getZ(),a=n.x-t.x,s=n.y-t.y,u=n.getZ()-t.getZ(),l=i*u-o*s,c=o*a-r*u,h=r*s-i*a,f=l*l+c*c+h*h;return Math.sqrt(f)/2}},{key:"centroid",value:function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new z(r,i)}},{key:"inCentre",value:function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),a=r+i+o,s=(r*t.x+i*e.x+o*n.x)/a,u=(r*t.y+i*e.y+o*n.y)/a;return new z(s,u)}}]),e}(),Pn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"addRingSide",value:function(t,e,n,r,i){if(0===e&&t.length=qt.MINIMUM_VALID_SIZE&&ht.isCCW(t)&&(o=i,a=r,n=Q.opposite(n));var s=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(s,o,a)}},{key:"addRingBothSides",value:function(t,e){this.addRingSide(t,e,Q.LEFT,W.EXTERIOR,W.INTERIOR),this.addRingSide(t,e,Q.RIGHT,W.INTERIOR,W.EXTERIOR)}},{key:"addPoint",value:function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,W.EXTERIOR,W.INTERIOR)}},{key:"addPolygon",value:function(t){var e=this._distance,n=Q.LEFT;this._distance<0&&(e=-this._distance,n=Q.RIGHT);var r=t.getExteriorRing(),i=Xt.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addRingSide(i,e,n,W.EXTERIOR,W.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addRingSide(s,e,Q.opposite(n),W.INTERIOR,W.EXTERIOR)}}},{key:"isTriangleErodedCompletely",value:function(t,e){var n=new Mn(t[0],t[1],t[2]),r=n.inCentre();return wt.pointToSegment(r,n.p0,n.p1)i}},{key:"addCollection",value:function(t){for(var e=0;e=this._max)throw new H;var t=this._parent.getGeometryN(this._index++);return t instanceof Gt?(this._subcollectionIterator=new e(t),this._subcollectionIterator.next()):t}},{key:"remove",value:function(){throw new Z(this.getClass().getName())}},{key:"hasNext",value:function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)}},{key:"interfaces_",get:function(){return[nn]}}],[{key:"constructor_",value:function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var t=arguments[0];this._parent=t,this._atStart=!0,this._index=0,this._max=t.getNumGeometries()}},{key:"isAtomic",value:function(t){return!(t instanceof Gt)}}]),e}(),kn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"locate",value:function(t){return e.locate(t,this._geom)}},{key:"interfaces_",get:function(){return[Nn]}}],[{key:"constructor_",value:function(){this._geom=null;var t=arguments[0];this._geom=t}},{key:"locatePointInPolygon",value:function(t,n){if(n.isEmpty())return W.EXTERIOR;var r=n.getExteriorRing(),i=e.locatePointInRing(t,r);if(i!==W.INTERIOR)return i;for(var o=0;o=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)}},{key:"computeDepths",value:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Q.LEFT),r=t.getDepth(Q.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new pt("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],a=arguments[2],s=arguments[0];s=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;n=a,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(D.isTrue(null!==e,"found null for first outgoing dirEdge"),D.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))}},{key:"getOutgoingDegree",value:function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}}},{key:"getLabel",value:function(){return this._label}},{key:"findCoveredLineEdges",value:function(){for(var t=W.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=W.INTERIOR;break}if(r.isInResult()){t=W.EXTERIOR;break}}}if(t===W.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===W.INTERIOR):(a.isInResult()&&(i=W.EXTERIOR),s.isInResult()&&(i=W.INTERIOR))}}},{key:"computeLabelling",value:function(t){f(i(a.prototype),"computeLabelling",this).call(this,t),this._label=new xe(W.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next().getEdge().getLabel(),r=0;r<2;r++){var o=n.getLocation(r);o!==W.INTERIOR&&o!==W.BOUNDARY||this._label.setLocation(r,W.INTERIOR)}}}],[{key:"constructor_",value:function(){this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}}]),a}(function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"getNextCW",value:function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)}},{key:"propagateSideLabels",value:function(t){for(var e=W.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Q.LEFT)!==W.NONE&&(e=r.getLocation(t,Q.LEFT))}if(e===W.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getLabel();if(s.getLocation(t,Q.ON)===W.NONE&&s.setLocation(t,Q.ON,i),s.isArea(t)){var u=s.getLocation(t,Q.LEFT),l=s.getLocation(t,Q.RIGHT);if(l!==W.NONE){if(l!==i)throw new pt("side location conflict",a.getCoordinate());u===W.NONE&&D.shouldNeverReachHere("found single null side (at "+a.getCoordinate()+")"),i=u}else D.isTrue(s.getLocation(t,Q.LEFT)===W.NONE,"found single null side"),s.setLocation(t,Q.RIGHT,i),s.setLocation(t,Q.LEFT,i)}}}},{key:"getCoordinate",value:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null}},{key:"print",value:function(t){_t.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"isAreaLabelsConsistent",value:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)}},{key:"checkAreaLabelsConsistent",value:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Q.LEFT);D.isTrue(r!==W.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var a=o.next().getLabel();D.isTrue(a.isArea(t),"Found non-area edge");var s=a.getLocation(t,Q.LEFT),u=a.getLocation(t,Q.RIGHT);if(s===u)return!1;if(u!==i)return!1;i=s}return!0}},{key:"findIndex",value:function(t){this.iterator();for(var e=0;e0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")}},{key:"addAll",value:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())}},{key:"findEdgeIndex",value:function(t){for(var e=0;et?1:this.diste?1:0}},{key:"interfaces_",get:function(){return[x]}}],[{key:"constructor_",value:function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new z(t),this.segmentIndex=e,this.dist=n}}]),e}(),Dn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"print",value:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)}},{key:"iterator",value:function(){return this._nodeMap.values().iterator()}},{key:"addSplitEdges",value:function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}}},{key:"addEndpoints",value:function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)}},{key:"createSplitEdge",value:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new z(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new Vn(o,new xe(this.edge._label))}},{key:"add",value:function(t,e,n){var r=new Fn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)}},{key:"isIntersection",value:function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1}}],[{key:"constructor_",value:function(){this._nodeMap=new Ie,this.edge=null;var t=arguments[0];this.edge=t}}]),e}(),Gn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"isIntersects",value:function(){return!this.isDisjoint()}},{key:"isCovers",value:function(){return(e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])||e.isTrue(this._matrix[W.INTERIOR][W.BOUNDARY])||e.isTrue(this._matrix[W.BOUNDARY][W.INTERIOR])||e.isTrue(this._matrix[W.BOUNDARY][W.BOUNDARY]))&&this._matrix[W.EXTERIOR][W.INTERIOR]===Pt.FALSE&&this._matrix[W.EXTERIOR][W.BOUNDARY]===Pt.FALSE}},{key:"isCoveredBy",value:function(){return(e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])||e.isTrue(this._matrix[W.INTERIOR][W.BOUNDARY])||e.isTrue(this._matrix[W.BOUNDARY][W.INTERIOR])||e.isTrue(this._matrix[W.BOUNDARY][W.BOUNDARY]))&&this._matrix[W.INTERIOR][W.EXTERIOR]===Pt.FALSE&&this._matrix[W.BOUNDARY][W.EXTERIOR]===Pt.FALSE}},{key:"set",value:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e=0&&e>=0&&this.setAtLeast(t,e,n)}},{key:"isWithin",value:function(){return e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&this._matrix[W.INTERIOR][W.EXTERIOR]===Pt.FALSE&&this._matrix[W.BOUNDARY][W.EXTERIOR]===Pt.FALSE}},{key:"isTouches",value:function(t,n){return t>n?this.isTouches(n,t):(t===Pt.A&&n===Pt.A||t===Pt.L&&n===Pt.L||t===Pt.L&&n===Pt.A||t===Pt.P&&n===Pt.A||t===Pt.P&&n===Pt.L)&&this._matrix[W.INTERIOR][W.INTERIOR]===Pt.FALSE&&(e.isTrue(this._matrix[W.INTERIOR][W.BOUNDARY])||e.isTrue(this._matrix[W.BOUNDARY][W.INTERIOR])||e.isTrue(this._matrix[W.BOUNDARY][W.BOUNDARY]))}},{key:"isOverlaps",value:function(t,n){return t===Pt.P&&n===Pt.P||t===Pt.A&&n===Pt.A?e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&e.isTrue(this._matrix[W.INTERIOR][W.EXTERIOR])&&e.isTrue(this._matrix[W.EXTERIOR][W.INTERIOR]):t===Pt.L&&n===Pt.L&&1===this._matrix[W.INTERIOR][W.INTERIOR]&&e.isTrue(this._matrix[W.INTERIOR][W.EXTERIOR])&&e.isTrue(this._matrix[W.EXTERIOR][W.INTERIOR])}},{key:"isEquals",value:function(t,n){return t===n&&e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&this._matrix[W.INTERIOR][W.EXTERIOR]===Pt.FALSE&&this._matrix[W.BOUNDARY][W.EXTERIOR]===Pt.FALSE&&this._matrix[W.EXTERIOR][W.INTERIOR]===Pt.FALSE&&this._matrix[W.EXTERIOR][W.BOUNDARY]===Pt.FALSE}},{key:"toString",value:function(){for(var t=new Kt("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,Pt.toDimensionSymbol(this._matrix[e][n]));return t.toString()}},{key:"setAll",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this._matrix[e][n]=t}},{key:"get",value:function(t,e){return this._matrix[t][e]}},{key:"transpose",value:function(){var t=this._matrix[1][0];return this._matrix[1][0]=this._matrix[0][1],this._matrix[0][1]=t,t=this._matrix[2][0],this._matrix[2][0]=this._matrix[0][2],this._matrix[0][2]=t,t=this._matrix[2][1],this._matrix[2][1]=this._matrix[1][2],this._matrix[1][2]=t,this}},{key:"matches",value:function(t){if(9!==t.length)throw new b("Should be length 9: "+t);for(var n=0;n<3;n++)for(var r=0;r<3;r++)if(!e.matches(this._matrix[n][r],t.charAt(3*n+r)))return!1;return!0}},{key:"add",value:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))}},{key:"isDisjoint",value:function(){return this._matrix[W.INTERIOR][W.INTERIOR]===Pt.FALSE&&this._matrix[W.INTERIOR][W.BOUNDARY]===Pt.FALSE&&this._matrix[W.BOUNDARY][W.INTERIOR]===Pt.FALSE&&this._matrix[W.BOUNDARY][W.BOUNDARY]===Pt.FALSE}},{key:"isCrosses",value:function(t,n){return t===Pt.P&&n===Pt.L||t===Pt.P&&n===Pt.A||t===Pt.L&&n===Pt.A?e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&e.isTrue(this._matrix[W.INTERIOR][W.EXTERIOR]):t===Pt.L&&n===Pt.P||t===Pt.A&&n===Pt.P||t===Pt.A&&n===Pt.L?e.isTrue(this._matrix[W.INTERIOR][W.INTERIOR])&&e.isTrue(this._matrix[W.EXTERIOR][W.INTERIOR]):t===Pt.L&&n===Pt.L&&0===this._matrix[W.INTERIOR][W.INTERIOR]}},{key:"interfaces_",get:function(){return[O]}}],[{key:"constructor_",value:function(){if(this._matrix=null,0===arguments.length)this._matrix=Array(3).fill().map((function(){return Array(3)})),this.setAll(Pt.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];e.constructor_.call(this),this.set(t)}else if(arguments[0]instanceof e){var n=arguments[0];e.constructor_.call(this),this._matrix[W.INTERIOR][W.INTERIOR]=n._matrix[W.INTERIOR][W.INTERIOR],this._matrix[W.INTERIOR][W.BOUNDARY]=n._matrix[W.INTERIOR][W.BOUNDARY],this._matrix[W.INTERIOR][W.EXTERIOR]=n._matrix[W.INTERIOR][W.EXTERIOR],this._matrix[W.BOUNDARY][W.INTERIOR]=n._matrix[W.BOUNDARY][W.INTERIOR],this._matrix[W.BOUNDARY][W.BOUNDARY]=n._matrix[W.BOUNDARY][W.BOUNDARY],this._matrix[W.BOUNDARY][W.EXTERIOR]=n._matrix[W.BOUNDARY][W.EXTERIOR],this._matrix[W.EXTERIOR][W.INTERIOR]=n._matrix[W.EXTERIOR][W.INTERIOR],this._matrix[W.EXTERIOR][W.BOUNDARY]=n._matrix[W.EXTERIOR][W.BOUNDARY],this._matrix[W.EXTERIOR][W.EXTERIOR]=n._matrix[W.EXTERIOR][W.EXTERIOR]}}},{key:"matches",value:function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],n=arguments[1];return n===Pt.SYM_DONTCARE||n===Pt.SYM_TRUE&&(t>=0||t===Pt.TRUE)||n===Pt.SYM_FALSE&&t===Pt.FALSE||n===Pt.SYM_P&&t===Pt.P||n===Pt.SYM_L&&t===Pt.L||n===Pt.SYM_A&&t===Pt.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var r=arguments[1];return new e(arguments[0]).matches(r)}}},{key:"isTrue",value:function(t){return t>=0||t===Pt.TRUE}}]),e}(),Bn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"size",value:function(){return this._size}},{key:"addAll",value:function(t){return null===t||0===t.length?null:(this.ensureCapacity(this._size+t.length),_t.arraycopy(t,0,this._data,this._size,t.length),void(this._size+=t.length))}},{key:"ensureCapacity",value:function(t){if(t<=this._data.length)return null;var e=Math.max(t,2*this._data.length);this._data=At.copyOf(this._data,e)}},{key:"toArray",value:function(){var t=new Array(this._size).fill(null);return _t.arraycopy(this._data,0,t,0,this._size),t}},{key:"add",value:function(t){this.ensureCapacity(this._size+1),this._data[this._size]=t,++this._size}}],[{key:"constructor_",value:function(){if(this._data=null,this._size=0,0===arguments.length)e.constructor_.call(this,10);else if(1===arguments.length){var t=arguments[0];this._data=new Array(t).fill(null)}}}]),e}(),qn=function(){function e(){t(this,e)}return n(e,[{key:"getChainStartIndices",value:function(t){var e=0,n=new Bn(Math.trunc(t.length/2));n.add(e);do{var r=this.findChainEnd(t,e);n.add(r),e=r}while(en?e:n}},{key:"getMinX",value:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(r=1),this._depth[t][n]=r}}}},{key:"getDelta",value:function(t){return this._depth[t][Q.RIGHT]-this._depth[t][Q.LEFT]}},{key:"getLocation",value:function(t,e){return this._depth[t][e]<=0?W.EXTERIOR:W.INTERIOR}},{key:"toString",value:function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]}},{key:"add",value:function(){if(1===arguments.length)for(var t=arguments[0],n=0;n<2;n++)for(var r=1;r<3;r++){var i=t.getLocation(n,r);i!==W.EXTERIOR&&i!==W.INTERIOR||(this.isNull(n,r)?this._depth[n][r]=e.depthAtLocation(i):this._depth[n][r]+=e.depthAtLocation(i))}else if(3===arguments.length){var o=arguments[0],a=arguments[1];arguments[2]===W.INTERIOR&&this._depth[o][a]++}}}],[{key:"constructor_",value:function(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var t=0;t<2;t++)for(var n=0;n<3;n++)this._depth[t][n]=e.NULL_VALUE}},{key:"depthAtLocation",value:function(t){return t===W.EXTERIOR?0:t===W.INTERIOR?1:e.NULL_VALUE}}]),e}();Un.NULL_VALUE=-1;var Vn=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"getDepth",value:function(){return this._depth}},{key:"getCollapsedEdge",value:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new a(t,xe.toLineLabel(this._label))}},{key:"isIsolated",value:function(){return this._isIsolated}},{key:"getCoordinates",value:function(){return this.pts}},{key:"setIsolated",value:function(t){this._isIsolated=t}},{key:"setName",value:function(t){this._name=t}},{key:"equals",value:function(t){if(!(t instanceof a))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;o0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}}},{key:"print",value:function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)}},{key:"computeIM",value:function(t){a.updateIM(this._label,t)}},{key:"isCollapsed",value:function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])}},{key:"isClosed",value:function(){return this.pts[0].equals(this.pts[this.pts.length-1])}},{key:"getMaximumSegmentIndex",value:function(){return this.pts.length-1}},{key:"getDepthDelta",value:function(){return this._depthDelta}},{key:"getNumPoints",value:function(){return this.pts.length}},{key:"printReverse",value:function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")}},{key:"getMonotoneChainEdge",value:function(){return null===this._mce&&(this._mce=new zn(this)),this._mce}},{key:"getEnvelope",value:function(){if(null===this._env){this._env=new V;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()}},{key:"isPointwiseEqual",value:function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;er||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return D.isTrue(!(a&&s),"Found bad envelope test"),s}},{key:"initCorners",value:function(t){var e=.5;this._minx=t.x-e,this._maxx=t.x+e,this._miny=t.y-e,this._maxy=t.y+e,this._corner[0]=new z(this._maxx,this._maxy),this._corner[1]=new z(this._minx,this._maxy),this._corner[2]=new z(this._minx,this._miny),this._corner[3]=new z(this._maxx,this._miny)}},{key:"intersects",value:function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))}},{key:"scale",value:function(t){return Math.round(t*this._scaleFactor)}},{key:"getCoordinate",value:function(){return this._originalPt}},{key:"copyScaled",value:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)}},{key:"getSafeEnvelope",value:function(){if(null===this._safeEnv){var t=e.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new V(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv}},{key:"intersectsPixelClosure",value:function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))}},{key:"intersectsToleranceSquare",value:function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))}},{key:"addSnappedNode",value:function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)}}],[{key:"constructor_",value:function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new b("Scale factor must be non-zero");1!==e&&(this._pt=new z(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new z,this._p1Scaled=new z),this.initCorners(this._pt)}}]),e}();Hn.SAFE_ENV_EXPANSION_FACTOR=.75;var Zn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"select",value:function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}}}],[{key:"constructor_",value:function(){this.selectedSegment=new ln}}]),e}(),Kn=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"snap",value:function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=r.getSafeEnvelope(),s=new Jn(r,i,o);return this._index.query(a,new(function(){function e(){t(this,e)}return n(e,[{key:"interfaces_",get:function(){return[Ze]}},{key:"visitItem",value:function(t){t.select(a,s)}}]),e}())),s.isNodeAdded()}}}],[{key:"constructor_",value:function(){this._index=null;var t=arguments[0];this._index=t}}]),e}(),Jn=function(e){r(a,e);var o=h(a);function a(){var e;return t(this,a),e=o.call(this),a.constructor_.apply(l(e),arguments),e}return n(a,[{key:"isNodeAdded",value:function(){return this._isNodeAdded}},{key:"select",value:function(){if(!(2===arguments.length&&Number.isInteger(arguments[1])&&arguments[0]instanceof hn))return f(i(a.prototype),"select",this).apply(this,arguments);var t=arguments[1],e=arguments[0].getContext();if(this._parentEdge===e&&(t===this._hotPixelVertexIndex||t+1===this._hotPixelVertexIndex))return null;this._isNodeAdded|=this._hotPixel.addSnappedNode(e,t)}}],[{key:"constructor_",value:function(){this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=n}}]),a}(Zn);Kn.HotPixelSnapAction=Jn;var $n=function(){function e(){t(this,e),e.constructor_.apply(this,arguments)}return n(e,[{key:"processIntersections",value:function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof pt))throw t;this._saveException=t}if(null!==this._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=e.precisionScaleFactor(this._argGeom,this._distance,n),i=new ne(r);this.bufferFixedPrecision(i)}}},{key:"computeGeometry",value:function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===ne.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()}},{key:"setQuadrantSegments",value:function(t){this._bufParams.setQuadrantSegments(t)}},{key:"bufferOriginalPrecision",value:function(){try{var t=new Yn(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof R))throw t;this._saveException=t}}},{key:"getResultGeometry",value:function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry}},{key:"setEndCapStyle",value:function(t){this._bufParams.setEndCapStyle(t)}}],[{key:"constructor_",value:function(){if(this._argGeom=null,this._distance=null,this._bufParams=new m,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}}},{key:"bufferOp",value:function(){if(2===arguments.length){var t=arguments[1];return new e(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Y&&"number"==typeof arguments[1]){var n=arguments[1],r=arguments[2],i=new e(arguments[0]);return i.setQuadrantSegments(r),i.getResultGeometry(n)}if(arguments[2]instanceof m&&arguments[0]instanceof Y&&"number"==typeof arguments[1]){var o=arguments[1];return new e(arguments[0],arguments[2]).getResultGeometry(o)}}else if(4===arguments.length){var a=arguments[1],s=arguments[2],u=arguments[3],l=new e(arguments[0]);return l.setQuadrantSegments(s),l.setEndCapStyle(u),l.getResultGeometry(a)}}},{key:"precisionScaleFactor",value:function(t,e,n){var r=t.getEnvelopeInternal(),i=bt.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)}}]),e}();tr.CAP_ROUND=m.CAP_ROUND,tr.CAP_BUTT=m.CAP_FLAT,tr.CAP_FLAT=m.CAP_FLAT,tr.CAP_SQUARE=m.CAP_SQUARE,tr.MAX_PRECISION_DIGITS=12;var er=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],nr=function(){function e(n){t(this,e),this.geometryFactory=n||new oe}return n(e,[{key:"read",value:function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!rr[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==er.indexOf(n)?rr[n].call(this,e.coordinates):"GeometryCollection"===n?rr[n].call(this,e.geometries):rr[n].call(this,e)}},{key:"write",value:function(t){var e=t.getGeometryType();if(!ir[e])throw new Error("Geometry is not supported");return ir[e].call(this,t)}}]),e}(),rr={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!rr[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=rr.bbox.call(this,t.bbox)),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n1?0:t<-1?qn:Math.acos(t)}function tr(t){return t>1?zn:t<-1?-zn:Math.asin(t)}function er(){}function nr(t,e){t&&ir.hasOwnProperty(t.type)&&ir[t.type](t,e)}var rr={Feature:function(t,e){nr(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++rqn?t-Vn:t<-qn?t+Vn:t,e]}function yr(t){return function(e,n){return[(e+=t)>qn?e-Vn:e<-qn?e+Vn:e,n]}}function vr(t){var e=yr(t);return e.invert=yr(-t),e}function mr(t,e){var n=Kn(t),r=Jn(t),i=Kn(e),o=Jn(e);function a(t,e){var a=Kn(e),s=Kn(t)*a,u=Jn(t)*a,l=Jn(e),c=l*n+s*r;return[Zn(u*i-c*o,s*n-l*r),tr(c*i+u*o)]}return a.invert=function(t,e){var a=Kn(e),s=Kn(t)*a,u=Jn(t)*a,l=Jn(e),c=l*i-u*o;return[Zn(u*i+l*o,s*n+c*r),tr(c*n-s*r)]},a}function _r(t,e){(e=ur(e))[0]-=t,pr(e);var n=Qn(-e[1]);return((-e[2]<0?-n:n)+Vn-Bn)%Vn}function br(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:er,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function wr(t,e){return Xn(t[0]-e[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(f.x,f.p.x,-1,i);f=f.p}l=(f=f.o).z,p=!p}while(!f.v);i.lineEnd()}}}function Er(t){if(e=t.length){for(var e,n,r=0,i=t[0];++re?1:t>=e?0:NaN}function Mr(t){for(var e,n,r,i=t.length,o=-1,a=0;++o=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n}Rn(),Rn(),Rn(),gr.invert=gr,function(t){var e;1===t.length&&(e=t,t=function(t,n){return Sr(e(t),n)})}(Sr);var Pr=1e9,Nr=-Pr;function Cr(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var c=0,h=0;if(null==i||(c=a(i,s))!==(h=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==h);else l.point(o[0],o[1])}function a(r,i){return Xn(r[0]-t)0?0:3:Xn(r[0]-n)0?2:1:Xn(r[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,h,f,p,d,g,y,v,m,_=a,b=br(),w={point:x,lineStart:function(){w.point=O,l&&l.push(c=[]),v=!0,y=!1,d=g=NaN},lineEnd:function(){u&&(O(h,f),p&&y&&b.rejoin(),u.push(b.result())),w.point=x,y&&_.lineEnd()},polygonStart:function(){_=b,u=[],l=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(f-o)*(r-a)>(p-a)*(t-o)&&++e:p<=r&&(f-o)*(r-a)<(p-a)*(t-o)&&--e;return e}(),n=m&&e,i=(u=Mr(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Or(u,s,e,o,a),a.polygonEnd()),_=a,u=l=c=null}};function x(t,e){i(t,e)&&_.point(t,e)}function O(o,a){var s=i(o,a);if(l&&c.push([o,a]),v)h=o,f=a,p=s,v=!1,s&&(_.lineStart(),_.point(o,a));else if(s&&y)_.point(o,a);else{var u=[d=Math.max(Nr,Math.min(Pr,d)),g=Math.max(Nr,Math.min(Pr,g))],b=[o=Math.max(Nr,Math.min(Pr,o)),a=Math.max(Nr,Math.min(Pr,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],l=0,c=1,h=e[0]-s,f=e[1]-u;if(a=n-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-u,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0&&(t[0]=s+l*h,t[1]=u+l*f),c<1&&(e[0]=s+c*h,e[1]=u+c*f),!0}}}}}(u,b,t,e,n,r)?s&&(_.lineStart(),_.point(o,a),m=!1):(y||(_.lineStart(),_.point(u[0],u[1])),_.point(b[0],b[1]),s||_.lineEnd(),m=!1)}d=o,g=a,y=s}return w}}var kr=Rn();function jr(t){return t}Rn(),Rn(),Rn();var Lr=1/0,Ir=Lr,Ar=-Lr,Tr=Ar,Rr={point:function(t,e){tAr&&(Ar=t),eTr&&(Tr=e)},lineStart:er,lineEnd:er,polygonStart:er,polygonEnd:er,result:function(){var t=[[Lr,Ir],[Ar,Tr]];return Ar=Tr=-(Ir=Lr=1/0),t}};function Fr(t,e,n,r){return function(i,o){var a,s,u,l=e(o),c=i.invert(r[0],r[1]),h=br(),f=e(h),p=!1,d={point:g,lineStart:v,lineEnd:m,polygonStart:function(){d.point=_,d.lineStart=b,d.lineEnd=w,s=[],a=[]},polygonEnd:function(){d.point=g,d.lineStart=v,d.lineEnd=m,s=Mr(s);var t=function(t,e){var n=e[0],r=e[1],i=[Jn(n),-Kn(n),0],o=0,a=0;kr.reset();for(var s=0,u=t.length;s=0?1:-1,E=O*x,S=E>qn,M=d*b;if(kr.add(Zn(M*O*Jn(E),g*w+M*Kn(E))),o+=S?x+O*Vn:x,S^f>=n^m>=n){var P=cr(ur(h),ur(v));pr(P);var N=cr(i,P);pr(N);var C=(S^x>=0?-1:1)*tr(N[2]);(r>C||r===C&&(P[0]||P[1]))&&(a+=S^x>=0?1:-1)}}return(o<-Bn||o0){for(p||(o.polygonStart(),p=!0),o.lineStart(),t=0;t1&&2&i&&l.push(l.pop().concat(l.shift())),s.push(l.filter(Dr))}return d}}function Dr(t){return t.length>1}function Gr(t,e){return((t=t.x)[0]<0?t[1]-zn-Bn:zn-t[1])-((e=e.x)[0]<0?e[1]-zn-Bn:zn-e[1])}Rn();var Br=Fr((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?qn:-qn,u=Xn(o-n);Xn(u-qn)0?zn:-zn),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=qn&&(Xn(n-i)Bn?Hn((Jn(e)*(o=Kn(r))*Jn(n)-Jn(r)*(i=Kn(e))*Jn(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*zn,r.point(-qn,i),r.point(0,i),r.point(qn,i),r.point(qn,0),r.point(qn,-i),r.point(0,-i),r.point(-qn,-i),r.point(-qn,0),r.point(-qn,i);else if(Xn(t[0]-e[0])>Bn){var o=t[0]0,i=Xn(n)>Bn;function o(t,e){return Kn(t)*Kn(e)>n}function a(t,e,r){var i=[1,0,0],o=cr(ur(t),ur(e)),a=lr(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var l=n*a/u,c=-n*s/u,h=cr(i,o),f=fr(i,l);hr(f,fr(o,c));var p=h,d=lr(f,p),g=lr(p,p),y=d*d-g*(lr(f,f)-1);if(!(y<0)){var v=$n(y),m=fr(p,(-d-v)/g);if(hr(m,f),m=sr(m),!r)return m;var _,b=t[0],w=e[0],x=t[1],O=e[1];w0^m[1]<(Xn(m[0]-b)qn^(b<=m[0]&&m[0]<=w)){var M=fr(p,(-d+v)/g);return hr(M,f),[m,sr(M)]}}}function s(e,n){var i=r?t:qn-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Fr(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,f){var p,d=[h,f],g=o(h,f),y=r?g?0:s(h,f):g?s(h+(h<0?qn:-qn),f):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(p=a(e,d))||wr(e,p)||wr(d,p))&&(d[0]+=Bn,d[1]+=Bn,g=o(d[0],d[1])),g!==u)c=0,g?(t.lineStart(),p=a(d,e),t.point(p[0],p[1])):(p=a(e,d),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(i&&e&&r^g){var v;y&n||!(v=a(d,e,!0))||(c=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||e&&wr(e,d)||t.point(d[0],d[1]),e=d,u=g,n=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var a=Kn(e),s=Jn(e),u=r*n;null==i?(i=e+r*Vn,o=e-u/2):(i=_r(a,i),o=_r(a,o),(r>0?io)&&(i+=r*Vn));for(var l,c=i;r>0?c>o:c4*e&&g--){var b=a+f,w=s+p,x=u+d,O=$n(b*b+w*w+x*x),E=tr(x/=O),S=Xn(Xn(x)-1)e||Xn((v*C+m*k)/_-.5)>.3||a*f+s*p+u*d2?t[2]%360*Wn:0,N()):[y*Yn,v*Yn,m*Yn]},S.precision=function(t){return arguments.length?(E=Wr(P,O=t*t),C()):$n(O)},S.fitExtent=function(t,e){return Vr(S,t,e)},S.fitSize=function(t,e){return function(t,e,n){return Vr(t,[[0,0],e],n)}(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&M,N()}}((function(){return t}))()}(Kr).scale(79.4188).clipAngle(179.999)}function $r(t,e){return[t,e]}Kr.invert=Zr((function(t){return t})),$r.invert=$r;var Qr=Tn.BufferOp,ti=Tn.GeoJSONReader,ei=Tn.GeoJSONWriter;function ni(t,e,n,r){var i=t.properties||{},o="Feature"===t.type?t.geometry:t;if("GeometryCollection"===o.type){var a=[];return vt(t,(function(t){var i=ni(t,e,n,r);i&&a.push(i)})),k(a)}var s=function(t){var e=jn(t).geometry.coordinates,n=[-e[0],-e[1]];return Jr().rotate(n).scale(_)}(o),u={type:o.type,coordinates:ri(o.coordinates,s)},l=(new ti).read(u),c=R(F(e,n),"meters"),h=Qr.bufferOp(l,c,r);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((h=(new ei).write(h)).coordinates))return x({type:h.type,coordinates:ii(h.coordinates,s)},i)}function ri(t,e){return"object"!==v(t[0])?e(t):t.map((function(t){return ri(t,e)}))}function ii(t,e){return"object"!==v(t[0])?e.invert(t):t.map((function(t){return ii(t,e)}))}function oi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return vt(t,(function(t,o,a){var s=e.weight?null==a?void 0:a[e.weight]:void 0;if(!Y(s=null==s?1:s))throw new Error("weight value must be a number for feature index "+o);(s=Number(s))>0&&ct(t,(function(t){n+=t[0]*s,r+=t[1]*s,i+=s}))})),E([n/i,r/i],e.properties,e)}function ai(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=0,r=0,i=0;return ct(t,(function(t){n+=t[0],r+=t[1],i++}),!0),E([n/i,r/i],e.properties)}function si(t,e,n,r,i){var o=r.tolerance||.001,a=0,s=0,u=0,l=0;if(dt(n,(function(e){var n,r=null==(n=e.properties)?void 0:n.weight,i=null==r?1:r;if(!Y(i=Number(i)))throw new Error("weight value must be a number");if(i>0){l+=1;var o=i*st(e,t);0===o&&(o=1);var c=i/o;a+=e.geometry.coordinates[0]*c,s+=e.geometry.coordinates[1]*c,u+=c}})),l<1)throw new Error("no features to measure");var c=a/u,h=s/u;return 1===l||0===i||Math.abs(c-e[0])0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hi;if(i(this,t),this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)}),[{key:"push",value:function(t){this.data.push(t),this.length++,this._up(this.length-1)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}},{key:"_down",value:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i}}]);function hi(t,e){return te?1:0}var fi,pi,di,gi,yi,vi,mi,_i=yn(Object.freeze({__proto__:null,default:ci})),bi={exports:{}},wi={exports:{}},xi=gn(function(){if(mi)return ui.exports;mi=1;var t=li,e=_i,n=function(){if(yi)return bi.exports;yi=1;var t=(pi||(pi=1,fi=function(t,e,n,r){var i=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var s=(r-n)/2,u=0,l=s-1;uo!=p>o&&i<(f-c)*(o-h)/(p-h)+c&&(a=!a)}return a}),fi),e=(gi||(gi=1,di=function(t,e,n,r){var i=t[0],o=t[1],a=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var s=r-n,u=0,l=s-1;uo!=p>o&&i<(f-c)*(o-h)/(p-h)+c&&(a=!a)}return a}),di);return bi.exports=function(n,r,i,o){return r.length>0&&Array.isArray(r[0])?e(n,r,i,o):t(n,r,i,o)},bi.exports.nested=e,bi.exports.flat=t,bi.exports}(),r=(vi||(vi=1,function(t,e){!function(t){var e=134217729;function n(t,e,n,r,i){var o,a,s,u,l=e[0],c=r[0],h=0,f=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++f]);var p=0;if(hl==c>-l?(s=o-((a=l+o)-l),l=e[++h]):(s=o-((a=c+o)-c),c=r[++f]),o=a,0!==s&&(i[p++]=s);hl==c>-l?(s=o-((a=o+l)-(u=a-o))+(l-u),l=e[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=r[++f]),o=a,0!==s&&(i[p++]=s);for(;h0!=d>0)return g;var y=Math.abs(p+d);return Math.abs(g)>=33306690738754716e-32*y?g:-function(t,r,l,c,h,f,p){var d,g,y,v,m,_,b,w,x,O,E,S,M,P,N,C,k,j,L=t-h,I=l-h,A=r-f,T=c-f;m=(N=(w=L-(b=(_=e*L)-(_-L)))*(O=T-(x=(_=e*T)-(_-T)))-((P=L*T)-b*x-w*x-b*O))-(E=N-(k=(w=A-(b=(_=e*A)-(_-A)))*(O=I-(x=(_=e*I)-(_-I)))-((C=A*I)-b*x-w*x-b*O))),i[0]=N-(E+m)+(m-k),m=(M=P-((S=P+E)-(m=S-P))+(E-m))-(E=M-C),i[1]=M-(E+m)+(m-C),m=(j=S+E)-S,i[2]=S-(j-m)+(E-m),i[3]=j;var R=function(t,e){for(var n=e[0],r=1;r<4;r++)n+=e[r];return n}(0,i),F=22204460492503146e-32*p;if(R>=F||-R>=F)return R;if(d=t-(L+(m=t-L))+(m-h),y=l-(I+(m=l-I))+(m-h),g=r-(A+(m=r-A))+(m-f),v=c-(T+(m=c-T))+(m-f),0===d&&0===g&&0===y&&0===v)return R;if(F=11093356479670487e-47*p+33306690738754706e-32*Math.abs(R),(R+=L*v+T*d-(A*y+I*g))>=F||-R>=F)return R;m=(N=(w=d-(b=(_=e*d)-(_-d)))*(O=T-(x=(_=e*T)-(_-T)))-((P=d*T)-b*x-w*x-b*O))-(E=N-(k=(w=g-(b=(_=e*g)-(_-g)))*(O=I-(x=(_=e*I)-(_-I)))-((C=g*I)-b*x-w*x-b*O))),u[0]=N-(E+m)+(m-k),m=(M=P-((S=P+E)-(m=S-P))+(E-m))-(E=M-C),u[1]=M-(E+m)+(m-C),m=(j=S+E)-S,u[2]=S-(j-m)+(E-m),u[3]=j;var D=n(4,i,4,u,o);m=(N=(w=L-(b=(_=e*L)-(_-L)))*(O=v-(x=(_=e*v)-(_-v)))-((P=L*v)-b*x-w*x-b*O))-(E=N-(k=(w=A-(b=(_=e*A)-(_-A)))*(O=y-(x=(_=e*y)-(_-y)))-((C=A*y)-b*x-w*x-b*O))),u[0]=N-(E+m)+(m-k),m=(M=P-((S=P+E)-(m=S-P))+(E-m))-(E=M-C),u[1]=M-(E+m)+(m-C),m=(j=S+E)-S,u[2]=S-(j-m)+(E-m),u[3]=j;var G=n(D,o,4,u,a);m=(N=(w=d-(b=(_=e*d)-(_-d)))*(O=v-(x=(_=e*v)-(_-v)))-((P=d*v)-b*x-w*x-b*O))-(E=N-(k=(w=g-(b=(_=e*g)-(_-g)))*(O=y-(x=(_=e*y)-(_-y)))-((C=g*y)-b*x-w*x-b*O))),u[0]=N-(E+m)+(m-k),m=(M=P-((S=P+E)-(m=S-P))+(E-m))-(E=M-C),u[1]=M-(E+m)+(m-C),m=(j=S+E)-S,u[2]=S-(j-m)+(E-m),u[3]=j;var B=n(G,a,4,u,s);return s[B-1]}(t,r,l,c,h,f,y)},t.orient2dfast=function(t,e,n,r,i,o){return(e-o)*(n-i)-(t-i)*(r-o)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}(0,wi.exports)),wi.exports).orient2d;function i(e,r,i){r=Math.max(0,void 0===r?2:r),i=i||0;var a=function(t){for(var e=t[0],r=t[0],i=t[0],o=t[0],a=0;ai[0]&&(i=s),s[1]o[1]&&(o=s)}var u=[e,r,i,o],l=u.slice();for(a=0;a=2&&c(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&c(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(e),s=new t(16);s.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},s.compareMinX=function(t,e){return t[0]-e[0]},s.compareMinY=function(t,e){return t[1]-e[1]},s.load(e);for(var u,l=[],d=0;du||h.push({node:g,dist:y})}for(;h.length&&!h.peek().node.children;){var v=h.pop(),m=v.node,_=d(m,n,r),b=d(m,i,o);if(v.dist<_&&v.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function l(t,e,n){for(var r,i,o,a,s=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),l=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),f=n.search({minX:s,minY:u,maxX:l,maxY:h}),p=0;p0!=c(r,i,a)>0&&c(o,a,r)>0!=c(o,a,i)>0)return!1;return!0}function c(t,e,n){return r(t[0],t[1],e[0],e[1],n[0],n[1])}function h(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function f(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function p(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function d(t,e,n){var r=e[0],i=e[1],o=n[0]-r,a=n[1]-i;if(0!==o||0!==a){var s=((t[0]-r)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(r=n[0],i=n[1]):s>0&&(r+=o*s,i+=a*s)}return(o=t[0]-r)*o+(a=t[1]-i)*a}function g(t,e,n,r,i,o,a,s){var u,l,c,h,f=n-t,p=r-e,d=a-i,g=s-o,y=t-i,v=e-o,m=f*f+p*p,_=f*d+p*g,b=d*d+g*g,w=f*y+p*v,x=d*y+g*v,O=m*b-_*_,E=O,S=O;0===O?(l=0,E=1,h=x,S=b):(h=m*x-_*w,(l=_*x-b*w)<0?(l=0,h=x,S=b):l>E&&(l=E,h=x+_,S=b)),h<0?(h=0,-w<0?l=0:-w>m?l=E:(l=-w,E=m)):h>S&&(h=S,-w+_<0?l=0:-w+_>m?l=E:(l=-w+_,E=m));var M=(1-(c=0===h?0:h/S))*i+c*a-((1-(u=0===l?0:l/E))*t+u*n),P=(1-c)*o+c*s-((1-u)*e+u*r);return M*M+P*P}function y(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}return e.default&&(e=e.default),ui.exports=i,ui.exports.default=i,ui.exports}());function Oi(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.concavity=e.concavity||1/0;var n=[];if(ct(t,(function(t){n.push([t[0],t[1]])})),!n.length)return null;var r=xi(n,e.concavity);return r.length>3?M([r]):null}function Ei(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.steps||64,i=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},o=[],a=0;a0;r.length0;){var s=t[Math.floor(Math.random()*o)],u=a?s.join("_"):""+s;n[u]||(n[u]=!0,r.push(s))}if(r.length0,u=t[Math.floor(Math.random()*a)];for(s&&u.join("_"),o.push(u);o.length0,v=[];if(a)u="kmrand"==a?r(t,e):"kmpp"==a?i(t,e):a;else for(var m={};u.lengthh&&(h=t[s].y);var f,p=l-u,d=h-c,g=p>d?p:d,y=.5*(l+u),v=.5*(h+c),m=[new Hi({__sentinel:!0,x:y-20*g,y:v-g},{__sentinel:!0,x:y,y:v+20*g},{__sentinel:!0,x:y+20*g,y:v-g})],_=[],b=[];for(s=t.length;s--;){for(b.length=0,f=m.length;f--;)(p=t[s].x-m[f].x)>0&&p*p>m[f].r?(_.push(m[f]),m.splice(f,1)):p*p+(d=t[s].y-m[f].y)*d>m[f].r||(b.push(m[f].a,m[f].b,m[f].b,m[f].c,m[f].c,m[f].a),m.splice(f,1));for(Ki(b),f=b.length;f;)n=b[--f],e=b[--f],r=t[s],i=n.x-e.x,o=n.y-e.y,a=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(a)>1e-12&&m.push(new Hi(e,n,r))}for(Array.prototype.push.apply(_,m),s=_.length;s--;)(_[s].a.__sentinel||_[s].b.__sentinel||_[s].c.__sentinel)&&_.splice(s,1);return _}(t.features.map((function(t){var r={x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]};return e?r.z=t.properties[e]:3===t.geometry.coordinates.length&&(n=!0,r.z=t.geometry.coordinates[2]),r}))).map((function(t){var e=[t.a.x,t.a.y],r=[t.b.x,t.b.y],i=[t.c.x,t.c.y],o={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):o={a:t.a.z,b:t.b.z,c:t.c.z},M([[e,r,i,e]],o)})))}var Hi=a((function t(e,n,r){i(this,t),this.a=e,this.b=n,this.c=r;var o,a,s=n.x-e.x,u=n.y-e.y,l=r.x-e.x,c=r.y-e.y,h=s*(e.x+n.x)+u*(e.y+n.y),f=l*(e.x+r.x)+c*(e.y+r.y),p=2*(s*(r.y-n.y)-u*(r.x-n.x));this.x=(c*h-u*f)/p,this.y=(s*f-l*h)/p,o=this.x-e.x,a=this.y-e.y,this.r=o*o+a*a}));function Zi(t,e){return e.x-t.x}function Ki(t){var e,n,r,i,o,a=t.length;t:for(;a;)for(n=t[--a],e=t[--a],r=a;r;)if(o=t[--r],e===(i=t[--r])&&n===o||e===o&&n===i){t.splice(a,2),t.splice(r,2),a-=2;continue t}}function Ji(t){return t}function $i(t,e){var n=function(t){if(null==t)return Ji;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*r+o,c[1]=(n+=t[1])*i+a;u1)for(var o,s,u=1,l=a(i[0]);ul&&(s=i[0],i[0]=i[u],i[u]=s,l=o);return i})).filter((function(t){return t.length>0}))}}var eo=Object.prototype.hasOwnProperty;function no(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var a=new r(t=1<=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=r,s[l]=o,o},maybeSet:function(r,o){for(var l=e(r)&u,c=a[l],h=0;c!=i;){if(n(c,r))return s[l];if(++h>=t)throw new Error("full hashmap");c=a[l=l+1&u]}return a[l]=r,s[l]=o,o},get:function(r,o){for(var l=e(r)&u,c=a[l],h=0;c!=i;){if(n(c,r))return s[l];if(++h>=t)break;c=a[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,n=a.length;e>7^ao[2]^ao[3])}function uo(t,e,n,r){lo(t,e,n),lo(t,e,e+r),lo(t,e+r,n)}function lo(t,e,n){for(var r,i=e+(n---e>>1);er&&(r=o),ai&&(i=a)}function u(t){t.forEach(s)}function l(t){t.forEach(u)}for(var c in t)o(t[c]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=function(t){var e,n,r={};for(e in t)r[e]=null==(n=t[e])?{type:null}:("FeatureCollection"===n.type?co:"Feature"===n.type?ho:fo)(n);return r}(t)),r=function(t){var e,n,r,i,o=t.coordinates,a=t.lines,s=t.rings,u=a.length+s.length;for(delete t.lines,delete t.rings,r=0,i=a.length;r=0){var o=h[n];i===e&&o===r||i===r&&o===e||(++p,f[n]=1)}else c[n]=e,h[n]=r}}function w(t){return so(o[t])}function x(t,e){return ro(o[t],o[e])}l=c=h=null;var O,E=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<=t)throw new Error("full hashset");u=o[s=s+1&a]}return o[s]=r,!0},has:function(r){for(var s=e(r)&a,u=o[s],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)break;u=o[s=s+1&a]}return!1},values:function(){for(var t=[],e=0,n=o.length;e1&&void 0!==arguments[1]?arguments[1]:{};if(!W(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==rt(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Si(t));var r=[],i=Et(t,(function(t,e){return function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=mo(r[0]),a=mo(r[r.length-1]),s=mo(i[0]),u=mo(i[i.length-1]);if(o===u)n=i.concat(r.slice(1));else if(s===a)n=r.concat(i.slice(1));else if(o===s)n=r.slice(1).reverse().concat(i);else{if(a!==u)return null;n=r.concat(i.reverse().slice(1))}return N(n)}(t,e)||(r.push(t),e)}));return i&&r.push(i),r.length?1===r.length?r[0]:j(r.map((function(t){return t.coordinates}))):null}function mo(t){return t[0].toString()+","+t[1].toString()}function _o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!W(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==rt(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==n&&void 0!==n||(t=Si(t));var r=function(t){var e={};_t(t,(function(t){e[t.geometry.type]=!0}));var n=Object.keys(e);return 1===n.length?n[0]:null}(t);if(!r)throw new Error("geojson must be homogenous");var i=t;switch(r){case"LineString":return vo(i,e);case"Polygon":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("FeatureCollection"!==rt(t))throw new Error("geojson must be a FeatureCollection");if(!t.features.length)throw new Error("geojson is empty");!1!==e.mutate&&void 0!==e.mutate||(t=Si(t));var n=[];_t(t,(function(t){n.push(t.geometry)}));var r=po({geoms:A(n).geometry});return Qi(r,r.objects.geoms.geometries)}(i,e);default:throw new Error(r+" is not supported")}}var bo=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,wo=Math.ceil,xo=Math.floor,Oo="[BigNumber Error] ",Eo=Oo+"Number primitive has more than 15 significant digits: ",So=1e14,Mo=9007199254740991,Po=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],No=1e7,Co=1e9;function ko(t){var e=0|t;return t>0||t===e?e:e-1}function jo(t){for(var e,n,r=1,i=t.length,o=t[0]+"";rl^n?1:-1;for(s=(u=i.length)<(l=o.length)?u:l,a=0;ao[a]^n?1:-1;return u==l?0:u>l^n?1:-1}function Io(t,e,n,r){if(tn||t!==xo(t))throw Error(Oo+(r||"Argument")+("number"==typeof t?tn?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function Ao(t){var e=t.c.length-1;return ko(t.e/14)==e&&t.c[e]%2!=0}function To(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Ro(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else eb?f.c=f.e=null:t.e<_?f.c=[f.e=0]:(f.e=t.e,f.c=t.c.slice()));if((l="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(s=0,u=t;u>=10;u/=10,s++);return void(s>b?f.c=f.e=null:(f.e=s,f.c=[t]))}h=String(t)}else{if(!bo.test(h=String(t)))return i(f,h,l);f.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(s=h.indexOf("."))>-1&&(h=h.replace(".","")),(u=h.search(/e/i))>0?(s<0&&(s=u),s+=+h.slice(u+1),h=h.substring(0,u)):s<0&&(s=h.length)}else{if(Io(e,2,S.length,"Base"),10==e&&M)return j(f=new P(t),d+f.e+1,g);if(h=String(t),l="number"==typeof t){if(0*t!=0)return i(f,h,l,e);if(f.s=1/t<0?(h=h.slice(1),-1):1,P.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(Eo+t)}else f.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(n=S.slice(0,e),s=u=0,c=h.length;us){s=c;continue}}else if(!a&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){a=!0,u=-1,s=0;continue}return i(f,String(t),l,e)}l=!1,(s=(h=r(h,e,10,f.s)).indexOf("."))>-1?h=h.replace(".",""):s=h.length}for(u=0;48===h.charCodeAt(u);u++);for(c=h.length;48===h.charCodeAt(--c););if(h=h.slice(u,++c)){if(c-=u,l&&P.DEBUG&&c>15&&(t>Mo||t!==xo(t)))throw Error(Eo+f.s*t);if((s=s-u-1)>b)f.c=f.e=null;else if(s<_)f.c=[f.e=0];else{if(f.e=s,f.c=[],u=(s+1)%14,s<0&&(u+=14),u=m)?To(u,a):Ro(u,a,"0");else if(o=(t=j(new P(t),e,n)).e,s=(u=jo(t.c)).length,1==r||2==r&&(e<=o||o<=y)){for(;ss){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-s)>0)for(o+1==s&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function C(t,e){for(var n,r,i=1,o=new P(t[0]);i=10;i/=10,r++);return(n=r+14*n-1)>b?t.c=t.e=null:n<_?t.c=[t.e=0]:(t.e=n,t.c=e),t}function j(t,e,n,r){var i,o,a,s,u,l,c,h=t.c,f=Po;if(h){t:{for(i=1,s=h[0];s>=10;s/=10,i++);if((o=e-i)<0)o+=14,a=e,u=h[l=0],c=xo(u/f[i-a-1]%10);else if((l=wo((o+1)/14))>=h.length){if(!r)break t;for(;h.length<=l;h.push(0));u=c=0,i=1,a=(o%=14)-14+1}else{for(u=s=h[l],i=1;s>=10;s/=10,i++);c=(a=(o%=14)-14+i)<0?0:xo(u/f[i-a-1]%10)}if(r=r||e<0||null!=h[l+1]||(a<0?u:u%f[i-a-1]),r=n<4?(c||r)&&(0==n||n==(t.s<0?3:2)):c>5||5==c&&(4==n||r||6==n&&(o>0?a>0?u/f[i-a]:0:h[l-1])%10&1||n==(t.s<0?8:7)),e<1||!h[0])return h.length=0,r?(e-=t.e+1,h[0]=f[(14-e%14)%14],t.e=-e||0):h[0]=t.e=0,t;if(0==o?(h.length=l,s=1,l--):(h.length=l+1,s=f[14-o],h[l]=a>0?xo(u/f[i-a]%f[a])*s:0),r)for(;;){if(0==l){for(o=1,a=h[0];a>=10;a/=10,o++);for(a=h[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(t.e++,h[0]==So&&(h[0]=1));break}if(h[l]+=s,h[l]!=So)break;h[l--]=0,s=1}for(o=h.length;0===h[--o];h.pop());}t.e>b?t.c=t.e=null:t.e<_&&(t.c=[t.e=0])}return t}function L(t){var e,n=t.e;return null===n?t.toString():(e=jo(t.c),e=n<=y||n>=m?To(e,n):Ro(e,n,"0"),t.s<0?"-"+e:e)}return P.clone=t,P.ROUND_UP=0,P.ROUND_DOWN=1,P.ROUND_CEIL=2,P.ROUND_FLOOR=3,P.ROUND_HALF_UP=4,P.ROUND_HALF_DOWN=5,P.ROUND_HALF_EVEN=6,P.ROUND_HALF_CEIL=7,P.ROUND_HALF_FLOOR=8,P.EUCLID=9,P.config=P.set=function(t){var e,n;if(null!=t){if("object"!=v(t))throw Error(Oo+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(Io(n=t[e],0,Co,e),d=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(Io(n=t[e],0,8,e),g=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(Io(n[0],-Co,0,e),Io(n[1],0,Co,e),y=n[0],m=n[1]):(Io(n,-Co,Co,e),y=-(m=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)Io(n[0],-Co,-1,e),Io(n[1],1,Co,e),_=n[0],b=n[1];else{if(Io(n,-Co,Co,e),!n)throw Error(Oo+e+" cannot be zero: "+n);_=-(b=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(Oo+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw w=!n,Error(Oo+"crypto unavailable");w=n}else w=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(Io(n=t[e],0,9,e),x=n),t.hasOwnProperty(e="POW_PRECISION")&&(Io(n=t[e],0,Co,e),O=n),t.hasOwnProperty(e="FORMAT")){if("object"!=v(n=t[e]))throw Error(Oo+e+" not an object: "+n);E=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(Oo+e+" invalid: "+n);M="0123456789"==n.slice(0,10),S=n}}return{DECIMAL_PLACES:d,ROUNDING_MODE:g,EXPONENTIAL_AT:[y,m],RANGE:[_,b],CRYPTO:w,MODULO_MODE:x,POW_PRECISION:O,FORMAT:E,ALPHABET:S}},P.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!P.DEBUG)return!0;var e,n,r=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-Co&&i<=Co&&i===xo(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break t}if((e=(i+1)%14)<1&&(e+=14),String(r[0]).length==e){for(e=0;e=So||n!==xo(n))break t;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(Oo+"Invalid BigNumber: "+t)},P.maximum=P.max=function(){return C(arguments,-1)},P.minimum=P.min=function(){return C(arguments,1)},P.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return xo(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,n,r,i,o,s=0,u=[],l=new P(p);if(null==t?t=d:Io(t,0,Co),i=wo(t/14),w)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));s>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),e[s]=n[0],e[s+1]=n[1]):(u.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw w=!1,Error(Oo+"crypto unavailable");for(e=crypto.randomBytes(i*=7);s=9e15?crypto.randomBytes(7).copy(e,s):(u.push(o%1e14),s+=7);s=i/7}if(!w)for(;s=10;o/=10,s++);s<14&&(r-=14-s)}return l.e=r,l.c=u,l}),P.sum=function(){for(var t=1,e=arguments,n=new P(e[0]);tn-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,o,a,s){var u,l,c,h,f,p,y,v,m=r.indexOf("."),_=d,b=g;for(m>=0&&(h=O,O=0,r=r.replace(".",""),p=(v=new P(i)).pow(r.length-m),O=h,v.c=e(Ro(jo(p.c),p.e,"0"),10,o,t),v.e=v.c.length),c=h=(y=e(r,i,o,s?(u=S,t):(u=t,S))).length;0==y[--h];y.pop());if(!y[0])return u.charAt(0);if(m<0?--c:(p.c=y,p.e=c,p.s=a,y=(p=n(p,v,_,b,o)).c,f=p.r,c=p.e),m=y[l=c+_+1],h=o/2,f=f||l<0||null!=y[l+1],f=b<4?(null!=m||f)&&(0==b||b==(p.s<0?3:2)):m>h||m==h&&(4==b||f||6==b&&1&y[l-1]||b==(p.s<0?8:7)),l<1||!y[0])r=f?Ro(u.charAt(1),-_,u.charAt(0)):u.charAt(0);else{if(y.length=l,f)for(--o;++y[--l]>o;)y[l]=0,l||(++c,y=[1].concat(y));for(h=y.length;!y[--h];);for(m=0,r="";m<=h;r+=u.charAt(y[m++]));r=Ro(r,c,u.charAt(0))}return r}}(),n=function(){function t(t,e,n){var r,i,o,a,s=0,u=t.length,l=e%No,c=e/No|0;for(t=t.slice();u--;)s=((i=l*(o=t[u]%No)+(r=c*o+(a=t[u]/No|0)*l)%No*No+s)/n|0)+(r/No|0)+c*a,t[u]=i%n;return s&&(t=[s].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;t.splice(0,1));}return function(r,i,o,a,s){var u,l,c,h,f,p,d,g,y,v,m,_,b,w,x,O,E,S=r.s==i.s?1:-1,M=r.c,N=i.c;if(!(M&&M[0]&&N&&N[0]))return new P(r.s&&i.s&&(M?!N||M[0]!=N[0]:N)?M&&0==M[0]||!N?0*S:S/0:NaN);for(y=(g=new P(S)).c=[],S=o+(l=r.e-i.e)+1,s||(s=So,l=ko(r.e/14)-ko(i.e/14),S=S/14|0),c=0;N[c]==(M[c]||0);c++);if(N[c]>(M[c]||0)&&l--,S<0)y.push(1),h=!0;else{for(w=M.length,O=N.length,c=0,S+=2,(f=xo(s/(N[0]+1)))>1&&(N=t(N,f,s),M=t(M,f,s),O=N.length,w=M.length),b=O,m=(v=M.slice(0,O)).length;m=s/2&&x++;do{if(f=0,(u=e(N,v,O,m))<0){if(_=v[0],O!=m&&(_=_*s+(v[1]||0)),(f=xo(_/x))>1)for(f>=s&&(f=s-1),d=(p=t(N,f,s)).length,m=v.length;1==e(p,v,d,m);)f--,n(p,O=10;S/=10,c++);j(g,o+(g.e=c+14*l-1)+1,a,h)}else g.e=l,g.r=+h;return g}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,l=/^\.([^.]+)$/,c=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,n,r){var i,o=n?e:e.replace(h,"");if(c.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(s,(function(t,e,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?t:e})),r&&(i=r,o=o.replace(u,"$1").replace(l,"0.$1")),e!=o))return new P(o,i);if(P.DEBUG)throw Error(Oo+"Not a"+(r?" base "+r:"")+" number: "+e);t.s=null}t.c=t.e=null},f.absoluteValue=f.abs=function(){var t=new P(this);return t.s<0&&(t.s=1),t},f.comparedTo=function(t,e){return Lo(this,new P(t,e))},f.decimalPlaces=f.dp=function(t,e){var n,r,i,o=this;if(null!=t)return Io(t,0,Co),null==e?e=g:Io(e,0,8),j(new P(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=14*((i=n.length-1)-ko(this.e/14)),i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},f.dividedBy=f.div=function(t,e){return n(this,new P(t,e),d,g)},f.dividedToIntegerBy=f.idiv=function(t,e){return n(this,new P(t,e),0,1)},f.exponentiatedBy=f.pow=function(t,e){var n,r,i,o,a,s,u,l,c=this;if((t=new P(t)).c&&!t.isInteger())throw Error(Oo+"Exponent not an integer: "+L(t));if(null!=e&&(e=new P(e)),a=t.e>14,!c.c||!c.c[0]||1==c.c[0]&&!c.e&&1==c.c.length||!t.c||!t.c[0])return l=new P(Math.pow(+L(c),a?t.s*(2-Ao(t)):+L(t))),e?l.mod(e):l;if(s=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new P(NaN);(r=!s&&c.isInteger()&&e.isInteger())&&(c=c.mod(e))}else{if(t.e>9&&(c.e>0||c.e<-1||(0==c.e?c.c[0]>1||a&&c.c[1]>=24e7:c.c[0]<8e13||a&&c.c[0]<=9999975e7)))return o=c.s<0&&Ao(t)?-0:0,c.e>-1&&(o=1/o),new P(s?1/o:o);O&&(o=wo(O/14+2))}for(a?(n=new P(.5),s&&(t.s=1),u=Ao(t)):u=(i=Math.abs(+L(t)))%2,l=new P(p);;){if(u){if(!(l=l.times(c)).c)break;o?l.c.length>o&&(l.c.length=o):r&&(l=l.mod(e))}if(i){if(0===(i=xo(i/2)))break;u=i%2}else if(j(t=t.times(n),t.e+1,1),t.e>14)u=Ao(t);else{if(0==(i=+L(t)))break;u=i%2}c=c.times(c),o?c.c&&c.c.length>o&&(c.c.length=o):r&&(c=c.mod(e))}return r?l:(s&&(l=p.div(l)),e?l.mod(e):o?j(l,O,g,void 0):l)},f.integerValue=function(t){var e=new P(this);return null==t?t=g:Io(t,0,8),j(e,e.e+1,t)},f.isEqualTo=f.eq=function(t,e){return 0===Lo(this,new P(t,e))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(t,e){return Lo(this,new P(t,e))>0},f.isGreaterThanOrEqualTo=f.gte=function(t,e){return 1===(e=Lo(this,new P(t,e)))||0===e},f.isInteger=function(){return!!this.c&&ko(this.e/14)>this.c.length-2},f.isLessThan=f.lt=function(t,e){return Lo(this,new P(t,e))<0},f.isLessThanOrEqualTo=f.lte=function(t,e){return-1===(e=Lo(this,new P(t,e)))||0===e},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(t,e){var n,r,i,o,a=this,s=a.s;if(e=(t=new P(t,e)).s,!s||!e)return new P(NaN);if(s!=e)return t.s=-e,a.plus(t);var u=a.e/14,l=t.e/14,c=a.c,h=t.c;if(!u||!l){if(!c||!h)return c?(t.s=-e,t):new P(h?a:NaN);if(!c[0]||!h[0])return h[0]?(t.s=-e,t):new P(c[0]?a:3==g?-0:0)}if(u=ko(u),l=ko(l),c=c.slice(),s=u-l){for((o=s<0)?(s=-s,i=c):(l=u,i=h),i.reverse(),e=s;e--;i.push(0));i.reverse()}else for(r=(o=(s=c.length)<(e=h.length))?s:e,s=e=0;e0)for(;e--;c[n++]=0);for(e=So-1;r>s;){if(c[--r]=0;){for(n=0,f=_[i]%y,p=_[i]/y|0,o=i+(a=u);o>i;)n=((l=f*(l=m[--a]%y)+(s=p*l+(c=m[a]/y|0)*f)%y*y+d[o]+n)/g|0)+(s/y|0)+p*c,d[o--]=l%g;d[o]=n}return n?++r:d.splice(0,1),k(t,d,r)},f.negated=function(){var t=new P(this);return t.s=-t.s||null,t},f.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new P(t,e)).s,!i||!e)return new P(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/14,a=t.e/14,s=r.c,u=t.c;if(!o||!a){if(!s||!u)return new P(i/0);if(!s[0]||!u[0])return u[0]?t:new P(s[0]?r:0*i)}if(o=ko(o),a=ko(a),s=s.slice(),i=o-a){for(i>0?(a=o,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for((i=s.length)-(e=u.length)<0&&(n=u,u=s,s=n,e=i),i=0;e;)i=(s[--e]=s[e]+u[e]+i)/So|0,s[e]=So===s[e]?0:s[e]%So;return i&&(s=[i].concat(s),++a),k(t,s,a)},f.precision=f.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return Io(t,1,Co),null==e?e=g:Io(e,0,8),j(new P(o),t,e);if(!(n=o.c))return null;if(r=14*(i=n.length-1)+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},f.shiftedBy=function(t){return Io(t,-9007199254740991,Mo),this.times("1e"+t)},f.squareRoot=f.sqrt=function(){var t,e,r,i,o,a=this,s=a.c,u=a.s,l=a.e,c=d+4,h=new P("0.5");if(1!==u||!s||!s[0])return new P(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+L(a)))||u==1/0?(((e=jo(s)).length+l)%2==0&&(e+="0"),u=Math.sqrt(+e),l=ko((l+1)/2)-(l<0||l%2),r=new P(e=u==1/0?"5e"+l:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+l)):r=new P(u+""),r.c[0])for((u=(l=r.e)+c)<3&&(u=0);;)if(o=r,r=h.times(o.plus(n(a,o,c,1))),jo(o.c).slice(0,u)===(e=jo(r.c)).slice(0,u)){if(r.e0&&d>0){for(o=d%s||s,c=p.substr(0,o);o0&&(c+=l+p.slice(o)),f&&(c="-"+c)}r=h?c+(n.decimalSeparator||"")+((u=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):c}return(n.prefix||"")+r+(n.suffix||"")},f.toFraction=function(t){var e,r,i,o,a,s,u,l,c,h,f,d,y=this,v=y.c;if(null!=t&&(!(u=new P(t)).isInteger()&&(u.c||1!==u.s)||u.lt(p)))throw Error(Oo+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+L(u));if(!v)return new P(y);for(e=new P(p),c=r=new P(p),i=l=new P(p),d=jo(v),a=e.e=d.length-y.e-1,e.c[0]=Po[(s=a%14)<0?14+s:s],t=!t||u.comparedTo(e)>0?a>0?e:c:u,s=b,b=1/0,u=new P(d),l.c[0]=0;h=n(u,e,0,1),1!=(o=r.plus(h.times(i))).comparedTo(t);)r=i,i=o,c=l.plus(h.times(o=c)),l=o,e=u.minus(h.times(o=e)),u=o;return o=n(t.minus(r),i,0,1),l=l.plus(o.times(c)),r=r.plus(o.times(i)),l.s=c.s=y.s,f=n(c,i,a*=2,g).minus(y).abs().comparedTo(n(l,r,a,g).minus(y).abs())<1?[c,i]:[l,r],b=s,f},f.toNumber=function(){return+L(this)},f.toPrecision=function(t,e){return null!=t&&Io(t,1,Co),N(this,t,e,2)},f.toString=function(t){var e,n=this,i=n.s,o=n.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=y||o>=m?To(jo(n.c),o):Ro(jo(n.c),o,"0"):10===t&&M?e=Ro(jo((n=j(new P(n),d+o+1,g)).c),n.e,"0"):(Io(t,2,S.length,"Base"),e=r(Ro(jo(n.c),o,"0"),10,t,i,!0)),i<0&&n.c[0]&&(e="-"+e)),e},f.valueOf=f.toJSON=function(){return L(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&P.set(e),P}(),Do=function(t){function e(t){return i(this,e),r(this,e,[t])}return c(e,t),a(e)}(a((function t(e){i(this,t),u(this,"key",void 0),u(this,"left",null),u(this,"right",null),this.key=e}))),Go=function(t){function e(t,n){var o;return i(this,e),u(o=r(this,e),"root",null),u(o,"compare",void 0),u(o,"validKey",void 0),u(o,Symbol.toStringTag,"[object Set]"),o.compare=null!=t?t:o.defaultCompare(),o.validKey=null!=n?n:function(t){return null!=t&&null!=t},o}return c(e,t),a(e,[{key:"delete",value:function(t){return!!this.validKey(t)&&null!=this._delete(t)}},{key:"deleteAll",value:function(t){var e,n=s(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.delete(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"forEach",value:function(t){for(var e,n=this[Symbol.iterator]();!(e=n.next()).done;)t(e.value,e.value,this)}},{key:"add",value:function(t){var e=this.splay(t);return 0!=e&&this.addNewRoot(new Do(t),e),this}},{key:"addAndReturn",value:function(t){var e=this.splay(t);return 0!=e&&this.addNewRoot(new Do(t),e),this.root.key}},{key:"addAll",value:function(t){var e,n=s(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.add(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"isEmpty",value:function(){return null==this.root}},{key:"isNotEmpty",value:function(){return null!=this.root}},{key:"single",value:function(){if(0==this.size)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}},{key:"first",value:function(){if(0==this.size)throw"Bad state: No element";return this._first().key}},{key:"last",value:function(){if(0==this.size)throw"Bad state: No element";return this._last().key}},{key:"lastBefore",value:function(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)<0)return this.root.key;var e=this.root.left;if(null==e)return null;for(var n=e.right;null!=n;)n=(e=n).right;return e.key}},{key:"firstAfter",value:function(t){if(null==t)throw"Invalid arguments(s)";if(null==this.root)return null;if(this.splay(t)>0)return this.root.key;var e=this.root.right;if(null==e)return null;for(var n=e.left;null!=n;)n=(e=n).left;return e.key}},{key:"retainAll",value:function(t){var n,r=new e(this.compare,this.validKey),i=this.modificationCount,o=s(t);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(i!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(a)&&0==this.splay(a)&&r.add(this.root.key)}}catch(t){o.e(t)}finally{o.f()}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}},{key:"lookup",value:function(t){return this.validKey(t)?0!=this.splay(t)?null:this.root.key:null}},{key:"intersection",value:function(t){var n,r=new e(this.compare,this.validKey),i=s(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.has(o)&&r.add(o)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"difference",value:function(t){var n,r=new e(this.compare,this.validKey),i=s(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.has(o)||r.add(o)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"union",value:function(t){var e=this.clone();return e.addAll(t),e}},{key:"clone",value:function(){var t=new e(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}},{key:"copyNode",value:function(t){if(null==t)return null;var e=new Do(t.key);return function t(e,n){var r,i;do{if(r=e.left,i=e.right,null!=r){var o=new Do(r.key);n.left=o,t(r,o)}if(null!=i){var a=new Do(i.key);n.right=a,e=i,n=a}}while(null!=i)}(t,e),e}},{key:"toSet",value:function(){return this.clone()}},{key:"entries",value:function(){return new zo(this.wrap())}},{key:"keys",value:function(){return this[Symbol.iterator]()}},{key:"values",value:function(){return this[Symbol.iterator]()}},{key:Symbol.iterator,value:function(){return new qo(this.wrap())}}])}(a((function t(){i(this,t),u(this,"size",0),u(this,"modificationCount",0),u(this,"splayCount",0)}),[{key:"splay",value:function(t){var e=this.root;if(null==e)return this.compare(t,t),-1;for(var n,r=null,i=null,o=null,a=null,s=e,u=this.compare;;)if((n=u(s.key,t))>0){var l=s.left;if(null==l)break;if((n=u(l.key,t))>0&&(s.left=l.right,l.right=s,null==(l=(s=l).left)))break;null==r?i=s:r.left=s,r=s,s=l}else{if(!(n<0))break;var c=s.right;if(null==c)break;if((n=u(c.key,t))<0&&(s.right=c.left,c.left=s,null==(c=(s=c).right)))break;null==o?a=s:o.right=s,o=s,s=c}return null!=o&&(o.right=s.left,s.left=a),null!=r&&(r.left=s.right,s.right=i),this.root!==s&&(this.root=s,this.splayCount++),n}},{key:"splayMin",value:function(t){for(var e=t,n=e.left;null!=n;){var r=n;e.left=r.right,r.right=e,n=(e=r).left}return e}},{key:"splayMax",value:function(t){for(var e=t,n=e.right;null!=n;){var r=n;e.right=r.left,r.left=e,n=(e=r).right}return e}},{key:"_delete",value:function(t){if(null==this.root)return null;if(0!=this.splay(t))return null;var e=this.root,n=e,r=e.left;if(this.size--,null==r)this.root=e.right;else{var i=e.right;(e=this.splayMax(r)).right=i,this.root=e}return this.modificationCount++,n}},{key:"addNewRoot",value:function(t,e){this.size++,this.modificationCount++;var n=this.root;null!=n?(e<0?(t.left=n,t.right=n.right,n.right=null):(t.right=n,t.left=n.left,n.left=null),this.root=t):this.root=t}},{key:"_first",value:function(){var t=this.root;return null==t?null:(this.root=this.splayMin(t),this.root)}},{key:"_last",value:function(){var t=this.root;return null==t?null:(this.root=this.splayMax(t),this.root)}},{key:"clear",value:function(){this.root=null,this.size=0,this.modificationCount++}},{key:"has",value:function(t){return this.validKey(t)&&0==this.splay(t)}},{key:"defaultCompare",value:function(){return function(t,e){return te?1:0}}},{key:"wrap",value:function(){var t=this;return{getRoot:function(){return t.root},setRoot:function(e){t.root=e},getSize:function(){return t.size},getModificationCount:function(){return t.modificationCount},getSplayCount:function(){return t.splayCount},setSplayCount:function(e){t.splayCount=e},splay:function(e){return t.splay(e)},has:function(e){return t.has(e)}}}}])),Bo=a((function t(e){i(this,t),u(this,"tree",void 0),u(this,"path",new Array),u(this,"modificationCount",null),u(this,"splayCount",void 0),this.tree=e,this.splayCount=e.getSplayCount()}),[{key:Symbol.iterator,value:function(){return this}},{key:"next",value:function(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}},{key:"current",value:function(){if(!this.path.length)return null;var t=this.path[this.path.length-1];return this.getValue(t)}},{key:"rebuildPath",value:function(t){this.path.splice(0,this.path.length),this.tree.splay(t),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}},{key:"findLeftMostDescendent",value:function(t){for(;null!=t;)this.path.push(t),t=t.left}},{key:"moveNext",value:function(){if(this.modificationCount!=this.tree.getModificationCount()){if(null==this.modificationCount){this.modificationCount=this.tree.getModificationCount();for(var t=this.tree.getRoot();null!=t;)this.path.push(t),t=t.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);var e=this.path[this.path.length-1],n=e.right;if(null!=n){for(;null!=n;)this.path.push(n),n=n.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}}]),qo=function(t){function e(){return i(this,e),r(this,e,arguments)}return c(e,t),a(e,[{key:"getValue",value:function(t){return t.key}}])}(Bo),zo=function(t){function e(){return i(this,e),r(this,e,arguments)}return c(e,t),a(e,[{key:"getValue",value:function(t){return[t.key,t.key]}}])}(Bo),Uo=function(t){return function(){return t}},Vo=function(t){var e=t?function(e,n){return n.minus(e).abs().isLessThanOrEqualTo(t)}:Uo(!1);return function(t,n){return e(t,n)?0:t.comparedTo(n)}};function Yo(t){var e=t?function(e,n,r,i,o){return e.exponentiatedBy(2).isLessThanOrEqualTo(i.minus(n).exponentiatedBy(2).plus(o.minus(r).exponentiatedBy(2)).times(t))}:Uo(!1);return function(t,n,r){var i=t.x,o=t.y,a=r.x,s=r.y,u=o.minus(s).times(n.x.minus(a)).minus(i.minus(a).times(n.y.minus(s)));return e(u,i,o,a,s)?0:u.comparedTo(0)}}var Wo=function(t){return t},Xo=function(t){if(t){var e=new Go(Vo(t)),n=new Go(Vo(t)),r=function(t,e){return e.addAndReturn(t)},i=function(t){return{x:r(t.x,e),y:r(t.y,n)}};return i({x:new Fo(0),y:new Fo(0)}),i}return Wo},Ho=function(t){return{set:function(t){Zo=Ho(t)},reset:function(){return Ho(t)},compare:Vo(t),snap:Xo(t),orient:Yo(t)}},Zo=Ho(),Ko=function(t,e){return t.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(t.ur.x)&&t.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(t.ur.y)},Jo=function(t,e){if(e.ur.x.isLessThan(t.ll.x)||t.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(t.ll.y)||t.ur.y.isLessThan(e.ll.y))return null;var n=t.ll.x.isLessThan(e.ll.x)?e.ll.x:t.ll.x,r=t.ur.x.isLessThan(e.ur.x)?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y.isLessThan(e.ll.y)?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y.isLessThan(e.ur.y)?t.ur.y:e.ur.y}}},$o=function(t,e){return t.x.times(e.y).minus(t.y.times(e.x))},Qo=function(t,e){return t.x.times(e.x).plus(t.y.times(e.y))},ta=function(t){return Qo(t,t).sqrt()},ea=function(t,e,n){var r={x:e.x.minus(t.x),y:e.y.minus(t.y)},i={x:n.x.minus(t.x),y:n.y.minus(t.y)};return Qo(i,r).div(ta(i)).div(ta(r))},na=function(t,e,n){return e.y.isZero()?null:{x:t.x.plus(e.x.div(e.y).times(n.minus(t.y))),y:n}},ra=function(t,e,n){return e.x.isZero()?null:{x:n,y:t.y.plus(e.y.div(e.x).times(n.minus(t.x)))}},ia=function(){function t(e,n){i(this,t),u(this,"point",void 0),u(this,"isLeft",void 0),u(this,"segment",void 0),u(this,"otherSE",void 0),u(this,"consumedBy",void 0),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return a(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,n=0,r=e.length;n0&&(t=r)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;var a,s;if(o.ringOut!==i.ringOut)return(null===(a=o.ringOut)||void 0===a?void 0:a.enclosingRing())!==i.ringOut?i.ringOut:null===(s=i.ringOut)||void 0===s?void 0:s.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}],[{key:"factory",value:function(e){for(var n=[],r=0,i=e.length;r1&&void 0!==arguments[1]?arguments[1]:fa.compare;i(this,t),u(this,"queue",void 0),u(this,"tree",void 0),u(this,"segments",void 0),this.queue=e,this.tree=new Go(n),this.segments=[]}),[{key:"process",value:function(t){var e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.delete(t.otherSE):this.tree.delete(e),n;t.isLeft&&this.tree.add(e);var r=e,i=e;do{r=this.tree.lastBefore(r)}while(null!=r&&null!=r.consumedBy);do{i=this.tree.firstAfter(i)}while(null!=i&&null!=i.consumedBy);if(t.isLeft){var o=null;if(r){var a=r.getIntersection(e);if(null!==a&&(e.isAnEndpoint(a)||(o=a),!r.isAnEndpoint(a)))for(var s=this._splitSafely(r,a),u=0,l=s.length;u0?(this.tree.delete(e),n.push(t)):(this.segments.push(e),e.prev=r)}else{if(r&&i){var _=r.getIntersection(i);if(null!==_){if(!r.isAnEndpoint(_))for(var b=this._splitSafely(r,_),w=0,x=b.length;w0&&s.swapEvents(),ia.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(i.checkForConsuming(),o.checkForConsuming()),n}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,n=this.windings.length;e0){var o=n;n=r,r=o}if(n.prev===r){var a=n;n=r,r=a}for(var s=0,u=r.rings.length;s0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(n.isGreaterThan(r)){if(a.isLessThan(s)&&a.isLessThan(l))return-1;if(a.isGreaterThan(s)&&a.isGreaterThan(l))return 1;var f=e.comparePoint(t.leftSE.point);if(0!==f)return f;var p=t.comparePoint(e.rightSE.point);return p<0?1:p>0?-1:1}if(a.isLessThan(s))return-1;if(a.isGreaterThan(s))return 1;if(i.isLessThan(o)){var d=e.comparePoint(t.rightSE.point);if(0!==d)return d}if(i.isGreaterThan(o)){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(!i.eq(o)){var y=u.minus(a),v=i.minus(n),m=l.minus(s),_=o.minus(r);if(y.isGreaterThan(v)&&m.isLessThan(_))return 1;if(y.isLessThan(v)&&m.isGreaterThan(_))return-1}return i.isGreaterThan(o)?1:i.isLessThan(o)||u.isLessThan(l)?-1:u.isGreaterThan(l)?1:t.ide.id?1:0}},{key:"fromRing",value:function(e,n,r){var i,o,a,s=ia.comparePoints(e,n);if(s<0)i=e,o=n,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));i=n,o=e,a=-1}return new t(new ia(i,!0),new ia(o,!1),[r],[a])}}])}(),pa=a((function t(e,n,r){if(i(this,t),u(this,"poly",void 0),u(this,"isExterior",void 0),u(this,"segments",void 0),u(this,"bbox",void 0),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=r,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=Zo.snap({x:new Fo(e[0][0]),y:new Fo(e[0][1])});this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,l=e.length;s1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:2,r=K(t),i=K(e),o=r[0]-i[0],a=r[1]-i[1];return 1===n?Math.abs(o)+Math.abs(a):Math.pow(Math.pow(o,n)+Math.pow(a,n),1/n)}function Oa(t,e){var n,r,i=(e=e||{}).threshold||1e4,o=e.p||2,a=null!=(n=e.binary)&&n,s=e.alpha||-1,u=null!=(r=e.standardization)&&r,l=[];dt(t,(function(t){l.push(ai(t))}));for(var c=[],h=0;h3&&void 0!==arguments[3]?arguments[3]:{},i=e<0,o=U(Math.abs(e),r.units,"meters");i&&(o=-Math.abs(o));var a=K(t),s=function(t,e,n,r){var i=e/(r=void 0===r?_:Number(r)),o=t[0]*Math.PI/180,a=z(t[1]),s=z(n),u=i*Math.cos(s),l=a+u;Math.abs(l)>Math.PI/2&&(l=l>0?Math.PI-l:-Math.PI-l);var c=Math.log(Math.tan(l/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),h=Math.abs(c)>1e-11?u/c:Math.cos(a);return[(180*(o+i*Math.sin(s)/h)/Math.PI+540)%360-180,180*l/Math.PI]}(a,o,n);return s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0,E(s,r.properties)}function Sa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=K(t),i=K(e);i[0]+=i[0]-r[0]>180?-360:r[0]-i[0]>180?360:0;var o=function(t,e,n){var r=n=void 0===n?_:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),l=Math.abs(u)>1e-11?a/u:Math.cos(i);return Math.sqrt(a*a+l*l*s*s)*r}(r,i);return U(o,"meters",n.units)}function Ma(t,e,n){if(!W(n=n||{}))throw new Error("options is invalid");var r=n.pivot,i=n.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");if(0===e)return t;var o=null!=r?r:ai(t);return!1!==i&&void 0!==i||(t=Si(t)),ct(t,(function(t){var n=ut(o,t)+e,r=Sa(o,t),i=J(Ea(o,r,n));t[0]=i[0],t[1]=i[1]})),t}function Pa(t,e,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",a=r.angle||0,s=r.pivot||t,u=r.properties||{};if(!t)throw new Error("center is required");if(!e)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!W(r))throw new Error("options must be an object");if(!Y(i))throw new Error("steps must be a number");if(!Y(a))throw new Error("angle must be a number");var l=K(t);if("degrees"!==o){var c=Ea(t,e,90,{units:o}),h=Ea(t,n,0,{units:o});e=K(c)[0]-l[0],n=K(h)[1]-l[1]}for(var f=[],p=0;p=-270&&(g=-g),d<-180&&d>=-360&&(y=-y),"degrees"===o){var v=z(a),m=g*Math.cos(v)+y*Math.sin(v),_=y*Math.cos(v)-g*Math.sin(v);g=m,y=_}f.push([g+l[0],y+l[1]])}return f.push(f[0]),"degrees"===o?M([f],u):Ma(M([f],u),a,{pivot:s})}function Na(t){var e=t*Math.PI/180;return Math.tan(e)}function Ca(t){return Ft(Lt(t))}function ka(t){var e=[];return"FeatureCollection"===t.type?dt(t,(function(t){ct(t,(function(n){e.push(E(n,t.properties))}))})):"Feature"===t.type?ct(t,(function(n){e.push(E(n,t.properties))})):ct(t,(function(t){e.push(E(t))})),k(e)}var ja=Math.PI/180,La=180/Math.PI,Ia=function(t,e){this.lon=t,this.lat=e,this.x=ja*t,this.y=ja*e};Ia.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Ia.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new Ia(e,t)};var Aa=function(){this.coords=[],this.length=0};Aa.prototype.move_to=function(t){this.length++,this.coords.push(t)};var Ta=function(t){this.properties=t||{},this.geometries=[]};Ta.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(vt(t,(function(t){n.push(t.coordinates)})),n.length<2)throw new Error("Must specify at least 2 geometries");var r=va.apply(ba,[n[0]].concat(g(n.slice(1))));return 0===r.length?null:1===r.length?M(r[0],e.properties):I(r,e.properties)}function Da(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=JSON.stringify(n.properties||{}),i=d(t,4),o=i[0],a=i[1],s=i[2],u=i[3],l=(a+u)/2,c=(o+s)/2,h=2*e/st([o,l],[s,l],n)*(s-o),f=2*e/st([c,a],[c,u],n)*(u-a),p=h/2,g=2*p,y=Math.sqrt(3)/2*f,v=s-o,m=u-a,_=3/4*g,b=y,w=(v-g)/(g-p/2),x=Math.floor(w),O=(x*_-p/2-v)/2-p/2+_/2,E=Math.floor((m-y)/y),S=(m-E*y)/2,M=E*y-m>y/2;M&&(S-=y/4);for(var P=[],N=[],C=0;C<6;C++){var j=2*Math.PI/6*C;P.push(Math.cos(j)),N.push(Math.sin(j))}for(var L=[],I=0;I<=x;I++)for(var A=0;A<=E;A++){var T=I%2==1;if(!(0===A&&T||0===A&&M)){var R=I*_+o-O,F=A*b+a+S;if(T&&(F-=y/2),!0===n.triangles)Ba([R,F],h/2,f/2,JSON.parse(r),P,N).forEach((function(t){n.mask?Fa(k([n.mask,t]))&&L.push(t):L.push(t)}));else{var D=Ga([R,F],h/2,f/2,JSON.parse(r),P,N);n.mask?Fa(k([n.mask,D]))&&L.push(D):L.push(D)}}}return k(L)}function Ga(t,e,n,r,i,o){for(var a=[],s=0;s<6;s++){var u=t[0]+e*i[s],l=t[1]+n*o[s];a.push([u,l])}return a.push(a[0].slice()),M([a],r)}function Ba(t,e,n,r,i,o){for(var a=[],s=0;s<6;s++){var u=[];u.push(t),u.push([t[0]+e*i[s],t[1]+n*o[s]]),u.push([t[0]+e*i[(s+1)%6],t[1]+n*o[(s+1)%6]]),u.push(t),a.push(M([u],r))}return a}function qa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.mask&&!n.units&&(n.units="kilometers");for(var r=[],i=t[0],o=t[1],a=t[2],s=t[3],u=e/st([i,o],[a,o],n)*(a-i),l=e/st([i,o],[i,s],n)*(s-o),c=a-i,h=s-o,f=Math.floor(c/u),p=(h-Math.floor(h/l)*l)/2,d=i+(c-f*u)/2;d<=a;){for(var g=o+p;g<=s;){var y=E([d,g],n.properties);n.mask?Pn(y,n.mask)&&r.push(y):r.push(y),g+=l}d+=u}return k(r)}function za(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=[],o=t[0],a=t[1],s=t[2],u=t[3],l=s-o,c=U(e,r.units,"degrees"),h=u-a,f=U(n,r.units,"degrees"),p=Math.floor(Math.abs(l)/c),d=Math.floor(Math.abs(h)/f),g=(h-d*f)/2,y=o+(l-p*c)/2,v=0;v2&&void 0!==arguments[2]?arguments[2]:{})}function Va(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=e/st([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),o=e/st([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),a=0,s=t[0];s<=t[2];){for(var u=0,l=t[1];l<=t[3];){var c=null,h=null;a%2==0&&u%2==0?(c=M([[[s,l],[s,l+o],[s+i,l],[s,l]]],n.properties),h=M([[[s,l+o],[s+i,l+o],[s+i,l],[s,l+o]]],n.properties)):a%2==0&&u%2==1?(c=M([[[s,l],[s+i,l+o],[s+i,l],[s,l]]],n.properties),h=M([[[s,l],[s,l+o],[s+i,l+o],[s,l]]],n.properties)):u%2==0&&a%2==1?(c=M([[[s,l],[s,l+o],[s+i,l+o],[s,l]]],n.properties),h=M([[[s,l],[s+i,l+o],[s+i,l],[s,l]]],n.properties)):u%2==1&&a%2==1&&(c=M([[[s,l],[s,l+o],[s+i,l],[s,l]]],n.properties),h=M([[[s,l+o],[s+i,l+o],[s+i,l],[s,l+o]]],n.properties)),n.mask?(Fa(k([n.mask,c]))&&r.push(c),Fa(k([n.mask,h]))&&r.push(h)):(r.push(c),r.push(h)),l+=o,u++}a++,s+=i}return k(r)}function Ya(t,e,n){return tr&&(i=n,n=r,r=i),tr?(t-r)/(t-e):(t-n)/(t-e)}function Xa(t,e,n,r){return t1){for(;0!==o;)o>>=1,s++;r===1<1){for(;0!==a;)a>>=1,u++;i===1<0&&(this.childB=new Qa(t,e+o,n,r-o,a),this.lowerBound=Math.min(this.lowerBound,this.childB.lowerBound),this.upperBound=Math.max(this.upperBound,this.childB.upperBound),i-a>0&&(this.childC=new Qa(t,e+o,n+a,r-o,i-a),this.lowerBound=Math.min(this.lowerBound,this.childC.lowerBound),this.upperBound=Math.max(this.upperBound,this.childC.upperBound))),i-a>0&&(this.childD=new Qa(t,e,n+a,o,i-a),this.lowerBound=Math.min(this.lowerBound,this.childD.lowerBound),this.upperBound=Math.max(this.upperBound,this.childD.upperBound))}}function ts(t){var e,n;if(!t)throw new Error("data is required");if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Error("data must be scalar field, i.e. array of arrays");if(t.length<2)throw new Error("data must contain at least two rows");if((n=t[0].length)<2)throw new Error("data must contain at least two columns");for(e=1;e=e||t[a][r-1]>=e){n=!1;break}if(n&&(t[i-1][0]>=e||t[i-1][r-1]>=e)&&(n=!1),n)for(o=0;o=e||t[i-1][o]>e){n=!1;break}return n}(t,n.threshold)&&(n.linearRing?_.push([[0,0],[0,b],[w,b],[w,0],[0,0]]):_.push([[0,0],[0,b],[w,b],[w,0]])),e.forEach((function(t,M){t.forEach((function(t,P){for(r=null,i=0;i<4;i++)if(r=x[i],"object"===v(t.edges[r])){for(s=[],o=t.edges[r],u=r,l=M,c=P,h=!1,f=[M+o.path[0][0],P+o.path[0][1]],s.push(f);!h&&"object"===v((a=e[l][c]).edges[u]);)if(o=a.edges[u],delete a.edges[u],(p=o.path[1])[0]+=l,p[1]+=c,s.push(p),u=o.move.enter,l+=o.move.x,c+=o.move.y,void 0===e[l]||void 0===e[l][c]){if(!n.linearRing)break;if(d=0,g=0,l===w?(l--,d=0):l<0?(l++,d=2):c===b?(c--,d=3):c<0&&(c++,d=1),l===M&&c===P&&d===S[r]){h=!0,u=r;break}for(;;){if(y=!1,g>4)throw new Error("Direction change counter overflow! This should never happen!");if(void 0!==e[l]&&void 0!==e[l][c]&&(a=e[l][c],m=x[d],"object"===v(a.edges[m]))){o=a.edges[m],s.push(Ja(l,c,d,o.path)),u=m,y=!0;break}if(y)break;if(s.push($a(l,c,d)),c+=E[d],void 0!==e[l+=O[d]]&&void 0!==e[l][c]||(0===d&&c<0||1===d&&l<0||2===d&&c===b||3===d&&l===w)&&(l-=O[d],c-=E[d],d=(d+1)%4,g++),l===M&&c===P&&d===S[r]){h=!0,u=r;break}}}!n.linearRing||s[s.length-1][0]===f[0]&&s[s.length-1][1]===f[1]||s.push(f),_.push(s)}}))})),_}(c,h,r)}s?p.push(f):p=f,"function"==typeof r.successCallback&&r.successCallback(p,t)})),p}function ns(t,e,n,r){var i,o,a,s,u,l,c=0,h=t[n+1][e],f=t[n+1][e+1],p=t[n][e+1],d=t[n][e],g=r.threshold;if(!(isNaN(d)||isNaN(p)||isNaN(f)||isNaN(h))){switch(c|=h>=g?8:0,c|=f>=g?4:0,c|=p>=g?2:0,l={cval:c=+(c|=d>=g?1:0),polygons:[],edges:{},x0:d,x1:p,x2:f,x3:h},c){case 0:r.polygons&&l.polygons.push([[0,0],[0,1],[1,1],[1,0]]);break;case 15:break;case 14:i=r.interpolate(d,h,g),s=r.interpolate(d,p,g),r.polygons_full&&(l.edges.left={path:[[0,i],[s,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,i],[s,0]]);break;case 13:s=r.interpolate(d,p,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.bottom={path:[[s,0],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&&l.polygons.push([[s,0],[1,o],[1,0]]);break;case 11:o=r.interpolate(p,f,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.right={path:[[1,o],[a,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[1,o],[a,1],[1,1]]);break;case 7:i=r.interpolate(d,h,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.top={path:[[a,1],[0,i]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&l.polygons.push([[a,1],[0,i],[0,1]]);break;case 1:i=r.interpolate(d,h,g),s=r.interpolate(d,p,g),r.polygons_full&&(l.edges.bottom={path:[[s,0],[0,i]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&l.polygons.push([[s,0],[0,i],[0,1],[1,1],[1,0]]);break;case 2:s=r.interpolate(d,p,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.right={path:[[1,o],[s,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,1],[1,1],[1,o],[s,0]]);break;case 4:o=r.interpolate(p,f,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.top={path:[[a,1],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&&l.polygons.push([[0,0],[0,1],[a,1],[1,o],[1,0]]);break;case 8:i=r.interpolate(d,h,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.left={path:[[0,i],[a,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[0,0],[0,i],[a,1],[1,1],[1,0]]);break;case 12:i=r.interpolate(d,h,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.left={path:[[0,i],[1,o]],move:{x:1,y:0,enter:"left"}}),r.polygons&&l.polygons.push([[0,0],[0,i],[1,o],[1,0]]);break;case 9:s=r.interpolate(d,p,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.bottom={path:[[s,0],[a,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&l.polygons.push([[s,0],[a,1],[1,1],[1,0]]);break;case 3:i=r.interpolate(d,h,g),o=r.interpolate(p,f,g),r.polygons_full&&(l.edges.right={path:[[1,o],[0,i]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&l.polygons.push([[0,i],[0,1],[1,1],[1,o]]);break;case 6:s=r.interpolate(d,p,g),a=r.interpolate(h,f,g),r.polygons_full&&(l.edges.top={path:[[a,1],[s,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&l.polygons.push([[0,0],[0,1],[a,1],[s,0]]);break;case 10:i=r.interpolate(d,h,g),o=r.interpolate(p,f,g),s=r.interpolate(d,p,g),a=r.interpolate(h,f,g),u=(d+p+f+h)/4,r.polygons_full&&(uf&&(g>c&&dc&&gu&&(u=y)}var v=[];if(s&&u0&&Math.abs(b-n[_-1][0])>f){var w=parseFloat(n[_-1][0]),x=parseFloat(n[_-1][1]),O=parseFloat(n[_][0]),E=parseFloat(n[_][1]);if(w>-180&&w-180&&n[_-1][0]c&&w<180&&-180===O&&_+1c&&n[_-1][0]<180){m.push([180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(wc){var S=w;w=O,O=S;var M=x;x=E,E=M}if(w>c&&O=180&&wc?180:-180,N]),(m=[]).push([n[_-1][0]>c?-180:180,N]),v.push(m)}else m=[],v.push(m);m.push([b,n[_][1]])}else m.push([n[_][0],n[_][1]])}}else{var C=[];v.push(C);for(var k=0;ke||this.upperBound=e)&&r.push({x:this.x,y:this.y})),r},Qa.prototype.cellsBelowThreshold=function(t,e){var n=[];return e=void 0===e||e,this.lowerBound>t||(this.childA||this.childB||this.childC||this.childD?(this.childA&&(n=n.concat(this.childA.cellsBelowThreshold(t,e))),this.childB&&(n=n.concat(this.childB.cellsBelowThreshold(t,e))),this.childD&&(n=n.concat(this.childD.cellsBelowThreshold(t,e))),this.childC&&(n=n.concat(this.childC.cellsBelowThreshold(t,e)))):(e||this.upperBound>=t)&&n.push({x:this.x,y:this.y})),n};var rs=function(t,e,n,r,i,o){o.polygons&&t.polygons.push([[0,0],[0,1],[1,1],[1,0]])},is=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,s],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,s],[a,0],[0,0]])},os=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[1,s]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[1,s],[1,0]])},as=function(t,e,n,r,i,o){var a=o.interpolate(n,r,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,a],[s,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[1,a],[s,1],[1,1]])},ss=function(t,e,n,r,i,o){var a=o.interpolate(i,r,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[a,1],[0,s]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,s],[0,1],[a,1]])},us=function(t,e,n,r,i,o){var a=o.interpolate(n,r,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,a],[0,s]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,s],[0,1],[1,1],[1,a]])},ls=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[s,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[a,0],[s,1],[1,1],[1,0]])},cs=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[1,s]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[1,s],[1,0]])},hs=function(t,e,n,r,i,o){var a=o.interpolate(i,r,o.minV,o.maxV),s=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[a,1],[s,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[a,1],[s,0]])},fs=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,l],[s,0]])},ps=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(n,r,o.minV,o.maxV),l=o.interpolate_b(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[1,l]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,u],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[1,l],[1,u],[s,0]])},ds=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rb={path:[[1,l],[a,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lt"}}),o.polygons&&t.polygons.push([[1,l],[a,1],[s,1],[1,u]])},gs=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate_a(e,i,o.minV,o.maxV);o.polygons_full&&(t.edges.tr={path:[[s,1],[0,l]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[a,1]],move:{x:0,y:1,enter:"bl"}}),o.polygons&&t.polygons.push([[s,1],[0,l],[0,u],[a,1]])},ys=function(t,e,n,r,i,o){var a=o.interpolate_a(e,i,o.minV,o.maxV),s=o.interpolate_b(e,i,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lt={path:[[0,s],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[0,a]],move:{x:-1,y:0,enter:"rb"}}),o.polygons&&t.polygons.push([[0,a],[0,s],[1,u],[1,l]])},vs=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate_b(e,n,o.minV,o.maxV),l=o.interpolate_a(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.tr={path:[[s,1],[u,0]],move:{x:0,y:-1,enter:"tr"}},t.edges.bl={path:[[l,0],[a,1]],move:{x:0,y:1,enter:"bl"}}),o.polygons&&t.polygons.push([[l,0],[a,1],[s,1],[u,0]])},ms=function(t,e,n,r,i,o){var a=o.interpolate(i,r,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[a,1],[1,s]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[a,1],[1,s],[1,0]])},_s=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[1,1],[1,0]])},bs=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,s],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[1,1],[1,s],[a,0]])},ws=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[s,0],[0,a]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,a],[0,1],[1,1],[1,0],[s,0]])},xs=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[0,a]],move:{x:-1,y:0,enter:"rt"}}),o.polygons&&t.polygons.push([[0,a],[0,1],[s,1],[1,u],[1,l]])},Os=function(t,e,n,r,i,o){var a=o.interpolate(n,r,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,n,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.rt={path:[[1,a],[s,0]],move:{x:0,y:-1,enter:"tr"}},t.edges.bl={path:[[u,0],[l,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[l,1],[1,1],[1,a],[s,0],[u,0]])},Es=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,u],[1,l],[1,0]])},Ss=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate_a(i,r,o.minV,o.maxV),u=o.interpolate_b(i,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[u,1],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[u,1],[l,0]])},Ms=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(e,n,o.minV,o.maxV),l=o.interpolate_a(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[l,0],[0,a]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[s,1],[u,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[0,a],[0,1],[s,1],[u,0],[l,0]])},Ps=function(t,e,n,r,i,o){var a=o.interpolate_a(e,i,o.minV,o.maxV),s=o.interpolate_b(e,i,o.minV,o.maxV),u=o.interpolate(i,r,o.minV,o.maxV),l=o.interpolate(n,i,o.minV,o.maxV);o.polygons_full&&(t.edges.lt={path:[[0,s],[u,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,l],[0,a]],move:{x:-1,y:0,enter:"rb"}}),o.polygons&&t.polygons.push([[0,a],[0,s],[u,1],[1,1],[1,l]])},Ns=function(t,e,n,r,i,o){var a=o.interpolate_a(i,r,o.minV,o.maxV),s=o.interpolate_b(i,r,o.minV,o.maxV),u=o.interpolate(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[l,0],[a,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,1],[s,1],[1,u],[1,0],[l,0]])},Cs=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate_b(n,r,o.minV,o.maxV),u=o.interpolate_a(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[1,s]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,u],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[1,s],[1,u],[l,0]])},ks=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate_a(i,r,o.minV,o.maxV),u=o.interpolate_b(i,r,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[u,1],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[u,1],[1,l],[1,0]])},js=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[l,1]],move:{x:0,y:1,enter:"br"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,u],[l,1],[1,1],[1,0]])},Ls=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate(e,i,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rt"}},t.edges.rt={path:[[1,l],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,1],[1,1],[1,l],[s,0]])},Is=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate_b(n,r,o.minV,o.maxV),l=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.tl={path:[[s,1],[1,u]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,l],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,1],[s,1],[1,u],[1,l],[a,0]])},As=function(t,e,n,r,i,o){var a=o.interpolate(e,i,o.minV,o.maxV),s=o.interpolate(i,r,o.minV,o.maxV),u=o.interpolate(n,r,o.minV,o.maxV),l=o.interpolate(e,n,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,a],[s,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,u],[l,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,a],[s,1],[1,1],[1,u],[l,0]])},Ts=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV),u=o.interpolate(i,r,o.minV,o.maxV),l=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[u,1],[1,l]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,1],[u,1],[1,l],[1,0]])},Rs=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV),c=o.interpolate(i,r,o.minV,o.maxV),h=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[c,1]],move:{x:0,y:1,enter:"br"}},t.edges.rt={path:[[1,h],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,l],[c,1],[1,1],[1,h],[s,0]])},Fs=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate(e,i,o.minV,o.maxV),u=o.interpolate_a(i,r,o.minV,o.maxV),l=o.interpolate_b(i,r,o.minV,o.maxV),c=o.interpolate_b(n,r,o.minV,o.maxV),h=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.lb={path:[[0,s],[u,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[l,1],[1,c]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,h],[a,0]],move:{x:0,y:-1,enter:"tl"}}),o.polygons&&t.polygons.push([[0,0],[0,s],[u,1],[l,1],[1,c],[1,h],[a,0]])},Ds=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate(e,i,o.minV,o.maxV),l=o.interpolate(i,r,o.minV,o.maxV),c=o.interpolate_b(n,r,o.minV,o.maxV),h=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rt"}},t.edges.tl={path:[[l,1],[1,c]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,h],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,1],[l,1],[1,c],[1,h],[s,0]])},Gs=function(t,e,n,r,i,o){var a=o.interpolate(e,n,o.minV,o.maxV),s=o.interpolate_a(e,i,o.minV,o.maxV),u=o.interpolate_b(e,i,o.minV,o.maxV),l=o.interpolate_a(i,r,o.minV,o.maxV),c=o.interpolate_b(i,r,o.minV,o.maxV),h=o.interpolate(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.br={path:[[a,0],[0,s]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,u],[l,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[c,1],[1,h]],move:{x:1,y:0,enter:"lb"}}),o.polygons&&t.polygons.push([[a,0],[0,s],[0,u],[l,1],[c,1],[1,h],[1,0]])},Bs=function(t,e,n,r,i,o){var a=o.interpolate_a(e,n,o.minV,o.maxV),s=o.interpolate_b(e,n,o.minV,o.maxV),u=o.interpolate_a(e,i,o.minV,o.maxV),l=o.interpolate_b(e,i,o.minV,o.maxV),c=o.interpolate_a(i,r,o.minV,o.maxV),h=o.interpolate_b(i,r,o.minV,o.maxV),f=o.interpolate_b(n,r,o.minV,o.maxV),p=o.interpolate_a(n,r,o.minV,o.maxV);o.polygons_full&&(t.edges.bl={path:[[a,0],[0,u]],move:{x:-1,y:0,enter:"rb"}},t.edges.lt={path:[[0,l],[c,1]],move:{x:0,y:1,enter:"bl"}},t.edges.tr={path:[[h,1],[1,f]],move:{x:1,y:0,enter:"lt"}},t.edges.rb={path:[[1,p],[s,0]],move:{x:0,y:-1,enter:"tr"}}),o.polygons&&t.polygons.push([[a,0],[0,u],[0,l],[c,1],[h,1],[1,f],[1,p],[s,0]])};function qs(t,e,n,r){var i,o,a,s=!1,u=null,l=null,c=null,h=null,f=!1,p=[],d=[],g=[];if(!t)throw new Error("data is required");if(null==e)throw new Error("lowerBound is required");if(null==n)throw new Error("bandWidth is required");if(a=function(t){var e,n,r,i,o;for(i=new Za,t=t||{},o=Object.keys(i),e=0;en||t[s][i-1]n){r=!1;break}if(r&&(t[o-1][0]n||t[o-1][i-1]n)&&(r=!1),r)for(a=0;an||t[o-1][a]n){r=!1;break}return r}(t,n.minV,n.maxV)&&(n.linearRing?b.push([[0,0],[0,w],[x,w],[x,0],[0,0]]):b.push([[0,0],[0,w],[x,w],[x,0]])),e.forEach((function(t,N){t.forEach((function(t,C){for(r=null,o=0;o<8;o++)if(r=M[o],"object"===v(t.edges[r])){for(i=[],a=t.edges[r],l=r,c=N,h=C,f=!1,p=[N+a.path[0][0],C+a.path[0][1]],i.push(p);!f&&"object"===v((d=e[c][h]).edges[l]);)if(a=d.edges[l],delete d.edges[l],(m=a.path[1])[0]+=c,m[1]+=h,i.push(m),l=a.move.enter,c+=a.move.x,h+=a.move.y,void 0===e[c]||void 0===e[c][h]){if(g=0,y=0,c===x)c--,g=0;else if(c<0)c++,g=2;else if(h===w)h--,g=3;else{if(!(h<0))throw new Error("Left the grid somewhere in the interior!");h++,g=1}if(c===N&&h===C&&g===P[r]){f=!0,l=r;break}for(;;){if(_=!1,y>4)throw new Error("Direction change counter overflow! This should never happen!");if(void 0!==e[c]&&void 0!==e[c][h])for(d=e[c][h],s=0;so?2:af?128:64,a|=uf?32:16,a|=lf?8:4,o=0,i={cval:a=+(a|=cf?2:1),polygons:[],edges:{},x0:c,x1:l,x2:u,x3:s,x:e,y:n},a){case 85:rs(i,c,l,u,s,r);case 0:case 170:break;case 169:is(i,c,l,u,s,r);break;case 166:os(i,c,l,u,s,r);break;case 154:as(i,c,l,u,s,r);break;case 106:ss(i,c,l,u,s,r);break;case 1:is(i,c,l,u,s,r);break;case 4:os(i,c,l,u,s,r);break;case 16:as(i,c,l,u,s,r);break;case 64:ss(i,c,l,u,s,r);break;case 168:fs(i,c,l,u,s,r);break;case 162:ps(i,c,l,u,s,r);break;case 138:ds(i,c,l,u,s,r);break;case 42:gs(i,c,l,u,s,r);break;case 2:fs(i,c,l,u,s,r);break;case 8:ps(i,c,l,u,s,r);break;case 32:ds(i,c,l,u,s,r);break;case 128:gs(i,c,l,u,s,r);break;case 5:cs(i,c,l,u,s,r);break;case 20:ls(i,c,l,u,s,r);break;case 80:us(i,c,l,u,s,r);break;case 65:hs(i,c,l,u,s,r);break;case 165:cs(i,c,l,u,s,r);break;case 150:ls(i,c,l,u,s,r);break;case 90:us(i,c,l,u,s,r);break;case 105:hs(i,c,l,u,s,r);break;case 160:ys(i,c,l,u,s,r);break;case 130:vs(i,c,l,u,s,r);break;case 10:ys(i,c,l,u,s,r);break;case 40:vs(i,c,l,u,s,r);break;case 101:ms(i,c,l,u,s,r);break;case 149:_s(i,c,l,u,s,r);break;case 86:ws(i,c,l,u,s,r);break;case 89:bs(i,c,l,u,s,r);break;case 69:ms(i,c,l,u,s,r);break;case 21:_s(i,c,l,u,s,r);break;case 84:ws(i,c,l,u,s,r);break;case 81:bs(i,c,l,u,s,r);break;case 96:xs(i,c,l,u,s,r);break;case 24:Os(i,c,l,u,s,r);break;case 6:Es(i,c,l,u,s,r);break;case 129:Ss(i,c,l,u,s,r);break;case 74:xs(i,c,l,u,s,r);break;case 146:Os(i,c,l,u,s,r);break;case 164:Es(i,c,l,u,s,r);break;case 41:Ss(i,c,l,u,s,r);break;case 66:Ms(i,c,l,u,s,r);break;case 144:Ps(i,c,l,u,s,r);break;case 36:Ns(i,c,l,u,s,r);break;case 9:Cs(i,c,l,u,s,r);break;case 104:Ms(i,c,l,u,s,r);break;case 26:Ps(i,c,l,u,s,r);break;case 134:Ns(i,c,l,u,s,r);break;case 161:Cs(i,c,l,u,s,r);break;case 37:ks(i,c,l,u,s,r);break;case 148:js(i,c,l,u,s,r);break;case 82:Ls(i,c,l,u,s,r);break;case 73:Is(i,c,l,u,s,r);break;case 133:ks(i,c,l,u,s,r);break;case 22:js(i,c,l,u,s,r);break;case 88:Ls(i,c,l,u,s,r);break;case 97:Is(i,c,l,u,s,r);break;case 145:case 25:As(i,c,l,u,s,r);break;case 70:case 100:Ts(i,c,l,u,s,r);break;case 17:0===(o=zs(c,l,u,s,h,f))?(is(i,c,l,u,s,r),as(i,c,l,u,s,r)):As(i,c,l,u,s,r);break;case 68:0===(o=zs(c,l,u,s,h,f))?(ss(i,c,l,u,s,r),os(i,c,l,u,s,r)):Ts(i,c,l,u,s,r);break;case 153:2===(o=zs(c,l,u,s,h,f))?(is(i,c,l,u,s,r),as(i,c,l,u,s,r)):As(i,c,l,u,s,r);break;case 102:2===(o=zs(c,l,u,s,h,f))?(ss(i,c,l,u,s,r),os(i,c,l,u,s,r)):Ts(i,c,l,u,s,r);break;case 152:2===(o=zs(c,l,u,s,h,f))?(as(i,c,l,u,s,r),fs(i,c,l,u,s,r)):Rs(i,c,l,u,s,r);break;case 137:2===(o=zs(c,l,u,s,h,f))?(is(i,c,l,u,s,r),ds(i,c,l,u,s,r)):Fs(i,c,l,u,s,r);break;case 98:2===(o=zs(c,l,u,s,h,f))?(ss(i,c,l,u,s,r),ps(i,c,l,u,s,r)):Ds(i,c,l,u,s,r);break;case 38:2===(o=zs(c,l,u,s,h,f))?(os(i,c,l,u,s,r),gs(i,c,l,u,s,r)):Gs(i,c,l,u,s,r);break;case 18:0===(o=zs(c,l,u,s,h,f))?(as(i,c,l,u,s,r),fs(i,c,l,u,s,r)):Rs(i,c,l,u,s,r);break;case 33:0===(o=zs(c,l,u,s,h,f))?(is(i,c,l,u,s,r),ds(i,c,l,u,s,r)):Fs(i,c,l,u,s,r);break;case 72:0===(o=zs(c,l,u,s,h,f))?(ss(i,c,l,u,s,r),ps(i,c,l,u,s,r)):Ds(i,c,l,u,s,r);break;case 132:0===(o=zs(c,l,u,s,h,f))?(os(i,c,l,u,s,r),gs(i,c,l,u,s,r)):Gs(i,c,l,u,s,r);break;case 136:0===(o=zs(c,l,u,s,h,f))?(gs(i,c,l,u,s,r),ps(i,c,l,u,s,r)):1===o?Bs(i,c,l,u,s,r):(fs(i,c,l,u,s,r),ds(i,c,l,u,s,r));break;case 34:0===(o=zs(c,l,u,s,h,f))?(fs(i,c,l,u,s,r),ds(i,c,l,u,s,r)):1===o?Bs(i,c,l,u,s,r):(gs(i,c,l,u,s,r),ps(i,c,l,u,s,r))}return i}}var Vs=Object.defineProperty,Ys=Object.getOwnPropertySymbols,Ws=Object.prototype.hasOwnProperty,Xs=Object.prototype.propertyIsEnumerable,Hs=function(t,e,n){return e in t?Vs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Zs=function(t,e){for(var n in e||(e={}))Ws.call(e,n)&&Hs(t,n,e[n]);if(Ys){var r,i=s(Ys(e));try{for(i.s();!(r=i.n()).done;)n=r.value,Xs.call(e,n)&&Hs(t,n,e[n])}catch(t){i.e(t)}finally{i.f()}}return t};function Ks(t){var e=t.map((function(t){return{ring:t,area:Nt(M([t]))}}));return e.sort((function(t,e){return e.area-t.area})),e.map((function(t){return t.ring}))}function Js(t){for(var e=t.map((function(t){return{lrCoordinates:t,grouped:!1}})),n=[];!Qs(e);)for(var r=0;r=0&&l<=1&&(f.onLine1=!0),c>=0&&c<=1&&(f.onLine2=!0),!(!f.onLine1||!f.onLine2)&&[f.x,f.y])}function su(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xt(t,(function(t,n){var r=n.geometry.coordinates;return t+st(r[0],r[1],e)}),0)}function uu(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.steps||64,a=lu(n),s=lu(r),u=Array.isArray(t)||"Feature"!==t.type?{}:t.properties;if(a===s)return N(Ei(t,e,i).geometry.coordinates[0],u);for(var l=a,c=a=c&&h===i.length-1);h++){if(c>e&&0===o.length){if(!(a=e-c))return o.push(i[h]),N(o);s=ot(i[h],i[h-1])-180,u=at(i[h],a,s,r),o.push(u.geometry.coordinates)}if(c>=n)return(a=n-c)?(s=ot(i[h],i[h-1])-180,u=at(i[h],a,s,r),o.push(u.geometry.coordinates),N(o)):(o.push(i[h]),N(o));if(c>=e&&o.push(i[h]),h===i.length-1)return N(o);c+=st(i[h],i[h+1],r)}if(c0){var s=r[e-1],u=function(t,e){return!function(t,e){return 0===fu(hu(t),hu(e))}(t,e)&&function(t,e){var n,r,i=t[0],o=hu(t),a=e[0],s=hu(e),u=fu(o,s);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(i,function(t,e){return[t*e[0],t*e[1]]}(fu((r=i,[(n=a)[0]-r[0],n[1]-r[1]]),s)/u,o))}(t,e)}(n,s);!1!==u&&(s[1]=u,n[0]=u),a.push(s[0]),e===o.length-2&&(a.push(n[0]),a.push(n[1]))}2===o.length&&(a.push(n[0]),a.push(n[1]))}var l,c,h,f,p,d})),N(a,t.properties)}function du(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(st(t.slice(0,2),[r,n])>=st(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var a=(e+r)/2;return[a-(i-n)/2,n,a+(i-n)/2,i]}function gu(t,e){if(!W(e=null!=e?e:{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw new Error(" is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof r)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return ct(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r1&&n.push(N(l)),k(n)}function mu(t,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var n,r=1/0;return dt(e,(function(e){var i=ln(e,t).properties.dist;iu?(s.unshift(t),u=e):s.push(t)}else s.push(t)})),M(s,e);default:throw new Error("geometry type "+a+" is not supported")}}function wu(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],a=i[1];return n===o&&r===a||t.push(e),t}function xu(t){return I(t)}function Ou(t){var e,n=0,r=s(t);try{for(r.s();!(e=r.n()).done;)n+=e.value}catch(t){r.e(t)}finally{r.f()}return n/t.length}var Eu=Object.defineProperty,Su=Object.defineProperties,Mu=Object.getOwnPropertyDescriptors,Pu=Object.getOwnPropertySymbols,Nu=Object.prototype.hasOwnProperty,Cu=Object.prototype.propertyIsEnumerable,ku=function(t,e,n){return e in t?Eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},ju=function(t,e){for(var n in e||(e={}))Nu.call(e,n)&&ku(t,n,e[n]);if(Pu){var r,i=s(Pu(e));try{for(i.s();!(r=i.n()).done;)n=r.value,Cu.call(e,n)&&ku(t,n,e[n])}catch(t){i.e(t)}finally{i.f()}}return t},Lu=function(t,e){return Su(t,Mu(e))};function Iu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var r=1/0,i=0;dt(e,(function(e,o){var a=st(t,e,n);a2&&void 0!==arguments[2]?arguments[2]:{},o=null!=(n=i.method)?n:"geodesic",a=null!=(r=i.units)?r:"kilometers";if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=E(t):"Point"===t.type?t=x(t):tt(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=N(e):"LineString"===e.type?e=x(e):tt(e,"LineString","line");var s=1/0,u=t.geometry.coordinates;return wt(e,(function(t){if(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],r=function(t,e,n,r){if("geodesic"===r.method)return ln(N([e,n]).geometry,t,{units:"degrees"}).properties.dist;var i=[n[0]-e[0],n[1]-e[1]],o=Tu([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return Sa(t,e,{units:"degrees"});var a=Tu(i,i);if(a<=o)return Sa(t,n,{units:"degrees"});var s=o/a;return Sa(t,[e[0]+s*i[0],e[1]+s*i[1]],{units:"degrees"})}(u,e,n,{method:o});r0)-(t<0)||+t}(r*(n[1]-e[1])-o*i)}function Yu(t,e){return e.geometry.coordinates[0].every((function(e){return qt(E(e),t)}))}var Wu=a((function t(e){i(this,t),this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}),[{key:"removeInnerEdge",value:function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))}},{key:"removeOuterEdge",value:function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))}},{key:"addOuterEdge",value:function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1}},{key:"sortOuterEdges",value:function(){var t=this;this.outerEdgesSorted||(this.outerEdges.sort((function(e,n){var r=e.to,i=n.to;if(r.coordinates[0]-t.coordinates[0]>=0&&i.coordinates[0]-t.coordinates[0]<0)return 1;if(r.coordinates[0]-t.coordinates[0]<0&&i.coordinates[0]-t.coordinates[0]>=0)return-1;if(r.coordinates[0]-t.coordinates[0]==0&&i.coordinates[0]-t.coordinates[0]==0)return r.coordinates[1]-t.coordinates[1]>=0||i.coordinates[1]-t.coordinates[1]>=0?r.coordinates[1]-i.coordinates[1]:i.coordinates[1]-r.coordinates[1];var o=Vu(t.coordinates,r.coordinates,i.coordinates);return o<0?1:o>0?-1:Math.pow(r.coordinates[0]-t.coordinates[0],2)+Math.pow(r.coordinates[1]-t.coordinates[1],2)-(Math.pow(i.coordinates[0]-t.coordinates[0],2)+Math.pow(i.coordinates[1]-t.coordinates[1],2))})),this.outerEdgesSorted=!0)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(t){return this.sortOuterEdges(),this.outerEdges[t]}},{key:"addInnerEdge",value:function(t){this.innerEdges.push(t)}}],[{key:"buildId",value:function(t){return t.join(",")}}]),Xu=function(){function t(e,n){i(this,t),this.from=e,this.to=n,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return a(t,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}},{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(t){return this.from.id===t.from.id&&this.to.id===t.to.id}},{key:"toString",value:function(){return"Edge { ".concat(this.from.id," -> ").concat(this.to.id," }")}},{key:"toLineString",value:function(){return N([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return Vu(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}])}(),Hu=a((function t(){i(this,t),this.edges=[],this.polygon=void 0,this.envelope=void 0}),[{key:"push",value:function(t){this.edges.push(t),this.polygon=this.envelope=void 0}},{key:"get",value:function(t){return this.edges[t]}},{key:"length",get:function(){return this.edges.length}},{key:"forEach",value:function(t){this.edges.forEach(t)}},{key:"map",value:function(t){return this.edges.map(t)}},{key:"some",value:function(t){return this.edges.some(t)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value:function(){var t=this,e=this.edges.reduce((function(e,n,r){return n.from.coordinates[1]>t.edges[e].from.coordinates[1]&&(e=r),e}),0),n=(0===e?this.length:e)-1,r=(e+1)%this.length,i=Vu(this.edges[n].from.coordinates,this.edges[e].from.coordinates,this.edges[r].from.coordinates);return 0===i?this.edges[n].from.coordinates[0]>this.edges[r].from.coordinates[0]:i>0}},{key:"toMultiPoint",value:function(){return L(this.edges.map((function(t){return t.from.coordinates})))}},{key:"toPolygon",value:function(){if(this.polygon)return this.polygon;var t=this.edges.map((function(t){return t.from.coordinates}));return t.push(this.edges[0].from.coordinates),this.polygon=M([t])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=Ca(this.toPolygon())}},{key:"inside",value:function(t){return qt(t,this.toPolygon())}}],[{key:"findEdgeRingContaining",value:function(t,e){var n,r,i=t.getEnvelope();return e.forEach((function(e){var o,a,u,l,c,h,f=e.getEnvelope();if(r&&(n=r.getEnvelope()),a=i,u=(o=f).geometry.coordinates[0].map((function(t){return t[0]})),l=o.geometry.coordinates[0].map((function(t){return t[1]})),c=a.geometry.coordinates[0].map((function(t){return t[0]})),h=a.geometry.coordinates[0].map((function(t){return t[1]})),(Math.max.apply(null,u)!==Math.max.apply(null,c)||Math.max.apply(null,l)!==Math.max.apply(null,h)||Math.min.apply(null,u)!==Math.min.apply(null,c)||Math.min.apply(null,l)!==Math.min.apply(null,h))&&Yu(f,i)){var p,d,g=s(t.map((function(t){return t.from.coordinates})));try{var y=function(){var t=d.value;e.some((function(e){return n=t,r=e.from.coordinates,n[0]===r[0]&&n[1]===r[1];var n,r}))||(p=t)};for(g.s();!(d=g.n()).done;)y()}catch(t){g.e(t)}finally{g.f()}p&&e.inside(E(p))&&(r&&!Yu(n,f)||(r=e))}})),r}}]),Zu=function(){function t(){i(this,t),this.edges=[],this.nodes={}}return a(t,[{key:"getNode",value:function(t){var e=Wu.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new Wu(t)),n}},{key:"addEdge",value:function(t,e){var n=new Xu(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)}},{key:"deleteDangles",value:function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))}},{key:"_removeIfDangle",value:function(t){var e=this;if(t.innerEdges.length<=1){var n=t.getOuterEdges().map((function(t){return t.to}));this.removeNode(t),n.forEach((function(t){return e._removeIfDangle(t)}))}}},{key:"deleteCutEdges",value:function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach((function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))}))}},{key:"_computeNextCWEdges",value:function(t){var e=this;void 0===t?Object.keys(this.nodes).forEach((function(t){return e._computeNextCWEdges(e.nodes[t])})):t.getOuterEdges().forEach((function(e,n){t.getOuterEdge((0===n?t.getOuterEdges().length:n)-1).symetric.next=e}))}},{key:"_computeNextCCWEdges",value:function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var a=i[o],s=a.symetric,u=void 0,l=void 0;a.label===e&&(u=a),s.label===e&&(l=s),u&&l&&(l&&(r=l),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)}},{key:"_findLabeledEdgeRings",value:function(){var t=[],e=0;return this.edges.forEach((function(n){if(!(n.label>=0)){t.push(n);var r=n;do{r.label=e,r=r.next}while(!n.isEqual(r));e++}})),t}},{key:"getEdgeRings",value:function(){var t=this;this._computeNextCWEdges(),this.edges.forEach((function(t){t.label=void 0})),this._findLabeledEdgeRings().forEach((function(e){t._findIntersectionNodes(e).forEach((function(n){t._computeNextCCWEdges(n,e.label)}))}));var e=[];return this.edges.forEach((function(n){n.ring||e.push(t._findEdgeRing(n))})),e}},{key:"_findIntersectionNodes",value:function(t){var e=[],n=t,r=function(){var r=0;n.from.getOuterEdges().forEach((function(e){e.label===t.label&&++r})),r>1&&e.push(n.from),n=n.next};do{r()}while(!t.isEqual(n));return e}},{key:"_findEdgeRing",value:function(t){var e=t,n=new Hu;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n}},{key:"removeNode",value:function(t){var e=this;t.getOuterEdges().forEach((function(t){return e.removeEdge(t)})),t.innerEdges.forEach((function(t){return e.removeEdge(t)})),delete this.nodes[t.id]}},{key:"removeEdge",value:function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()}}],[{key:"fromGeoJson",value:function(e){!function(t){if(!t)throw new Error("No geojson passed");if("FeatureCollection"!==t.type&&"GeometryCollection"!==t.type&&"MultiLineString"!==t.type&&"LineString"!==t.type&&"Feature"!==t.type)throw new Error("Invalid input type '".concat(t.type,"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature"))}(e);var n=new t;return _t(e,(function(t){tt(t,"LineString","Graph::fromGeoJson"),ht(t,(function(t,e){if(t){var r=n.getNode(t),i=n.getNode(e);n.addEdge(r,i)}return e}))})),n}}])}();function Ku(t,e){var n,r;ct(t,(function(t,i,o,a,s){if(r!==s)e.push([]);else{var u=n[0],l=n[1],c=t[0],h=t[1];e[s].push([.75*u+.25*c,.75*l+.25*h]),e[s].push([.25*u+.75*c,.25*l+.75*h])}n=t,r=s}),!1),e.forEach((function(t){t.push(t[0])}))}function Ju(t,e){var n,r,i;ct(t,(function(t,o,a,s,u){if(r!==s)e.push([[]]);else if(i!==u)e[s].push([]);else{var l=n[0],c=n[1],h=t[0],f=t[1];e[s][u].push([.75*l+.25*h,.75*c+.25*f]),e[s][u].push([.25*l+.75*h,.25*c+.75*f])}n=t,r=s,i=u}),!1),e.forEach((function(t){t.forEach((function(t){t.push(t[0])}))}))}function $u(t,e,n,r,i){for(var o=0;o0?tl(e,a,r)<0||(r=a):n>0&&u<=0&&(Qu(e,a,i)||(i=a)),n=u}return[r,i]}function Qu(t,e,n){return tl(t,e,n)>0}function tl(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function el(t){return rl(t,"mercator",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function nl(t){return rl(t,"wgs84",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}function rl(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(n=n||{}).mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&Y(t[0])?t="mercator"===e?il(t):ol(t):(!0!==r&&(t=Si(t)),ct(t,(function(t){var n="mercator"===e?il(t):ol(t);t[0]=n[0],t[1]=n[1]}))),t}function il(t){var e=Math.PI/180,n=6378137,r=20037508.342789244,i=[n*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return i[0]>r&&(i[0]=r),i[0]<-r&&(i[0]=-r),i[1]>r&&(i[1]=r),i[1]<-r&&(i[1]=-r),i}function ol(t){var e=180/Math.PI,n=6378137;return[t[0]*e/n,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/n)))*e]}var al=Object.freeze({__proto__:null,toMercator:el,toWgs84:nl}),sl={20:1.07275,15:1.13795,10:1.22385,5:1.3581,2:1.51743,1:1.62762};function ul(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function ll(t){var e=[];return function t(n){return 0===n||1===n?1:e[n]>0?e[n]:e[n]=t(n-1)*n}(t)}function cl(t){return fl(t),hl(t)}function hl(t){return Array.isArray(t)?vl(t):t&&t.bbox?vl(t.bbox):[360*yl(),180*yl()]}function fl(t){null!=t&&(Array.isArray(t)?X(t):null!=t.bbox&&X(t.bbox))}function pl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};fl(e.bbox),null==t&&(t=1);for(var n=[],r=0;r1&&void 0!==arguments[1]?arguments[1]:{};fl(e.bbox),null==t&&(t=1),void 0!==e.bbox&&null!==e.bbox||(e.bbox=[-180,-90,180,90]),Y(e.num_vertices)&&void 0!==e.num_vertices||(e.num_vertices=10),Y(e.max_radial_length)&&void 0!==e.max_radial_length||(e.max_radial_length=10);var n=Math.abs(e.bbox[0]-e.bbox[2]),r=Math.abs(e.bbox[1]-e.bbox[3]),i=Math.min(n/2,r/2);if(e.max_radial_length>i)throw new Error("max_radial_length is greater than the radius of the bbox");for(var o=[e.bbox[0]+e.max_radial_length,e.bbox[1]+e.max_radial_length,e.bbox[2]-e.max_radial_length,e.bbox[3]-e.max_radial_length],a=[],s=function(){var t,n=[],r=g(Array(e.num_vertices+1)).map(Math.random);r.forEach((function(t,e,n){n[e]=e>0?t+n[e-1]:t})),r.forEach((function(t){t=2*t*Math.PI/r[r.length-1];var i=Math.random();n.push([i*(e.max_radial_length||10)*Math.sin(t),i*(e.max_radial_length||10)*Math.cos(t)])})),n[n.length-1]=n[0],n=n.reverse().map((t=hl(o),function(e){return[e[0]+t[0],e[1]+t[1]]})),a.push(M([n]))},u=0;u1&&void 0!==arguments[1]?arguments[1]:{};if(!W(e=e||{}))throw new Error("options is invalid");var n=e.bbox;fl(n);var r=e.num_vertices,i=e.max_length,o=e.max_rotation;null==t&&(t=1),(!Y(r)||void 0===r||r<2)&&(r=10),Y(i)&&void 0!==i||(i=1e-4),Y(o)&&void 0!==o||(o=Math.PI/8);for(var a=[],s=0;s0;){var l=s.pop();if(l===n)return Sl(l);l.closed=!0;for(var c=t.neighbors(l),h=0,f=c.length;h1?(r=n[0],i=n[1]):s>0&&(r+=o*s,i+=a*s)}return(o=t[0]-r)*o+(a=t[1]-i)*a}function Ll(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,i,o){for(var a,s=i,u=n+1;us&&(a=u,s=l)}s>i&&(a-n>1&&t(e,n,a,i,o),o.push(e[a]),r-a>1&&t(e,a,r,i,o))}(t,0,n,e,r),r.push(t[n]),r}function Il(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return Ll(t=n?t:function(t,e){for(var n,r,i,o,a,s=t[0],u=[s],l=1,c=t.length;le&&(u.push(n),s=n);return s!==n&&u.push(n),u}(t,r),r)}function Al(t,e,n){return t.map((function(t){if(t.length<4)throw new Error("invalid polygon");for(var r=e,i=Il(t,r,n);!Tl(i);)i=Il(t,r-=.01*r,n);return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function Tl(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}function Rl(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}Pl.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t0&&(this.content[0]=e,this.bubbleUp(0)),t},remove:function(t){var e=this.content.indexOf(t),n=this.content.pop();e!==this.content.length-1&&(this.content[e]=n,this.scoreFunction(n)0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)80*i){o=s=t[0],a=c=t[1];for(var _=i;_s&&(s=h),p>c&&(c=p);d=0!==(d=Math.max(s-o,c-a))?32767/d:0}return r(v,m,i,o,a,d,0),m}function e(t,e,n,r,i){var o,a;if(i===S(t,e,n,r)>0)for(o=e;o=e;o-=r)a=x(o,t[o],t[o+1],a);return a&&y(a,a.next)&&(O(a),a=a.next),a}function n(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!y(r,r.next)&&0!==g(r.prev,r,r.next))r=r.next;else{if(O(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function r(t,e,u,l,c,f,p){if(t){!p&&f&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=h(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,l,c,f);for(var d,g,y=t;t.prev!==t.next;)if(d=t.prev,g=t.next,f?o(t,l,c,f):i(t))e.push(d.i/u|0),e.push(t.i/u|0),e.push(g.i/u|0),O(t),t=g.next,y=g.next;else if((t=g)===y){p?1===p?r(t=a(n(t),e,u),e,u,l,c,f,2):2===p&&s(t,e,u,l,c,f):r(n(t),e,u,l,c,f,1);break}}}function i(t){var e=t.prev,n=t,r=t.next;if(g(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,a=r.x,s=e.y,u=n.y,l=r.y,c=io?i>a?i:a:o>a?o:a,d=s>u?s>l?s:l:u>l?u:l,y=r.next;y!==e;){if(y.x>=c&&y.x<=f&&y.y>=h&&y.y<=d&&p(i,s,o,u,a,l,y.x,y.y)&&g(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function o(t,e,n,r){var i=t.prev,o=t,a=t.next;if(g(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,f=o.y,d=a.y,y=su?s>l?s:l:u>l?u:l,_=c>f?c>d?c:d:f>d?f:d,b=h(y,v,e,n,r),w=h(m,_,e,n,r),x=t.prevZ,O=t.nextZ;x&&x.z>=b&&O&&O.z<=w;){if(x.x>=y&&x.x<=m&&x.y>=v&&x.y<=_&&x!==i&&x!==a&&p(s,c,u,f,l,d,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,O.x>=y&&O.x<=m&&O.y>=v&&O.y<=_&&O!==i&&O!==a&&p(s,c,u,f,l,d,O.x,O.y)&&g(O.prev,O,O.next)>=0)return!1;O=O.nextZ}for(;x&&x.z>=b;){if(x.x>=y&&x.x<=m&&x.y>=v&&x.y<=_&&x!==i&&x!==a&&p(s,c,u,f,l,d,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;O&&O.z<=w;){if(O.x>=y&&O.x<=m&&O.y>=v&&O.y<=_&&O!==i&&O!==a&&p(s,c,u,f,l,d,O.x,O.y)&&g(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function a(t,e,r){var i=t;do{var o=i.prev,a=i.next.next;!y(o,a)&&v(o,i,i.next,a)&&b(o,a)&&b(a,o)&&(e.push(o.i/r|0),e.push(i.i/r|0),e.push(a.i/r|0),O(i),O(i.next),i=t=a),i=i.next}while(i!==t);return n(i)}function s(t,e,i,o,a,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&d(u,l)){var c=w(u,l);return u=n(u,u.next),c=n(c,c.next),r(u,e,i,o,a,s,0),void r(c,e,i,o,a,s,0)}l=l.next}u=u.next}while(u!==t)}function u(t,e){return t.x-e.x}function l(t,e){var r=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a&&(a=s,n=r.x=r.x&&r.x>=h&&i!==r.x&&p(on.x||r.x===n.x&&c(n,r)))&&(n=r,d=u)),r=r.next}while(r!==l);return n}(t,e);if(!r)return e;var i=w(r,t);return n(i,i.next),n(r,r.next)}function c(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function h(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,n=t;do{(e.x=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function d(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&v(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||y(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function v(t,e,n,r){var i=_(g(t,e,n)),o=_(g(t,e,r)),a=_(g(n,r,t)),s=_(g(n,r,e));return i!==o&&a!==s||!(0!==i||!m(t,n,e))||!(0!==o||!m(t,r,e))||!(0!==a||!m(n,t,r))||!(0!==s||!m(n,e,r))}function m(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function _(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function w(t,e){var n=new E(t.i,t.x,t.y),r=new E(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function x(t,e,n,r){var i=new E(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function O(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function E(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,n,r){for(var i=0,o=e,a=n-r;o0&&(r+=t[i-1].length,n.holes.push(r))}return n},Dl.exports}());function Bl(t){var e=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=Gl(e.vertices,e.holes,2),r=[],i=[];n.forEach((function(t,r){var o=n[r];i.push([e.vertices[2*o],e.vertices[2*o+1]])}));for(var o=0;o=1||u<=0||l>=1||l<=0))){var g=d,y=!o[g];y&&(o[g]=!0),e?i.push(e(d,t,n,c,h,u,a,s,f,p,l,y)):i.push(d)}}function g(t,e){var n,i,o,a,s=r[t][e],u=r[t][e+1];return s[0]f[e.isect].coord?-1:1})),l=[];b.length>0;){var S=b.pop(),P=S.isect,N=S.parent,C=S.winding,j=l.length,L=[f[P].coord],I=P;if(f[P].ringAndEdge1Walkable)var A=f[P].ringAndEdge1,T=f[P].nxtIsectAlongRingAndEdge1;else A=f[P].ringAndEdge2,T=f[P].nxtIsectAlongRingAndEdge2;for(;!Xl(f[P].coord,f[T].coord);){L.push(f[T].coord);var R=void 0;for(r=0;r1)for(e=0;e=0==e}function Wl(t){for(var e=0,n=0;n0)){if(o/=f,f<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>c&&(c=o)}else if(f>0){if(o0)){if(o/=p,p<0){if(o0){if(o>h)return;o>c&&(c=o)}if(o=i-l,p||!(o<0)){if(o/=p,p<0){if(o>h)return;o>c&&(c=o)}else if(p>0){if(o0||h<1)||(c>0&&(t[0]=[u+c*f,l+c*p]),h<1&&(t[1]=[u+h*f,l+h*p]),!0)}}}}}function sc(t,e,n,r,i){var o=t[1];if(o)return!0;var a,s,u=t[0],l=t.left,c=t.right,h=l[0],f=l[1],p=c[0],d=c[1],g=(h+p)/2,y=(f+d)/2;if(d===f){if(g=r)return;if(h>p){if(u){if(u[1]>=i)return}else u=[g,n];o=[g,i]}else{if(u){if(u[1]1)if(h>p){if(u){if(u[1]>=i)return}else u=[(n-s)/a,n];o=[(i-s)/a,i]}else{if(u){if(u[1]=r)return}else u=[e,a*e+s];o=[r,a*r+s]}else{if(u){if(u[0]=-Cc)){var p=u*u+l*l,d=c*c+h*h,g=(h*p-l*d)/f,y=(u*d-c*p)/f,v=fc.pop()||new pc;v.arc=t,v.site=i,v.x=g+a,v.y=(v.cy=y+s)+Math.sqrt(g*g+y*y),t.circle=v;for(var m=null,_=Mc._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Mc.insert(m,v),m||(hc=v)}}}}function gc(t){var e=t.circle;e&&(e.P||(hc=e.N),Mc.remove(e),fc.push(e),Ql(e),t.circle=null)}var yc=[];function vc(){Ql(this),this.edge=this.site=this.circle=null}function mc(t){var e=yc.pop()||new vc;return e.site=t,e}function _c(t){gc(t),Ec.remove(t),yc.push(t),Ql(t)}function bc(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,a=t.N,s=[t];_c(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)Nc)s=s.L;else{if(!((i=o-Oc(s,a))>Nc)){r>-Nc?(e=s.P,n=s):i>-Nc?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}!function(t){Sc[t.index]={site:t,halfedges:[]}}(t);var u=mc(t);if(Ec.insert(e,u),e||n){if(e===n)return gc(e),n=mc(e.site),Ec.insert(u,n),u.edge=n.edge=rc(e.site,u.site),dc(e),void dc(n);if(n){gc(e),gc(n);var l=e.site,c=l[0],h=l[1],f=t[0]-c,p=t[1]-h,d=n.site,g=d[0]-c,y=d[1]-h,v=2*(f*y-p*g),m=f*f+p*p,_=g*g+y*y,b=[(y*m-p*_)/v+c,(f*_-g*m)/v+h];oc(n.edge,l,d,b),u.edge=rc(l,t,null,b),n.edge=rc(t,d,null,b),dc(e),dc(n)}else u.edge=rc(e.site,u.site)}}function xc(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;var s=(n=a.site)[0],u=n[1],l=u-e;if(!l)return s;var c=s-r,h=1/o-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-u+l/2+i-o/2)))/h+r:(r+s)/2}function Oc(t,e){var n=t.N;if(n)return xc(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var Ec,Sc,Mc,Pc,Nc=1e-6,Cc=1e-12;function kc(t,e){return e[1]-t[1]||e[0]-t[0]}function jc(t,e){var n,r,i,o=t.sort(kc).pop();for(Pc=[],Sc=new Array(t.length),Ec=new $l,Mc=new $l;;)if(i=hc,o&&(!i||o[1]Nc||Math.abs(i[0][1]-i[1][1])>Nc)||delete Pc[o]}(a,s,u,l),function(t,e,n,r){var i,o,a,s,u,l,c,h,f,p,d,g,y=Sc.length,v=!0;for(i=0;iNc||Math.abs(g-f)>Nc)&&(u.splice(s,0,Pc.push(ic(a,p,Math.abs(d-t)Nc?[t,Math.abs(h-t)Nc?[Math.abs(f-r)Nc?[n,Math.abs(h-n)Nc?[Math.abs(f-e)=s)return null;var u=t-i.site[0],l=e-i.site[1],c=u*u+l*l;do{i=o.cells[r=a],a=null,i.halfedges.forEach((function(n){var r=o.edges[n],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=t-s[0],l=e-s[1],h=u*u+l*l;h2&&void 0!==arguments[2]?arguments[2]:{},r=nt(t).coordinates,i=0,o=0;o=i&&o===r.length-1);o++){if(i>=e){var a=e-i;if(a){var s=ot(r[o],r[o-1])-180;return at(r[o],a,s,n)}return E(r[o])}i+=st(r[o],r[o+1],n)}return E(r[r.length-1])},t.angle=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!W(r))throw new Error("options is invalid");if(!t)throw new Error("startPoint is required");if(!e)throw new Error("midPoint is required");if(!n)throw new Error("endPoint is required");var i=t,o=e,a=n,s=G(!0!==r.mercator?ot(o,i):ut(o,i)),u=G(!0!==r.mercator?ot(o,a):ut(o,a));u1&&void 0!==arguments[1]?arguments[1]:{},n=e.resolution||1e4,r=e.sharpness||.85,i=[],o=nt(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),a=new Dt({duration:n,points:o,sharpness:r}),s=function(t){var e=a.pos(t);Math.floor(t/100)%2==0&&i.push([e.x,e.y])},u=0;u0;else if(n!==u>0)return!0}return!1},t.booleanContains=function(t,e){var n=nt(t),r=nt(e),i=n.type,o=r.type,a=n.coordinates,u=r.coordinates;switch(i){case"Point":if("Point"===o)return Wt(a,u);throw new Error("feature2 "+o+" geometry not supported");case"MultiPoint":switch(o){case"Point":return function(t,e){var n,r=!1;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:{}).precision;if("number"!=typeof(n=null==n||isNaN(n)?6:n)||!(n>=0))throw new Error("precision must be a positive number");return nt(t).type===nt(e).type&&Ee(Pe(t),Pe(e),{precision:n})},t.booleanIntersects=je,t.booleanOverlap=function(t,e){var n=nt(t),r=nt(e),i=n.type,o=r.type;if("MultiPoint"===i&&"MultiPoint"!==o||("LineString"===i||"MultiLineString"===i)&&"LineString"!==o&&"MultiLineString"!==o||("Polygon"===i||"MultiPolygon"===i)&&"Polygon"!==o&&"MultiPolygon"!==o)throw new Error("features must be of the same type");if("Point"===i)throw new Error("Point geometry not supported");if(Ee(t,e,{precision:6}))return!1;var a=0;switch(i){case"MultiPoint":for(var s=0;s0},t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==wn(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==wn(e,"line2"))throw new Error("line2 must be a LineString");for(var n=Ke(Pe(t)).features,r=Ke(Pe(e)).features,i=0;i1;case"MultiPoint":for(var i=0;i0&&ae(M([r[0]]),M([r[i]])).features.length>1)return!1}return!0;case"MultiPolygon":for(i=0;i0&&ae(M([o[0]]),M([o[a]])).features.length>1)return!1}return!0;default:return!1}},t.booleanWithin=Pn,t.buffer=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!==v(n))throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return vt(t,(function(t){var n=ni(t,e,r,i);n&&o.push(n)})),k(o);case"FeatureCollection":return dt(t,(function(t){var n=ni(t,e,r,i);n&&dt(n,(function(t){t&&o.push(t)}))})),k(o)}return ni(t,e,r,i)},t.center=jn,t.centerMean=oi,t.centerMedian=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!W(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!Y(n))throw new Error("counter must be a number");var r=e.weight,i=oi(t,{weight:e.weight}),o=k([]);dt(t,(function(t){var e;o.features.push(ai(t,{properties:{weight:null==(e=t.properties)?void 0:e[r]}}))}));var a={tolerance:e.tolerance,medianCandidates:[]};return si(i.geometry.coordinates,[0,0],o,a,n)},t.centerOfMass=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(rt(e)){case"Point":return E(K(e),n.properties);case"Polygon":var r=[];ct(e,(function(t){r.push(t)}));var i,o,a,s,u,l,c,h,f=ai(e,{properties:n.properties}),p=f.geometry.coordinates,d=0,g=0,y=0,v=r.map((function(t){return[t[0]-p[0],t[1]-p[1]]}));for(i=0;i2&&void 0!==arguments[2]?arguments[2]:{};!0!==n.mutate&&(t=Si(t));var r=n.minPoints||3,i=D(e,n.units),o=new Ui(t.features.length),a=t.features.map((function(t){return!1})),s=t.features.map((function(t){return!1})),u=t.features.map((function(t){return!1})),l=t.features.map((function(t){return-1}));o.load(t.features.map((function(t,e){var n=d(t.geometry.coordinates,2),r=n[0],i=n[1];return{minX:r,minY:i,maxX:r,maxY:i,index:e}})));var c=function(n){var r=t.features[n],a=d(r.geometry.coordinates,2),s=a[0],u=a[1],l=Math.max(u-i,-90),c=Math.min(u+i,90),h=l<0&&c>0?i:Math.abs(l)=r){var i=h;h++,a[e]=!0,function(t,e){for(var n=0;n=r&&e.push.apply(e,g(o))}s[i]||(s[i]=!0,l[i]=t)}}(i,n)}else u[e]=!0}})),t.features.forEach((function(e,n){var r=t.features[n];r.properties||(r.properties={}),l[n]>=0?(r.properties.dbscan=u[n]?"edge":"core",r.properties.cluster=l[n]):r.properties.dbscan="noise"})),t},t.clustersKmeans=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.features.length;e.numberOfClusters=e.numberOfClusters||Math.round(Math.sqrt(n/2)),e.numberOfClusters>n&&(e.numberOfClusters=n),!0!==e.mutate&&(t=Si(t));var r=yt(t),i=r.slice(0,e.numberOfClusters),o=Yi(r,e.numberOfClusters,i),a={};return o.centroids.forEach((function(t,e){a[e]=t})),dt(t,(function(t,e){var n=o.idxs[e];t.properties.cluster=n,t.properties.centroid=a[n]})),t},t.collect=function(t,e,n,r){var i=new Wi(6),o=e.features.map((function(t){var e;return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:null==(e=t.properties)?void 0:e[n]}}));return i.load(o),t.features.forEach((function(t){t.properties||(t.properties={});var e=Lt(t),n=i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),o=[];n.forEach((function(e){qt([e.minX,e.minY],t)&&o.push(e.property)})),t.properties[r]=o})),t},t.collectionOf=et,t.combine=function(t){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return dt(t,(function(t){var n,r,i,o;switch(null==(o=t.geometry)?void 0:o.type){case"Point":e.MultiPoint.coordinates.push(t.geometry.coordinates),e.MultiPoint.properties.push(t.properties);break;case"MultiPoint":(n=e.MultiPoint.coordinates).push.apply(n,g(t.geometry.coordinates)),e.MultiPoint.properties.push(t.properties);break;case"LineString":e.MultiLineString.coordinates.push(t.geometry.coordinates),e.MultiLineString.properties.push(t.properties);break;case"MultiLineString":(r=e.MultiLineString.coordinates).push.apply(r,g(t.geometry.coordinates)),e.MultiLineString.properties.push(t.properties);break;case"Polygon":e.MultiPolygon.coordinates.push(t.geometry.coordinates),e.MultiPolygon.properties.push(t.properties);break;case"MultiPolygon":(i=e.MultiPolygon.coordinates).push.apply(i,g(t.geometry.coordinates)),e.MultiPolygon.properties.push(t.properties)}})),k(Object.keys(e).filter((function(t){return e[t].coordinates.length})).sort().map((function(t){return x({type:t,coordinates:e[t].coordinates},{collectedProperties:e[t].properties})})))},t.concave=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxEdge||1/0,r=function(t){var e=[],n={};return dt(t,(function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");Object.prototype.hasOwnProperty.call(n,r)||(e.push(t),n[r]=!0)}})),k(e)}(t),i=Xi(r);if(i.features=i.features.filter((function(t){var r=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],a=st(r,i,e),s=st(i,o,e),u=st(r,o,e);return a<=n&&s<=n&&u<=n})),i.features.length<1)return null;var o=_o(i);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),x(o)},t.containsNumber=$,t.convertArea=V,t.convertLength=U,t.convex=Oi,t.coordAll=yt,t.coordEach=ct,t.coordReduce=ht,t.createBins=Li,t.degreesToRadians=z,t.destination=at,t.difference=function(t){var e=[];if(vt(t,(function(t){e.push(t.coordinates)})),e.length<2)throw new Error("Must have at least two features");var n=t.features[0].properties||{},r=ma.apply(ba,[e[0]].concat(g(e.slice(1))));return 0===r.length?null:1===r.length?M(r[0],n):I(r,n)},t.dissolve=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!W(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;et(t,"Polygon","dissolve");var r=[];if(!n)return wa(I(ya.apply(null,t.features.map((function(t){return t.geometry.coordinates})))));var i={};dt(t,(function(t){t.properties&&(Object.prototype.hasOwnProperty.call(i,t.properties[n])||(i[t.properties[n]]=[]),i[t.properties[n]].push(t))}));for(var o=Object.keys(i),a=0;a1&&void 0!==arguments[1]?arguments[1]:{},o=i.properties,a=null==(e=i.autoComplete)||e,s=null==(n=i.orderCoords)||n;if(null!=(r=i.mutate)&&r||(t=Si(t)),"FeatureCollection"===t.type){var u=[];return t.features.forEach((function(t){u.push(J(bu(t,{},a,s)))})),I(u,o)}return bu(t,o,a,s)},t.mask=function(t,e,n){var r,i=null!=(r=null==n?void 0:n.mutate)&&r,o=e;e&&!1===i&&(o=Si(e));var a,s=function(t){var e=[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return t&&(e="Feature"===t.type?t.geometry.coordinates:t.coordinates),M(e)}(o);return("FeatureCollection"===t.type?xu(2===(a=t).features.length?ya(a.features[0].geometry.coordinates,a.features[1].geometry.coordinates):ya.apply(ba,a.features.map((function(t){return t.geometry.coordinates})))):"Feature"===t.type?xu(ya(t.geometry.coordinates)):xu(ya(t.coordinates))).geometry.coordinates.forEach((function(t){s.geometry.coordinates.push(t[0])})),s},t.meta=Pt,t.midpoint=function(t,e){return at(t,st(t,e)/2,ot(t,e))},t.moranIndex=function(t,e){var n,r,i=e.inputField,o=e.threshold||1e5,a=e.p||2,u=null!=(n=e.binary)&&n,l=Oa(t,{alpha:e.alpha||-1,binary:u,p:a,standardization:null==(r=e.standardization)||r,threshold:o}),c=[];dt(t,(function(t){var e=t.properties||{};c.push(e[i])}));for(var h=Ou(c),f=function(t){var e,n=Ou(t),r=0,i=s(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;r+=Math.pow(o-n,2)}}catch(t){i.e(t)}finally{i.f()}return r/t.length}(c),p=0,d=0,g=0,y=0,v=l.length,m=0;m2&&void 0!==arguments[2]?arguments[2]:{},r=n.units,i=n.properties||{},o=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return vt(t,(function(t){"Point"===t.type&&e.push({type:"Feature",properties:{},geometry:t})})),{type:"FeatureCollection",features:e};case"FeatureCollection":return t.features=t.features.filter((function(t){return"Point"===t.geometry.type})),t;default:throw new Error("points must be a Point Collection")}}(t);if(!o.features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==rt(e))throw new Error("line must be a LineString");var a=1/0,s=null;return dt(o,(function(t){var n=Au(t,e,{units:r});n2&&void 0!==arguments[2]?arguments[2]:{},s=null!=(i=a.method)?i:"geodesic",u=null!=(o=a.units)?o:"kilometers";if(!e)throw new Error("point is required");if(!r)throw new Error("polygon or multi-polygon is required");var l,c=nt(r);if("MultiPolygon"===c.type){var p=c.coordinates.map((function(n){return t(e,M(n),{method:s,units:u})}));return Math.min.apply(Math,g(p.map(Math.abs)))*(qt(e,r)?-1:1)}if(c.coordinates.length>1){var d=c.coordinates.map((function(n){return t(e,M([n]),{method:s,units:u})})),y=n(l=d)||h(l)||m(l)||f(),v=y[0],_=y.slice(1);if(v>=0)return v;var b=Math.min.apply(Math,g(_));return b<0?Math.abs(b):Math.min(b,Math.abs(v))}var w=se(c),x=1/0;return _t(w,(function(t){x=Math.min(x,Au(e,t,{method:s,units:u}))})),qt(e,c)?-x:x},t.points=S,t.pointsWithinPolygon=Uu,t.polygon=M,t.polygonSmooth=function(t,e){(e=e||{}).iterations=e.iterations||1;var n=e.iterations,r=[];if(!t)throw new Error("inputPolys is required");return vt(t,(function(t,e,i){if("Polygon"===t.type){for(var o=[[]],a=0;a0&&(u=M(o).geometry),Ku(u,s),o=s.slice(0)}r.push(M(o,i))}else{if("MultiPolygon"!==t.type)throw new Error("geometry is invalid, must be Polygon or MultiPolygon");for(var l=[[[]]],c=0;c0&&(f=I(l).geometry),Ju(f,h),l=h.slice(0)}r.push(I(l,i))}})),k(r)},t.polygonTangents=function(t,e){var n,r=J(t),i=J(e),o=[],a=[],s=Lt(e),u=0,l=null;switch(r[0]>s[0]&&r[0]s[1]&&r[1]_&&(_=x)}for(var O=[],E=Object.keys(l).length,S=f/E,M=0,P=0;P<_+1;P++)M+=Math.exp(-S)*Math.pow(S,P)/ll(P),O.push(M);for(var N=[],C=0,k=0;k<_+1;k++){for(var j=0,L=Object.keys(l);jA&&(A=R)}var F=sl[r]/Math.sqrt(E),D={criticalValue:F,isRandom:!0,maxAbsoluteDifference:A,observedDistribution:N};return A>F&&(D.isRandom=!1),D},t.radiansToDegrees=q,t.radiansToLength=R,t.random=ml,t.randomLineString=gl,t.randomPoint=pl,t.randomPolygon=dl,t.randomPosition=cl,t.rectangleGrid=za,t.rewind=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!W(r=r||{}))throw new Error("options is invalid");var i=null!=(e=r.mutate)&&e,o=null!=(n=r.reverse)&&n;if(!t)throw new Error(" is required");if("boolean"!=typeof o)throw new Error(" must be a boolean");if("boolean"!=typeof i)throw new Error(" must be a boolean");i||"Point"===t.type||"MultiPoint"===t.type||(t=Si(t));var a=[];switch(t.type){case"GeometryCollection":return vt(t,(function(t){_l(t,o)})),t;case"FeatureCollection":return dt(t,(function(t){dt(_l(t,o),(function(t){a.push(t)}))})),k(a)}return _l(t,o)},t.rhumbBearing=ut,t.rhumbDestination=Ea,t.rhumbDistance=Sa,t.round=T,t.sample=function(t,e){if(!t)throw new Error("fc is required");if(null==e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return k(function(t,e){for(var n,r,i=t.slice(0),o=t.length,a=o-e;o-- >a;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(a)}(t.features,e))},t.sector=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!W(i=i||{}))throw new Error("options is invalid");var o=i.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!==v(i))throw new Error("options must be an object");if(xl(n)===xl(r))return Ei(t,e,i);var a=J(t),s=uu(t,e,n,r,i),u=[[a]];return ct(s,(function(t){u[0].push(t)})),u[0].push(a),M(u,o)},t.segmentEach=wt,t.segmentReduce=xt,t.shortestPath=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!W(n=n||{}))throw new Error("options is invalid");var r=n.obstacles||k([]),i=n.resolution||100;if(!t)throw new Error("start is required");if(!e)throw new Error("end is required");if(i&&(!Y(i)||i<=0))throw new Error("options.resolution must be a number, greater than 0");var o=K(t),a=K(e);if(t=E(o),e=E(a),"FeatureCollection"===r.type){if(0===r.features.length)return N([o,a])}else{if("Polygon"!==r.type)throw new Error("invalid obstacles");r=k([x(nt(r))])}var s=r;s.features.push(t),s.features.push(e);var u=d(Lt(Ol(Ft(Lt(s)),1.15)),4),l=u[0],c=u[1],h=u[2],f=u[3],p=st([l,c],[h,c],n)/i;s.features.pop(),s.features.pop();for(var g,y,v=p/st([l,c],[h,c],n)*(h-l),m=p/st([l,c],[l,f],n)*(f-c),_=h-l,b=f-c,w=Math.floor(_/v),O=Math.floor(b/m),S=(_-w*v)/2,M=[],P=[],C=1/0,j=1/0,L=f-(b-O*m)/2,I=0;L>=c;){for(var A=[],T=[],R=l+S,F=0;R<=h;){var D=E([R,L]),G=kl(D,r);A.push(G?0:1),T.push(R+"|"+L);var B=st(D,t);!G&&B1&&void 0!==arguments[1]?arguments[1]:{};if(!W(i=null!=i?i:{}))throw new Error("options is invalid");var o=null!=(e=i.tolerance)?e:1,a=null!=(n=i.highQuality)&&n,s=null!=(r=i.mutate)&&r;if(!t)throw new Error("geojson is required");if(o&&o<0)throw new Error("invalid tolerance");return!0!==s&&(t=Si(t)),vt(t,(function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;if(Pe(t,{mutate:!0}),"GeometryCollection"!==r)switch(r){case"LineString":t.coordinates=Il(t.coordinates,e,n);break;case"MultiLineString":t.coordinates=t.coordinates.map((function(t){return Il(t,e,n)}));break;case"Polygon":t.coordinates=Al(t.coordinates,e,n);break;case"MultiPolygon":t.coordinates=t.coordinates.map((function(t){return Al(t,e,n)}))}}(t,o,a)})),t},t.square=du,t.squareGrid=Ua,t.standardDeviationalEllipse=function(t,e){var n;if(!W(e=e||{}))throw new Error("options is invalid");var r=e.steps||64,i=e.weight,o=e.properties||{};if(!Y(r))throw new Error("steps must be a number");if(!W(o))throw new Error("properties must be a number");var a=yt(t).length,s=oi(t,{weight:i}),u=0,l=0,c=0;dt(t,(function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=Rl(J(t),J(s));u+=Math.pow(r.x,2)*n,l+=Math.pow(r.y,2)*n,c+=r.x*r.y*n}));var h=u-l,f=Math.sqrt(Math.pow(h,2)+4*Math.pow(c,2)),p=2*c,d=Math.atan((h+f)/p),g=180*d/Math.PI,y=0,v=0,m=0;dt(t,(function(t){var e,n=i&&(null==(e=t.properties)?void 0:e[i])||1,r=Rl(J(t),J(s));y+=Math.pow(r.x*Math.cos(d)-r.y*Math.sin(d),2)*n,v+=Math.pow(r.x*Math.sin(d)+r.y*Math.cos(d),2)*n,m+=n}));var _=Math.sqrt(2*y/m),b=Math.sqrt(2*v/m),w=Pa(s,_,b,{units:"degrees",angle:g,steps:r,properties:o}),x=Uu(t,k([w])),O={meanCenterCoordinates:J(s),semiMajorAxis:_,semiMinorAxis:b,numberOfFeatures:a,angle:g,percentageWithinEllipse:100*yt(x).length/a};return w.properties=null!=(n=w.properties)?n:{},w.properties.standardDeviationalEllipse=O,w},t.tag=function(t,e,n,r){return t=Si(t),e=Si(e),dt(t,(function(t){t.properties||(t.properties={}),dt(e,(function(e){t.properties&&e.properties&&void 0===t.properties[r]&&qt(t,e)&&(t.properties[r]=e.properties[n])}))})),t},t.tesselate=function(t){if(!t.geometry||"Polygon"!==t.geometry.type&&"MultiPolygon"!==t.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var e={type:"FeatureCollection",features:[]};return"Polygon"===t.geometry.type?e.features=Bl(t.geometry.coordinates):t.geometry.coordinates.forEach((function(t){e.features=e.features.concat(Bl(t))})),e},t.tin=Xi,t.toMercator=el,t.toWgs84=nl,t.transformRotate=Ma,t.transformScale=Ol,t.transformTranslate=function(t,e,n,r){if(!W(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,a=r.mutate;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===e&&0===o)return t;if(null==n||isNaN(n))throw new Error("direction is required");return e<0&&(e=-e,n+=180),!1!==a&&void 0!==a||(t=Si(t)),ct(t,(function(t){var r=J(Ea(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)})),t},t.triangleGrid=Va,t.truncate=gu,t.union=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];if(vt(t,(function(t){n.push(t.coordinates)})),n.length<2)throw new Error("Must have at least 2 geometries");var r=ya.apply(ba,[n[0]].concat(g(n.slice(1))));return 0===r.length?null:1===r.length?M(r[0],e.properties):I(r,e.properties)},t.unkinkPolygon=function(t){var e=[];return _t(t,(function(t){"Polygon"===t.geometry.type&&dt(zl(t),(function(n){e.push(M(n.geometry.coordinates,t.properties))}))})),k(e)},t.validateBBox=X,t.validateId=H,t.voronoi=function(t,e){if(!W(e=e||{}))throw new Error("options is invalid");var n=e.bbox||[-180,-85,180,85];if(!t)throw new Error("points is required");if(!Array.isArray(n))throw new Error("bbox is invalid");return et(t,"Point","points"),k(function(){var t=Kl,e=Jl,n=null;function r(r){return new jc(r.map((function(n,i){var o=[Math.round(t(n,i,r)/Nc)*Nc,Math.round(e(n,i,r)/Nc)*Nc];return o.index=i,o.data=n,o})),n)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(e){return arguments.length?(t="function"==typeof e?e:Zl(+e),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:Zl(+t),r):e},r.extent=function(t){return arguments.length?(n=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):n&&[[n[0][0],n[0][1]],[n[1][0],n[1][1]]]},r.size=function(t){return arguments.length?(n=null==t?null:[[0,0],[+t[0],+t[1]]],r):n&&[n[1][0]-n[0][0],n[1][1]-n[0][1]]},r}().x((function(t){return t.geometry.coordinates[0]})).y((function(t){return t.geometry.coordinates[1]})).extent([[n[0],n[1]],[n[2],n[3]]]).polygons(t.features).map((function(e,n){return Object.assign(function(t){return(t=t.slice()).push(t[0]),M([t])}(e),{properties:Pi(t.features[n].properties)})})))}}(e)},,function(t,e,n){"use strict";e.a={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"}},,,function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(u," */")),o=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([i]).join("\n")}var a,s,u;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o=1024){var n=0;for(var i in l)0==(3&n++)&&(delete l[i],--c)}e=function(t){var e,n,i,s,l;if(a.exec(t)&&(t=u(t)),o.exec(t)){var c=t.length-1,h=void 0;h=c<=4?1:2;var f=4===c||8===c;e=parseInt(t.substr(1+0*h,h),16),n=parseInt(t.substr(1+1*h,h),16),i=parseInt(t.substr(1+2*h,h),16),s=f?parseInt(t.substr(1+3*h,h),16):255,1==h&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,f&&(s=(s<<4)+s)),l=[e,n,i,s/255]}else 0==t.indexOf("rgba(")?p(l=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((l=t.slice(4,-1).split(",").map(Number)).push(1),p(l)):Object(r.a)(!1,14);return l}(t),l[t]=e,++c}return e});function f(t){return Array.isArray(t)?t:h(t)}function p(t){return t[0]=Object(i.a)(t[0]+.5|0,0,255),t[1]=Object(i.a)(t[1]+.5|0,0,255),t[2]=Object(i.a)(t[2]+.5|0,0,255),t[3]=Object(i.a)(t[3],0,1),t}function d(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+n+","+r+","+(void 0===t[3]?1:t[3])+")"}},function(t,e,n){"use strict";e.a={ARRAY_BUFFER:"arraybuffer",JSON:"json",TEXT:"text",XML:"xml"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return p})),n.d(e,"c",(function(){return d}));var r,i=n(117),o=n(24),a=n(8),s=n(58),u=n(13),l=n(25);function c(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function h(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function f(t,e,n,r){var i=Object(u.p)(n,e,t),o=Object(u.h)(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var l=t.getMetersPerUnit();void 0!==l&&(o/=l);var c=t.getExtent();if(!c||Object(a.f)(c,i)){var h=Object(u.h)(t,o,i)/o;isFinite(h)&&h>0&&(o/=h)}return o}function p(t,e,n,r){var i=Object(a.w)(n),o=f(t,e,i,r);return(!isFinite(o)||o<=0)&&Object(a.s)(n,(function(n){return o=f(t,e,n,r),isFinite(o)&&o>0})),o}function d(t,e,n,u,f,p,d,g,y,v,m,_){var b=Object(s.a)(Math.round(n*t),Math.round(n*e));if(Object(o.a)(b,_),0===y.length)return b.canvas;function w(t){return Math.round(t*n)/n}b.scale(n,n),b.globalCompositeOperation="lighter";var x=Object(a.j)();y.forEach((function(t,e,n){Object(a.p)(x,t.extent)}));var O=Object(a.D)(x),E=Object(a.z)(x),S=Object(s.a)(Math.round(n*O/u),Math.round(n*E/u));Object(o.a)(S,_);var M=n/u;y.forEach((function(t,e,n){var r=t.extent[0]-x[0],i=-(t.extent[3]-x[3]),o=Object(a.D)(t.extent),s=Object(a.z)(t.extent);t.image.width>0&&t.image.height>0&&S.drawImage(t.image,v,v,t.image.width-2*v,t.image.height-2*v,r*M,i*M,o*M,s*M)}));var P=Object(a.B)(d);return g.getTriangles().forEach((function(t,e,o){var a=t.source,s=t.target,f=a[0][0],d=a[0][1],g=a[1][0],y=a[1][1],v=a[2][0],m=a[2][1],O=w((s[0][0]-P[0])/p),E=w(-(s[0][1]-P[1])/p),M=w((s[1][0]-P[0])/p),N=w(-(s[1][1]-P[1])/p),C=w((s[2][0]-P[0])/p),k=w(-(s[2][1]-P[1])/p),j=f,L=d;f=0,d=0;var I=[[g-=j,y-=L,0,0,M-O],[v-=j,m-=L,0,0,C-O],[0,0,g,y,N-E],[0,0,v,m,k-E]],A=Object(l.f)(I);if(A){if(b.save(),b.beginPath(),function(){if(void 0===r){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",c(t,4,5,4,0),c(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;r=h(e,0)||h(e,4)||h(e,8)}return r}()||_===i.b){b.moveTo(M,N);for(var T=O-M,R=E-N,F=0;F<4;F++)b.lineTo(M+w((F+1)*T/4),N+w(F*R/3)),3!=F&&b.lineTo(M+w((F+1)*T/4),N+w((F+1)*R/3));b.lineTo(C,k)}else b.moveTo(M,N),b.lineTo(O,E),b.lineTo(C,k);b.clip(),b.transform(A[0],A[2],A[1],A[3],O,E),b.translate(x[0]-j,x[3]-L),b.scale(u/n,-u/n),b.drawImage(S.canvas,0,0),b.restore()}})),m&&(b.save(),b.globalCompositeOperation="source-over",b.strokeStyle="black",b.lineWidth=1,g.getTriangles().forEach((function(t,e,n){var r=t.target,i=(r[0][0]-P[0])/p,o=-(r[0][1]-P[1])/p,a=(r[1][0]-P[0])/p,s=-(r[1][1]-P[1])/p,u=(r[2][0]-P[0])/p,l=-(r[2][1]-P[1])/p;b.beginPath(),b.moveTo(a,s),b.lineTo(i,o),b.lineTo(u,l),b.closePath(),b.stroke()})),b.restore()),b.canvas}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(25);function i(t){return void 0!==t?0:void 0}function o(t){return void 0!==t?t:void 0}function a(t){var e=2*Math.PI/t;return function(t,n){return n?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}function s(t){var e=t||Object(r.j)(5);return function(t,n){return n?t:void 0!==t?Math.abs(t)<=e?0:t:void 0}}},function(t,e,n){"use strict";e.a={FRACTION:"fraction",PIXELS:"pixels"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function i(t,e,n,i,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=n,o.maxY=i,o):new r(t,e,n,i)}e.b=r},function(t,e,n){"use strict";e.a={CARMENTA_SERVER:"carmentaserver",GEOSERVER:"geoserver",MAPSERVER:"mapserver",QGIS:"qgis"}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return q}));var r,i=n(75),o=n(116),a=n(50),s=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:250,n}return s(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==a.a.DBLCLICK){var n=t.originalEvent,r=t.map,i=t.coordinate,s=n.shiftKey?-this.delta_:this.delta_,u=r.getView();Object(o.c)(u,s,i,this.duration_),n.preventDefault(),e=!0}return!e},e}(o.a),l=n(228),c=n(79),h=n(51),f=n(53),p=n(161),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{stopDown:h.a})||this).condition_=r.condition?r.condition:f.c,n.lastAngle_=void 0,n.duration_=void 0!==r.duration?r.duration:250,n}return d(e,t),e.prototype.handleDragEvent=function(t){if(Object(f.g)(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==p.c){var r=e.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!Object(f.g)(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Object(f.g)(t)&&(!(!Object(f.f)(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(c.b),y=n(254),v=n(104),m=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e){var n=this,r=e||{},i=r.condition?r.condition:f.k;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return m(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var r=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(r),o=e.getResolution()/i;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:v.b})},e}(y.a),b=n(28),w=37,x=38,O=39,E=40,S=n(48),M=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.defaultCondition_=function(t){return Object(f.i)(t)&&Object(f.m)(t)},n.condition_=void 0!==r.condition?r.condition:n.defaultCondition_,n.duration_=void 0!==r.duration?r.duration:100,n.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,n}return M(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==b.a.KEYDOWN){var n=t.originalEvent,r=n.keyCode;if(this.condition_(t)&&(r==E||r==w||r==O||r==x)){var i=t.map.getView(),a=i.getResolution()*this.pixelDelta_,s=0,u=0;r==E?u=-a:r==w?s=-a:r==O?s=a:u=a;var l=[s,u];Object(S.g)(l,i.getRotation()),Object(o.b)(i,l,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),N=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.condition_=r.condition?r.condition:f.m,n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:100,n}return N(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==b.a.KEYDOWN||t.type==b.a.KEYPRESS){var n=t.originalEvent,r=n.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,a=r=="+".charCodeAt(0)?this.delta_:-this.delta_,s=i.getView();Object(o.c)(s,a,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(o.a),k=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[n+2]>t;)n-=3;var r=this.points_[e+2]-this.points_[n+2];if(r<1e3/60)return!1;var i=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),j=n(81),L=n(25),I=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),A="trackpad",T="wheel",R=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,r)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,n.duration_=void 0!==r.duration?r.duration:250,n.timeout_=void 0!==r.timeout?r.timeout:80,n.useAnchor_=void 0===r.useAnchor||r.useAnchor,n.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:f.d;return n.condition_=r.onFocusOnly?Object(f.a)(f.e,i):i,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return I(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==b.a.WHEEL)return!0;var e,n=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==b.a.WHEEL&&(e=r.deltaY,j.b&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=j.a),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?A:T);var o=n.getView();if(this.mode_===A&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-Object(L.a)(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Object(o.c)(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(o.a),F=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),D=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==r.threshold?r.threshold:.3,n.duration_=void 0!==r.duration?r.duration:250,n}return F(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==p.c){var u=a.getViewport().getBoundingClientRect(),l=Object(c.a)(this.targetPointers);l[0]-=u.left,l[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(l),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(c.b),G=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=h.a),(n=t.call(this,i)||this).anchor_=null,n.duration_=void 0!==r.duration?r.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return G(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,o=n.clientY-r.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,u=s.getView();1!=e&&(this.lastScaleDelta_=e);var l=s.getViewport().getBoundingClientRect(),h=Object(c.a)(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(c.b);function q(t){var e=t||{},n=new i.a,r=new k(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new g),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new u({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new l.a({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new D),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new B({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new P),n.push(new C({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new R({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new _({duration:e.zoomDuration})),n}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(255);function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Object(r.a)(t,e)}},function(t,e,n){"use strict";function r(t,e,n,r){var i=n?n.call(r,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Object(a.s)(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===m.a.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===m.a.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===m.a.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===m.a.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===m.a.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new v.a(m.a.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==I||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===I)e=!0;else if(i===R)e=2===this.sketchCoords_.length;else if(i===A)n=this.sketchCoords_.length>this.minPoints_;else if(i===T){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var a=this.getMap(),s=0,u=r.length;s=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===T&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===A||r===R){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var o=this.finishCoordinate_.slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}this.geometryFunction_(t,e,n),e.getType()===i.a.POLYGON&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===T){(t=this.sketchCoords_[0]).splice(-2,1);var a=this.sketchLine_.getGeometry();if(t.length>=2){o=t[t.length-2].slice();t[t.length-1]=o,this.createOrUpdateSketchPoint_(o)}a.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===A?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===T&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),this.type_===i.a.MULTI_POINT?t.setGeometry(new b.a([e])):this.type_===i.a.MULTI_LINE_STRING?t.setGeometry(new _.a([e])):this.type_===i.a.MULTI_POLYGON&&t.setGeometry(new w.a([e])),this.dispatchEvent(new B(D,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new B(G,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===A||n===R)e=this.sketchCoords_;else{if(n!==T)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&e.shift(),e.pop();for(var i=0;i=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(t,n,a){var s=o.URL||o.webkitURL,u=document.createElement("a");n=n||t.name||"download",u.download=n,u.rel="noopener","string"==typeof t?(u.href=t,u.origin===location.origin?i(u):r(u.href)?e(t,n,a):i(u,u.target="_blank")):(u.href=s.createObjectURL(t),setTimeout((function(){s.revokeObjectURL(u.href)}),4e4),setTimeout((function(){i(u)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,o){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,o),n);else if(r(t))e(t,n,o);else{var a=document.createElement("a");a.href=t,a.target="_blank",setTimeout((function(){i(a)}))}}:function(t,n,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,r);var s="application/octet-stream"===t.type,u=/constructor/i.test(o.HTMLElement)||o.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&u||a)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var t=c.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},c.readAsDataURL(t)}else{var h=o.URL||o.webkitURL,f=h.createObjectURL(t);i?i.location=f:location.href=f,i=null,setTimeout((function(){h.revokeObjectURL(f)}),4e4)}});o.saveAs=s.saveAs=s,t.exports=s})?r.apply(e,i):r)||(t.exports=o)}).call(this,n(137))},,function(t,e,n){"use strict";var r,i=n(181),o=n(52),a=n(233),s=n(43),u=n(270),l=n(2),c=function(){function t(t){this.tagName_=t}return t.prototype.getTagName=function(){return this.tagName_},t}(),h=n(31),f=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),p=function(t){function e(e,n){var r=t.call(this,e)||this;return r.conditions=n,Object(h.a)(r.conditions.length>=2,57),r}return f(e,t),e}(c),d=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),g=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return d(e,t),e}(p),y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e,n,r){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=n,4!==n.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=r,i}return y(e,t),e}(c),m=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.geometryName=n||"the_geom",o.geometry=r,o.srsName=i,o}return m(e,t),e}(c),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=(function(t){function e(e,n,r){return t.call(this,"Contains",e,n,r)||this}b(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),x=(function(t){function e(e,n,r,i,o){var a=t.call(this,"DWithin",e,n,o)||this;return a.distance=r,a.unit=i,a}w(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),O=(function(t){function e(e,n,r){return t.call(this,"Disjoint",e,n,r)||this}x(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),E=function(t){function e(e,n){var r=t.call(this,e)||this;return r.propertyName=n,r}return O(e,t),e}(c),S=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=(function(t){function e(e,n,r){var i=t.call(this,"During",e)||this;return i.begin=n,i.end=r,i}S(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),P=function(t){function e(e,n,r,i){var o=t.call(this,e,n)||this;return o.expression=r,o.matchCase=i,o}return M(e,t),e}(E),N=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=(function(t){function e(e,n,r){return t.call(this,"PropertyIsEqualTo",e,n,r)||this}N(e,t)}(P),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),k=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThan",e,n)||this}C(e,t)}(P),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),j=(function(t){function e(e,n){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,n)||this}k(e,t)}(P),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),L=(function(t){function e(e,n,r){return t.call(this,"Intersects",e,n,r)||this}j(e,t)}(_),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),I=(function(t){function e(e,n,r){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=n,i.upperBoundary=r,i}L(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),A=(function(t){function e(e,n,r,i,o,a){var s=t.call(this,"PropertyIsLike",e)||this;return s.pattern=n,s.wildCard=void 0!==r?r:"*",s.singleChar=void 0!==i?i:".",s.escapeChar=void 0!==o?o:"!",s.matchCase=a,s}I(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),T=(function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}A(e,t)}(E),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),R=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThan",e,n)||this}T(e,t)}(P),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),F=(function(t){function e(e,n){return t.call(this,"PropertyIsLessThanOrEqualTo",e,n)||this}R(e,t)}(P),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),D=(function(t){function e(e){var n=t.call(this,"Not")||this;return n.condition=e,n}F(e,t)}(c),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),G=(function(t){function e(e,n,r){return t.call(this,"PropertyIsNotEqualTo",e,n,r)||this}D(e,t)}(P),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),B=(function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}G(e,t)}(p),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),q=(function(t){function e(e){var n=t.call(this,"ResourceId")||this;return n.rid=e,n}B(e,t)}(c),function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}());!function(t){function e(e,n,r){return t.call(this,"Within",e,n,r)||this}q(e,t)}(_);var z=n(24),U=n(13),V=n(19),Y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),W={"http://www.opengis.net/gml":{boundedBy:Object(l.l)(s.b.prototype.readGeometryElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Object(l.i)(s.b.prototype.readFeaturesInternal)}},X={"http://www.opengis.net/wfs":{totalInserted:Object(l.l)(V.e),totalUpdated:Object(l.l)(V.e),totalDeleted:Object(l.l)(V.e)},"http://www.opengis.net/wfs/2.0":{totalInserted:Object(l.l)(V.e),totalUpdated:Object(l.l)(V.e),totalDeleted:Object(l.l)(V.e)}},H={"http://www.opengis.net/wfs":{TransactionSummary:Object(l.l)(ot,"transactionSummary"),InsertResults:Object(l.l)(lt,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:Object(l.l)(ot,"transactionSummary"),InsertResults:Object(l.l)(lt,"insertIds")}},Z={"http://www.opengis.net/wfs":{PropertyName:Object(l.j)(V.g)},"http://www.opengis.net/wfs/2.0":{PropertyName:Object(l.j)(V.g)}},K={"http://www.opengis.net/wfs":{Insert:Object(l.j)(ct),Update:Object(l.j)(dt),Delete:Object(l.j)(pt),Property:Object(l.j)(gt),Native:Object(l.j)(yt)},"http://www.opengis.net/wfs/2.0":{Insert:Object(l.j)(ct),Update:Object(l.j)(dt),Delete:Object(l.j)(pt),Property:Object(l.j)(gt),Native:Object(l.j)(yt)}},J="http://www.w3.org/2000/xmlns/",$={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},Q={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},tt={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},et={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},nt={"2.0.0":a.a,"1.1.0":o.a,"1.0.0":i.a},rt=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.version_=r.version?r.version:"1.1.0",n.featureType_=r.featureType,n.featureNS_=r.featureNS,n.gmlFormat_=r.gmlFormat?r.gmlFormat:new nt[n.version_],n.schemaLocation_=r.schemaLocation?r.schemaLocation:et[n.version_],n}return Y(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var n={node:t};Object(z.a)(n,{featureType:this.featureType_,featureNS:this.featureNS_}),Object(z.a)(n,this.getReadOptions(t,e||{}));var r,i=[n];r="2.0.0"===this.version_?W:this.gmlFormat_.FEATURE_COLLECTION_PARSERS;var o=Object(l.r)([],r,t,i,this.gmlFormat_);return o||(o=[]),o},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=Object(l.p)(t);return this.readTransactionResponseFromDocument(e)}return Object(l.h)(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=Object(l.p)(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Object(l.h)(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},n=Object(V.d)(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=n,Object(l.r)(e,W,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return Object(l.r)({},H,t,[])},e.prototype.writeGetFeature=function(t){var e=this,n=Object(l.c)(Q[this.version_],"GetFeature");n.setAttribute("service","WFS"),n.setAttribute("version",this.version_),t.handle&&n.setAttribute("handle",t.handle),t.outputFormat&&n.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&n.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&n.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&n.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&n.setAttribute("count",String(t.count)),void 0!==t.viewParams&&n.setAttribute("viewParams",t.viewParams),n.setAttributeNS(l.b,"xsi:schemaLocation",this.schemaLocation_);var r={node:n};if(Object(z.a)(r,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),Object(h.a)(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var i=t.filter;t.bbox&&(Object(h.a)(t.geometryName,12),i=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,i)),Object(z.a)(r,{geometryName:t.geometryName,filter:i}),At(n,t.featureTypes,[r])}else t.featureTypes.forEach((function(i){var o=e.combineBboxAndFilter(i.geometryName,i.bbox,t.srsName,t.filter);Object(z.a)(r,{geometryName:i.geometryName,filter:o}),At(n,[i.name],[r])}));return n},e.prototype.combineBboxAndFilter=function(t,e,n,r){var i=function(t,e,n){return new v(t,e,n)}(t,e,n);return r?function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(g,e))}(r,i):i},e.prototype.writeTransaction=function(t,e,n,r){var i,o=[],a=r.version?r.version:this.version_,s=Object(l.c)(Q[a],"Transaction");s.setAttribute("service","WFS"),s.setAttribute("version",a),r&&(i=r.gmlOptions?r.gmlOptions:{},r.handle&&s.setAttribute("handle",r.handle)),s.setAttributeNS(l.b,"xsi:schemaLocation",et[a]);var u=function(t,e,n,r){var i,o=r.featurePrefix?r.featurePrefix:"feature";"1.0.0"===n?i=2:"1.1.0"===n?i=3:"2.0.0"===n&&(i=3.2);return Object(z.a)({node:t},{version:n,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:i,hasZ:r.hasZ,srsName:r.srsName},e)}(s,i,a,r);return t&&it("Insert",t,o,u),e&&it("Update",e,o,u),n&&it("Delete",n,o,u),r.nativeElements&&it("Native",r.nativeElements,o,u),s},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var n=[{}];return this.gmlFormat_.readGeometryElement(e,n),Object(U.g)(n.pop().srsName)}return null},e}(u.a);function it(t,e,n,r){Object(l.s)(r,K,Object(l.n)(t),e,n)}function ot(t,e){return Object(l.r)({},X,t,e)}var at={"http://www.opengis.net/ogc":{FeatureId:Object(l.i)((function(t,e){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Object(l.i)((function(t,e){return t.getAttribute("fid")}))}};function st(t,e){Object(l.q)(at,t,e)}var ut={"http://www.opengis.net/wfs":{Feature:st},"http://www.opengis.net/wfs/2.0":{Feature:st}};function lt(t,e){return Object(l.r)([],ut,t,e)}function ct(t,e,n){var r=n[n.length-1],s=r.featureType,u=r.featureNS,c=r.gmlVersion,h=Object(l.c)(u,s);t.appendChild(h),2===c?i.a.prototype.writeFeatureElement(h,e,n):3===c?o.a.prototype.writeFeatureElement(h,e,n):a.a.prototype.writeFeatureElement(h,e,n)}function ht(t,e,n){var r=n[n.length-1].version,i=$[r],o=Object(l.c)(i,"Filter"),a=Object(l.c)(i,"FeatureId");o.appendChild(a),a.setAttribute("fid",e),t.appendChild(o)}function ft(t,e){var n=(t=t||"feature")+":";return 0===e.indexOf(n)?e:n+e}function pt(t,e,n){var r=n[n.length-1];Object(h.a)(void 0!==e.getId(),26);var i=r.featureType,o=r.featurePrefix,a=r.featureNS,s=ft(o,i);t.setAttribute("typeName",s),t.setAttributeNS(J,"xmlns:"+o,a);var u=e.getId();void 0!==u&&ht(t,u,n)}function dt(t,e,n){var r=n[n.length-1];Object(h.a)(void 0!==e.getId(),27);var i=r.version,o=r.featureType,a=r.featurePrefix,s=r.featureNS,u=ft(a,o),c=e.getGeometryName();t.setAttribute("typeName",u),t.setAttributeNS(J,"xmlns:"+a,s);var f=e.getId();if(void 0!==f){for(var p=e.getKeys(),d=[],g=0,y=p.length;g=a[0]&&s[2]<=a[2]||(s[1]>=a[1]&&s[3]<=a[3]||Object(i.a)(t,e,n,o,(function(t,e){return Object(r.F)(a,t,e)})))))}function s(t,e,n,r,i){for(var o=0,s=n.length;o0?r:Math.max(s/c[0],o/c[1]),f=i+1,p=new Array(f),d=0;d0}function o(t,e,n,r,o){for(var a=void 0!==o&&o,s=0,u=n.length;s1?u:2,x=s||new Array(w);for(y=0;y>1;othis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var n=this.cache_[e];0!=(3&t++)||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var r=o(t,e,n);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,n,r){var i=o(t,e,n);this.cache_[i]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function o(t,e,n){return e+":"+t+":"+(n?Object(r.b)(n):"null")}var a=new i},,function(t,e,n){"use strict";function r(t,e){var n=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))}));var r=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r,i=n(73),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.map=n,i.frameState=void 0!==r?r:null,i}return o(e,t),e}(i.a);e.a=a},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));var r=n(0),i="undefined"!=typeof document,o=function(t){return t()},a=!!r.useInsertionEffect&&r.useInsertionEffect,s=i&&a||o,u=a||r.useLayoutEffect},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=n(279),o=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(t){return 45===t.charCodeAt(1)},u=function(t){return null!=t&&"boolean"!=typeof t},l=Object(i.a)((function(t){return s(t)?t:t.replace(o,"-$&").toLowerCase()})),c=function(t,e){switch(t){case"animation":case"animationName":if("string"==typeof e)return e.replace(a,(function(t,e,n){return f={name:e,styles:n,next:f},e}))}return 1===r[t]||s(t)||"number"!=typeof e||0===e?e:e+"px"};function h(t,e,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return f={name:i.name,styles:i.styles,next:f},i.name;var o=n;if(void 0!==o.styles){var a=o.next;if(void 0!==a)for(;void 0!==a;)f={name:a.name,styles:a.styles,next:f},a=a.next;return o.styles+";"}return function(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i=4;++r,i-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+u,styles:i,next:f}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return M}));var r,i=n(73),o=n(38),a=n(101),s=n(28),u=n(209),l=n(274),c=n(160),h=n(8),f=n(27),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n,r,i,s,u,f){var p=this,d=e.getExtent(),g=n.getExtent(),y=g?Object(h.A)(r,g):r,v=Object(h.w)(y),m=Object(c.b)(e,n,v,i),_=a.b,b=new l.a(e,n,y,d,m*_,i),w=u(b.calculateSourceExtent(),m,s),x=w?o.a.IDLE:o.a.EMPTY,O=w?w.getPixelRatio():1;return(p=t.call(this,r,i,O,x)||this).targetProj_=n,p.maxSourceExtent_=d,p.triangulation_=b,p.targetResolution_=i,p.targetExtent_=r,p.sourceImage_=w,p.sourcePixelRatio_=O,p.contextOptions_=f,p.canvas_=null,p.sourceListenerKey_=null,p}return p(e,t),e.prototype.disposeInternal=function(){this.state==o.a.LOADING&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==o.a.LOADED){var e=Object(h.D)(this.targetExtent_)/this.targetResolution_,n=Object(h.z)(this.targetExtent_)/this.targetResolution_;this.canvas_=Object(c.c)(e,n,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==o.a.IDLE){this.state=o.a.LOADING,this.changed();var t=this.sourceImage_.getState();t==o.a.LOADED||t==o.a.ERROR?this.reproject_():(this.sourceListenerKey_=Object(f.a)(this.sourceImage_,s.a.CHANGE,(function(t){var e=this.sourceImage_.getState();e!=o.a.LOADED&&e!=o.a.ERROR||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){Object(f.c)(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(u.a),g=n(208),y=n(117),v=n(20),m=n(13),_=n(35),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w="imageloadstart",x="imageloadend",O="imageloaderror",E=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return b(e,t),e}(i.a),S=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return n.on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n.contextOptions_=!1===e.imageSmoothing?y.b:void 0,n}return b(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=Object(_.f)(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(a.a&&i&&r&&!Object(m.c)(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Object(m.c)(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&Object(h.o)(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new d(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},e.prototype.getImageInternal=function(t,e,n,r){return Object(v.b)()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case o.a.LOADING:this.loading=!0,this.dispatchEvent(new E(w,e));break;case o.a.LOADED:this.loading=!1,this.dispatchEvent(new E(x,e));break;case o.a.ERROR:this.loading=!1,this.dispatchEvent(new E(O,e))}},e}(g.a);function M(t,e){t.getImage().src=e}e.a=S},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return c}));var r=n(16),i=n(25);function o(t,e,n){var r=n||6371008.8,o=Object(i.j)(t[1]),a=Object(i.j)(e[1]),s=(a-o)/2,u=Object(i.j)(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(u)*Math.sin(u)*Math.cos(o)*Math.cos(a);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function a(t,e){for(var n=0,r=0,i=t.length;r0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(i.b);e.a=c},,,function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return o}));var r,i=!("undefined"==typeof window||!window.document||!window.document.createElement);function o(t){if((!r&&0!==r||t)&&i){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),r=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return r}},function(t,e,n){"use strict";var r,i=n(55),o=n(16),a=n(96),s=n(122),u=n(8),l=n(114),c=n(141),h=n(84),f=n(206),p=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(e,n){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return p(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,r){return r=this.minZoom;){if(2===this.zoomFactor_?(a=Math.floor(a/2),s=Math.floor(s/2),o=Object(r.a)(a,a,s,s,n)):o=this.getTileRangeForExtentAndZ(u,l,n),e(l,o))return!0;--l}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,n){if(t[0]this.maxZoom||et.length)&&(e=t.length);for(var n=0,r=Array(e);n-1}}(e))return m["EPSG:3857"];var n=function(t){var e=d(t,"extension");if(e)return d(e,"proj4")}(e);return n?g(n):e}return function(t){return"+"===t[0]}(t)?g(t):void 0},w=function(t,e){var n,r;if(t=t||{},!e)return t;for(r in e)void 0!==(n=e[r])&&(t[r]=n);return t},x=function(t,e,n){var r=t*e;return n/Math.sqrt(1-r*r)},O=function(t){return t<0?-1:1},E=function(t){return Math.abs(t)<=l?t:t-O(t)*u},S=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r},M=function(t,e){for(var n,r,o=.5*t,a=i-2*Math.atan(e),s=0;s<=15;s++)if(n=t*Math.sin(a),a+=r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-a,Math.abs(r)<=1e-10)return a;return-9999};function P(t){return t}var N=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,n,r=t.x,o=t.y;if(o*a>90&&o*a<-90&&r*a>180&&r*a<-180)return null;if(Math.abs(Math.abs(o)-i)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*E(r-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(s+.5*o));else{var u=Math.sin(o),l=S(this.e,o,u);e=this.x0+this.a*this.k0*E(r-this.long0),n=this.y0-this.a*this.k0*Math.log(l)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,r=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=i-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var a=Math.exp(-o/(this.a*this.k0));if(-9999===(n=M(this.e,a)))return null}return e=E(this.long0+r/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]},{init:function(){},forward:P,inverse:P,names:["longlat","identity"]}],C={},k=[];function j(t,e){var n=k.length;return t.names?(k[n]=t,t.names.forEach((function(t){C[t.toLowerCase()]=n})),this):(console.log(e),!0)}function L(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}var I={start:function(){N.forEach(j)},add:j,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==C[e]&&k[C[e]]||(e=L(e))in C&&k[C[e]]?k[C[e]]:void 0}},A={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const T=A.WGS84;var R={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var F in R){var D=R[F];D.datumName&&(R[D.datumName]=D)}var G=R;var B=function(t,e,n,i,o,a,s){var u={};return u.datum_type=void 0===t||"none"===t?5:4,e&&(u.datum_params=e.map(parseFloat),0===u.datum_params[0]&&0===u.datum_params[1]&&0===u.datum_params[2]||(u.datum_type=1),u.datum_params.length>3&&(0===u.datum_params[3]&&0===u.datum_params[4]&&0===u.datum_params[5]&&0===u.datum_params[6]||(u.datum_type=2,u.datum_params[3]*=r,u.datum_params[4]*=r,u.datum_params[5]*=r,u.datum_params[6]=u.datum_params[6]/1e6+1))),s&&(u.datum_type=3,u.grids=s),u.a=n,u.b=i,u.es=o,u.ep2=a,u},q={};async function z(t,e){for(var n=[],r=await e.getImageCount(),i=r-1;i>=0;i--){var o=await e.getImage(i),a=await o.readRasters(),s=[o.getWidth(),o.getHeight()],u=o.getBoundingBox().map(V),l=[o.fileDirectory.ModelPixelScale[0],o.fileDirectory.ModelPixelScale[1]].map(V),c=u[0]+(s[0]-1)*l[0],h=u[3]-(s[1]-1)*l[1],f=a[0],p=a[1],d=[];for(let t=s[1]-1;t>=0;t--)for(let e=s[0]-1;e>=0;e--){var g=t*s[0]+e;d.push([-Y(p[g]),Y(f[g])])}n.push({del:l,lim:s,ll:[-c,h],cvs:d})}var y={header:{nSubgrids:r},subgrids:n};return q[t]=y,y}function U(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:q[t]||null,isNull:!1}}function V(t){return t*Math.PI/180}function Y(t){return t/3600*Math.PI/180}function W(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function X(t){return t.map((function(t){return[Y(t.longitudeShift),Y(t.latitudeShift)]}))}function H(t,e,n){return{name:W(t,e+8,e+16).trim(),parent:W(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function Z(t,e,n,r,i){var o=e+176,a=16;!1===i&&(a=8);for(var s=[],u=0;u-1.001*i)l=-i;else if(l>i&&l<1.001*i)l=i;else{if(l<-i)return{x:-1/0,y:-1/0,z:t.z};if(l>i)return{x:1/0,y:1/0,z:t.z}}return u>Math.PI&&(u-=2*Math.PI),o=Math.sin(l),s=Math.cos(l),a=o*o,{x:((r=n/Math.sqrt(1-e*a))+c)*s*Math.cos(u),y:(r+c)*s*Math.sin(u),z:(r*(1-e)+c)*o}}function Q(t,e,n,r){var o,a,s,u,l,c,h,f,p,d,g,y,v,m,_,b=t.x,w=t.y,x=t.z?t.z:0;if(o=Math.sqrt(b*b+w*w),a=Math.sqrt(b*b+w*w+x*x),o/n<1e-12){if(m=0,a/n<1e-12)return i,_=-r,{x:t.x,y:t.y,z:t.z}}else m=Math.atan2(w,b);s=x/a,f=(u=o/a)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*u*u)),p=s*l,v=0;do{v++,c=e*(h=n/Math.sqrt(1-e*p*p))/(h+(_=o*f+x*p-h*(1-e*p*p))),y=(g=s*(l=1/Math.sqrt(1-c*(2-c)*u*u)))*f-(d=u*(1-c)*l)*p,f=d,p=g}while(y*y>1e-24&&v<30);return{x:m,y:Math.atan(g/Math.abs(d)),z:_}}function tt(t){return 1===t||2===t}var et=function(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var r=t.a,i=t.es;if(3===t.datum_type){if(0!==nt(t,!1,n))return;r=6378137,i=.0066943799901413165}var o=e.a,a=e.b,s=e.es;if(3===e.datum_type&&(o=6378137,a=6356752.314,s=.0066943799901413165),i===s&&r===o&&!tt(t.datum_type)&&!tt(e.datum_type))return n;if((n=$(n,i,r),tt(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6];return{x:l*(t.x-u*t.y+s*t.z)+r,y:l*(u*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(n,t.datum_type,t.datum_params)),tt(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],l=n[6],c=(t.x-r)/l,h=(t.y-i)/l,f=(t.z-o)/l;return{x:c+u*h-s*f,y:-u*c+h+a*f,z:s*c-a*h+f}}}(n,e.datum_type,e.datum_params)),n=Q(n,s,o,a),3===e.datum_type)&&0!==nt(e,!0,n))return;return n};function nt(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},o=[];t:for(var s=0;sr.y||d>r.x||v1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=E(o.x+n.ll[0]),r.y=o.y+n.ll[1]}else isNaN(o.x)||(r.x=t.x+o.x,r.y=t.y+o.y);return r}function it(t,e){var n,r={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(r.x),o=Math.floor(r.y),a=r.x-1*i,s=r.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;n=o*e.lim[0]+i;var l=e.cvs[n][0],c=e.cvs[n][1];n++;var h=e.cvs[n][0],f=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],d=e.cvs[n][1];n--;var g=e.cvs[n][0],y=e.cvs[n][1],v=a*s,m=a*(1-s),_=(1-a)*(1-s),b=(1-a)*s;return u.x=_*l+m*h+b*g+v*p,u.y=_*c+m*f+b*y+v*d,u}var ot=function(t,e,n){var r,i,o,a=n.x,s=n.y,u=n.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(r=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(r=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(r=u,i="z"),t.axis[o]){case"e":l[i]=r;break;case"w":l[i]=-r;break;case"n":l[i]=r;break;case"s":l[i]=-r;break;case"u":void 0!==n[i]&&(l.z=r);break;case"d":void 0!==n[i]&&(l.z=-r);break;default:return null}return l},at=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function st(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function ut(t,e,n,r){var i,s=void 0!==(n=Array.isArray(n)?at(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(function(t){st(t.x),st(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=ut(t,i=new J("WGS84"),n,r),t=i),r&&"enu"!==t.axis&&(n=ot(t,!1,n)),"longlat"===t.projName)n={x:n.x*o,y:n.y*o,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=et(t.datum,e.datum,n))return n=n,e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*a,y:n.y*a,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),r&&"enu"!==e.axis?ot(e,!0,n):(n&&!s&&delete n.z,n)}var lt=J("WGS84");function ct(t,e,n,r){var i,o,a;return Array.isArray(n)?(i=ut(t,e,n,r)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y,n[2]].concat(n.slice(3)):[i.x,i.y].concat(n.slice(2)):[i.x,i.y]):(o=ut(t,e,n,r),2===(a=Object.keys(n)).length||a.forEach((function(r){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;o[r]=n[r]})),o)}function ht(t){return t instanceof J?t:"object"==typeof t&&"oProj"in t?t.oProj:J(t)}var ft=function(t,e,n){var r,i,o,a=!1;return void 0===e?(i=ht(t),r=lt,a=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,i=ht(t),r=lt,a=!0),r||(r=ht(t)),i||(i=ht(e)),n?ct(r,i,n):(o={forward:function(t,e){return ct(r,i,t,e)},inverse:function(t,e){return ct(i,r,t,e)}},a&&(o.oProj=i),o)},pt=73,dt=79,gt={forward:yt,inverse:function(t){var e=bt(Ot(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:vt};function yt(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(p=t.easting,d=t.northing,g=t.zoneNumber,y=xt(g),v=Math.floor(p/1e5),m=Math.floor(d/1e5)%20,i=v,o=m,a=y,s=a-1,u="AJSAJS".charCodeAt(s),l="AFAFAF".charCodeAt(s),c=u+i-1,h=l+o,f=!1,c>90&&(c=c-90+65-1,f=!0),(c===pt||upt||(c>pt||udt||(c>dt||u90&&(c=c-90+65-1),h>86?(h=h-86+65-1,f=!0):f=!1,(h===pt||lpt||(h>pt||ldt||(h>dt||l86&&(h=h-86+65-1),String.fromCharCode(c)+String.fromCharCode(h))+n.substr(n.length-5,e)+r.substr(r.length-5,e);var i,o,a,s,u,l,c,h,f;var p,d,g,y,v,m}(function(t){var e,n,r,i,o,a,s,u=t.lat,l=t.lon,c=6378137,h=mt(u),f=mt(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60);u>=56&&u<64&&l>=3&&l<12&&(s=32);u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37));a=mt(6*(s-1)-180+3),.006739496752268451,e=c/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),n=Math.tan(h)*Math.tan(h),r=.006739496752268451*Math.cos(h)*Math.cos(h),i=Math.cos(h)*(f-a),o=c*(.9983242984503243*h-.002514607064228144*Math.sin(2*h)+2639046602129982e-21*Math.sin(4*h)-3.418046101696858e-9*Math.sin(6*h));var p=.9996*e*(i+(1-n+r)*i*i*i/6+(5-18*n+n*n+72*r-.39089081163157013)*i*i*i*i*i/120)+5e5,d=.9996*(o+e*Math.tan(h)*(i*i/2+(5-n+9*r+4*r*r)*i*i*i*i/24+(61-58*n+n*n+600*r-2.2240339282485886)*i*i*i*i*i*i/720));u<0&&(d+=1e7);return{northing:Math.round(d),easting:Math.round(p),zoneNumber:s,zoneLetter:wt(u)}}({lat:t[1],lon:t[0]}),e)}function vt(t){var e=bt(Ot(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function mt(t){return t*(Math.PI/180)}function _t(t){return t/Math.PI*180}function bt(t){var e=t.northing,n=t.easting,r=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,l,c,h,f,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=n-5e5,y=e;r<"N"&&(y-=1e7),c=6*(i-1)-180+3,f=(h=y/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*h)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*h)+151*d*d*d/96*Math.sin(6*h),o=p/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),a=Math.tan(f)*Math.tan(f),s=.006739496752268451*Math.cos(f)*Math.cos(f),u=.99330562*p/Math.pow(1-.00669438*Math.sin(f)*Math.sin(f),1.5),l=g/(.9996*o);var v=f-o*Math.tan(f)/u*(l*l/2-(5+3*a+10*s-4*s*s-.06065547077041606)*l*l*l*l/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*l*l*l*l*l*l/720);v=_t(v);var m,_=(l-(1+2*a+s)*l*l*l/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(f);if(_=c+_t(_),t.accuracy){var b=bt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});m={top:b.lat,right:b.lon,bottom:v,left:_}}else m={lat:v,lon:_};return m}function wt(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function xt(t){var e=t%6;return 0===e&&(e=6),e}function Ot(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,r=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;r=t.substring(o,o+=2);for(var u=xt(a),l=function(t,e){var n="AJSAJS".charCodeAt(e-1),r=1e5,i=!1;for(;n!==t.charCodeAt(0);){if(++n===pt&&n++,n===dt&&n++,n>90){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n="AFAFAF".charCodeAt(e-1),r=0,i=!1;for(;n!==t.charCodeAt(0);){if(++n===pt&&n++,n===dt&&n++,n>86){if(i)throw"Bad character: "+t;n=65,i=!0}r+=1e5}return r}(r.charAt(1),u);c0&&(f=1e5/Math.pow(10,g),p=t.substring(o,o+g),y=parseFloat(p)*f,d=t.substring(o+g),v=parseFloat(d)*f),{easting:y+l,northing:v+c,zoneLetter:s,zoneNumber:a,accuracy:f}}function Et(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function St(t,e,n){if(!(this instanceof St))return new St(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0]),this.y=parseFloat(r[1]),this.z=parseFloat(r[2])||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}St.fromMGRS=function(t){return new St(vt(t))},St.prototype.toMGRS=function(t){return yt([this.x,this.y],t)};var Mt=St,Pt=.01068115234375,Nt=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Pt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*Pt)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e},Ct=function(t,e,n,r){return n*=e,e*=e,r[0]*t-n*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},kt=function(t,e,n){for(var r=1/(1-e),i=t,o=20;o;--o){var a=Math.sin(i),s=1-e*a*a;if(i-=s=(Ct(i,a,Math.cos(i),n)-t)*(s*Math.sqrt(s))*r,Math.abs(s)<1e-10)return i}return i};var jt={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Nt(this.es),this.ml0=Ct(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,r,i=t.x,o=t.y,a=E(i-this.long0),s=Math.sin(o),u=Math.cos(o);if(this.es){var l=u*a,c=Math.pow(l,2),h=this.ep2*Math.pow(u,2),f=Math.pow(h,2),p=Math.abs(u)>1e-10?Math.tan(o):0,d=Math.pow(p,2),g=Math.pow(d,2);e=1-this.es*Math.pow(s,2),l/=Math.sqrt(e);var y=Ct(o,s,u,this.en);n=this.a*(this.k0*l*(1+c/6*(1-d+h+c/20*(5-18*d+g+14*h-58*d*h+c/42*(61+179*g-g*d-479*d)))))+this.x0,r=this.a*(this.k0*(y-this.ml0+s*a*l/2*(1+c/12*(5-d+9*h+4*f+c/30*(61+g-58*d+270*h-330*d*h+c/56*(1385+543*g-g*d-3111*d))))))+this.y0}else{var v=u*Math.sin(a);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,r=u*Math.cos(a)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(r))>=1){if(v-1>1e-10)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=n,t.y=r,t},inverse:function(t){var e,n,r,o,a=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+s/this.k0,n=kt(e,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,h=this.ep2*Math.pow(l,2),f=Math.pow(h,2),p=Math.pow(c,2),d=Math.pow(p,2);e=1-this.es*Math.pow(u,2);var g=a*Math.sqrt(e)/this.k0,y=Math.pow(g,2);r=n-(e*=c)*y/(1-this.es)*.5*(1-y/12*(5+3*p-9*h*p+h-4*f-y/30*(61+90*p-252*h*p+45*d+46*h-y/56*(1385+3633*p+4095*d+1574*d*p)))),o=E(this.long0+g*(1-y/6*(1+2*p+h-y/20*(5+28*p+24*d+8*h*p+6*h-y/42*(61+662*p+1320*d+720*d*p))))/l)}else r=i*O(s),o=0;else{var v=Math.exp(a/this.k0),m=.5*(v-1/v),_=this.lat0+s/this.k0,b=Math.cos(_);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(m,2))),r=Math.asin(e),s<0&&(r=-r),o=0===m&&0===b?0:E(Math.atan2(m,b)+this.long0)}return t.x=o,t.y=r,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},Lt=function(t){var e=Math.exp(t);return e=(e-1/e)/2},It=function(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),r=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))},At=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(It(1,e)+1))),t<0?-e:e},Tt=function(t,e){for(var n,r=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return e+n*Math.sin(2*e)},Rt=function(t,e,n){for(var r,i,o=Math.sin(e),a=Math.cos(e),s=Lt(n),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(n),l=2*a*u,c=-2*o*s,h=t.length-1,f=t[h],p=0,d=0,g=0;--h>=0;)r=d,i=p,f=l*(d=f)-r-c*(p=g)+t[h],g=c*d-i+l*p;return[(l=o*u)*f-(c=a*s)*g,l*g+c*f]};var Ft={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(jt.init.apply(this),this.forward=jt.forward,this.inverse=jt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var r=Tt(this.cbg,this.lat0);this.Zb=-this.Qn*(r+function(t,e){for(var n,r=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)n=r*o-a+t[i],a=o,o=n;return Math.sin(e)*n}(this.gtu,2*r))},forward:function(t){var e=E(t.x-this.long0),n=t.y;n=Tt(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),o=Math.sin(e),a=Math.cos(e);n=Math.atan2(r,a*i),e=Math.atan2(o*i,It(r,i*a)),e=At(Math.tan(e));var s,u,l=Rt(this.gtu,2*n,2*e);return n+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,n,r=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=Rt(this.utg,2*i,2*r);i+=o[0],r+=o[1],r=Math.atan(Lt(r));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(r),l=Math.cos(r);i=Math.atan2(a*l,It(u,l*s)),r=Math.atan2(u,l*s),e=E(r+this.long0),n=Tt(this.cgb,i)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var Dt={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(E(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*o,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ft.init.apply(this),this.forward=Ft.forward,this.inverse=Ft.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},Gt=function(t,e){return Math.pow((1-t)/(1+t),e)};var Bt={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+s)/(Math.pow(Math.tan(.5*this.lat0+s),this.C)*Gt(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+s),this.C)*Gt(this.e*Math.sin(n),this.ratexp))-i,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,r=Math.pow(Math.tan(.5*n+s)/this.K,1/this.C),o=20;o>0&&(n=2*Math.atan(r*Gt(this.e*Math.sin(t.y),-.5*this.e))-i,!(Math.abs(n-t.y)<1e-14));--o)t.y=n;return o?(t.x=e,t.y=n,t):null},names:["gauss"]};var qt={init:function(){Bt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,r,i;return t.x=E(t.x-this.long0),Bt.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*r),t.x=i*n*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*n*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,r,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=It(t.x,t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),n=Math.cos(a),i=Math.asin(n*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*n-t.y*this.sinc0*e)}else i=this.phic0,r=0;return t.x=r,t.y=i,Bt.inverse.apply(this,[t]),t.x=E(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function zt(t,e,n){return e*=n,Math.tan(.5*(i+t))*Math.pow((1-e)/(1+e),.5*n)}var Ut={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+O(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&Math.abs(Math.cos(this.lat_ts))>1e-10&&(this.k0=.5*this.cons*x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/S(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=x(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(zt(this.lat0,this.sinlat0,this.e))-i,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,r,o,a,s,u=t.x,l=t.y,c=Math.sin(l),h=Math.cos(l),f=E(u-this.long0);return Math.abs(Math.abs(u-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(f)),t.x=this.a*e*h*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*h*Math.cos(f))+this.y0,t):(n=2*Math.atan(zt(l,c,this.e))-i,o=Math.cos(n),r=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(a=S(this.e,l*this.con,this.con*c),s=2*this.a*this.k0*a/this.cons,t.x=this.x0+s*Math.sin(u-this.long0),t.y=this.y0-this.con*s*Math.cos(u-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+o*Math.cos(f)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*o*Math.cos(f))),t.y=e*(this.cosX0*r-this.sinX0*o*Math.cos(f))+this.y0),t.x=e*o*Math.sin(f)+this.x0,t))},inverse:function(t){var e,n,r,o,a;t.x-=this.x0,t.y-=this.y0;var s=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var u=2*Math.atan(s/(2*this.a*this.k0));return e=this.long0,n=this.lat0,s<=1e-10?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(u)*this.sinlat0+t.y*Math.sin(u)*this.coslat0/s),e=Math.abs(this.coslat0)<1e-10?this.lat0>0?E(this.long0+Math.atan2(t.x,-1*t.y)):E(this.long0+Math.atan2(t.x,t.y)):E(this.long0+Math.atan2(t.x*Math.sin(u),s*this.coslat0*Math.cos(u)-t.y*this.sinlat0*Math.sin(u))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(s<=1e-10)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,r=s*this.cons/(2*this.a*this.k0),n=this.con*M(this.e,r),e=this.con*E(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else o=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=1e-10?a=this.X0:(a=Math.asin(Math.cos(o)*this.sinX0+t.y*Math.sin(o)*this.cosX0/s),e=E(this.long0+Math.atan2(t.x*Math.sin(o),s*this.cosX0*Math.cos(o)-t.y*this.sinX0*Math.sin(o)))),n=-1*M(this.e,Math.tan(.5*(i+a)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_:zt};var Vt={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,r=1/this.rf,i=2*r-Math.pow(r,2),o=this.e=Math.sqrt(i);this.R=this.k0*n*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,r=e/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,l=o,c=-1e3,h=0;Math.abs(l-c)>1e-7;){if(++h>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]};var Yt={init:function(){var t,e,n,r,o,a,l,c,h,f,p,d,g,y,v=0,m=0,_=0,b=0,w=0,x=0,O=0;this.no_off=(g=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],y="object"==typeof(d=this).projName?Object.keys(d.projName)[0]:d.projName,"no_uoff"in d||"no_off"in d||-1!==g.indexOf(y)||-1!==g.indexOf(L(y))),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var P=!1;if("rectified_grid_angle"in this&&(P=!0),M&&(O=this.alpha),P&&(v=this.rectified_grid_angle),M||P)m=this.longc;else if(_=this.long1,w=this.lat1,b=this.long2,x=this.lat2,Math.abs(w-x)<=1e-7||(t=Math.abs(w))<=1e-7||Math.abs(t-i)<=1e-7||Math.abs(Math.abs(this.lat0)-i)<=1e-7||Math.abs(Math.abs(x)-i)<=1e-7)throw new Error;var N=1-this.es;e=Math.sqrt(N),Math.abs(this.lat0)>1e-10?(c=Math.sin(this.lat0),n=Math.cos(this.lat0),t=1-this.es*c*c,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/N),this.A=this.B*this.k0*e/t,(o=(r=this.B*e/(n*Math.sqrt(t)))*r-1)<=0?o=0:(o=Math.sqrt(o),this.lat0<0&&(o=-o)),this.E=o+=r,this.E*=Math.pow(S(this.e,this.lat0,c),this.B)):(this.B=1/e,this.A=this.k0,this.E=r=o=1),M||P?(M?(p=Math.asin(Math.sin(O)/r),P||(v=O)):(p=v,O=Math.asin(r*Math.sin(p))),this.lam0=m-Math.asin(.5*(o-1/o)*Math.tan(p))/this.B):(a=Math.pow(S(this.e,w,Math.sin(w)),this.B),l=Math.pow(S(this.e,x,Math.sin(x)),this.B),o=this.E/a,h=(l-a)/(l+a),f=((f=this.E*this.E)-l*a)/(f+l*a),(t=_-b)<-Math.PI?b-=u:t>Math.PI&&(b+=u),this.lam0=E(.5*(_+b)-Math.atan(f*Math.tan(.5*this.B*(_-b))/h)/this.B),p=Math.atan(2*Math.sin(this.B*E(_-this.lam0))/(o-1/o)),v=O=Math.asin(r*Math.sin(p))),this.singam=Math.sin(p),this.cosgam=Math.cos(p),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(O))),this.lat0<0&&(this.u_0=-this.u_0)),o=.5*p,this.v_pole_n=this.ArB*Math.log(Math.tan(s-o)),this.v_pole_s=this.ArB*Math.log(Math.tan(s+o))},forward:function(t){var e,n,r,o,a,s,u,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-i)>1e-10){if(e=.5*((a=this.E/Math.pow(S(this.e,t.y,Math.sin(t.y)),this.B))-(s=1/a)),n=.5*(a+s),o=Math.sin(this.B*t.x),r=(e*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(r)-1)<1e-10)throw new Error;l=.5*this.ArB*Math.log((1-r)/(1+r)),s=Math.cos(this.B*t.x),u=Math.abs(s)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+o*this.singam,s)}else l=t.y>0?this.v_pole_n:this.v_pole_s,u=this.ArB*t.y;return this.no_rot?(c.x=u,c.y=l):(u-=this.u_0,c.x=l*this.cosrot+u*this.sinrot,c.y=u*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,n,r,o,a,s,u,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(n=t.y,e=t.x):(n=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),o=.5*((r=Math.exp(-this.BrA*n))-1/r),a=.5*(r+1/r),u=((s=Math.sin(this.BrA*e))*this.cosgam+o*this.singam)/a,Math.abs(Math.abs(u)-1)<1e-10)l.x=0,l.y=u<0?-i:i;else{if(l.y=this.E/Math.sqrt((1+u)/(1-u)),l.y=M(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(o*this.cosgam-s*this.singam,Math.cos(this.BrA*e))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var Wt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),r=x(this.e,e,n),o=S(this.e,this.lat1,e),a=Math.sin(this.lat2),s=Math.cos(this.lat2),u=x(this.e,a,s),l=S(this.e,this.lat2,a),c=Math.abs(Math.abs(this.lat0)-i)<1e-10?0:S(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(r/u)/Math.log(o/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=O(n)*(i-2e-10));var r,o,a=Math.abs(Math.abs(n)-i);if(a>1e-10)r=S(this.e,n,Math.sin(n)),o=this.a*this.f0*Math.pow(r,this.ns);else{if((a=n*this.ns)<=0)return null;o=0}var s=this.ns*E(e-this.long0);return t.x=this.k0*(o*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-o*Math.cos(s))+this.y0,t},inverse:function(t){var e,n,r,o,a,s=(t.x-this.x0)/this.k0,u=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+u*u),n=1):(e=-Math.sqrt(s*s+u*u),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*s,n*u)),0!==e||this.ns>0){if(n=1/this.ns,r=Math.pow(e/(this.a*this.f0),n),-9999===(o=M(this.e,r)))return null}else o=-i;return a=E(l/this.ns+this.long0),t.x=a,t.y=o,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Xt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y,c=E(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),r=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),o=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,r,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(e)),t.x=this.long0-n/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]},Ht=function(t,e,n,r,i){return t*i-e*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)},Zt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},Kt=function(t){return.375*t*(1+.25*t*(1+.46875*t))},Jt=function(t){return.05859375*t*t*(1+.75*t)},$t=function(t){return t*t*t*(35/3072)},Qt=function(t,e,n){var r=e*n;return t/Math.sqrt(1-r*r)},te=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e};var ie={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-i)<1e-10?this.mode=this.lat0<0?1:2:Math.abs(e)<1e-10?this.mode=3:this.mode=4,this.es>0)switch(this.qp=re(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=.3333333333333333*t,e=t*t,n[0]+=.17222222222222222*e,n[1]=.06388888888888888*e,e*=t,n[0]+=.10257936507936508*e,n[1]+=.0664021164021164*e,n[2]=.016415012942191543*e,n}(this.es),this.mode){case 2:case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=re(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else 4===this.mode&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,r,o,a,u,l,c,h,f,p=t.x,d=t.y;if(p=E(p-this.long0),this.sphere){if(a=Math.sin(d),f=Math.cos(d),r=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+f*r:1+this.sinph0*a+this.cosph0*f*r)<=1e-10)return null;e=(n=Math.sqrt(2/n))*f*Math.sin(p),n*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*f*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.lat0)<1e-10)return null;n=s-.5*d,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(p),n*=r}}else{switch(l=0,c=0,h=0,r=Math.cos(p),o=Math.sin(p),a=Math.sin(d),u=re(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(l=u/this.qp,c=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:h=1+this.sinb1*l+this.cosb1*c*r;break;case this.EQUIT:h=1+c*r;break;case this.N_POLE:h=i+d,u=this.qp-u;break;case this.S_POLE:h=d-i,u=this.qp+u}if(Math.abs(h)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),n=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*l-this.sinb1*c*r):(h=Math.sqrt(2/(1+c*r)))*l*this.ymf,e=this.xmf*h*c*o;break;case this.N_POLE:case this.S_POLE:u>=0?(e=(h=Math.sqrt(u))*o,n=r*(this.mode===this.S_POLE?h:-h)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,r,o,a,s,u,l,c,h,f=t.x/this.a,p=t.y/this.a;if(this.sphere){var d,g=0,y=0;if((n=.5*(d=Math.sqrt(f*f+p*p)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(n),g=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(d)<=1e-10?0:Math.asin(p*y/d),f*=y,p=g*d;break;case this.OBLIQ:n=Math.abs(d)<=1e-10?this.lat0:Math.asin(g*this.sinph0+p*y*this.cosph0/d),f*=y*this.cosph0,p=(g-Math.sin(n)*this.sinph0)*d;break;case this.N_POLE:p=-p,n=i-n;break;case this.S_POLE:n-=i}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,p):0}else{if(u=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,p*=this.dd,(s=Math.sqrt(f*f+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*s/this.rq),r=Math.cos(o),f*=o=Math.sin(o),this.mode===this.OBLIQ?(u=r*this.sinb1+p*o*this.cosb1/s,a=this.qp*u,p=s*this.cosb1*r-p*this.sinb1*o):(u=p*o/s,a=this.qp*u,p=s*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(a=f*f+p*p))return t.x=this.long0,t.y=this.lat0,t;u=1-a/this.qp,this.mode===this.S_POLE&&(u=-u)}e=Math.atan2(f,p),l=Math.asin(u),c=this.apa,h=l+l,n=l+c[0]*Math.sin(h)+c[1]*Math.sin(h+h)+c[2]*Math.sin(h+h+h)}return t.x=E(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},oe=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var ae={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=x(this.e3,this.sin_po,this.cos_po),this.qs1=re(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=x(this.e3,this.sin_po,this.cos_po),this.qs2=re(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=re(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=re(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*E(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,n)),o=E(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,r,i,o,a=oe(.5*e);if(t<1e-10)return a;for(var s=t*t,u=1;u<=25;u++)if(a+=o=.5*(i=1-(r=t*(n=Math.sin(a)))*r)*i/Math.cos(a)*(e/(1-s)-n/i+.5/t*Math.log((1-r)/(1+r))),Math.abs(o)<=1e-7)return a;return null}};var se={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y;return r=E(u-this.long0),e=Math.sin(l),n=Math.cos(l),i=Math.cos(r),1,(o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10?(a=this.x0+1*this.a*n*Math.sin(r)/o,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)/o):(a=this.x0+this.infinity_dist*n*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),n=Math.sin(i),r=Math.cos(i),a=oe(r*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.atan2(t.x*n,e*this.cos_p14*r-t.y*this.sin_p14*n),o=E(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]};var ue={init:function(){this.sphere||(this.k0=x(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,r=t.x,i=t.y,o=E(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=re(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,n=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=E(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*i:i;for(var r,o,a,s,u=Math.asin(.5*e),l=0;l<30;l++)if(o=Math.sin(u),a=Math.cos(u),s=t*o,u+=r=Math.pow(1-s*s,2)/(2*a)*(e/(1-t*t)-o/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(r)<=1e-10)return u;return NaN}(this.e,2*t.y*this.k0/this.a),e=E(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};var le={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,r=E(e-this.long0),i=te(n-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,n=t.y;return t.x=E(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=te(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]};var ce={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Zt(this.es),this.e1=Kt(this.es),this.e2=Jt(this.es),this.e3=$t(this.es),this.ml0=this.a*Ht(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,r,i=t.x,o=t.y,a=E(i-this.long0);if(r=a*Math.sin(o),this.sphere)Math.abs(o)<=1e-10?(e=this.a*a,n=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),n=this.a*(te(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=1e-10)e=this.a*a,n=-1*this.ml0;else{var s=Qt(this.a,this.e,Math.sin(o))/Math.tan(o);e=s*Math.sin(r),n=this.a*Ht(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(r))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,r,i,o,a,s,u,l;if(r=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=1e-10)e=E(r/this.a+this.long0),n=0;else{var c;for(a=this.lat0+i/this.a,s=r*r/this.a/this.a+a*a,u=a,o=20;o;--o)if(u+=l=-1*(a*(u*(c=Math.tan(u))+1)-u-.5*(u*u+s)*c)/((u-a)/c-1),Math.abs(l)<=1e-10){n=u;break}e=E(this.long0+Math.asin(r*Math.tan(u)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=1e-10)n=0,e=E(this.long0+r/this.a);else{var h,f,p,d,g;for(a=(this.ml0+i)/this.a,s=r*r/this.a/this.a+a*a,u=a,o=20;o;--o)if(g=this.e*Math.sin(u),h=Math.sqrt(1-g*g)*Math.tan(u),f=this.a*Ht(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=l=(a*(h*(d=f/this.a)+1)-d-.5*h*(d*d+s))/(this.es*Math.sin(2*u)*(d*d+s-2*a*d)/(4*h)+(a-d)*(h*p-2/Math.sin(2*u))-p),Math.abs(l)<=1e-10){n=u;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=E(this.long0+Math.asin(r*h/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","American_Polyconic","poly"]};var he={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,i=t.y-this.lat0,o=n-this.long0,a=i/r*1e-5,s=o,u=1,l=0;for(e=1;e<=10;e++)u*=a,l+=this.A[e]*u;var c,h=l,f=s,p=1,d=0,g=0,y=0;for(e=1;e<=6;e++)c=d*h+p*f,p=p*h-d*f,d=c,g=g+this.B_re[e]*p-this.B_im[e]*d,y=y+this.B_im[e]*p+this.B_re[e]*d;return t.x=y*this.a+this.x0,t.y=g*this.a+this.y0,t},inverse:function(t){var e,n,i=t.x,o=t.y,a=i-this.x0,s=(o-this.y0)/this.a,u=a/this.a,l=1,c=0,h=0,f=0;for(e=1;e<=6;e++)n=c*s+l*u,l=l*s-c*u,c=n,h=h+this.C_re[e]*l-this.C_im[e]*c,f=f+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p.999999999999&&(n=.999999999999),e=Math.asin(n);var r=E(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return t.x=r,t.y=i,t},names:["Mollweide","moll"]};var ge={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Zt(this.es),this.e1=Kt(this.es),this.e2=Jt(this.es),this.e3=$t(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=x(this.e,this.sin_phi,this.cos_phi),this.ml1=Ht(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=x(this.e,this.sin_phi,this.cos_phi),this.ml2=Ht(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Ht(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var i=Ht(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-i)}var o=this.ns*E(n-this.long0),a=this.x0+e*Math.sin(o),s=this.y0+this.rh-e*Math.cos(o);return t.x=a,t.y=s,t},inverse:function(t){var e,n,r,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=E(this.long0+o/this.ns),r=te(this.g-n/this.a),t.x=i,t.y=r,t;var a=this.g-n/this.a;return r=ee(a,this.e0,this.e1,this.e2,this.e3),i=E(this.long0+o/this.ns),t.x=i,t.y=r,t},names:["Equidistant_Conic","eqdc"]};var ye={init:function(){this.R=this.a},forward:function(t){var e,n,r=t.x,o=t.y,a=E(r-this.long0);Math.abs(o)<=1e-10&&(e=this.x0+this.R*a,n=this.y0);var s=oe(2*Math.abs(o/Math.PI));(Math.abs(a)<=1e-10||Math.abs(Math.abs(o)-i)<=1e-10)&&(e=this.x0,n=o>=0?this.y0+Math.PI*this.R*Math.tan(.5*s):this.y0+Math.PI*this.R*-Math.tan(.5*s));var u=.5*Math.abs(Math.PI/a-a/Math.PI),l=u*u,c=Math.sin(s),h=Math.cos(s),f=h/(c+h-1),p=f*f,d=f*(2/c-1),g=d*d,y=Math.PI*this.R*(u*(f-g)+Math.sqrt(l*(f-g)*(f-g)-(g+l)*(p-g)))/(g+l);a<0&&(y=-y),e=this.x0+y;var v=l+f;return y=Math.PI*this.R*(d*v-u*Math.sqrt((g+l)*(l+1)-v*v))/(g+l),n=o>=0?this.y0+y:this.y0-y,t.x=e,t.y=n,t},inverse:function(t){var e,n,r,i,o,a,s,u,l,c,h,f;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,o=(r=t.x/h)*r+(i=t.y/h)*i,h=3*(i*i/(u=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+r*r)*s*s/u/u/u-9*a*s/u/u)/27)/(l=(a-s*s/3/u)/u)/(c=2*Math.sqrt(-l/3)),Math.abs(h)>1&&(h=h>=0?1:-1),f=Math.acos(h)/3,n=t.y>=0?(-c*Math.cos(f+Math.PI/3)-s/3/u)*Math.PI:-(-c*Math.cos(f+Math.PI/3)-s/3/u)*Math.PI,e=Math.abs(r)<1e-10?this.long0:E(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-i*i)+o*o))/2/r),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]};var ve={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))},forward:function(t){var e,n,r,o,a,s,u,l,c,h,f,p=t.x,d=t.y,g=Math.sin(t.y),y=Math.cos(t.y),v=E(p-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(i-d)*Math.sin(v),t.y=this.y0-this.a*(i-d)*Math.cos(v),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(i+d)*Math.sin(v),t.y=this.y0+this.a*(i+d)*Math.cos(v),t):(c=this.sin_p12*g+this.cos_p12*y*Math.cos(v),l=(u=Math.acos(c))?u/Math.sin(u):1,t.x=this.x0+this.a*l*y*Math.sin(v),t.y=this.y0+this.a*l*(this.cos_p12*g-this.sin_p12*y*Math.cos(v)),t):(e=Zt(this.es),n=Kt(this.es),r=Jt(this.es),o=$t(this.es),Math.abs(this.sin_p12-1)<=1e-10?(a=this.a*Ht(e,n,r,o,i),s=this.a*Ht(e,n,r,o,d),t.x=this.x0+(a-s)*Math.sin(v),t.y=this.y0-(a-s)*Math.cos(v),t):Math.abs(this.sin_p12+1)<=1e-10?(a=this.a*Ht(e,n,r,o,i),s=this.a*Ht(e,n,r,o,d),t.x=this.x0+(a+s)*Math.sin(v),t.y=this.y0+(a+s)*Math.cos(v),t):Math.abs(p)<1e-10&&Math.abs(d-this.lat0)<1e-10?(t.x=t.y=0,t):(f=(h=function(t,e,n,r,i,o){const a=r-e,s=Math.atan((1-o)*Math.tan(t)),u=Math.atan((1-o)*Math.tan(n)),l=Math.sin(s),c=Math.cos(s),h=Math.sin(u),f=Math.cos(u);let p,d,g,y,v,m,_,b,w,x,O,E,S,M,P,N=a,C=100;do{if(d=Math.sin(N),g=Math.cos(N),y=Math.sqrt(f*d*(f*d)+(c*h-l*f*g)*(c*h-l*f*g)),0===y)return{azi1:0,s12:0};v=l*h+c*f*g,m=Math.atan2(y,v),_=c*f*d/y,b=1-_*_,w=0!==b?v-2*l*h/b:0,x=o/16*b*(4+o*(4-3*b)),p=N,N=a+(1-x)*o*_*(m+x*y*(w+x*v*(2*w*w-1)))}while(Math.abs(N-p)>1e-12&&--C>0);return 0===C?{azi1:NaN,s12:NaN}:(O=b*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),E=1+O/16384*(4096+O*(O*(320-175*O)-768)),S=O/1024*(256+O*(O*(74-47*O)-128)),M=S*y*(w+S/4*(v*(2*w*w-1)-S/6*w*(4*y*y-3)*(4*w*w-3))),P=i*(1-o)*E*(m-M),{azi1:Math.atan2(f*d,c*h-l*f*g),s12:P})}(this.lat0,this.long0,d,p,this.a,this.f)).azi1,t.x=h.s12*Math.sin(f),t.y=h.s12*Math.cos(f),t))},inverse:function(t){var e,n,r,o,a,s,u,l,c,h,f,p,d,g,y;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*i*this.a)return;return n=e/this.a,r=Math.sin(n),o=Math.cos(n),a=this.long0,Math.abs(e)<=1e-10?s=this.lat0:(s=oe(o*this.sin_p12+t.y*r*this.cos_p12/e),u=Math.abs(this.lat0)-i,a=Math.abs(u)<=1e-10?this.lat0>=0?E(this.long0+Math.atan2(t.x,-t.y)):E(this.long0-Math.atan2(-t.x,t.y)):E(this.long0+Math.atan2(t.x*r,e*this.cos_p12*o-t.y*this.sin_p12*r))),t.x=a,t.y=s,t}return l=Zt(this.es),c=Kt(this.es),h=Jt(this.es),f=$t(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*Ht(l,c,h,f,i),e=Math.sqrt(t.x*t.x+t.y*t.y),s=ee((p-e)/this.a,l,c,h,f),a=E(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=s,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*Ht(l,c,h,f,i),e=Math.sqrt(t.x*t.x+t.y*t.y),s=ee((e-p)/this.a,l,c,h,f),a=E(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=s,t):(d=Math.atan2(t.x,t.y),g=Math.sqrt(t.x*t.x+t.y*t.y),y=function(t,e,n,r,i,o){const a=Math.atan((1-o)*Math.tan(t)),s=Math.sin(a),u=Math.cos(a),l=Math.sin(n),c=Math.cos(n),h=Math.atan2(s,u*c),f=u*l,p=1-f*f,d=p*(i*i-i*(1-o)*(i*(1-o)))/(i*(1-o)*(i*(1-o))),g=1+d/16384*(4096+d*(d*(320-175*d)-768)),y=d/1024*(256+d*(d*(74-47*d)-128));let v,m,_,b,w,x=r/(i*(1-o)*g),O=100;do{m=Math.cos(2*h+x),_=Math.sin(x),b=Math.cos(x),w=y*_*(m+y/4*(b*(2*m*m-1)-y/6*m*(4*_*_-3)*(4*m*m-3))),v=x,x=r/(i*(1-o)*g)+w}while(Math.abs(x-v)>1e-12&&--O>0);if(0===O)return{lat2:NaN,lon2:NaN};const E=s*_-u*b*c,S=o/16*p*(4+o*(4-3*p));return{lat2:Math.atan2(s*b+u*_*c,(1-o)*Math.sqrt(f*f+E*E)),lon2:e+(Math.atan2(_*l,u*b-s*_*c)-(1-S)*o*f*(x+S*_*(m+S*b*(2*m*m-1))))}}(this.lat0,this.long0,d,g,this.a,this.f),t.x=y.lon2,t.y=y.lat2,t)},names:["Azimuthal_Equidistant","aeqd"]};var me={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,r,i,o,a,s,u=t.x,l=t.y;return r=E(u-this.long0),e=Math.sin(l),n=Math.cos(l),i=Math.cos(r),1,((o=this.sin_p14*e+this.cos_p14*n*i)>0||Math.abs(o)<=1e-10)&&(a=1*this.a*n*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*i)),t.x=a,t.y=s,t},inverse:function(t){var e,n,r,o,a,s,u;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),n=oe(e/this.a),r=Math.sin(n),o=Math.cos(n),s=this.long0,Math.abs(e)<=1e-10?(u=this.lat0,t.x=s,t.y=u,t):(u=oe(o*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.abs(this.lat0)-i,Math.abs(a)<=1e-10?(s=this.lat0>=0?E(this.long0+Math.atan2(t.x,-t.y)):E(this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=u,t):(s=E(this.long0+Math.atan2(t.x*r,e*this.cos_p14*o-t.y*this.sin_p14*r)),t.x=s,t.y=u,t))},names:["ortho"]},_e=1,be=2,we=3,xe=4,Oe=5,Ee=6,Se=1,Me=2,Pe=3,Ne=4;function Ce(t,e,n,r){var o;return t<1e-10?(r.value=Se,o=0):(o=Math.atan2(e,n),Math.abs(o)<=s?r.value=Se:o>s&&o<=i+s?(r.value=Me,o-=i):o>i+s||o<=-(i+s)?(r.value=Pe,o=o>=0?o-l:o+l):(r.value=Ne,o+=i)),o}function ke(t,e){var n=t+e;return n<-l?n+=u:n>+l&&(n-=u),n}var je={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=i-s/2?this.face=Oe:this.lat0<=-(i-s/2)?this.face=Ee:Math.abs(this.long0)<=s?this.face=_e:Math.abs(this.long0)<=i+s?this.face=this.long0>0?be:xe:this.face=we,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,r,o,a,u,c={x:0,y:0},h={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===Oe)o=i-e,n>=s&&n<=i+s?(h.value=Se,r=n-i):n>i+s||n<=-(i+s)?(h.value=Me,r=n>0?n-l:n+l):n>-(i+s)&&n<=-s?(h.value=Pe,r=n+i):(h.value=Ne,r=n);else if(this.face===Ee)o=i+e,n>=s&&n<=i+s?(h.value=Se,r=-n+i):n=-s?(h.value=Me,r=-n):n<-s&&n>=-(i+s)?(h.value=Pe,r=-n-i):(h.value=Ne,r=n>0?-n+l:-n-l);else{var f,p,d,g,y,v;this.face===be?n=ke(n,+i):this.face===we?n=ke(n,+l):this.face===xe&&(n=ke(n,-i)),g=Math.sin(e),y=Math.cos(e),v=Math.sin(n),f=y*Math.cos(n),p=y*v,d=g,this.face===_e?r=Ce(o=Math.acos(f),d,p,h):this.face===be?r=Ce(o=Math.acos(p),d,-f,h):this.face===we?r=Ce(o=Math.acos(-f),d,-p,h):this.face===xe?r=Ce(o=Math.acos(-p),d,f,h):(o=r=0,h.value=Se)}return u=Math.atan(12/l*(r+Math.acos(Math.sin(r)*Math.cos(s))-i)),a=Math.sqrt((1-Math.cos(o))/(Math.cos(u)*Math.cos(u))/(1-Math.cos(Math.atan(1/Math.cos(r))))),h.value===Me?u+=i:h.value===Pe?u+=l:h.value===Ne&&(u+=1.5*l),c.x=a*Math.cos(u),c.y=a*Math.sin(u),c.x=c.x*this.a+this.x0,c.y=c.y*this.a+this.y0,t.x=c.x,t.y=c.y,t},inverse:function(t){var e,n,r,o,a,s,u,c,h,f,p,d,g={lam:0,phi:0},y={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?y.value=Se:t.y>=0&&t.y>=Math.abs(t.x)?(y.value=Me,e-=i):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=Pe,e=e<0?e+l:e-l):(y.value=Ne,e+=i),h=l/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),s=Math.atan(a),(u=1-(r=Math.cos(e))*r*(o=Math.tan(n))*o*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?u=-1:u>1&&(u=1),this.face===Oe)c=Math.acos(u),g.phi=i-c,y.value===Se?g.lam=s+i:y.value===Me?g.lam=s<0?s+l:s-l:y.value===Pe?g.lam=s-i:g.lam=s;else if(this.face===Ee)c=Math.acos(u),g.phi=c-i,y.value===Se?g.lam=-s+i:y.value===Me?g.lam=-s:y.value===Pe?g.lam=-s-i:g.lam=s<0?-s-l:-s+l;else{var v,m,_;h=(v=u)*v,m=(h+=(_=h>=1?0:Math.sqrt(1-h)*Math.sin(s))*_)>=1?0:Math.sqrt(1-h),y.value===Me?(h=m,m=-_,_=h):y.value===Pe?(m=-m,_=-_):y.value===Ne&&(h=m,m=_,_=-h),this.face===be?(h=v,v=-m,m=h):this.face===we?(v=-v,m=-m):this.face===xe&&(h=v,v=m,m=-h),g.phi=Math.acos(-_)-i,g.lam=Math.atan2(m,v),this.face===be?g.lam=ke(g.lam,-i):this.face===we?g.lam=ke(g.lam,-l):this.face===xe&&(g.lam=ke(g.lam,+i))}return 0!==this.es&&(f=g.phi<0?1:0,p=Math.tan(g.phi),d=this.b/Math.sqrt(p*p+this.one_minus_f_squared),g.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),f&&(g.phi=-g.phi)),g.lam+=this.long0,t.x=g.lam,t.y=g.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Le=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ie=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ae=a/5,Te=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var Re={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=E(t.x-this.long0),n=Math.abs(t.y),r=Math.floor(n*Ae);r<0?r=0:r>=18&&(r=17);var i={x:Te(Le[r],n=a*(n-.08726646259971647*r))*e,y:Te(Ie[r],n)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*.8487+this.x0,i.y=i.y*this.a*1.3523+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=Le[18][0],e.y=t.y<0?-i:i;else{var n=Math.floor(18*e.y);for(n<0?n=0:n>=18&&(n=17);;)if(Ie[n][0]>e.y)--n;else{if(!(Ie[n+1][0]<=e.y))break;++n}var r=Ie[n],a=5*(e.y-r[0])/(Ie[n+1][0]-r[0]);a=function(t,e,n,r){for(var i=e;r;--r){var o=t(i);if(i-=o,Math.abs(o)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,n,r,i,o=t.x,a=t.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/It(this.radius_p*Math.cos(a),Math.sin(a));if(n=s*Math.cos(o)*Math.cos(a),r=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-n)*n-r*r-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/It(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/It(r,e)))}else"sphere"===this.shape&&(e=Math.cos(a),n=Math.cos(o)*e,r=Math.sin(o)*e,i=Math.sin(a),e=this.radius_g-n,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/It(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(r/e),t.y=this.radius_g_1*Math.atan(i/It(r,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,n,r,i,o=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*It(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*It(1,a));var u=s/this.radius_p;if(e=a*a+u*u+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+o*o,(r=(n=2*this.radius_g*o)*n-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-n-Math.sqrt(r))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},Ye=1.340264,We=-.081106,Xe=893e-6,He=.003796,Ze=Math.sqrt(3)/2;var Ke={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=E(t.x-this.long0),n=t.y,r=Math.asin(Ze*Math.sin(n)),i=r*r,o=i*i*i;return t.x=e*Math.cos(r)/(Ze*(Ye+3*We*i+o*(7*Xe+9*He*i))),t.y=r*(Ye+We*i+o*(Xe+He*i)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,n,r,i,o=t.y;for(i=0;i<12&&(o-=r=(o*(Ye+We*(e=o*o)+(n=e*e*e)*(Xe+He*e))-t.y)/(Ye+3*We*e+n*(7*Xe+9*He*e)),!(Math.abs(r)<1e-9));++i);return n=(e=o*o)*e*e,t.x=Ze*t.x*(Ye+3*We*e+n*(7*Xe+9*He*e))/Math.cos(o),t.y=Math.asin(Math.sin(o)/Ze),t.x=E(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};function Je(t){var e,n,r,i=E(t.x-(this.long0||0)),o=t.y;return e=this.am1+this.m1-Ct(o,n=Math.sin(o),r=Math.cos(o),this.en),n=r*i/(e*Math.sqrt(1-this.es*n*n)),t.x=e*Math.sin(n),t.y=this.am1-e*Math.cos(n),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function $e(t){var e,n,r,o;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,n=It(t.x,t.y=this.am1-t.y),o=kt(this.am1+this.m1-n,this.es,this.en),(e=Math.abs(o))1e-10?(t.x=n*Math.sin(e=r*Math.cos(i)/n),t.y=this.cphi1-n*Math.cos(e)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function tn(t){var e,n;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var r=It(t.x,t.y=this.cphi1-t.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>i)throw new Error;return e=Math.abs(Math.abs(n)-i)<=1e-10?0:r*Math.atan2(t.x,t.y)/Math.cos(n),t.x=E(e+(this.long0||0)),t.y=te(n),t}var en={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<1e-10)throw new Error;this.es?(this.en=Nt(this.es),this.m1=Ct(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=$e,this.forward=Je):(Math.abs(this.phi1)+1e-10>=i?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=tn,this.forward=Qe)},names:["bonne","Bonne (Werner lat_1=90)"]};const nn=Object.assign(ft,{defaultDatum:"WGS84",Proj:J,WGS84:new J("WGS84"),Point:Mt,toPoint:at,defs:m,nadgrid:function(t,e,n){return e instanceof ArrayBuffer?function(t,e,n){var r=!0;void 0!==n&&!1===n.includeErrorFields&&(r=!1);var i=new DataView(e),o=function(t){var e=t.getInt32(8,!1);if(11===e)return!1;11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(i),a=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:W(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(i,o),s=function(t,e,n,r){for(var i=176,o=[],a=0;a=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function y(t,e){for(var n=0;n=r&&n.x<=r+i&&n.y>=o&&n.y<=o+a){if(n.xr+i-s)return-(r+i-n.x-s)/s}return 0}}function x(t){return function(e,n){var r=e.y,i=e.h,o=e.x,a=e.w,s=Math.min(i/2,t);if(n.y>=r&&n.y<=r+i&&n.x>=o&&n.x<=o+a){if(n.yr+i-s)return-(r+i-n.y-s)/s}return 0}}var O=w(150);e.defaultHorizontalStrength=O;var E=x(150);function S(t){var e=function(e){function n(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i=function(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?_(t):e}(this,v(n).call(this,t,e)),b(_(_(i)),"updateScrolling",(0,a.default)((function(t){var e=i.container.getBoundingClientRect(),n={x:e.left,y:e.top,w:e.width,h:e.height},r=(0,h.getCoords)(t),o=i.props,a=o.horizontalStrength,s=o.verticalStrength;i.scaleX=a(n,r),i.scaleY=s(n,r),i.frame||!i.scaleX&&!i.scaleY||i.startScrolling()}),100,{trailing:!1})),b(_(_(i)),"handleEvent",(function(t){i.dragging&&!i.attached&&(i.attach(),i.updateScrolling(t))})),i.wrappedInstance=r.default.createRef(),i.scaleX=0,i.scaleY=0,i.frame=null,i.attached=!1,i.dragging=!1,i}var i,u,l;return 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}}),e&&m(t,e)}(n,e),i=n,(u=[{key:"componentDidMount",value:function(){var t=this;this.container=(0,o.findDOMNode)(this.wrappedInstance.current),this.container&&"function"==typeof this.container.addEventListener&&this.container.addEventListener("dragover",this.handleEvent),window.document.body.addEventListener("touchmove",this.handleEvent);var e=this.props.dragDropManager;this.clearMonitorSubscription=e.getMonitor().subscribeToStateChange((function(){return t.handleMonitorChange()}))}},{key:"componentWillUnmount",value:function(){this.container&&"function"==typeof this.container.removeEventListener&&this.container.removeEventListener("dragover",this.handleEvent),window.document.body.removeEventListener("touchmove",this.handleEvent),this.clearMonitorSubscription(),this.stopScrolling()}},{key:"handleMonitorChange",value:function(){var t=this.props.dragDropManager.getMonitor().isDragging();!this.dragging&&t?this.dragging=!0:this.dragging&&!t&&(this.dragging=!1,this.stopScrolling())}},{key:"attach",value:function(){this.attached=!0,window.document.body.addEventListener("dragover",this.updateScrolling),window.document.body.addEventListener("touchmove",this.updateScrolling)}},{key:"detach",value:function(){this.attached=!1,window.document.body.removeEventListener("dragover",this.updateScrolling),window.document.body.removeEventListener("touchmove",this.updateScrolling)}},{key:"startScrolling",value:function(){var t=this,e=0;!function n(){var r=t.scaleX,i=t.scaleY,o=t.container,a=t.props,u=a.strengthMultiplier,l=a.onScrollChange;if(0!==u&&r+i!==0){if((e+=1)%2){var c=o.scrollLeft,f=o.scrollTop,p=o.scrollWidth,d=o.scrollHeight,g=o.clientWidth,y=o.clientHeight;l(r?o.scrollLeft=(0,h.intBetween)(0,p-g,c+r*u):c,i?o.scrollTop=(0,h.intBetween)(0,d-y,f+i*u):f)}t.frame=(0,s.default)(n)}else t.stopScrolling()}()}},{key:"stopScrolling",value:function(){this.detach(),this.scaleX=0,this.scaleY=0,this.frame&&(s.default.cancel(this.frame),this.frame=null)}},{key:"render",value:function(){var e=this.props,n=(e.strengthMultiplier,e.verticalStrength,e.horizontalStrength,e.onScrollChange,g(e,["strengthMultiplier","verticalStrength","horizontalStrength","onScrollChange"]));return r.default.createElement(t,d({ref:this.wrappedInstance},n))}}])&&y(i.prototype,u),l&&y(i,l),n}(r.Component);return b(e,"displayName","Scrolling(".concat((0,u.default)(t),")")),b(e,"propTypes",{dragDropManager:i.default.object.isRequired,onScrollChange:i.default.func,verticalStrength:i.default.func,horizontalStrength:i.default.func,strengthMultiplier:i.default.number}),b(e,"defaultProps",{onScrollChange:h.noop,verticalStrength:E,horizontalStrength:O,strengthMultiplier:30}),(0,c.default)(e,t)}e.defaultVerticalStrength=E},,,,,,function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,l=[],c=!1,h=-1;function f(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&p())}function p(){if(!c){var t=s(f);c=!0;for(var e=l.length;e;){for(u=l,l=[];++h1)for(var n=1;n=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new y(p,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new y(e?d:g,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new y(f,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(o.b);e.a=v},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";e.a=function(t){function e(t,e,r){var i=e.trim().split(d);e=i;var o=i.length,a=t.length;switch(a){case 0:case 1:var s=0;for(t=0===a?"":t[0]+" ";sr&&(r=(e=e.trim()).charCodeAt(0)),r){case 38:return e.replace(g,"$1"+t.trim());case 58:return t.trim()+e.replace(g,"$1"+t.trim());default:if(0<1*n&&0u.charCodeAt(8))break;case 115:a=a.replace(u,"-webkit-"+u)+";"+a;break;case 207:case 102:a=a.replace(u,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0p)&&(G=(z=z.replace(" ",":")).length),0x&&(h=(f+p)/2,Object(r.c)(t,e,n,o,h,y)&&(w=h,x=O)),f=p}return isNaN(w)&&(w=a[s]),u?(u.push(w,y,x),u):[w,y,x]}function a(t,e,n,r,i){for(var a=[],s=0,u=n.length;s=.5&&k>=.5){var j=N[4],L=N[5],I=a.opacity,A=void 0;1!==I&&(A=x.globalAlpha,x.globalAlpha=I),x.drawImage(P,0,0,+P.width,+P.height,Math.round(j),Math.round(L),Math.round(C),Math.round(k)),1!==I&&(x.globalAlpha=A)}return this.postRender(x,t),E&&x.restore(),w!==O.style.transform&&(O.style.transform=w),this.container},e}(i.a);e.a=f},function(t,e,n){"use strict";var r,i=n(134),o=n(207),a=n.n(o),s=n(24),u=n(68),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c="renderOrder",h=function(t){function e(e){var n=this,r=e||{},i=Object(s.a)({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return l(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(c)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new a.a(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(c,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:u.a,this.styleFunction_=null===t?void 0:Object(u.d)(this.style_),this.changed()},e}(i.a);e.a=h},function(t,e,n){"use strict";var r,i=n(86),o=n(64),a=n(20),s=n(31),u=n(24),l=n(25),c=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),h=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=Object(u.a)({},e);return"object"==typeof e.properties&&(delete r.properties,Object(u.a)(r,e.properties)),r[o.a.OPACITY]=void 0!==e.opacity?e.opacity:1,Object(s.a)("number"==typeof r[o.a.OPACITY],64),r[o.a.VISIBLE]=void 0===e.visible||e.visible,r[o.a.Z_INDEX]=e.zIndex,r[o.a.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,r[o.a.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,r[o.a.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,r[o.a.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==r.className?e.className:"ol-layer",delete r.className,n.setProperties(r),n.state_=null,n}return c(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=Object(l.a)(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return Object(a.b)()},e.prototype.getLayerStatesArray=function(t){return Object(a.b)()},e.prototype.getExtent=function(){return this.get(o.a.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(o.a.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(o.a.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(o.a.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(o.a.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(o.a.OPACITY)},e.prototype.getSourceState=function(){return Object(a.b)()},e.prototype.getVisible=function(){return this.get(o.a.VISIBLE)},e.prototype.getZIndex=function(){return this.get(o.a.Z_INDEX)},e.prototype.setExtent=function(t){this.set(o.a.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(o.a.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(o.a.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(o.a.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(o.a.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){Object(s.a)("number"==typeof t,64),this.set(o.a.OPACITY,t)},e.prototype.setVisible=function(t){this.set(o.a.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(o.a.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(i.a);e.a=h},function(t,e,n){"use strict";var r,i=n(115),o=n(159),a=n(20),s=n(35),u=n(2),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=Object(u.g)(),e}return l(e,t),e.prototype.getType=function(){return o.a.XML},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var n=Object(u.p)(t);return this.readFeatureFromDocument(n,e)}return Object(u.h)(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var n=this.readFeaturesFromDocument(t,e);return n.length>0?n[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var n=Object(u.p)(t);return this.readFeaturesFromDocument(n,e)}return Object(u.h)(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&Object(s.c)(n,this.readFeaturesFromNode(r,e));return n},e.prototype.readFeaturesFromNode=function(t,e){return Object(a.b)()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var n=Object(u.p)(t);return this.readGeometryFromDocument(n,e)}return Object(u.h)(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Object(u.p)(t);return this.readProjectionFromDocument(e)}return Object(u.h)(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},e.prototype.writeGeometryNode=function(t,e){return null},e}(i.a);e.a=c},,function(t,e,n){"use strict";var r,i=n(269),o=n(75),a=n(76),s=n(28),u=n(142),l=n(133),c=n(31),h=n(24),f=n(8),p=n(20),d=n(27),g=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y="layers",v=function(t){function e(e){var n=this,r=e||{},i=Object(h.a)({},r);delete i.layers;var a=r.layers;return(n=t.call(this,i)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(y,n.handleLayersChanged_),a?Array.isArray(a)?a=new o.a(a.slice(),{unique:!0}):Object(c.a)("function"==typeof a.getArray,43):a=new o.a(void 0,{unique:!0}),n.setLayers(a),n}return g(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(d.c),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Object(d.a)(t,a.a.ADD,this.handleLayersAdd_,this),Object(d.a)(t,a.a.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(d.c);Object(h.b)(this.listenerKeys_);for(var n=t.getArray(),r=0,i=n.length;r=0},e}(a.a);e.a=m},function(t,e,n){"use strict";var r=n(8),i=n(13),o=n(25),a=function(){function t(t,e,n,a,s,u){this.sourceProj_=t,this.targetProj_=e;var l={},c=Object(i.i)(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return l[e]||(l[e]=c(t)),l[e]},this.maxSourceExtent_=a,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!a&&!!this.sourceProj_.getExtent()&&Object(r.D)(a)==Object(r.D)(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Object(r.D)(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Object(r.D)(this.targetProj_.getExtent()):null;var h=Object(r.B)(n),f=Object(r.C)(n),p=Object(r.v)(n),d=Object(r.u)(n),g=this.transformInv_(h),y=this.transformInv_(f),v=this.transformInv_(p),m=this.transformInv_(d),_=10+(u?Math.max(0,Math.ceil(Object(o.d)(Object(r.t)(n)/(u*u*256*256)))):0);if(this.addQuad_(h,f,p,d,g,y,v,m,_),this.wrapsXInSource_){var b=1/0;this.triangles_.forEach((function(t,e,n){b=Math.min(b,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-b>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-b>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-b>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-b>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n.5&&f<1,g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var y=Object(r.b)([t,e,n,i]);g=Object(r.D)(y)/this.targetWorldWidth_>.25||g}!d&&this.sourceProj_.isGlobal()&&f&&(g=f>.25||g)}if(!(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Object(r.E)(h,this.maxSourceExtent_)){var v=0;if(!(g||isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(u[0])&&isFinite(u[1])&&isFinite(l[0])&&isFinite(l[1])))if(c>0)g=!0;else if(1!=(v=(isFinite(a[0])&&isFinite(a[1])?0:8)+(isFinite(s[0])&&isFinite(s[1])?0:4)+(isFinite(u[0])&&isFinite(u[1])?0:2)+(isFinite(l[0])&&isFinite(l[1])?0:1))&&2!=v&&4!=v&&8!=v)return;if(c>0){if(!g){var m=[(t[0]+n[0])/2,(t[1]+n[1])/2],_=this.transformInv_(m),b=void 0;if(d)b=(Object(o.e)(a[0],p)+Object(o.e)(u[0],p))/2-Object(o.e)(_[0],p);else b=(a[0]+u[0])/2-_[0];var w=(a[1]+u[1])/2-_[1];g=b*b+w*w>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var x=[(e[0]+n[0])/2,(e[1]+n[1])/2],O=this.transformInv_(x),E=[(i[0]+t[0])/2,(i[1]+t[1])/2],S=this.transformInv_(E);this.addQuad_(t,e,x,E,a,s,O,S,c-1),this.addQuad_(E,x,n,i,S,O,u,l,c-1)}else{var M=[(t[0]+e[0])/2,(t[1]+e[1])/2],P=this.transformInv_(M),N=[(n[0]+i[0])/2,(n[1]+i[1])/2],C=this.transformInv_(N);this.addQuad_(t,M,N,i,a,P,C,l,c-1),this.addQuad_(M,e,n,N,P,s,u,C,c-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&v)&&this.addTriangle_(t,n,i,a,u,l),0==(14&v)&&this.addTriangle_(t,n,e,a,u,s),v&&(0==(13&v)&&this.addTriangle_(e,i,t,s,l,a),0==(7&v)&&this.addTriangle_(e,i,n,s,l,u))}},t.prototype.calculateSourceExtent=function(){var t=Object(r.j)();return this.triangles_.forEach((function(e,n,i){var o=e.source;Object(r.q)(t,o[0]),Object(r.q)(t,o[1]),Object(r.q)(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();e.a=a},function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(2),i=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Object(r.p)(t);return this.readFromDocument(e)}return Object(r.h)(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},t.prototype.readFromNode=function(t){},t}();e.a=i},function(t,e,n){"use strict";function r(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){var e=Object.create(null);return function(n){return void 0===e[n]&&(e[n]=t(n)),e[n]}}n.d(e,"a",(function(){return r}))},,,,function(t,e,n){"use strict";var r,i={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},o=[i.FILL],a=[i.STROKE],s=[i.BEGIN_PATH],u=[i.CLOSE_PATH],l=i,c=n(16),h=n(88),f=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),p=n(127),d=n(8),g=n(30),y=n(35),v=n(84),m=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return m(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=t.length;ap&&(this.instructions.push([l.CUSTOM,p,o,t,n,v.a]),this.hitDetectionInstructions.push([l.CUSTOM,p,o,t,r||n,v.a]));break;case c.a.POINT:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([l.CUSTOM,p,o,t,n]),this.hitDetectionInstructions.push([l.CUSTOM,p,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[l.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[l.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var n,r,i=e.length,o=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[l.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[l.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!Object(y.b)(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=u)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[l.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Object(d.d)(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Object(d.c)(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(f),b=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),w=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return b(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([l.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([l.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([l.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([l.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),r=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=i,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=e},e}(_),x=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),O=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return x(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),a=[l.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([l.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,g.e,g.f],s);var o=t.getFlatCoordinates(),u=t.getStride();this.drawFlatCoordinates_(o,0,o.length,u),this.hitDetectionInstructions.push(a),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([l.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],s);for(var o=t.getEnds(),u=t.getFlatCoordinates(),c=t.getStride(),h=0,f=0,p=o.length;ft&&(v>y&&(y=v,d=m,g=o),v=0,m=o-i)),a=s,c=f,h=p),u=_,l=b}return(v+=s)>y?[m,o]:[d,g]}var k=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),j={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},L={Circle:M,Default:_,Image:w,LineString:O,Polygon:M,Text:function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return k(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,a=o.length,s=t.getType(),u=null,h=t.getStride();if(i.placement!==P.a.LINE||s!=c.a.LINE_STRING&&s!=c.a.MULTI_LINE_STRING&&s!=c.a.POLYGON&&s!=c.a.MULTI_POLYGON){var f=i.overflow?null:[];switch(s){case c.a.POINT:case c.a.MULTI_POINT:u=t.getFlatCoordinates();break;case c.a.LINE_STRING:u=t.getFlatMidpoint();break;case c.a.CIRCLE:u=t.getCenter();break;case c.a.MULTI_LINE_STRING:u=t.getFlatMidpoints(),h=2;break;case c.a.POLYGON:u=t.getFlatInteriorPoint(),i.overflow||f.push(u[2]/this.resolution),h=3;break;case c.a.MULTI_POLYGON:var p=t.getFlatInteriorPoints();u=[];for(M=0,N=p.length;MN[2]}else S=b>M;var C,k=Math.PI,j=[],L=x+r===e;if(y=0,v=O,f=t[e=x],p=t[e+1],L){m(),C=Math.atan2(p-g,f-d),S&&(C+=C>0?-k:k);var I=(M+b)/2,A=(P+w)/2;return j[0]=[I,A,(E-o)/2,C,i],j}for(var T=0,R=i.length;T0?-k:k),void 0!==C){var D=F-C;if(D+=D>k?-2*k:D<-k?2*k:0,Math.abs(D)>a)return null}C=F;for(var G=T,B=0;Tt?t-u:i,w=o+l>e?e-l:o,x=p[3]+b*h[0]+p[1],O=p[0]+w*h[1]+p[2],E=m-p[3],S=_-p[0];return(g||0!==c)&&(H[0]=E,J[0]=E,H[1]=S,Z[1]=S,Z[0]=E+x,K[0]=Z[0],K[1]=S+O,J[1]=K[1]),0!==c?(v=Object(z.b)(Object(z.c)(),n,r,1,1,c,-n,-r),Object(z.a)(v,H),Object(z.a)(v,Z),Object(z.a)(v,K),Object(z.a)(v,J),Object(d.k)(Math.min(H[0],Z[0],K[0],J[0]),Math.min(H[1],Z[1],K[1],J[1]),Math.max(H[0],Z[0],K[0],J[0]),Math.max(H[1],Z[1],K[1],J[1]),X)):Object(d.k)(Math.min(E,E+x),Math.min(S,S+O),Math.max(E,E+x),Math.max(S,S+O),X),f&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:b,drawImageH:w,originX:u,originY:l,declutterBox:{minX:X[0],minY:X[1],maxX:X[2],maxY:X[3],value:y},canvasTransform:v,scale:h}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,a){var s=!(!o&&!a),u=r.declutterBox,l=t.canvas,c=a?a[2]*r.scale[0]/2:0;return u.minX-c<=l.width/e&&u.maxX+c>=0&&u.minY-c<=l.height/e&&u.maxY+c>=0&&(s&&this.replayTextBackground_(t,H,Z,K,J,o,a),Object(g.n)(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Object(z.a)(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),a=this.strokeStates[n],s=this.pixelRatio,u=tt(t,i.textAlign||g.l),l=j[i.textBaseline||g.m],c=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:u*(o.width/s-2*i.scale[0])+2*(.5-u)*c,anchorY:l*o.height/s+2*(.5-l)*c}},t.prototype.execute_=function(t,e,n,r,i,o,a,s){var u;this.pixelCoordinates_&&Object(y.b)(n,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=Object(V.c)(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Object(z.f)(this.renderedTransform_,n));for(var c,h,f,p,v,m,_,b,w,x,O,E,S,M,P,N,C=0,k=r.length,L=0,I=0,A=0,T=null,R=null,F=this.coordinateCache_,D=this.viewRotation_,G=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,B={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:D},q=this.instructions!=r||this.overlaps?0:200;Cq&&(this.fill_(t),I=0),A>q&&(t.stroke(),A=0),I||A||(t.beginPath(),p=NaN,v=NaN),++C;break;case l.CIRCLE:var X=u[L=U[1]],H=u[L+1],Z=u[L+2]-X,K=u[L+3]-H,J=Math.sqrt(Z*Z+K*K);t.moveTo(X+J,H),t.arc(X,H,J,0,2*Math.PI,!0),++C;break;case l.CLOSE_PATH:t.closePath(),++C;break;case l.CUSTOM:L=U[1],c=U[2];var Q=U[3],tt=U[4],et=6==U.length?U[5]:void 0;B.geometry=Q,B.feature=S,C in F||(F[C]=[]);var nt=F[C];et?et(u,L,c,2,nt):(nt[0]=u[L],nt[1]=u[L+1],nt.length=2),tt(nt,B),++C;break;case l.DRAW_IMAGE:L=U[1],c=U[2],b=U[3],h=U[4],f=U[5];var rt=U[6],it=U[7],ot=U[8],at=U[9],st=U[10],ut=U[11],lt=U[12],ct=U[13],ht=U[14];if(!b&&U.length>=19){w=U[18],x=U[19],O=U[20],E=U[21];var ft=this.drawLabelWithPointPlacement_(w,x,O,E);b=ft.label,U[3]=b;var pt=U[22];h=(ft.anchorX-pt)*this.pixelRatio,U[4]=h;var dt=U[23];f=(ft.anchorY-dt)*this.pixelRatio,U[5]=f,rt=b.height,U[6]=rt,ct=b.width,U[13]=ct}var gt=void 0;U.length>24&&(gt=U[24]);var yt=void 0,vt=void 0,mt=void 0;U.length>16?(yt=U[15],vt=U[16],mt=U[17]):(yt=g.j,vt=!1,mt=!1),st&&G?ut+=D:st||G||(ut-=D);for(var _t=0;Ln)break;var s=r[a];s||(s=[],r[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var u=[],l=(i=0,r.length);i0){if(!o||h!==F&&h!==B||-1!==o.indexOf(t)){var l=(f[s]-3)/4,p=r-l%a,d=r-(l/a|0),g=i(t,e,p*p+d*d);if(g)return g}c.clearRect(0,0,a,a);break}}var g,v,m,_,b,w=Object.keys(this.executorsByZIndex_).map(Number);for(w.sort(y.g),g=w.length-1;g>=0;--g){var x=w[g].toString();for(m=this.executorsByZIndex_[x],v=it.length-1;v>=0;--v)if(void 0!==(_=m[h=it[v]])&&(b=_.executeHitDetection(c,s,n,p,l)))return b}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],a=[n,r,n,o,i,o,i,r];return Object(V.c)(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return Object(rt.d)(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,r,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(y.g),this.maxExtent_&&(t.save(),this.clip(t,n));var u,l,c,h,f,p,d=o||it;for(a&&s.reverse(),u=0,l=s.length;ug[2];)b=m*++_,l.push(this.getRenderTransform(r,i,o,.5,h,f,b).slice()),v-=m}this.hitDetectionImageData_=function(t,e,n,r,i,o,a){var s=.5*t[0],u=.5*t[1],l=Object(nt.a)(s,u);l.imageSmoothingEnabled=!1;for(var h=l.canvas,f=new ht(l,.5,i,null,a),p=n.length,g=Math.floor(16777215/p),v={},m=1;m<=p;++m){var _=n[m-1],b=_.getStyleFunction()||r;if(r){var w=b(_,o);if(w){Array.isArray(w)||(w=[w]);for(var x="#"+("000000"+(m*g).toString(16)).slice(-6),O=0,E=w.length;Ow[0]&&E[2]>w[2]&&b.push([E[0]-x,E[1],E[2]-x,E[3]])}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==g&&Object(d.g)(this.wrappedRenderedExtent_,m))return Object(y.b)(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,M=new I(mt(c,h),m,c,h);this.getLayer().getDeclutter()&&(S=new I(mt(c,h),m,c,h));var P,N=Object(bt.k)();if(N){for(var C=0,k=b.length;Ct)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Object(s.b)()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:Object(u.a)(r/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(o.a),h=n(58),f=n(178),p=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var d=function(t){function e(e,n,r,i,o,a){var s=t.call(this,e,n,a)||this;return s.crossOrigin_=i,s.src_=r,s.key=r,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return p(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=a.a.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=a.a.ERROR,this.unlistenImage_(),this.image_=((t=Object(h.a)(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=a.a.LOADED:this.state=a.a.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==a.a.ERROR&&(this.state=a.a.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==a.a.IDLE&&(this.state=a.a.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Object(f.b)(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(c),g=n(101),y=n(274),v=n(160),m=n(25),_=n(8),b=n(27),w=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x=function(t){function e(e,n,r,i,o,s,u,l,c,h,f,p){var d=t.call(this,o,a.a.IDLE)||this;d.renderEdges_=void 0!==f&&f,d.contextOptions_=p,d.pixelRatio_=u,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=n,d.targetTileGrid_=i,d.wrappedTileCoord_=s||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var b=i.getTileCoordExtent(d.wrappedTileCoord_),w=d.targetTileGrid_.getExtent(),x=d.sourceTileGrid_.getExtent(),O=w?Object(_.A)(b,w):b;if(0===Object(_.t)(O))return d.state=a.a.EMPTY,d;var E=e.getExtent();E&&(x=x?Object(_.A)(x,E):E);var S=i.getResolution(d.wrappedTileCoord_[0]),M=Object(v.a)(e,r,O,S);if(!isFinite(M)||M<=0)return d.state=a.a.EMPTY,d;var P=void 0!==h?h:g.b;if(d.triangulation_=new y.a(e,r,O,x,M*P,S),0===d.triangulation_.getTriangles().length)return d.state=a.a.EMPTY,d;d.sourceZ_=n.getZForResolution(M);var N=d.triangulation_.calculateSourceExtent();if(x&&(e.canWrapX()?(N[1]=Object(m.a)(N[1],x[1],x[3]),N[3]=Object(m.a)(N[3],x[1],x[3])):N=Object(_.A)(N,x)),Object(_.t)(N)){for(var C=n.getTileRangeForExtentAndZ(N,d.sourceZ_),k=C.minX;k<=C.maxX;k++)for(var j=C.minY;j<=C.maxY;j++){var L=c(d.sourceZ_,k,j,u);L&&d.sourceTiles_.push(L)}0===d.sourceTiles_.length&&(d.state=a.a.EMPTY)}else d.state=a.a.EMPTY;return d}return w(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==a.a.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=a.a.ERROR;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),u=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Object(v.c)(r,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,u,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=a.a.LOADED}this.changed()},e.prototype.load=function(){if(this.state==a.a.IDLE){this.state=a.a.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var o=e.getState();if(o==a.a.IDLE||o==a.a.LOADING){t++;var s=Object(b.a)(e,i.a.CHANGE,(function(n){var r=e.getState();r!=a.a.LOADED&&r!=a.a.ERROR&&r!=a.a.EMPTY||(Object(b.c)(s),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(s)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,n){t.getState()==a.a.IDLE&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(b.c),this.sourcesListenerKeys_=null},e}(c),O=n(31),E=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var n=this.entries_[t];return Object(O.a)(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Object(O.a)(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Object(O.a)(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),S=n(98),M=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return M(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),e=Object(S.b)(t)[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(Object(S.c)(t.tileCoord)),t.release())}.bind(this))}},e}(E),N="tileloadstart",C="tileloadend",k="tileloaderror",j=n(73),L=n(208),I=n(13),A=n(182),T=n(67),R=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),F=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var r=e.tileGrid;return r&&Object(T.d)(r.getTileSize(r.getMinZoom()),[256,256]),n.tileCache=new P(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition},n.zDirection=e.zDirection?e.zDirection:0,n}return R(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,u,l=!0,c=n.minX;c<=n.maxX;++c)for(var h=n.minY;h<=n.maxY;++h)s=Object(S.d)(e,c,h),u=!1,i.containsKey(s)&&(u=(o=i.get(s)).getState()===a.a.LOADED)&&(u=!1!==r(o)),u||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,n,r,i){return Object(s.b)()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Object(A.c)(t)},e.prototype.getTileCacheForProjection=function(t){return Object(O.a)(Object(I.c)(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(e),o=Object(T.d)(r.getTileSize(t),this.tmpSize);return 1==i?o:Object(T.c)(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=Object(A.d)(r,t,n)),Object(S.f)(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,r){},e}(L.a),D=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return R(e,t),e}(j.a),G=F;function B(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,u){return a?t.replace(n,a[0].toString()).replace(r,a[1].toString()).replace(i,a[2].toString()).replace(o,(function(){var t=a[0],n=e.getFullTileRange(t);return Object(O.a)(n,55),(n.getHeight()-a[2]-1).toString()})):void 0}}function q(t,e){for(var n=t.length,r=new Array(n),i=0;i=0;--E){var S=_[E],M=S.layer;if(M.hasRenderer()&&Object(c.b)(S,f)&&a.call(s,M)){var P=M.getRenderer(),N=M.getSource();if(P&&N){var C=N.getWrapX()?g:t,k=p.bind(null,S.managed);x[0]=C[0]+y[O][0],x[1]=C[1]+y[O][1],l=P.forEachFeatureAtCoordinate(x,e,n,k,w)}if(l)return l}}if(0!==w.length){var j=1/w.length;return w.forEach((function(t,e){return t.distanceSq+=e*j})),w.sort((function(t,e){return t.distanceSq-e.distanceSq})),w.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){return Object(a.b)()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,r,i,a){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,r,o.b,this,i,a)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Object(a.b)()},e.prototype.scheduleExpireIconCache=function(t){l.a.canExpireCache()&&t.postRenderFunctions.push(p)},e}(i.a),g=n(142),y=n(266),v=n(147),m=n(133),_=n(65),b=n(30),w=n(27),x=n(58),O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=Object(w.a)(b.a,g.a.PROPERTYCHANGE,e.redrawText.bind(e)),n.element_=document.createElement("div");var r=n.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",n.element_.className=_.e+" ol-layers";var i=e.getViewport();return i.insertBefore(n.element_,i.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return O(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var r=new y.a(t,void 0,e);n.dispatchEvent(r)}},e.prototype.disposeInternal=function(){Object(w.c)(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(v.a.PRECOMPOSE,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var r=[],i=null,o=0,a=e.length;o=0;--o)r[o].renderDeclutter(t);Object(x.f)(this.element_,this.children_),this.dispatchRenderEvent(v.a.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,n,r,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var u=a[s],l=u.layer;if(l.hasRenderer()&&Object(c.b)(u,o)&&i(l)){var h=l.getRenderer().getDataAtPixel(t,e,n);if(h){var f=r(l,h);if(f)return f}}}},e}(d),S=n(86),M=n(75),P=n(76),N=n(28),C=n(272),k=n(144),j=n(50),L=n(183),I=n(140),A=n(81),T=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),R=function(t){function e(e,n){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=void 0===n?1:n,r.down_=null;var i=r.map_.getViewport();return r.activePointers_=0,r.trackedTouches_={},r.element_=i,r.pointerdownListenerKey_=Object(w.a)(i,L.a.POINTERDOWN,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=Object(w.a)(i,L.a.POINTERMOVE,r.relayEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(N.a.TOUCHMOVE,r.boundHandleTouchMove_,!!A.e&&{passive:!1}),r}return T(e,t),e.prototype.emulateClick_=function(t){var e=new k.a(j.a.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new k.a(j.a.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new k.a(j.a.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==j.a.POINTERUP||e.type==j.a.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==j.a.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new k.a(j.a.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(w.c),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new k.a(j.a.POINTERDOWN,this.map_,t);for(var n in this.dispatchEvent(e),this.down_={},t){var r=t[n];this.down_[n]="function"==typeof r?o.c:r}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Object(w.a)(i,j.a.POINTERMOVE,this.handlePointerMove_,this),Object(w.a)(i,j.a.POINTERUP,this.handlePointerUp_,this),Object(w.a)(this.element_,j.a.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Object(w.a)(this.element_.getRootNode(),j.a.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new k.a(j.a.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new k.a(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Object(w.c)(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(N.a.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Object(w.c)(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(w.c),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(I.a),F=n(220),D=n(210),G="layergroup",B="size",q="target",z="view",U=n(31),V=n(24),Y=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Object(V.b)(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(n);return delete this.queuedElements_[r],n},t.prototype.enqueue=function(t){Object(U.a)(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,n=this.priorities_,r=e.length,i=e[t],o=n[t],a=t;t>1;){var s=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),l=ut;){var a=this.getParentIndex_(e);if(!(r[a]>o))break;n[e]=n[a],r[e]=r[a],e=a}n[e]=i,r[e]=o},t.prototype.reprioritize=function(){var t,e,n,r=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e0;)r=(n=this.dequeue()[0]).getKey(),n.getState()!==W.a.IDLE||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,n.load())},e}(Y);var Z=n(128),K=n(71),J=n(13),$=n(67),Q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var tt=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,r,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new C.a({layers:t.layers});o[G]=a,o[q]=t.target,o[z]=t.view instanceof Z.a?t.view:new Z.a,void 0!==t.controls&&(Array.isArray(t.controls)?n=new M.a(t.controls.slice()):(Object(U.a)("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new M.a(t.interactions.slice()):(Object(U.a)("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new M.a(t.overlays.slice()):(Object(U.a)("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new M.a;return{controls:n,interactions:r,keyboardEventTarget:e,overlays:i,values:o}}(e);n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:A.a,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=Object(s.c)(),n.pixelToCoordinateTransform_=Object(s.c)(),n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=r.keyboardEventTarget,n.keyHandlerKeys_=null,n.controls=r.controls||new M.a,n.interactions=r.interactions||new M.a,n.overlays_=r.overlays,n.overlayIdIndex_={},n.renderer_=null,n.handleResize_,n.postRenderFunctions_=[],n.tileQueue_=new H(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(G,n.handleLayerGroupChanged_),n.addChangeListener(z,n.handleViewChanged_),n.addChangeListener(B,n.handleSizeChanged_),n.addChangeListener(q,n.handleTargetChanged_),n.setProperties(r.values);var i=n;return!e.view||e.view instanceof Z.a||e.view.then((function(t){i.setView(new Z.a(t))})),n.controls.addEventListener(P.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(P.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(P.a.ADD,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(P.a.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(P.a.ADD,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(P.a.REMOVE,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n}return Q(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_){var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,a=void 0!==n.layerFilter?n.layerFilter:o.b,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,s,e,null,a,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_){var r=n||{},i=void 0!==r.hitTolerance?r.hitTolerance:0,a=r.layerFilter||o.b;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,a)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:o.b,i=void 0!==e.hitTolerance?e.hitTolerance:0,a=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(q)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Object(J.m)(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Object(s.a)(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(G)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof M.a)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e=0;s--){var u=a[s];if(u.getMap()===this&&u.getActive()&&this.getTargetElement())if(!u.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,r=n;if(t){var i=t.viewHints;if(i[K.a.ANIMATING]||i[K.a.INTERACTING]){var o=Date.now()-t.time>8;n=o?0:8,r=o?0:2}}e.getTilesLoading()0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!Object(s.b)(e,this.renderedAttributions_)){Object(l.d)(this.ulElement_);for(var r=0,i=e.length;r0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:p.b}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var r="rotate("+n+"rad)";if(this.autoHide_){var i=this.element.classList.contains(a.c);i||0!==n?i&&0!==n&&this.element.classList.remove(a.c):this.element.classList.add(a.c)}this.label_.style.transform=r}this.rotation_=n}},e}(i.a),y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),v=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",s=void 0!==r.delta?r.delta:1,u=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",l=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",c=void 0!==r.zoomInLabel?r.zoomInLabel:"+",h=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",f=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",p=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",d=document.createElement("button");d.className=u,d.setAttribute("type","button"),d.title=f,d.appendChild("string"==typeof c?document.createTextNode(c):c),d.addEventListener(o.a.CLICK,n.handleClick_.bind(n,s),!1);var g=document.createElement("button");g.className=l,g.setAttribute("type","button"),g.title=p,g.appendChild("string"==typeof h?document.createTextNode(h):h),g.addEventListener(o.a.CLICK,n.handleClick_.bind(n,-s),!1);var y=i+" "+a.e+" "+a.b,v=n.element;return v.className=y,v.appendChild(d),v.appendChild(g),n.duration_=void 0!==r.duration?r.duration:250,n}return y(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var n=e.getZoom();if(void 0!==n){var r=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:p.b})):e.setZoom(r)}}},e}(i.a);function m(t){var e=t||{},n=new f.a;return(void 0===e.zoom||e.zoom)&&n.push(new v(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new g(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new h(e.attributionOptions)),n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r=function(){function t(t){var e=this;this._insertTag=function(t){var n;n=0===e.tags.length?e.insertionPoint?e.insertionPoint.nextSibling:e.prepend?e.container.firstChild:e.before:e.tags[e.tags.length-1].nextSibling,e.container.insertBefore(t,n),e.tags.push(t)},this.isSpeedy=void 0===t.speedy||t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(t){t.forEach(this._insertTag)},e.insert=function(t){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),void 0!==t.nonce&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}(this));var e=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(t){if(t.sheet)return t.sheet;for(var e=0;e-1&&!t.return)switch(t.type){case i.a:t.return=function t(e,n){switch(Object(i.o)(e,n)){case 5103:return i.f+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return i.f+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return i.f+e+i.c+e+i.d+e+e;case 6828:case 4268:return i.f+e+i.d+e+e;case 6165:return i.f+e+i.d+"flex-"+e+e;case 5187:return i.f+e+Object(i.v)(e,/(\w+).+(:[^]+)/,i.f+"box-$1$2"+i.d+"flex-$1$2")+e;case 5443:return i.f+e+i.d+"flex-item-"+Object(i.v)(e,/flex-|-self/,"")+e;case 4675:return i.f+e+i.d+"flex-line-pack"+Object(i.v)(e,/align-content|flex-|-self/,"")+e;case 5548:return i.f+e+i.d+Object(i.v)(e,"shrink","negative")+e;case 5292:return i.f+e+i.d+Object(i.v)(e,"basis","preferred-size")+e;case 6060:return i.f+"box-"+Object(i.v)(e,"-grow","")+i.f+e+i.d+Object(i.v)(e,"grow","positive")+e;case 4554:return i.f+Object(i.v)(e,/([^-])(transform)/g,"$1"+i.f+"$2")+e;case 6187:return Object(i.v)(Object(i.v)(Object(i.v)(e,/(zoom-|grab)/,i.f+"$1"),/(image-set)/,i.f+"$1"),e,"")+e;case 5495:case 3959:return Object(i.v)(e,/(image-set\([^]*)/,i.f+"$1$`$1");case 4968:return Object(i.v)(Object(i.v)(e,/(.+:)(flex-)?(.*)/,i.f+"box-pack:$3"+i.d+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+i.f+e+e;case 4095:case 3583:case 4068:case 2532:return Object(i.v)(e,/(.+)-inline(.+)/,i.f+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Object(i.A)(e)-1-n>6)switch(Object(i.h)(e,n+1)){case 109:if(45!==Object(i.h)(e,n+4))break;case 102:return Object(i.v)(e,/(.+:)(.+)-([^]+)/,"$1"+i.f+"$2-$3$1"+i.c+(108==Object(i.h)(e,n+3)?"$3":"$2-$3"))+e;case 115:return~Object(i.p)(e,"stretch")?t(Object(i.v)(e,"stretch","fill-available"),n)+e:e}break;case 4949:if(115!==Object(i.h)(e,n+1))break;case 6444:switch(Object(i.h)(e,Object(i.A)(e)-3-(~Object(i.p)(e,"!important")&&10))){case 107:return Object(i.v)(e,":",":"+i.f)+e;case 101:return Object(i.v)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+i.f+(45===Object(i.h)(e,14)?"inline-":"")+"box$3$1"+i.f+"$2$3$1"+i.d+"$2box$3")+e}break;case 5936:switch(Object(i.h)(e,n+11)){case 114:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return i.f+e+i.d+Object(i.v)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return i.f+e+i.d+e+e}return e}(t.value,t.length);break;case i.b:return Object(i.x)([Object(i.k)(t,{value:Object(i.v)(t.value,"@","@"+i.f)})],r);case i.e:if(t.length)return Object(i.i)(t.props,(function(e){switch(Object(i.q)(e,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Object(i.x)([Object(i.k)(t,{props:[Object(i.v)(e,/:(read-\w+)/,":"+i.c+"$1")]})],r);case"::placeholder":return Object(i.x)([Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,":"+i.f+"input-$1")]}),Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,":"+i.c+"$1")]}),Object(i.k)(t,{props:[Object(i.v)(e,/:(plac\w+)/,i.d+"input-$1")]})],r)}return""}))}}],g=function(t){var e=t.key;if(s&&"css"===e){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(t){-1!==t.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(t),t.setAttribute("data-s",""))}))}var o,a,u=t.stylisPlugins||d,l={},c=[];s&&(o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+e+' "]'),(function(t){for(var e=t.getAttribute("data-emotion").split(" "),n=1;np?d=Math.round(s/p):g=Math.round(h/f),d!==i||g!==o){var y=Object(l.a)(d,g);Object(u.a)(y,this.getContextOptions());var v=y.canvas;y.drawImage(r,0,0,i,o,0,0,v.width,v.height),this.image_.setImage(v)}}t.prototype.handleImageChange.call(this,e)},e}(o.a);e.a=p},,,,function(t,e,n){"use strict";var r,i=n(136),o=n(211),a=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=['Map tiles by Stamen Design, under CC BY 3.0.',o.a],u={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},l={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},c=function(t){function e(e){var n=e.layer.indexOf("-"),r=-1==n?e.layer:e.layer.slice(0,n),i=l[r],o=u[e.layer],a=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:s,cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,maxZoom:null!=e.maxZoom?e.maxZoom:i.maxZoom,minZoom:null!=e.minZoom?e.minZoom:i.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:a,wrapX:e.wrapX,zDirection:e.zDirection})||this}return a(e,t),e}(i.a);e.a=c},function(t,e,n){"use strict";var r,i=n(134),o=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return o(e,t),e}(i.a),s=n(267),u=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),l=function(t){function e(e){return t.call(this,e)||this}return u(e,t),e.prototype.createRenderer=function(){return new s.a(this)},e}(a);e.a=l},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(126);function i(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}function o(){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=i(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}}).apply(null,arguments)}},,function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,s,u=a(t),l=1;l({x:t,y:t});function u(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function l(){return"undefined"!=typeof window}function c(t){return p(t)?(t.nodeName||"").toLowerCase():"#document"}function h(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function f(t){var e;return null==(e=(p(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function p(t){return!!l()&&(t instanceof Node||t instanceof h(t).Node)}function d(t){return!!l()&&(t instanceof Element||t instanceof h(t).Element)}function g(t){return!!l()&&(t instanceof HTMLElement||t instanceof h(t).HTMLElement)}function y(t){return!(!l()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof h(t).ShadowRoot)}function v(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=b(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function m(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function _(t){return["html","body","#document"].includes(c(t))}function b(t){return h(t).getComputedStyle(t)}function w(t){if("html"===c(t))return t;const e=t.assignedSlot||t.parentNode||y(t)&&t.host||f(t);return y(e)?e.host:e}function x(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=function t(e){const n=w(e);return _(n)?e.ownerDocument?e.ownerDocument.body:e.body:g(n)&&v(n)?n:t(n)}(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=h(i);if(o){const t=O(a);return e.concat(a,a.visualViewport||[],v(i)?i:[],t&&n?x(t):[])}return e.concat(i,x(i,[],n))}function O(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function E(t){const e=b(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=g(t),a=i?t.offsetWidth:n,s=i?t.offsetHeight:r,u=o(n)!==a||o(r)!==s;return u&&(n=a,r=s),{width:n,height:r,$:u}}function S(t){return d(t)?t:t.contextElement}function M(t){const e=S(t);if(!g(e))return s(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:a}=E(e);let u=(a?o(n.width):n.width)/r,l=(a?o(n.height):n.height)/i;return u&&Number.isFinite(u)||(u=1),l&&Number.isFinite(l)||(l=1),{x:u,y:l}}const P=s(0);function N(t){const e=h(t);return m()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:P}function C(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),o=S(t);let a=s(1);e&&(r?d(r)&&(a=M(r)):a=M(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==h(t))&&e}(o,n,r)?N(o):s(0);let c=(i.left+l.x)/a.x,f=(i.top+l.y)/a.y,p=i.width/a.x,g=i.height/a.y;if(o){const t=h(o),e=r&&d(r)?h(r):r;let n=t,i=O(n);for(;i&&r&&e!==n;){const t=M(i),e=i.getBoundingClientRect(),r=b(i),o=e.left+(i.clientLeft+parseFloat(r.paddingLeft))*t.x,a=e.top+(i.clientTop+parseFloat(r.paddingTop))*t.y;c*=t.x,f*=t.y,p*=t.x,g*=t.y,c+=o,f+=a,n=h(i),i=O(n)}}return u({width:p,height:g,x:c,y:f})}function k(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function j(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:s=!0,ancestorResize:u=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:h=!1}=o,p=S(t),d=s||u?[...p?x(p):[],...x(e)]:[];d.forEach(t=>{s&&t.addEventListener("scroll",n,{passive:!0}),u&&t.addEventListener("resize",n)});const g=p&&c?function(t,e){let n,o=null;const s=f(t);function u(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(c,h){void 0===c&&(c=!1),void 0===h&&(h=1),u();const f=t.getBoundingClientRect(),{left:p,top:d,width:g,height:y}=f;if(c||e(),!g||!y)return;const v={rootMargin:-a(d)+"px "+-a(s.clientWidth-(p+g))+"px "+-a(s.clientHeight-(d+y))+"px "+-a(p)+"px",threshold:i(0,r(1,h))||1};let m=!0;function _(e){const r=e[0].intersectionRatio;if(r!==h){if(!m)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||k(f,t.getBoundingClientRect())||l(),m=!1}try{o=new IntersectionObserver(_,{...v,root:s.ownerDocument})}catch(t){o=new IntersectionObserver(_,v)}o.observe(t)}(!0),u}(p,n):null;let y,v=-1,m=null;l&&(m=new ResizeObserver(t=>{let[r]=t;r&&r.target===p&&m&&(m.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var t;null==(t=m)||t.observe(e)})),n()}),p&&!h&&m.observe(p),m.observe(e));let _=h?C(t):null;return h&&function e(){const r=C(t);_&&!k(_,r)&&n();_=r,y=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach(t=>{s&&t.removeEventListener("scroll",n),u&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=m)||t.disconnect(),m=null,h&&cancelAnimationFrame(y)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n(13);function r(t,e){return[[-1/0,-1/0,1/0,1/0]]}},,function(t,e,n){"use strict";var r,i=n(139),o=n(63),a=n(65),s=n(13),u=n(31),l=(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c="degrees",h="imperial",f="nautical",p="metric",d="us",g=[1,2,5],y=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=i+"-inner",n.element.className=i+" "+a.e,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==r.minWidth?r.minWidth:64,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener("units",n.handleUnitsChanged_),n.setUnits(r.units||p),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return l(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,r=this.getUnits(),i=r==c?o.b.DEGREES:o.b.METERS,a=Object(s.h)(n,t.resolution,e,i),l=this.minWidth_*(this.dpi_||25.4/.28)/(25.4/.28),y=l*a,v="";if(r==c){var m=s.a[o.b.DEGREES];(y*=m)=l)break;++O}x=this.scaleBar_?this.createScaleBar(b,_,v):_.toFixed(w<0?-w:0)+" "+v,this.renderedHTML_!=x&&(this.innerElement_.innerHTML=x,this.renderedHTML_=x),this.renderedWidth_!=b&&(this.innerElement_.style.width=b+"px",this.renderedWidth_=b),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,n){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s
'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,n):"")+""),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,n)),a="#ffffff"===a?"#000000":"#ffffff";return'
'+(this.scaleBarText_?'
'+r+"
":"")+i.join("")+"
"},e.prototype.createMarker=function(t,e){return'
'},e.prototype.createStepText=function(t,e,n,r,i){var o=(0===t?0:Math.round(r/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'
'+o+"
"},e.prototype.getScaleForResolution=function(){var t=Object(s.h)(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||25.4/.28,n=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*n*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(i.a);e.a=y},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(113),i=n.n(r),o=function(t,e){return i()(t,e)}},,,,,,function(t,e,n){(function(r){var i,o;i=function(){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){if("object"!==i(t.console)){t.console={};for(var e,n,r=t.console,o=function(){},a=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=a.pop();)r[e]||(r[e]={});for(;n=s.pop();)r[n]||(r[n]=o)}var u,l,c,h,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,u="",l=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[s++]=f.charAt(e)+f.charAt(n)+f.charAt(r)+f.charAt(i),a>16&255,n=a>>8&255,r=255&a,l[u++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s>>0,r=new Array(n),i=1>>0,i=0;i>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i>16&255,r=l>>8&255,o=255&l}if(void 0===r||void 0===a&&n===r&&r===o)if("string"==typeof n)e=n+" "+s[0];else switch(t.precision){case 2:e=_(n/255)+" "+s[0];break;case 3:default:e=b(n/255)+" "+s[0]}else if(void 0===a||"object"===i(a)){if(a&&!isNaN(a.a)&&0===a.a)return["1.000","1.000","1.000",s[1]].join(" ");if("string"==typeof n)e=[n,r,o,s[1]].join(" ");else switch(t.precision){case 2:e=[_(n/255),_(r/255),_(o/255),s[1]].join(" ");break;default:case 3:e=[b(n/255),b(r/255),b(o/255),s[1]].join(" ")}}else if("string"==typeof n)e=[n,r,o,a,s[2]].join(" ");else switch(t.precision){case 2:e=[_(n/255),_(r/255),_(o/255),_(a/255),s[2]].join(" ");break;case 3:default:e=[b(n/255),b(r/255),b(o/255),b(a/255),s[2]].join(" ")}return e},gt=p.__private__.getFilters=function(){return l},yt=p.__private__.putStream=function(t){var e,n=(t=t||{}).data||"",r=t.filters||gt(),i=t.alreadyAppliedFilters||[],o=t.addLength1||!1,a=n.length;!0===r&&(r=["FlateEncode"]);var u=t.additionalKeyValues||[],l=(e=void 0!==s.API.processDataByFilters?s.API.processDataByFilters(n,r):{data:n,reverseChain:[]}).reverseChain+(Array.isArray(i)?i.join(" "):i.toString());0!==e.data.length&&(u.push({key:"Length",value:e.data.length}),!0===o&&u.push({key:"Length1",value:a})),0!=l.length&&(l.split("/").length-1==1?u.push({key:"Filter",value:l}):u.push({key:"Filter",value:"["+l+"]"})),q("<<");for(var c=0;c>"),0!==e.data.length&&(q("stream"),q(e.data),q("endstream"))},vt=p.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;lt(r,!0),rt[N].mediaBox.topRightX,rt[N].mediaBox.bottomLeftX,rt[N].mediaBox.topRightY,rt[N].mediaBox.bottomLeftY,q("<>"),q("endobj");var o=n.join("\n");return lt(i,!0),yt({data:o,filters:gt()}),q("endobj"),r},mt=p.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=nt;t++)rt[t].objId=ut(),rt[t].contentsObjId=ut();for(t=1;t<=nt;t++)n.push(vt({number:t,data:D[t],objId:rt[t].objId,contentsObjId:rt[t].contentsObjId,mediaBox:rt[t].mediaBox,cropBox:rt[t].cropBox,bleedBox:rt[t].bleedBox,trimBox:rt[t].trimBox,artBox:rt[t].artBox,userUnit:rt[t].userUnit,rootDictionaryObjId:ht,resourceDictionaryObjId:ft}));lt(ht,!0),q("<>"),q("endobj"),ot.publish("postPutPages")},_t=function(t,e,n){et.hasOwnProperty(e)||(et[e]={}),et[e][n]=t},bt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(tt).length+1).toString(10),a={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return ot.publish("addFont",{font:a,instance:this}),void 0!==o&&(tt[o]=a,_t(o,e,n)),o},wt=p.__private__.pdfEscape=p.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,a,s,u,l,c;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&tt[I].metadata&&tt[I].metadata[i]&&tt[I].metadata[i].encoding&&(o=tt[I].metadata[i].encoding,!a&&tt[I].encoding&&(a=tt[I].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(u=!1,s=[],n=0,r=t.length;n>8&&(u=!0);t=s.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(c),s.push(l-(c<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},xt=p.__private__.beginPage=function(t,e){var r,i="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&(r=v(t.toLowerCase()))&&(t=r[0],e=r[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=n[0],e=n[1]),i){switch(i.substr(0,1)){case"l":t>"),q("endobj")},Nt=p.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||ht;switch(st(),q("<<"),q("/Type /Catalog"),q("/Pages "+e+" 0 R"),k||(k="fullwidth"),k){case"fullwidth":q("/OpenAction [3 0 R /FitH null]");break;case"fullheight":q("/OpenAction [3 0 R /FitV null]");break;case"fullpage":q("/OpenAction [3 0 R /Fit]");break;case"original":q("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+k;"%"===n.substr(n.length-1)&&(k=parseInt(k)/100),"number"==typeof k&&q("/OpenAction [3 0 R /XYZ null null "+_(k)+"]")}switch(L||(L="continuous"),L){case"continuous":q("/PageLayout /OneColumn");break;case"single":q("/PageLayout /SinglePage");break;case"two":case"twoleft":q("/PageLayout /TwoColumnLeft");break;case"tworight":q("/PageLayout /TwoColumnRight")}j&&q("/PageMode /"+j),ot.publish("putCatalog"),q(">>"),q("endobj")},Ct=p.__private__.putTrailer=function(){q("trailer"),q("<<"),q("/Size "+($+1)),q("/Root "+$+" 0 R"),q("/Info "+($-1)+" 0 R"),q("/ID [ <"+w+"> <"+w+"> ]"),q(">>")},jt=p.__private__.putHeader=function(){q("%PDF-"+d),q("%ºß¬à")},Lt=p.__private__.putXRef=function(){var t=1,e="0000000000";for(q("xref"),q("0 "+($+1)),q("0000000000 65535 f "),t=1;t<=$;t++)"function"==typeof Q[t]?q((e+Q[t]()).slice(-10)+" 00000 n "):void 0!==Q[t]?q((e+Q[t]).slice(-10)+" 00000 n "):q("0000000000 00000 n ")},It=p.__private__.buildDocument=function(){F=!1,B=$=0,G=[],Q=[],it=[],ht=ut(),ft=ut(),ot.publish("buildDocument"),jt(),mt(),function(){ot.publish("putAdditionalObjects");for(var t=0;t>"),q("endobj")));var e}(),ot.publish("putResources"),lt(ft,!0),q("<<"),function(){for(var t in q("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),q("/Font <<"),tt)tt.hasOwnProperty(t)&&(!1===h||!0===h&&f.hasOwnProperty(t))&&q("/"+t+" "+tt[t].objectNumber+" 0 R");q(">>"),q("/XObject <<"),ot.publish("putXobjectDict"),q(">>")}(),q(">>"),q("endobj"),ot.publish("postPutResources"),Pt(),Nt();var t=B;return Lt(),Ct(),q("startxref"),q(""+t),q("%%EOF"),F=!0,G.join("\n")},At=p.__private__.getBlob=function(t){return new Blob([U(t)],{type:"application/pdf"})},Tt=p.output=p.__private__.output=((T=function(t,e){e=e||{};var n=It();switch("string"==typeof e?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return n;case"save":p.save(e.filename);break;case"arraybuffer":return U(n);case"blob":return At(n);case"bloburi":case"bloburl":if(void 0!==r.URL&&"function"==typeof r.URL.createObjectURL)return r.URL&&r.URL.createObjectURL(At(n))||void 0;console.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":return"data:application/pdf;filename="+e.filename+";base64,"+btoa(n);case"dataurlnewwindow":var i='',o=r.open();if(null!==o&&o.document.write(i),o||"undefined"==typeof safari)return o;case"datauri":case"dataurl":return r.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return T.apply(this,arguments)}catch(n){var t=n.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var e="Error in function "+t.split("\n")[0].split("<")[0]+": "+n.message;if(!r.console)throw new Error(e);r.console.error(e,n),r.alert&&alert(e)}},(T.foo.bar=T).foo),Rt=function(t){return!0===Array.isArray(at)&&-1":")"),et=1):(J=Ht(e),$=Zt(n),Q=(l?"<":"(")+x[K]+(l?">":")")),void 0!==U&&void 0!==U[K]&&(nt=U[K]+" Tw\n"),0!==C.length&&0===K?t.push(nt+C.join(" ")+" "+J.toFixed(2)+" "+$.toFixed(2)+" Tm\n"+Q):1===et||0===et&&0===K?t.push(nt+J.toFixed(2)+" "+$.toFixed(2)+" Td\n"+Q):t.push(nt+Q);t=0===et?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var rt="BT\n/"+I+" "+Y+" Tf\n"+(Y*h).toFixed(2)+" TL\n"+te+"\n";return rt+=c,rt+=t,q(rt+="ET"),f[I]=!0,p},p.__private__.lstext=p.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},p.__private__.clip=p.clip=function(t){q("evenodd"===t?"W*":"W"),q("n")},p.__private__.clip_fixed=p.clip_fixed=function(t){console.log("clip_fixed is deprecated"),p.clip(t)};var Bt=p.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},qt=p.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};p.__private__.line=p.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},p.__private__.lines=p.lines=function(t,e,n,r,i,o){var a,s,u,l,c,h,f,p,d,g,y,v;if("number"==typeof t&&(v=n,n=e,e=t,t=v),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Bt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(q(b(Ht(e))+" "+b(Zt(n))+" m "),a=r[0],s=r[1],l=t.length,g=e,y=n,u=0;u=a.length-1;if(E&&!S){_+=" ";continue}if(E||S){if(S)v=O;else if(t.multiline&&l<(f+2)*(b+2)+2)continue t}else{if(!t.multiline)continue t;if(l<(f+2)*(b+2)+2)continue t;v=O}for(var M="",P=y;P<=v;P++)M+=a[P]+" ";switch(M=" "==M.substr(M.length-1)?M.substr(0,M.length-1):M,m=x(M,t,u).width,t.textAlign){case"right":d=c-m-2;break;case"center":d=(c-m)/2;break;case"left":default:d=2}e+=s(d)+" "+s(g)+" Td\n",e+="("+o(M)+") Tj\n",e+=-s(d)+" 0 Td\n",g=-(u+2),m=0,y=v+1,b++,_=""}break}return i.text=e,i.fontSize=u,i},x=function(t,e,r){var i=n.internal.getFont(e.fontName,e.fontStyle),o=n.getStringUnitWidth(t,{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:n.getStringUnitWidth("3",{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:o}},O={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},E=function(){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var r=t[e];r.objId=void 0,r.hasAnnotation&&S.call(n,r)}},S=function(t){var e={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===e.type&&t.object===e.object}))&&n.internal.getPageInfo(t.page).pageContext.annotations.push(e)},M=function(){if(void 0===n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},P=function(){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0},N=function(t){var e=!t;for(var r in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var o=t[r],a=[],s=o.Rect;if(o.Rect&&(o.Rect=_.call(this,o.Rect)),n.internal.newObjectDeferredBegin(o.objId,!0),o.DA=H.createDefaultAppearanceStream(o),"object"===i(o)&&"function"==typeof o.getKeyValueListForStream&&(a=o.getKeyValueListForStream()),o.Rect=s,o.hasAppearanceStream&&!o.appearanceStreamContent){var u=b.call(this,o);a.push({key:"AP",value:"<>"}),n.internal.acroformPlugin.xForms.push(u)}if(o.appearanceStreamContent){var l="";for(var c in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(c)){var h=o.appearanceStreamContent[c];if(l+="/"+c+" ",l+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var r in h){var f;h.hasOwnProperty(r)&&("function"==typeof(f=h[r])&&(f=f.call(this,o)),l+="/"+r+" "+f+" ",0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f))}else"function"==typeof(f=h)&&(f=f.call(this,o)),l+="/"+r+" "+f,0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f);l+=">>"}a.push({key:"AP",value:"<<\n"+l+">>"})}n.internal.putStream({additionalKeyValues:a}),n.internal.out("endobj")}e&&C.call(this,n.internal.acroformPlugin.xForms)},C=function(t){for(var e in t)if(t.hasOwnProperty(e)){var r=e,o=t[e];n.internal.newObjectDeferredBegin(o&&o.objId,!0),"object"===i(o)&&"function"==typeof o.putStream&&o.putStream(),delete t[r]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(n=this,R.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(O)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");r=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new T,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",P),n.internal.events.subscribe("buildDocument",E),n.internal.events.subscribe("putCatalog",M),n.internal.events.subscribe("postPutPages",N),n.internal.acroformPlugin.isInitialized=!0}},j=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),n.join("\n")}},set:function(t){"object"===i(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};l(q,R);var z=function(){q.call(this),this.pushButton=!0};l(z,q);var U=function(){q.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};l(U,q);var V=function(){var t,e;R.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),r)e.push("/"+t+" ("+r[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===i(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=H.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};l(V,R),U.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},U.prototype.createOption=function(t){this.Kids.length;var e=new V;return e.Parent=this,e.optionName=t,this.Kids.push(e),Z.call(this,e),e};var Y=function(){q.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=H.CheckBox.createAppearanceStream()};l(Y,q);var W=function(){R.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,13):this.Ff=m(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,21):this.Ff=m(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=m(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,24):this.Ff=m(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,25):this.Ff=m(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=m(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};l(W,R);var X=function(){W.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,14):this.Ff=m(this.Ff,14)}}),this.password=!0};l(X,W);var H={CheckBox:{createAppearanceStream:function(){return{N:{On:H.CheckBox.YesNormal},D:{On:H.CheckBox.YesPushDown,Off:H.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=f(t),r=[],i=n.internal.getFont(t.fontName,t.fontStyle).id,o=n.__private__.encodeColorString(t.color),a=w(t,t.caption);return r.push("0.749023 g"),r.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+i+" "+s(a.fontSize)+" Tf "+o),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join("\n"),e},YesNormal:function(t){var e=f(t),r=n.internal.getFont(t.fontName,t.fontStyle).id,i=n.__private__.encodeColorString(t.color),o=[],a=H.internal.getHeight(t),u=H.internal.getWidth(t),l=w(t,t.caption);return o.push("1 g"),o.push("0 0 "+s(u)+" "+s(a)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+s(u-1)+" "+s(a-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+r+" "+s(l.fontSize)+" Tf "+i),o.push(l.text),o.push("ET"),o.push("Q"),e.stream=o.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:H.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=H.RadioButton.Circle.YesNormal,e.D[t]=H.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=H.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*H.internal.Bezier_C).toFixed(5)),a=Number((r*H.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[],r=H.internal.getWidth(t)<=H.internal.getHeight(t)?H.internal.getWidth(t)/4:H.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*H.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+u(H.internal.getWidth(t)/2)+" "+u(H.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:H.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=H.RadioButton.Cross.YesNormal,e.D[t]=H.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=f(t),n=[],r=H.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+s(H.internal.getWidth(t)-2)+" "+s(H.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(s(r.x1.x)+" "+s(r.x1.y)+" m"),n.push(s(r.x2.x)+" "+s(r.x2.y)+" l"),n.push(s(r.x4.x)+" "+s(r.x4.y)+" m"),n.push(s(r.x3.x)+" "+s(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=H.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+s(H.internal.getWidth(t)-2)+" "+s(H.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(s(n.x1.x)+" "+s(n.x1.y)+" m"),r.push(s(n.x2.x)+" "+s(n.x2.y)+" l"),r.push(s(n.x4.x)+" "+s(n.x4.y)+" m"),r.push(s(n.x3.x)+" "+s(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+s(H.internal.getWidth(t))+" "+s(H.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=n.internal.getFont(t.fontName,t.fontStyle).id,r=n.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+r}};H.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=H.internal.getWidth(t),n=H.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},H.internal.getWidth=function(t){var e=0;return"object"===i(t)&&(e=c(t.Rect[2])),e},H.internal.getHeight=function(t){var e=0;return"object"===i(t)&&(e=c(t.Rect[3])),e};var Z=t.addField=function(t){if(k.call(this),!(t instanceof R))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){n.internal.acroformPlugin.printedOut&&(n.internal.acroformPlugin.printedOut=!1,n.internal.acroformPlugin.acroFormDictionaryRoot=null),n.internal.acroformPlugin.acroFormDictionaryRoot||k.call(n),n.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=n.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof q==0)throw new Error("Invalid argument passed to jsPDF.addButton.");return Z.call(this,t)},t.addTextField=function(t){if(t instanceof W==0)throw new Error("Invalid argument passed to jsPDF.addTextField.");return Z.call(this,t)},t.addChoiceField=function(t){if(t instanceof F==0)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return Z.call(this,t)},"object"==i(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=F,e.ListBox=D,e.ComboBox=G,e.EditBox=B,e.Button=q,e.PushButton=z,e.RadioButton=U,e.CheckBox=Y,e.TextField=W,e.PasswordField=X,e.AcroForm={Appearance:H}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=F,t.AcroFormListBox=D,t.AcroFormComboBox=G,t.AcroFormEditBox=B,t.AcroFormButton=q,t.AcroFormPushButton=z,t.AcroFormRadioButton=U,t.AcroFormCheckBox=Y,t.AcroFormTextField=W,t.AcroFormPasswordField=X,t.AcroFormAppearance=H,t.AcroForm={ChoiceField:F,ListBox:D,ComboBox:G,EditBox:B,Button:q,PushButton:z,RadioButton:U,CheckBox:Y,TextField:W,PasswordField:X,Appearance:H}})((window.tmp=dt).API,"undefined"!=typeof window&&window||void 0!==r&&r),function(t){var e="addImage_",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.getImageFileTypeByImageData=function(e,r){var i,o;r=r||"UNKNOWN";var a,s,u,l="UNKNOWN";for(u in t.isArrayBufferView(e)&&(e=t.arrayBufferToBinaryString(e)),n)for(a=n[u],i=0;i>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",u=0,l=e.trns.length;u>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},t.createImageInfo=function(t,e,n,r,i,o,a,s,u,l,c,h,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),u&&(p.dp=u),l&&(p.trns=l),c&&(p.pal=c),h&&(p.smask=h),f&&(p.p=f),p},t.addImage=function(n,r,o,f,p,d,g,y,v){var m="";if("string"!=typeof r){var _=d;d=p,p=f,f=o,o=r,r=_}if("object"===i(n)&&!l(n)&&"imageData"in n){var b=n;n=b.imageData,r=b.format||r||"UNKNOWN",o=b.x||o||0,f=b.y||f||0,p=b.w||p,d=b.h||d,g=b.alias||g,y=b.compression||y,v=b.rotation||b.angle||v}var w=this.internal.getFilters();if(void 0===y&&-1!==w.indexOf("FlateEncode")&&(y="SLOW"),"string"==typeof n&&(n=unescape(n)),isNaN(o)||isNaN(f))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var x,O,E,S,M,P,N,C=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",s)),t}.call(this);if(!((x=h(n,C))||(l(n)&&(n=c(n,r)),(null==(N=g)||0===N.length)&&(g="string"==typeof(P=n)?t.sHashCode(P):t.isArrayBufferView(P)?t.sHashCode(t.arrayBufferToBinaryString(P)):null),x=h(g,C)))){if(this.isString(n)&&(""!==(m=this.convertStringToImageData(n))||void 0!==(m=t.loadFile(n)))&&(n=m),r=this.getImageFileTypeByImageData(n,r),!u(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if(this.supportsArrayBuffer()&&(n instanceof Uint8Array||(O=n,n=this.binaryStringToUint8Array(n))),!(x=this["process"+r.toUpperCase()](n,(M=0,(S=C)&&(M=Object.keys?Object.keys(S).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(S)),M),g,((E=y)&&"string"==typeof E&&(E=E.toUpperCase()),E in t.image_compression?E:t.image_compression.NONE),O)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var u=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),l=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;if(n=u[0],r=u[1],a[o]=i,s){s*=Math.PI/180;var h=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(h),p(f),p(-1*f),p(h),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,l(t),c(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([l(n),"0","0",l(r),"0","0","cm"].join(" "))):this.internal.write([l(n),"0","0",l(r),l(t),c(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,o,f,p,d,x,x.i,C,v),this},t.convertStringToImageData=function(e){var n,r="";if(this.isString(e)){var i;n=null!==(i=this.extractImageFromDataUrl(e))?i.data:e;try{r=atob(n)}catch(e){throw t.validateStringAsBase64(n)?new Error("atob-Error in jsPDF.convertStringToImageData "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return r};var f=function(t,e){return t.subarray(e,e+5)};t.processJPEG=function(t,e,n,i,o,a){var s,u=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(s=function(t){var e;if("JPEG"!==r(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),i=4,o=t.length;i>",l.content=y;var f=l.objId+" 0 R";y="<>";else if(u.options.pageNumber)switch(y="<>",this.internal.write(y))}}this.internal.write("]")}}]),a.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},a.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},a.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},a.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var o=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==e[t.charCodeAt(0)]},a=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},s=t.__arabicParser__.isArabicEndLetter=function(t){return a(t)&&o(t)&&e[t.charCodeAt(0)].length<=2},u=t.__arabicParser__.isArabicAlfLetter=function(t){return a(t)&&0<=i.indexOf(t.charCodeAt(0))},l=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return a(t)&&o(t)&&1<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return a(t)&&o(t)&&2<=e[t.charCodeAt(0)].length}),c=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return a(t)&&o(t)&&3<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return a(t)&&o(t)&&4==e[t.charCodeAt(0)].length}),h=t.__arabicParser__.resolveLigatures=function(t){var e=0,r=n,i=0,o="",a=0;for(e=0;e>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){this.internal.out("/OpenAction "+e+" 0 R")}))}return this},s=dt.API,(u=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(e){t=e}});var e=150;Object.defineProperty(this,"width",{get:function(){return e},set:function(t){e=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(t){r=t}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},u.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},s.events.push(["initialized",function(){this.canvas=new u,this.canvas.pdf=this}]),l=dt.API,h={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},f=1,p=function(t,e,n,r,i){h={x:t,y:e,w:n,h:r,ln:i}},d=function(){return h},g={left:0,top:0,bottom:0},l.setHeaderFunction=function(t){c=t},l.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var s=0;s=this.internal.pageSize.getHeight()-l.bottom&&(this.cellAddPage(),u=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,u&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var c=0;c=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},l.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},l.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},l.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},l.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");f.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},l.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},l.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n"},m=function(t){var e,n,r,i,o,a=String,s="length",u="charCodeAt",l="slice",c="replace";for(t[l](-2),t=t[l](0,-2)[c](/\s/g,"")[c]("z","!!!!!"),r=[],i=0,o=(t+=e="uuuuu"[l](t[s]%5||5))[s];i>24,255&n>>16,255&n>>8,255&n);return function(t,n){for(var r=e[s];0"},b=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),String.fromCharCode.apply(null,i)},y.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n>"),this.internal.out("endobj"),C=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+k+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==N&&void 0!==C&&this.internal.out("/Names <>")})),this},(j=dt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0> endobj")}var h=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),j.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},t.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[h++]=s>>>16&255,f[h++]=s>>>8&255,f[h++]=255&s,L.arrayBufferToBinaryString(f)},T=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},R=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},F=function(t,e,n,r){for(var i,o,a,s=t.length/e,u=new Uint8Array(t.length+s),l=V(),c=0;c>>1)&255;return o},z=function(t,e,n){var r,i,o,a,s=[],u=0,l=t.length;for(s[0]=4;u>>d&255,d+=o.bits;v[_]=w>>>d&255}if(16===o.bits){g=(M=new Uint32Array(o.decodePixels().buffer)).length,y=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),v=new Uint8Array(g*(32/o.pixelBitlength));for(var w,x=1>>0&255,x&&(y[b++]=w>>>16&255,w=M[_++],y[b++]=w>>>0&255),v[O++]=w>>>16&255;p=8}r!==L.image_compression.NONE&&I()?(t=A(y,o.width*o.colors,o.colors,r),c=A(v,o.width,1,r)):(t=y,c=v,f=null)}if(3===o.colorType&&(h=this.color_spaces.INDEXED,l=o.palette,o.transparency.indexed)){var E=o.transparency.indexed,S=0;for(_=0,g=E.length;_r&&(i.push(t.slice(u,o)),s=0,u=o),s+=e[o],o++;return u!==o&&i.push(t.slice(u,o)),i},tt=function(t,e,n){n||(n={});var r,i,o,a,s,u,l=[],c=[l],h=n.textIndent||0,f=0,p=0,d=t.split(" "),g=K.apply(this,[" ",n])[0];if(u=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var y=Array(u).join(" "),v=[];d.map((function(t){1<(t=t.split(/\s*\n/)).length?v=v.concat(t.map((function(t,e){return(e&&t.length?"\n":"")+t}))):v.push(t[0])})),d=v,u=$.apply(this,[y,n])}for(o=0,a=d.length;o>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},ut=dt.API,ht=ct=lt="",ut.addMetadata=function(t,e){return ct=e||"http://jspdf.default.namespaceuri/",lt=t,this.internal.events.subscribe("postPutResources",(function(){if(lt){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(lt)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),a=n.length+r.length+i.length+e.length+o.length;ht=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ht=""})),this.internal.events.subscribe("putCatalog",(function(){ht&&this.internal.write("/Metadata "+ht+" 0 R")})),this},function(t,e){var n=t.API,r=n.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"Identity-H"===e.encoding){for(var a=e.metadata.Unicode.widths,s=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),u="",l=0;l>"),n("endobj");var p=r();n("<<"),n("/Type /Font"),n("/BaseFont /"+e.fontName),n("/FontDescriptor "+f+" 0 R"),n("/W "+t.API.PDFObject.convert(a)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=r(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+e.fontName),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+p+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]),n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"WinAnsiEncoding"===e.encoding){e.metadata.Unicode.widths;for(var a=e.metadata.rawData,s="",u=0;u>"),n("endobj"),e.objectNumber=r(),u=0;u>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]);var o=function(t){var e,n,i=t.text||"",o=t.x,a=t.y,s=t.options||{},u=t.mutex||{},l=u.pdfEscape,c=u.activeFontKey,h=u.fonts,f=(u.activeFontSize,""),p=0,d="",g=h[n=c].encoding;if("Identity-H"!==h[n].encoding)return{text:i,x:o,y:a,options:s,mutex:u};for(d=i,n=c,"[object Array]"===Object.prototype.toString.call(i)&&(d=i[0]),p=0;pu-l.top-l.bottom&&r.pagesplit){var d=function(t,e,n,i,o){var a=document.createElement("canvas");a.height=o,a.width=i;var s=a.getContext("2d");return s.mozImageSmoothingEnabled=!1,s.webkitImageSmoothingEnabled=!1,s.msImageSmoothingEnabled=!1,s.imageSmoothingEnabled=!1,s.fillStyle=r.backgroundColor||"#ffffff",s.fillRect(0,0,i,o),s.drawImage(t,e,n,i,o,0,0,i,o),a},g=function(){for(var r,o,c=0,g=0,y={},v=!1;;){var m;if(g=0,y.top=0!==c?l.top:n,y.left=0!==c?l.left:e,v=(s-l.left-l.right)*a=t.width)break;this.addPage()}else _=[m=d(t,0,c,r,o),y.left,y.top,m.width/a,m.height/a,f,null,p],this.addImage.apply(this,_);if((c+=o)>=t.height)break;this.addPage()}i(h,c,null,_)}.bind(this);if("CANVAS"===t.nodeName){var y=new Image;y.onload=g,y.src=t.toDataURL("image/png"),t=y}else g()}else{var v=Math.random().toString(35),m=[t,e,n,h,c,f,v,p];this.addImage.apply(this,m),i(h,c,v,m)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"==typeof rasterizeHTML)return null;var l="drawDocument";return"string"==typeof t&&(l=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||s*a,rasterizeHTML[l](t,void 0,r).then((function(t){r.onrendered(t.image)}),(function(t){i(null,t)}))},function(t){var e,n,r,o,a,s,u,l,c,h,f,p,d,g,y,v,m,_,b,w;e=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},p=function(t){var e,n,i;for(e=void 0,n=(i=t.split(",")).shift();!e&&n;)e=r[n.trim().toLowerCase()],n=i.shift();return e},d=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1r.pdf.margins_doc.top&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top,r.executeWatchFunctions(a));var C=c(a),k=r.x,j=12/r.pdf.internal.scaleFactor,L=(C["margin-left"]+C["padding-left"])*j,I=(C["margin-right"]+C["padding-right"])*j,A=(C["margin-top"]+C["padding-top"])*j,T=(C["margin-bottom"]+C["padding-bottom"])*j;void 0!==C.float&&"right"===C.float?k+=r.settings.width-a.width-I:k+=L,r.pdf.addImage(P,k,r.y+A,a.width,a.height),P=void 0,"right"===C.float||"left"===C.float?(r.watchFunctions.push(function(t,e,n,i){return r.y>=e?(r.x+=t,r.settings.width+=n,!0):!!(i&&1===i.nodeType&&!x[i.nodeName]&&r.x+i.width>r.pdf.margins_doc.left+r.pdf.margins_doc.width)&&(r.x+=t,r.y=e,r.settings.width+=n,!0)}.bind(this,"left"===C.float?-a.width-L-I:0,r.y+a.height+A+T,a.width)),r.watchFunctions.push(function(t,e,n){return!(r.y]*?>/gi,""),c="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",l.innerHTML='