IITC plugin: Calc and draw homogeneous fields

Calc and draw homogeneous fields

// ==UserScript==
// @name        IITC plugin: Calc and draw homogeneous fields
// @version     0.3.3
// @author      Odrick
// @description Calc and draw homogeneous fields
// @homepage    https://github.com/odrick/iitc-plugin-homogeneous-field#readme
// @supportURL  https://github.com/odrick/iitc-plugin-homogeneous-field/issues
// @match       https://*.ingress.com/intel*
// @match       http://*.ingress.com/intel*
// @match       https://*.ingress.com/mission/*
// @match       http://*.ingress.com/mission/*
// @id          iitc-plugin-homogeneous-field@odrick
// @category    Layer
// @license     MIT
// @include     https://*.ingress.com/intel*
// @include     http://*.ingress.com/intel*
// @include     https://*.ingress.com/mission/*
// @include     http://*.ingress.com/mission/*
// @grant       none
// @namespace https://greasyfork.org/users/410740
// ==/UserScript==

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=134)}([function(t,e,n){var r=n(2),i=n(18),o=n(11),s=n(12),a=n(19),u=function(t,e,n){var c,l,f,h,p=t&u.F,g=t&u.G,d=t&u.S,y=t&u.P,v=t&u.B,m=g?r:d?r[e]||(r[e]={}):(r[e]||{}).prototype,_=g?i:i[e]||(i[e]={}),x=_.prototype||(_.prototype={});for(c in g&&(n=e),n)f=((l=!p&&m&&void 0!==m[c])?m:n)[c],h=v&&l?a(f,r):y&&"function"==typeof f?a(Function.call,f):f,m&&s(m,c,f,t&u.U),_[c]!=f&&o(_,c,h),y&&x[c]!=f&&(x[c]=f)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(4);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(48)("wks"),i=n(33),o=n(2).Symbol,s="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(21),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){t.exports=!n(3)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(1),i=n(95),o=n(23),s=Object.defineProperty;e.f=n(7)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(24);t.exports=function(t){return Object(r(t))}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(8),i=n(32);t.exports=n(7)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(2),i=n(11),o=n(14),s=n(33)("src"),a=n(138),u=(""+a).split("toString");n(18).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(o(n,s)||i(n,s,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:a?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[s]||a.call(this)}))},function(t,e,n){var r=n(0),i=n(3),o=n(24),s=/"/g,a=function(t,e,n,r){var i=String(o(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(r).replace(s,"&quot;")+'"'),a+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(a),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(49),i=n(24);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(50),i=n(32),o=n(15),s=n(23),a=n(14),u=n(95),c=Object.getOwnPropertyDescriptor;e.f=n(7)?c:function(t,e){if(t=o(t),e=s(e,!0),u)try{return c(t,e)}catch(t){}if(a(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(14),i=n(9),o=n(69)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e){var n=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(10);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){"use strict";var r=n(3);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,n){var r=n(4);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,n){var r=n(0),i=n(18),o=n(3);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],s={};s[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",s)}},function(t,e,n){var r=n(19),i=n(49),o=n(9),s=n(6),a=n(85);t.exports=function(t,e){var n=1==t,u=2==t,c=3==t,l=4==t,f=6==t,h=5==t||f,p=e||a;return function(e,a,g){for(var d,y,v=o(e),m=i(v),_=r(a,g,3),x=s(m.length),b=0,w=n?p(e,x):u?p(e,0):void 0;x>b;b++)if((h||b in m)&&(y=_(d=m[b],b,v),t))if(n)w[b]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return b;case 2:w.push(d)}else if(l)return!1;return f?-1:c||l?l:w}}},function(t,e,n){"use strict";if(n(7)){var r=n(29),i=n(2),o=n(3),s=n(0),a=n(63),u=n(93),c=n(19),l=n(39),f=n(32),h=n(11),p=n(41),g=n(21),d=n(6),y=n(123),v=n(35),m=n(23),_=n(14),x=n(45),b=n(4),w=n(9),E=n(82),I=n(36),S=n(17),N=n(37).f,P=n(84),C=n(33),L=n(5),M=n(26),O=n(53),R=n(52),T=n(87),A=n(47),F=n(58),D=n(38),k=n(86),j=n(112),G=n(8),q=n(16),B=G.f,z=q.f,U=i.RangeError,V=i.TypeError,X=i.Uint8Array,Y=Array.prototype,W=u.ArrayBuffer,H=u.DataView,$=M(0),J=M(2),K=M(3),Z=M(4),Q=M(5),tt=M(6),et=O(!0),nt=O(!1),rt=T.values,it=T.keys,ot=T.entries,st=Y.lastIndexOf,at=Y.reduce,ut=Y.reduceRight,ct=Y.join,lt=Y.sort,ft=Y.slice,ht=Y.toString,pt=Y.toLocaleString,gt=L("iterator"),dt=L("toStringTag"),yt=C("typed_constructor"),vt=C("def_constructor"),mt=a.CONSTR,_t=a.TYPED,xt=a.VIEW,bt=M(1,(function(t,e){return Nt(R(t,t[vt]),e)})),wt=o((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),Et=!!X&&!!X.prototype.set&&o((function(){new X(1).set({})})),It=function(t,e){var n=g(t);if(n<0||n%e)throw U("Wrong offset!");return n},St=function(t){if(b(t)&&_t in t)return t;throw V(t+" is not a typed array!")},Nt=function(t,e){if(!b(t)||!(yt in t))throw V("It is not a typed array constructor!");return new t(e)},Pt=function(t,e){return Ct(R(t,t[vt]),e)},Ct=function(t,e){for(var n=0,r=e.length,i=Nt(t,r);r>n;)i[n]=e[n++];return i},Lt=function(t,e,n){B(t,e,{get:function(){return this._d[n]}})},Mt=function(t){var e,n,r,i,o,s,a=w(t),u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,h=P(a);if(null!=h&&!E(h)){for(s=h.call(a),r=[],e=0;!(o=s.next()).done;e++)r.push(o.value);a=r}for(f&&u>2&&(l=c(l,arguments[2],2)),e=0,n=d(a.length),i=Nt(this,n);n>e;e++)i[e]=f?l(a[e],e):a[e];return i},Ot=function(){for(var t=0,e=arguments.length,n=Nt(this,e);e>t;)n[t]=arguments[t++];return n},Rt=!!X&&o((function(){pt.call(new X(1))})),Tt=function(){return pt.apply(Rt?ft.call(St(this)):St(this),arguments)},At={copyWithin:function(t,e){return j.call(St(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return Z(St(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return k.apply(St(this),arguments)},filter:function(t){return Pt(this,J(St(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return Q(St(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(St(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){$(St(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(St(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(St(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ct.apply(St(this),arguments)},lastIndexOf:function(t){return st.apply(St(this),arguments)},map:function(t){return bt(St(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return at.apply(St(this),arguments)},reduceRight:function(t){return ut.apply(St(this),arguments)},reverse:function(){for(var t,e=St(this).length,n=Math.floor(e/2),r=0;r<n;)t=this[r],this[r++]=this[--e],this[e]=t;return this},some:function(t){return K(St(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return lt.call(St(this),t)},subarray:function(t,e){var n=St(this),r=n.length,i=v(t,r);return new(R(n,n[vt]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,d((void 0===e?r:v(e,r))-i))}},Ft=function(t,e){return Pt(this,ft.call(St(this),t,e))},Dt=function(t){St(this);var e=It(arguments[1],1),n=this.length,r=w(t),i=d(r.length),o=0;if(i+e>n)throw U("Wrong length!");for(;o<i;)this[e+o]=r[o++]},kt={entries:function(){return ot.call(St(this))},keys:function(){return it.call(St(this))},values:function(){return rt.call(St(this))}},jt=function(t,e){return b(t)&&t[_t]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Gt=function(t,e){return jt(t,e=m(e,!0))?f(2,t[e]):z(t,e)},qt=function(t,e,n){return!(jt(t,e=m(e,!0))&&b(n)&&_(n,"value"))||_(n,"get")||_(n,"set")||n.configurable||_(n,"writable")&&!n.writable||_(n,"enumerable")&&!n.enumerable?B(t,e,n):(t[e]=n.value,t)};mt||(q.f=Gt,G.f=qt),s(s.S+s.F*!mt,"Object",{getOwnPropertyDescriptor:Gt,defineProperty:qt}),o((function(){ht.call({})}))&&(ht=pt=function(){return ct.call(this)});var Bt=p({},At);p(Bt,kt),h(Bt,gt,kt.values),p(Bt,{slice:Ft,set:Dt,constructor:function(){},toString:ht,toLocaleString:Tt}),Lt(Bt,"buffer","b"),Lt(Bt,"byteOffset","o"),Lt(Bt,"byteLength","l"),Lt(Bt,"length","e"),B(Bt,dt,{get:function(){return this[_t]}}),t.exports=function(t,e,n,u){var c=t+((u=!!u)?"Clamped":"")+"Array",f="get"+t,p="set"+t,g=i[c],v=g||{},m=g&&S(g),_=!g||!a.ABV,w={},E=g&&g.prototype,P=function(t,n){B(t,n,{get:function(){return function(t,n){var r=t._d;return r.v[f](n*e+r.o,wt)}(this,n)},set:function(t){return function(t,n,r){var i=t._d;u&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),i.v[p](n*e+i.o,r,wt)}(this,n,t)},enumerable:!0})};_?(g=n((function(t,n,r,i){l(t,g,c,"_d");var o,s,a,u,f=0,p=0;if(b(n)){if(!(n instanceof W||"ArrayBuffer"==(u=x(n))||"SharedArrayBuffer"==u))return _t in n?Ct(g,n):Mt.call(g,n);o=n,p=It(r,e);var v=n.byteLength;if(void 0===i){if(v%e)throw U("Wrong length!");if((s=v-p)<0)throw U("Wrong length!")}else if((s=d(i)*e)+p>v)throw U("Wrong length!");a=s/e}else a=y(n),o=new W(s=a*e);for(h(t,"_d",{b:o,o:p,l:s,e:a,v:new H(o)});f<a;)P(t,f++)})),E=g.prototype=I(Bt),h(E,"constructor",g)):o((function(){g(1)}))&&o((function(){new g(-1)}))&&F((function(t){new g,new g(null),new g(1.5),new g(t)}),!0)||(g=n((function(t,n,r,i){var o;return l(t,g,c),b(n)?n instanceof W||"ArrayBuffer"==(o=x(n))||"SharedArrayBuffer"==o?void 0!==i?new v(n,It(r,e),i):void 0!==r?new v(n,It(r,e)):new v(n):_t in n?Ct(g,n):Mt.call(g,n):new v(y(n))})),$(m!==Function.prototype?N(v).concat(N(m)):N(v),(function(t){t in g||h(g,t,v[t])})),g.prototype=E,r||(E.constructor=g));var C=E[gt],L=!!C&&("values"==C.name||null==C.name),M=kt.values;h(g,yt,!0),h(E,_t,c),h(E,xt,!0),h(E,vt,g),(u?new g(1)[dt]==c:dt in E)||B(E,dt,{get:function(){return c}}),w[c]=g,s(s.G+s.W+s.F*(g!=v),w),s(s.S,c,{BYTES_PER_ELEMENT:e}),s(s.S+s.F*o((function(){v.of.call(g,1)})),c,{from:Mt,of:Ot}),"BYTES_PER_ELEMENT"in E||h(E,"BYTES_PER_ELEMENT",e),s(s.P,c,At),D(c),s(s.P+s.F*Et,c,{set:Dt}),s(s.P+s.F*!L,c,kt),r||E.toString==ht||(E.toString=ht),s(s.P+s.F*o((function(){new g(1).slice()})),c,{slice:Ft}),s(s.P+s.F*(o((function(){return[1,2].toLocaleString()!=new g([1,2]).toLocaleString()}))||!o((function(){E.toLocaleString.call([1,2])}))),c,{toLocaleString:Tt}),A[c]=L?C:M,r||L||h(E,gt,M)}}else t.exports=function(){}},function(t,e,n){var r=n(118),i=n(0),o=n(48)("metadata"),s=o.store||(o.store=new(n(121))),a=function(t,e,n){var i=s.get(t);if(!i){if(!n)return;s.set(t,i=new r)}var o=i.get(e);if(!o){if(!n)return;i.set(e,o=new r)}return o};t.exports={store:s,map:a,has:function(t,e,n){var r=a(e,n,!1);return void 0!==r&&r.has(t)},get:function(t,e,n){var r=a(e,n,!1);return void 0===r?void 0:r.get(t)},set:function(t,e,n,r){a(n,r,!0).set(t,e)},keys:function(t,e){var n=a(t,e,!1),r=[];return n&&n.forEach((function(t,e){r.push(e)})),r},key:function(t){return void 0===t||"symbol"==typeof t?t:String(t)},exp:function(t){i(i.S,"Reflect",t)}}},function(t,e){t.exports=!1},function(t,e,n){var r=n(33)("meta"),i=n(4),o=n(14),s=n(8).f,a=0,u=Object.isExtensible||function(){return!0},c=!n(3)((function(){return u(Object.preventExtensions({}))})),l=function(t){s(t,r,{value:{i:"O"+ ++a,w:{}}})},f=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!u(t))return"F";if(!e)return"E";l(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!u(t))return!0;if(!e)return!1;l(t)}return t[r].w},onFreeze:function(t){return c&&f.NEED&&u(t)&&!o(t,r)&&l(t),t}}},function(t,e,n){var r=n(5)("unscopables"),i=Array.prototype;null==i[r]&&n(11)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(97),i=n(70);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(21),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(1),i=n(98),o=n(70),s=n(69)("IE_PROTO"),a=function(){},u=function(){var t,e=n(67)("iframe"),r=o.length;for(e.style.display="none",n(71).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;r--;)delete u.prototype[o[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=r(t),n=new a,a.prototype=null,n[s]=t):n=u(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(97),i=n(70).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){"use strict";var r=n(2),i=n(8),o=n(7),s=n(5)("species");t.exports=function(t){var e=r[t];o&&e&&!e[s]&&i.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(19),i=n(110),o=n(82),s=n(1),a=n(6),u=n(84),c={},l={};(e=t.exports=function(t,e,n,f,h){var p,g,d,y,v=h?function(){return t}:u(t),m=r(n,f,e?2:1),_=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(p=a(t.length);p>_;_++)if((y=e?m(s(g=t[_])[0],g[1]):m(t[_]))===c||y===l)return y}else for(d=v.call(t);!(g=d.next()).done;)if((y=i(d,m,g.value,e))===c||y===l)return y}).BREAK=c,e.RETURN=l},function(t,e,n){var r=n(12);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){var r=n(4);t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){!function(t){"use strict";function e(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&S(r),i&&N(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i,s=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");switch(s&&S(s),t){case"Point":i=r(e).geometry;break;case"LineString":i=a(e).geometry;break;case"Polygon":i=o(e).geometry;break;case"MultiPoint":i=f(e).geometry;break;case"MultiLineString":i=l(e).geometry;break;case"MultiPolygon":i=h(e).geometry;break;default:throw new Error(t+" is invalid")}return s&&(i.bbox=s),i}function r(t,n,r){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(!E(t[0])||!E(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},n,r)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return r(t,e)})),n)}function o(t,n,r){if(!t)throw new Error("coordinates is required");for(var i=0;i<t.length;i++){var o=t[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++){if(0===i&&0===s&&!E(o[0][0])||!E(o[0][1]))throw new Error("coordinates must contain numbers");if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}}return e({type:"Polygon",coordinates:t},n,r)}function s(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return o(t,e)})),n)}function a(t,n,r){if(!t)throw new Error("coordinates is required");if(t.length<2)throw new Error("coordinates must be an array of two or more positions");if(!E(t[0][1])||!E(t[0][1]))throw new Error("coordinates must contain numbers");return e({type:"LineString",coordinates:t},n,r)}function u(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return c(t.map((function(t){return a(t,e)})),n)}function c(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");n&&S(n),r&&N(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function l(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiLineString",coordinates:t},n,r)}function f(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiPoint",coordinates:t},n,r)}function h(t,n,r){if(!t)throw new Error("coordinates is required");return e({type:"MultiPolygon",coordinates:t},n,r)}function p(t,n,r){if(!t)throw new Error("geometries is required");if(!Array.isArray(t))throw new Error("geometries must be an Array");return e({type:"GeometryCollection",geometries:t},n,r)}function g(t,e){if(null==t||isNaN(t))throw new Error("num is required");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 d(t,e){if(null==t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=Eo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function y(t,e){if(null==t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=Eo[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function v(t,e){return _(y(t,e))}function m(t){if(null==t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function _(t){if(null==t)throw new Error("radians is required");return t%(2*Math.PI)*180/Math.PI}function x(t){if(null==t)throw new Error("degrees is required");return t%360*Math.PI/180}function b(t,e,n){if(null==t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return d(y(t,e),n||"kilometers")}function w(t,e,n){if(null==t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var r=So[e||"meters"];if(!r)throw new Error("invalid original units");var i=So[n||"kilometers"];if(!i)throw new Error("invalid final units");return t/r*i}function E(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function I(t){return!!t&&t.constructor===Object}function S(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(!E(t))throw new Error("bbox must only contain numbers")}))}function N(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function P(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,l,f=0,h=0,p=t.type,g="FeatureCollection"===p,d="Feature"===p,y=g?t.features.length:1,v=0;v<y;v++){a=(l=!!(c=g?t.features[v].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<a;m++){var _=0,x=0;if(null!==(s=l?c.geometries[m]:c)){u=s.coordinates;var b=s.type;switch(f=!n||"Polygon"!==b&&"MultiPolygon"!==b?0:1,b){case null:break;case"Point":e(u,h,v,_,x),h++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++)e(u[r],h,v,_,x),h++,"MultiPoint"===b&&_++;"LineString"===b&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-f;i++)e(u[r][i],h,v,_,x),h++;"MultiLineString"===b&&_++,"Polygon"===b&&x++}"Polygon"===b&&_++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for("MultiPolygon"===b&&(x=0),i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-f;o++)e(u[r][i][o],h,v,_,x),h++;x++}_++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)P(s.geometries[r],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function C(t,e,n,r){var i=n;return P(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function L(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length;n++)e(t.features[n].properties,n);break;case"Feature":e(t.properties,0)}}function M(t,e,n){var r=n;return L(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function O(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function R(t,e,n){var r=n;return O(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function T(t){var e=[];return P(t,(function(t){e.push(t)})),e}function A(t,e){var n,r,i,o,s,a,u,c,l,f,h=0,p="FeatureCollection"===t.type,g="Feature"===t.type,d=p?t.features.length:1;for(n=0;n<d;n++){for(a=p?t.features[n].geometry:g?t.geometry:t,c=p?t.features[n].properties:g?t.properties:{},l=p?t.features[n].bbox:g?t.bbox:void 0,f=p?t.features[n].id:g?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,h,c,l,f);break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)e(o.geometries[r],h,c,l,f);break;default:throw new Error("Unknown Geometry Type")}else e(null,h,c,l,f);h++}}function F(t,e,n){var r=n;return A(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r}function D(t,n){A(t,(function(t,r,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return void n(e(t,i,{bbox:o,id:s}),r,0)}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}t.coordinates.forEach((function(t,o){n(e({type:a,coordinates:t},i),r,o)}))}))}function k(t,e,n){var r=n;return D(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r}function j(t,e){D(t,(function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;"Point"!==o&&"MultiPoint"!==o&&C(t,(function(o,s,u,c,l,f){var h=a([o,s],t.properties);return e(h,n,r,f,i),i++,s}))}}))}function G(t,e,n){var r=n,i=!1;return j(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}function q(t,e){if(!t)throw new Error("geojson is required");D(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":e(t,n,r,0,0);break;case"Polygon":for(var s=0;s<o.length;s++)e(a(o[s],t.properties),n,r,s)}}}))}function B(t,e,n){var r=n;return q(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r}function z(t){var e=[1/0,1/0,-1/0,-1/0];return P(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function U(t){if(!t)throw new Error("obj is required");var e=V(t);if(e.length>1&&E(e[0])&&E(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function V(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return X(e),e;throw new Error("No valid coordinates")}function X(t){if(t.length>1&&E(t[0])&&E(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return X(t[0]);throw new Error("coordinates must only contain numbers")}function Y(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 W(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 H(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");for(var r=0;r<t.features.length;r++){var i=t.features[r];if(!i||"Feature"!==i.type||!i.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!i.geometry||i.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+i.geometry.type)}}function $(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")}function J(){throw new Error("invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType")}function K(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}function Z(t,e,n){n=n||{};for(var r=Object.keys(Lo),i=0;i<r.length;i++){var o=r[i],s=n[o];s=null!=s?s:Lo[o],Mo[o]=s}Mo.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+e);var a=function(t){var e=[],n=0;return t.rows,t.cols,t.cells.forEach((function(r,i){r.forEach((function(r,o){if(void 0!==r&&!function(t){return 5===t.cval||10===t.cval}(r)&&!tt(r)){var s=function(t,e,n){var r,i,o,s=t.length,a=[],u=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],c=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],l=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],f=(t[e][n],t[e][n]),h=f.cval,p=nt(f,o=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][h]);a.push([n+p[0],e+p[1]]),p=nt(f,o=l[h]),a.push([n+p[0],e+p[1]]),et(f);for(var g=n+u[h],d=e+c[h],y=h;g>=0&&d>=0&&d<s&&(g!=n||d!=e)&&void 0!==(f=t[d][g]);){if(0===(h=f.cval)||15===h)return{path:a,info:"mergeable"};o=l[h],r=u[h],i=c[h],5!==h&&10!==h||(5===h?f.flipped?-1===c[y]?(o="left",r=-1,i=0):(o="right",r=1,i=0):-1===u[y]&&(o="bottom",r=0,i=-1):10===h&&(f.flipped?-1===u[y]?(o="top",r=0,i=1):(o="bottom",r=0,i=-1):1===c[y]&&(o="left",r=-1,i=0))),p=nt(f,o),a.push([g+p[0],d+p[1]]),et(f),g+=r,d+=i,y=h}return{path:a,info:"closed"}}(t.cells,i,o),a=!1;if("mergeable"===s.info)for(var u=s.path[s.path.length-1][0],c=s.path[s.path.length-1][1],l=n-1;l>=0;l--)if(Math.abs(e[l][0][0]-u)<=1e-7&&Math.abs(e[l][0][1]-c)<=1e-7){for(var f=s.path.length-2;f>=0;--f)e[l].unshift(s.path[f]);a=!0;break}a||(e[n++]=s.path)}}))})),e}(function(t,e){for(var n=t.length-1,r=t[0].length-1,i={rows:n,cols:r,cells:[]},o=0;o<n;++o){i.cells[o]=[];for(var s=0;s<r;++s){var a=0,u=t[o+1][s],c=t[o+1][s+1],l=t[o][s+1],f=t[o][s];if(!(isNaN(u)||isNaN(c)||isNaN(l)||isNaN(f))){a|=u>=e?8:0,a|=c>=e?4:0,a|=l>=e?2:0;var h,p,g,d,y=!1;if(5==(a|=f>=e?1:0)||10===a){var v=(u+c+l+f)/4;5===a&&v<e?(a=10,y=!0):10===a&&v<e&&(a=5,y=!0)}0!==a&&15!==a&&(h=p=g=d=.5,1===a?(g=1-Q(e,u,f),p=1-Q(e,l,f)):2===a?(p=Q(e,f,l),d=1-Q(e,c,l)):3===a?(g=1-Q(e,u,f),d=1-Q(e,c,l)):4===a?(h=Q(e,u,c),d=Q(e,l,c)):5===a?(h=Q(e,u,c),d=Q(e,l,c),p=1-Q(e,l,f),g=1-Q(e,u,f)):6===a?(p=Q(e,f,l),h=Q(e,u,c)):7===a?(g=1-Q(e,u,f),h=Q(e,u,c)):8===a?(g=Q(e,f,u),h=1-Q(e,c,u)):9===a?(p=1-Q(e,l,f),h=1-Q(e,c,u)):10===a?(h=1-Q(e,c,u),d=1-Q(e,c,l),p=Q(e,f,l),g=Q(e,f,u)):11===a?(h=1-Q(e,c,u),d=1-Q(e,c,l)):12===a?(g=Q(e,f,u),d=Q(e,l,c)):13===a?(p=1-Q(e,l,f),d=Q(e,l,c)):14===a?(g=Q(e,f,u),p=Q(e,f,l)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+a),i.cells[o][s]={cval:a,flipped:y,top:h,right:d,bottom:p,left:g})}}}return i}(t,e));return"function"==typeof Mo.successCallback&&Mo.successCallback(a),a}function Q(t,e,n){return(t-e)/(n-e)}function tt(t){return 0===t.cval||15===t.cval}function et(t){tt(t)||5===t.cval||10===t.cval||(t.cval=15)}function nt(t,e){return"top"===e?[t.top,1]:"bottom"===e?[t.bottom,0]:"right"===e?[1,t.right]:"left"===e?[0,t.left]:void 0}function rt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function it(t,e){if(!(this instanceof it))return new it(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function ot(t,e){st(t,0,t.children.length,e,t)}function st(t,e,n,r,i){i||(i=gt(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],at(i,t.leaf?r(o):o);return i}function at(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function ut(t,e){return t.minX-e.minX}function ct(t,e){return t.minY-e.minY}function lt(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ft(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ht(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function pt(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function gt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function dt(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,Oo(t,o,e,n,i),s.push(e,o,o,n))}function yt(t,e){return t(e={exports:{}},e.exports),e.exports}function vt(t,e){if(!(this instanceof vt))return new vt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||function(t,e){return t<e?-1:t>e?1:0},this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function mt(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var r,i=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;o<t.length;o++)Vo(t[o],a)||u.push(t[o]);var c=qo(u),l=[];for(o=0;o<c.length;o++)l.push(u[c[o]]);return l}(t),o=Ro(16,["[0]","[1]","[0]","[1]"]).load(t),s=[],a=0;a<i.length;a++){var u=i[a];o.remove(u),r=Et(u,r),s.push(r)}var c=Ro(16);for(a=0;a<s.length;a++)c.insert(wt(s[a]));for(var l=e*e,f=n*n;s.length;){var h=s.shift(),p=h.p,g=h.next.p,d=It(p,g);if(!(d<f)){var y=d/l;(u=function(t,e,n,r,i,o,s){for(var a=new zo(null,_t),u=t.data;u;){for(var c=0;c<u.children.length;c++){var l=u.children[c],f=u.leaf?St(l,n,r):function(t,e,n){if(xt(t,n)||xt(e,n))return 0;var r=Nt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Nt(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Nt(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Nt(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}(n,r,l);f>o||a.push({node:l,dist:f})}for(;a.length&&!a.peek().node.children;){var h=a.pop(),p=h.node,g=St(p,e,n),d=St(p,r,i);if(h.dist<g&&h.dist<d&&bt(n,p,s)&&bt(r,p,s))return p}(u=a.pop())&&(u=u.node)}return null}(o,h.prev.p,p,g,h.next.next.p,y,c))&&Math.min(It(u,p),It(u,g))<=y&&(s.push(h),s.push(Et(u,h)),o.remove(u),c.remove(h),c.insert(wt(h)),c.insert(wt(h.next)))}}h=r;var v=[];do{v.push(h.p),h=h.next}while(h!==r);return v.push(h.p),v}function _t(t,e){return t.dist-e.dist}function xt(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function bt(t,e,n){for(var r=Math.min(t[0],e[0]),i=Math.min(t[1],e[1]),o=Math.max(t[0],e[0]),s=Math.max(t[1],e[1]),a=n.search({minX:r,minY:i,maxX:o,maxY:s}),u=0;u<a.length;u++)if(function(t,e,n,r){return t!==r&&e!==n&&Xo(t,e,n)>0!=Xo(t,e,r)>0&&Xo(n,r,t)>0!=Xo(n,r,e)>0}(a[u].p,a[u].next.p,t,e))return!1;return!0}function wt(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 Et(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 It(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function St(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Nt(t,e,n,r,i,o,s,a){var u,c,l,f,h=n-t,p=r-e,g=s-i,d=a-o,y=t-i,v=e-o,m=h*h+p*p,_=h*g+p*d,x=g*g+d*d,b=h*y+p*v,w=g*y+d*v,E=m*x-_*_,I=E,S=E;0===E?(c=0,I=1,f=w,S=x):(f=m*w-_*b,(c=_*w-x*b)<0?(c=0,f=w,S=x):c>I&&(c=I,f=w+_,S=x)),f<0?(f=0,-b<0?c=0:-b>m?c=I:(c=-b,I=m)):f>S&&(f=S,-b+_<0?c=0:-b+_>m?c=I:(c=-b+_,I=m));var N=(1-(l=0===f?0:f/S))*i+l*s-((1-(u=0===c?0:c/I))*t+u*n),P=(1-l)*o+l*a-((1-u)*e+u*r);return N*N+P*P}function Pt(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.concavity||1/0,r=[];if(P(t,(function(t){r.push([t[0],t[1]])})),!r.length)return null;var i=Yo(r,n);return i.length>3?o([i]):null}function Ct(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=U(t),o=V(e),s=e.geometry?e.geometry.type:e.type,a=e.bbox;if(a&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,a))return!1;"Polygon"===s&&(o=[o]);for(var u=0,c=!1;u<o.length&&!c;u++)if(Lt(i,o[u][0],r)){for(var l=!1,f=1;f<o[u].length&&!l;)Lt(i,o[u][f],!r)&&(l=!0),f++;l||(c=!0)}return c}function Lt(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],c=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+c*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(c-t[1])<=0)return!n;a>t[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function Mt(t,e){var n=[];return A(e,(function(e){O(t,(function(t){Ct(t,e)&&n.push(t)}))})),c(n)}function Ot(t,e){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var n=!1;return c(function(t){if(t.length<3)return[];t.sort(Tt);for(var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,l=t[a].y,f=l;a--;)t[a].y<l&&(l=t[a].y),t[a].y>f&&(f=t[a].y);var h,p=c-u,g=f-l,d=p>g?p:g,y=.5*(c+u),v=.5*(f+l),m=[new Rt({x:y-20*d,y:v-d,__sentinel:!0},{x:y,y:v+20*d,__sentinel:!0},{x:y+20*d,y:v-d,__sentinel:!0})],_=[],x=[];for(a=t.length;a--;){for(x.length=0,h=m.length;h--;)(p=t[a].x-m[h].x)>0&&p*p>m[h].r?(_.push(m[h]),m.splice(h,1)):p*p+(g=t[a].y-m[h].y)*g>m[h].r||(x.push(m[h].a,m[h].b,m[h].b,m[h].c,m[h].c,m[h].a),m.splice(h,1));for(At(x),h=x.length;h;)n=x[--h],e=x[--h],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),Math.abs(s)>1e-12&&m.push(new Rt(e,n,r))}for(Array.prototype.push.apply(_,m),a=_.length;a--;)(_[a].a.__sentinel||_[a].b.__sentinel||_[a].c.__sentinel)&&_.splice(a,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],s={};return n?(e.push(t.a.z),r.push(t.b.z),i.push(t.c.z)):s={a:t.a.z,b:t.b.z,c:t.c.z},o([[e,r,i,e]],s)})))}function Rt(t,e,n){this.a=t,this.b=e,this.c=n;var r,i,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,c=o*(t.x+e.x)+s*(t.y+e.y),l=a*(t.x+n.x)+u*(t.y+n.y),f=2*(o*(n.y-e.y)-s*(n.x-e.x));this.x=(u*c-s*l)/f,this.y=(o*l-a*c)/f,r=this.x-t.x,i=this.y-t.y,this.r=r*r+i*i}function Tt(t,e){return e.x-t.x}function At(t){var e,n,r,i,o,s=t.length;t:for(;s;)for(n=t[--s],e=t[--s],r=s;r;)if(o=t[--r],i=t[--r],e===i&&n===o||e===o&&n===i){t.splice(s,2),t.splice(r,2),s-=2;continue t}}function Ft(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=U(t),o=U(e),s=x(o[1]-i[1]),a=x(o[0]-i[0]),u=x(i[1]),c=x(o[1]),l=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(u)*Math.cos(c);return d(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),r)}function Dt(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return kt(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"features":return;default:e[n]=t[n]}})),e.features=t.features.map((function(t){return kt(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return jt(t);default:throw new Error("unknown GeoJSON type")}}function kt(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};return e?(Object.keys(e).forEach((function(r){var i=e[r];"object"==typeof i?null===i?n[r]=null:i.length?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=jt(t.geometry),e}function jt(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return jt(t)})),e):(e.coordinates=function t(e){return"object"!=typeof e[0]?e.slice():e.map((function(e){return t(e)}))}(t.coordinates),e)}function Gt(t,e){function n(t,e){e.length&&e.pop();for(var n=u[t<0?~t:t],r=0,i=n.length;r<i;++r)e.push(a(n[r],r));t<0&&Jo(e,i)}function r(t){return a(t)}function i(t){for(var e=[],r=0,i=t.length;r<i;++r)n(t[r],e);return e.length<2&&e.push(e[0]),e}function o(t){for(var e=i(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(o)}var a=$o(t.transform),u=t.arcs;return function t(e){var n,o=e.type;switch(o){case"GeometryCollection":return{type:o,geometries:e.geometries.map(t)};case"Point":n=r(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(r);break;case"LineString":n=i(e.arcs);break;case"MultiLineString":n=e.arcs.map(i);break;case"Polygon":n=s(e.arcs);break;case"MultiPolygon":n=e.arcs.map(s);break;default:return null}return{type:o,coordinates:n}}(e)}function qt(t,e){function n(t){t.forEach((function(e){e.forEach((function(e){(i[e=e<0?~e:e]||(i[e]=[])).push(t)}))})),o.push(t)}function r(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(Gt(t,{type:"Polygon",arcs:[e]}).coordinates[0])}var i={},o=[],s=[];return e.forEach((function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":n(e.arcs);break;case"MultiPolygon":e.arcs.forEach(n)}})),o.forEach((function(t){if(!t._){var e=[],n=[t];for(t._=1,s.push(e);t=n.pop();)e.push(t),t.forEach((function(t){t.forEach((function(t){i[t<0?~t:t].forEach((function(t){t._||(t._=1,n.push(t))}))}))}))}})),o.forEach((function(t){delete t._})),{type:"MultiPolygon",arcs:s.map((function(e){var n,o=[];if(e.forEach((function(t){t.forEach((function(t){t.forEach((function(t){i[t<0?~t:t].length<2&&o.push(t)}))}))})),(n=(o=Ko(t,o)).length)>1)for(var s,a,u=1,c=r(o[0]);u<n;++u)(s=r(o[u]))>c&&(a=o[0],o[0]=o[u],o[u]=a,c=s);return o}))}}function Bt(t,e,n){for(var r,i=e+(n---e>>1);e<i;++e,--n)r=t[e],t[e]=t[n],t[n]=r}function zt(t){return null==t?{type:null}:("FeatureCollection"===t.type?function(t){var e={type:"GeometryCollection",geometries:t.features.map(Ut)};return null!=t.bbox&&(e.bbox=t.bbox),e}:"Feature"===t.type?Ut:Vt)(t)}function Ut(t){var e,n=Vt(t.geometry);for(e in null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),t.properties){n.properties=t.properties;break}return n}function Vt(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(Vt)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}function Xt(t){var e,n=t[0],r=t[1];return r<n&&(e=n,n=r,r=e),n+31*r}function Yt(t,e){var n,r=t[0],i=t[1],o=e[0],s=e[1];return i<r&&(n=r,r=i,i=n),s<o&&(n=o,o=s,s=n),r===o&&i===s}function Wt(t){return t[0].toString()+","+t[1].toString()}function Ht(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(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=Dt(t));var r=function(t){var e={};D(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");switch(r){case"LineString":return function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(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=Dt(t));var r=[],i=B(t,(function(t,e){return function(t,e){var n,r=t.geometry.coordinates,i=e.geometry.coordinates,o=Wt(r[0]),s=Wt(r[r.length-1]),u=Wt(i[0]),c=Wt(i[i.length-1]);if(o===c)n=i.concat(r.slice(1));else if(u===s)n=r.concat(i.slice(1));else if(o===u)n=r.slice(1).reverse().concat(i);else{if(s!==c)return null;n=r.concat(i.reverse().slice(1))}return a(n)}(t,e)||(r.push(t),e)}));return i&&r.push(i),r.length?1===r.length?r[0]:l(r.map((function(t){return t.coordinates}))):null}(t,e);case"Polygon":return function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if("FeatureCollection"!==K(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=Dt(t));var r=[];D(t,(function(t){r.push(t.geometry)}));var i=ss({geoms:p(r).geometry});return Zo(i,i.objects.geoms.geometries)}(t,e);default:throw new Error(r+" is not supported")}}function $t(t,n){var r="object"==typeof n?n.mutate:n;if(!t)throw new Error("geojson is required");var i=K(t),o=[];switch(i){case"LineString":o=Jt(t);break;case"MultiLineString":case"Polygon":V(t).forEach((function(t){o.push(Jt(t))}));break;case"MultiPolygon":V(t).forEach((function(t){var e=[];t.forEach((function(t){e.push(Jt(t))})),o.push(e)}));break;case"Point":return t;case"MultiPoint":var s={};V(t).forEach((function(t){var e=t.join("-");s.hasOwnProperty(e)||(o.push(t),s[e]=!0)}));break;default:throw new Error(i+" geometry not supported")}return t.coordinates?!0===r?(t.coordinates=o,t):{type:i,coordinates:o}:!0===r?(t.geometry.coordinates=o,t):e({type:i,coordinates:o},t.properties,t.bbox,t.id)}function Jt(t){var e=V(t);if(2===e.length&&!function(t,e){return t[0]===e[0]&&t[1]===e[1]}(e[0],e[1]))return e;var n,r,i,o=[],s=e.length-1;o.push(e[0]);for(var a=1;a<s;a++)n=e[a-1],r=e[a],function(t,e,n){var r=n[0],i=n[1],o=t[0],s=t[1],a=e[0],u=e[1],c=a-o,l=u-s;return(r-o)*l-(i-s)*c==0&&(Math.abs(c)>=Math.abs(l)?c>0?o<=r&&r<=a:a<=r&&r<=o:l>0?s<=i&&i<=u:u<=i&&i<=s)}(n,i=e[a+1],r)||o.push(r);return o.push(i),o}function Kt(t,e){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function Zt(t,e,n){var r=e.x,i=e.y,o=n.x-r,s=n.y-i;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-i)*s)/(o*o+s*s);a>1?(r=n.x,i=n.y):a>0&&(r+=o*a,i+=s*a)}return(o=t.x-r)*o+(s=t.y-i)*s}function Qt(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return function(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,i,o){for(var s,a=i,u=n+1;u<r;u++){var c=Zt(e[u],e[n],e[r]);c>a&&(s=u,a=c)}a>i&&(s-n>1&&t(e,n,s,i,o),o.push(e[s]),r-s>1&&t(e,s,r,i,o))}(t,0,n,e,r),r.push(t[n]),r}(t=n?t:function(t,e){for(var n,r=t[0],i=[r],o=1,s=t.length;o<s;o++)Kt(n=t[o],r)>e&&(i.push(n),r=n);return r!==n&&i.push(n),i}(t,r),r)}function te(t,e,n){return Qt(t.map((function(t){return{x:t[0],y:t[1],z:t[2]}})),e,n).map((function(t){return t.z?[t.x,t.y,t.z]:[t.x,t.y]}))}function ee(t,e,n){return t.map((function(t){var r=t.map((function(t){return{x:t[0],y:t[1]}}));if(r.length<4)throw new Error("invalid polygon");for(var i=Qt(r,e,n).map((function(t){return[t.x,t.y]}));!function(t){return!(t.length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1])}(i);)i=Qt(r,e-=.01*e,n).map((function(t){return[t.x,t.y]}));return i[i.length-1][0]===i[0][0]&&i[i.length-1][1]===i[0][1]||i.push(i[0]),i}))}function ne(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.resolution||1e4,r=e.sharpness||.85;if(!t)throw new Error("line is required");if(!E(n))throw new Error("resolution must be an number");if(!E(r))throw new Error("sharpness must be an number");for(var i=[],o=new as({points:$(t).coordinates.map((function(t){return{x:t[0],y:t[1]}})),duration:n,sharpness:r}),s=0;s<o.duration;s+=10){var u=o.pos(s);Math.floor(s/100)%2==0&&i.push([u.x,u.y])}return a(i,t.properties)}function re(t){S(t);var e=Number(t[0]),n=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[e,n];return o([[s,[r,n],[r,i],[e,i],s]])}function ie(t){return re(z(t))}function oe(t){var e=t[0],n=t[1],r=t[2],i=t[3];if(Ft(t.slice(0,2),[r,n])>=Ft(t.slice(0,2),[e,i])){var o=(n+i)/2;return[e,o-(r-e)/2,r,o+(r-e)/2]}var s=(e+r)/2;return[s-(i-n)/2,n,s+(i-n)/2,i]}function se(t,e,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,s=i.properties,a=U(t),u=x(a[0]),c=x(a[1]),l=x(n),f=y(e,o),h=Math.asin(Math.sin(c)*Math.cos(f)+Math.cos(c)*Math.sin(f)*Math.cos(l));return r([_(u+Math.atan2(Math.sin(l)*Math.sin(f)*Math.cos(c),Math.cos(f)-Math.sin(c)*Math.sin(h))),_(h)],s)}function ae(t,e,n){var r=(n=n||{}).steps||64,i=n.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be a number");r=r||64,i=i||t.properties||{};for(var s=[],a=0;a<r;a++)s.push(se(t,e,-360*a/r,n).geometry.coordinates);return s.push(s[0]),o([s],i)}function ue(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");if(!0===n.final)return function(t,e){var n=ue(e,t);return(n+180)%360}(t,e);var r=U(t),i=U(e),o=x(r[0]),s=x(i[0]),a=x(r[1]),u=x(i[1]),c=Math.sin(s-o)*Math.cos(u),l=Math.cos(a)*Math.sin(u)-Math.sin(a)*Math.cos(u)*Math.cos(s-o);return _(Math.atan2(c,l))}function ce(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties;if(!t)throw new Error("geojson is required");var i=z(t);return r([(i[0]+i[2])/2,(i[1]+i[3])/2],n)}function le(t,e){var n=0,i=0,o=0;return P(t,(function(t){n+=t[0],i+=t[1],o++}),!0),r([n/o,i/o],e)}function fe(t){var e=[];return"FeatureCollection"===t.type?O(t,(function(t){P(t,(function(n){e.push(r(n,t.properties))}))})):P(t,(function(n){e.push(r(n,t.properties))})),c(e)}function he(t,e,n){n=n||2;var r,i,o,s,a,u,c,l=e&&e.length,f=l?e[0]*n:t.length,h=pe(t,0,f,n,!0),p=[];if(!h)return p;if(l&&(h=function(t,e,n,r){var i,o,s,a=[];for(i=0,o=e.length;i<o;i++)(s=pe(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===s.next&&(s.steiner=!0),a.push(function(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}(s));for(a.sort(de),i=0;i<a.length;i++)!function(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s){if(s=a,a===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===s)return n.prev;var u,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)i>=r.x&&r.x>=l&&i!==r.x&&ve(o<f?i:s,o,l,f,o<f?s:i,o,r.x,r.y)&&((u=Math.abs(o-r.y)/(i-r.x))<h||u===h&&r.x>n.x)&&be(r,t)&&(n=r,h=u),r=r.next;return n}(t,e)){var n=we(e,t);ge(n,n.next)}}(a[i],n),n=ge(n,n.next);return n}(t,e,h,n)),t.length>80*n){r=o=t[0],i=s=t[1];for(var g=n;g<f;g+=n)(a=t[g])<r&&(r=a),(u=t[g+1])<i&&(i=u),a>o&&(o=a),u>s&&(s=u);c=0!==(c=Math.max(o-r,s-i))?1/c:0}return function t(e,n,r,i,o,s,a){if(e){!a&&s&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=ye(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,s,a,u,c=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<c&&(a++,r=r.nextZ);e++);for(u=c;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(s>1)}(i)}(e,i,o,s);for(var u,c,l=e;e.prev!==e.next;)if(u=e.prev,c=e.next,s?function(t,e,n,r){var i=t.prev,o=t,s=t.next;if(me(i,o,s)>=0)return!1;for(var a=i.x<o.x?i.x<s.x?i.x:s.x:o.x<s.x?o.x:s.x,u=i.y<o.y?i.y<s.y?i.y:s.y:o.y<s.y?o.y:s.y,c=i.x>o.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,l=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,f=ye(a,u,e,n,r),h=ye(c,l,e,n,r),p=t.nextZ;p&&p.z<=h;){if(p!==t.prev&&p!==t.next&&ve(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&me(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&ve(i.x,i.y,o.x,o.y,s.x,s.y,p.x,p.y)&&me(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}(e,i,o,s):function(t){var e=t.prev,n=t,r=t.next;if(me(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ve(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&me(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(e))n.push(u.i/r),n.push(e.i/r),n.push(c.i/r),Ie(e),e=c.next,l=c.next;else if((e=c)===l){a?1===a?t(e=function(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!_e(i,o)&&xe(i,r,r.next,o)&&be(i,o)&&be(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Ie(r),Ie(r.next),r=t=o),r=r.next}while(r!==t);return r}(e,n,r),n,r,i,o,s,2):2===a&&function(e,n,r,i,o,s){var a=e;do{for(var u=a.next.next;u!==a.prev;){if(a.i!==u.i&&function(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&&xe(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&be(t,e)&&be(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)}(a,u)){var c=we(a,u);return a=ge(a,a.next),c=ge(c,c.next),t(a,n,r,i,o,s),void t(c,n,r,i,o,s)}u=u.next}a=a.next}while(a!==e)}(e,n,r,i,o,s):t(ge(e),n,r,i,o,s,1);break}}}(h,p,n,r,i,c),p}function pe(t,e,n,r,i){var o,s;if(i===Ne(t,e,n,r)>0)for(o=e;o<n;o+=r)s=Ee(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=Ee(o,t[o],t[o+1],s);return s&&_e(s,s.next)&&(Ie(s),s=s.next),s}function ge(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_e(r,r.next)&&0!==me(r.prev,r,r.next))r=r.next;else{if(Ie(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function de(t,e){return t.x-e.x}function ye(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ve(t,e,n,r,i,o,s,a){return(i-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(r-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(i-s)*(r-a)>=0}function me(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _e(t,e){return t.x===e.x&&t.y===e.y}function xe(t,e,n,r){return!!(_e(t,e)&&_e(n,r)||_e(t,r)&&_e(n,e))||me(t,e,n)>0!=me(t,e,r)>0&&me(n,r,t)>0!=me(n,r,e)>0}function be(t,e){return me(t.prev,t,t.next)<0?me(t,e,t.next)>=0&&me(t,t.prev,e)>=0:me(t,e,t.prev)<0||me(t,t.next,e)<0}function we(t,e){var n=new Se(t.i,t.x,t.y),r=new Se(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 Ee(t,e,n,r){var i=new Se(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 Ie(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 Se(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ne(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}function Pe(t){var e=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}(t),n=us(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 s=0;s<i.length;s+=3){var a=i.slice(s,s+3);a.push(i[s]),r.push(o([a]))}return r}function Ce(t,e){if(!t)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var n,r=1/0;return O(e,(function(e,i){var o=Ft(t,e);o<r&&((n=Dt(e)).properties.featureIndex=i,n.properties.distanceToPoint=o,r=o)})),n}function Le(t,e,n,r,i){!function t(e,n,r,i,o){for(;i>r;){if(i-r>600){var s=i-r+1,a=n-r+1,u=Math.log(s),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-a*c/s+l)),Math.min(i,Math.floor(n+(s-a)*c/s+l)),o)}var f=e[n],h=r,p=i;for(Me(e,r,n),o(e[i],f)>0&&Me(e,r,i);h<p;){for(Me(e,h,p),h++,p--;o(e[h],f)<0;)h++;for(;o(e[p],f)>0;)p--}0===o(e[r],f)?Me(e,r,p):Me(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,n||0,r||t.length-1,i||function(t,e){return t<e?-1:t>e?1:0})}function Me(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Oe(t,e){if(!(this instanceof Oe))return new Oe(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function Re(t,e){Te(t,0,t.children.length,e,t)}function Te(t,e,n,r,i){i||(i=Be(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],Ae(i,t.leaf?r(o):o);return i}function Ae(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Fe(t,e){return t.minX-e.minX}function De(t,e){return t.minY-e.minY}function ke(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function je(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Ge(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function qe(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Be(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ze(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(Le(t,o=e+Math.ceil((n-e)/r/2)*r,e,n,i),s.push(e,o,o,n))}function Ue(t){var e=Oe(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=Ve(e)).bbox=e}else t.bbox=t.bbox?t.bbox:Xe(t);return Oe.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){var n=Ve(t);n.bbox=t,e.push(n)})):O(t,(function(t){t.bbox=t.bbox?t.bbox:Xe(t),e.push(t)})),Oe.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=Ve(e)).bbox=e}return Oe.prototype.remove.call(this,t)},e.clear=function(){return Oe.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:Oe.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return Oe.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:Oe.prototype.all.call(this)}},e.toJSON=function(){return Oe.prototype.toJSON.call(this)},e.fromJSON=function(t){return Oe.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:Xe(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}function Ve(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function Xe(t){var e=[1/0,1/0,-1/0,-1/0];return P(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function Ye(t){if(!t)throw new Error("geojson is required");var e=[];return D(t,(function(t){!function(t,e){var n=[],r=t.geometry;switch(r.type){case"Polygon":n=V(r);break;case"LineString":n=[V(r)]}n.forEach((function(n){(function(t,e){var n=[];return t.reduce((function(t,r){var i=a([t,r],e);return i.bbox=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return[n<i?n:i,r<o?r:o,n>i?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)})),c(e)}function We(t,n){var r={},i=[];if("LineString"===t.type&&(t=e(t)),"LineString"===n.type&&(n=e(n)),"Feature"===t.type&&"Feature"===n.type&&"LineString"===t.geometry.type&&"LineString"===n.geometry.type&&2===t.geometry.coordinates.length&&2===n.geometry.coordinates.length){var o=He(t,n);return o&&i.push(o),c(i)}var s=Ue();return s.load(Ye(n)),O(Ye(t),(function(t){O(s.search(t),(function(e){var n=He(t,e);if(n){var o=V(n).join(",");r[o]||(r[o]=!0,i.push(n))}}))})),c(i)}function He(t,e){var n=V(t),i=V(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=n[0][0],s=n[0][1],a=n[1][0],u=n[1][1],c=i[0][0],l=i[0][1],f=i[1][0],h=i[1][1],p=(h-l)*(a-o)-(f-c)*(u-s);if(0===p)return null;var g=((f-c)*(s-l)-(h-l)*(o-c))/p,d=((a-o)*(s-l)-(u-s)*(o-c))/p;return g>=0&&g<=1&&d>=0&&d<=1?r([o+g*(a-o),s+g*(u-s)]):null}function $e(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i=t.geometry?t.geometry.type:t.type;if("LineString"!==i&&"MultiLineString"!==i)throw new Error("lines must be LineString or MultiLineString");var o=r([1/0,1/0],{dist:1/0}),s=0;return D(t,(function(t){for(var i=V(t),u=0;u<i.length-1;u++){var c=r(i[u]);c.properties.dist=Ft(e,c,n);var l=r(i[u+1]);l.properties.dist=Ft(e,l,n);var f=Ft(c,l,n),h=Math.max(c.properties.dist,l.properties.dist),p=ue(c,l),g=se(e,h,p+90,n),d=se(e,h,p-90,n),y=We(a([g.geometry.coordinates,d.geometry.coordinates]),a([c.geometry.coordinates,l.geometry.coordinates])),v=null;y.features.length>0&&((v=y.features[0]).properties.dist=Ft(e,v,n),v.properties.location=s+Ft(c,v,n)),c.properties.dist<o.properties.dist&&((o=c).properties.index=u,o.properties.location=s),l.properties.dist<o.properties.dist&&((o=l).properties.index=u+1,o.properties.location=s+f),v&&v.properties.dist<o.properties.dist&&((o=v).properties.index=u),s+=f}})),o}function Je(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r,i=n.final;if(!t)throw new Error("start point is required");if(!e)throw new Error("end point is required");return(r=i?Ke(U(e),U(t)):Ke(U(t),U(e)))>180?-(360-r):r}function Ke(t,e){var n=x(t[1]),r=x(e[1]),i=x(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(_(Math.atan2(i,o))+360)%360}function Ze(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=U(t),o=U(e);return o[0]+=o[0]-i[0]>180?-360:i[0]-o[0]>180?360:0,b(function(t,e,n){var r=n=void 0===n?wo:Number(n),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,s=o-i,a=Math.abs(e[0]-t[0])*Math.PI/180;a>Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?s/u:Math.cos(i);return Math.sqrt(s*s+c*c*a*a)*r}(i,o),"meters",r)}function Qe(t,e){return en(t,"mercator",e)}function tn(t,e){return en(t,"wgs84",e)}function en(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.mutate;if(!t)throw new Error("geojson is required");return Array.isArray(t)&&E(t[0])?t="mercator"===e?nn(t):rn(t):(!0!==r&&(t=Dt(t)),P(t,(function(t){var n="mercator"===e?nn(t):rn(t);t[0]=n[0],t[1]=n[1]}))),t}function nn(t){var e=Math.PI/180,n=20037508.342789244,r=[6378137*(Math.abs(t[0])<=180?t[0]:t[0]-360*function(t){return t<0?-1:t>0?1:0}(t[0]))*e,6378137*Math.log(Math.tan(.25*Math.PI+.5*t[1]*e))];return r[0]>n&&(r[0]=n),r[0]<-n&&(r[0]=-n),r[1]>n&&(r[1]=n),r[1]<-n&&(r[1]=-n),r}function rn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}function on(t,n,i){if(!I(i=i||{}))throw new Error("options is invalid");if(!t)throw new Error("pt is required");if(Array.isArray(t)?t=r(t):"Point"===t.type?t=e(t):W(t,"Point","point"),!n)throw new Error("line is required");Array.isArray(n)?n=a(n):"LineString"===n.type?n=e(n):W(n,"LineString","line");var o=1/0,s=t.geometry.coordinates;return j(n,(function(t){var e=t.geometry.coordinates[0],n=t.geometry.coordinates[1],a=function(t,e,n,i){var o=i.mercator,s=!0!==o?Ft(e,t,i):sn(e,t,i),a=m(!0!==o?ue(e,t):Je(e,t)),u=m(!0!==o?ue(e,n):Je(e,n)),c=Math.abs(a-u);if(c>90)return s;var l=(u+180)%360,f=m(!0!==o?ue(n,t):Je(n,t)),h=Math.abs(f-l);return h>180&&(h=Math.abs(h-360)),h>90?!0!==o?Ft(t,n,i):sn(t,n,i):!0!==o?s*Math.sin(x(c)):function(t,e,n,i){var o=0;(Math.abs(t[0])>=180||Math.abs(e[0])>=180||Math.abs(n[0])>=180)&&(o=t[0]>0||e[0]>0||n[0]>0?-180:180);var s=r(n),a=tn(function(t,e,n){var r=t[0],i=t[1],o=e[0]-r,s=e[1]-i,a=((n[0]-r)*o+(n[1]-i)*s)/(o*o+s*s);return[r+a*o,i+a*s]}(Qe([t[0]+o,t[1]]),Qe([e[0]+o,e[1]]),Qe([n[0]+o,n[1]])));return 0!==o&&(a[0]-=o),Ze(s,a,i)}(e,n,t,i)}(s,e,n,i);o>a&&(o=a)})),o}function sn(t,e,n){var r=n.units,i=0;Math.abs(t[0])>=180&&(i=t[0]>0?-180:180),Math.abs(e[0])>=180&&(i=e[0]>0?-180:180);var o=Qe([t[0]+i,t[1]]),s=Qe([e[0]+i,e[1]]),a=function(t){return t*t},u=a(o[0]-s[0])+a(o[1]-s[1]);return b(Math.sqrt(u),"meters",r)}function an(t){for(var n=function(t){return"FeatureCollection"!==t.type?"Feature"!==t.type?c([e(t)]):c([t]):t}(t),i=ce(n),o=!1,s=0;!o&&s<n.features.length;){var a,u=n.features[s].geometry,l=!1;if("Point"===u.type)i.geometry.coordinates[0]===u.coordinates[0]&&i.geometry.coordinates[1]===u.coordinates[1]&&(o=!0);else if("MultiPoint"===u.type){var f=!1;for(a=0;!f&&a<u.coordinates.length;)i.geometry.coordinates[0]===u.coordinates[a][0]&&i.geometry.coordinates[1]===u.coordinates[a][1]&&(o=!0,f=!0),a++}else if("LineString"===u.type)for(a=0;!l&&a<u.coordinates.length-1;)un(i.geometry.coordinates[0],i.geometry.coordinates[1],u.coordinates[a][0],u.coordinates[a][1],u.coordinates[a+1][0],u.coordinates[a+1][1])&&(l=!0,o=!0),a++;else if("MultiLineString"===u.type)for(var h=0;h<u.coordinates.length;){l=!1,a=0;for(var p=u.coordinates[h];!l&&a<p.length-1;)un(i.geometry.coordinates[0],i.geometry.coordinates[1],p[a][0],p[a][1],p[a+1][0],p[a+1][1])&&(l=!0,o=!0),a++;h++}else"Polygon"!==u.type&&"MultiPolygon"!==u.type||Ct(i,u)&&(o=!0);s++}if(o)return i;var g=c([]);for(s=0;s<n.features.length;s++)g.features=g.features.concat(fe(n.features[s]).features);return r(Ce(i,g).geometry.coordinates)}function un(t,e,n,r,i,o){return Math.sqrt((i-n)*(i-n)+(o-r)*(o-r))===Math.sqrt((t-n)*(t-n)+(e-r)*(e-r))+Math.sqrt((i-t)*(i-t)+(o-e)*(o-e))}function cn(t){return F(t,(function(t,e){return t+function t(e){var n,r=0;switch(e.type){case"Polygon":return ln(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)r+=ln(e.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)r+=t(e.geometries[n]);return r}}(e)}),0)}function ln(t){var e=0;if(t&&t.length>0){e+=Math.abs(fn(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(fn(t[n]))}return e}function fn(t){var e,n,r,i,o,s,a=0,u=t.length;if(u>2){for(s=0;s<u;s++)s===u-2?(r=u-2,i=u-1,o=0):s===u-1?(r=u-1,i=0,o=1):(r=s,i=s+1,o=s+2),e=t[r],n=t[i],a+=(hn(t[o][0])-hn(e[0]))*Math.sin(hn(n[1]));a=a*fs*fs/2}return a}function hn(t){return t*Math.PI/180}function pn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");if(!t)throw new Error("geojson is required");return G(t,(function(t,n){var r=n.geometry.coordinates;return t+Ft(r[0],r[1],e)}),0)}function gn(t,e,n,r){if(!I(r=r||{}))throw new Error("options is invalid");var i,o=[];if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}for(var s,u,c,l=0,f=0;f<i.length&&!(e>=l&&f===i.length-1);f++){if(l>e&&0===o.length){if(!(s=e-l))return o.push(i[f]),a(o);u=ue(i[f],i[f-1])-180,c=se(i[f],s,u,r),o.push(c.geometry.coordinates)}if(l>=n)return(s=n-l)?(u=ue(i[f],i[f-1])-180,c=se(i[f],s,u,r),o.push(c.geometry.coordinates),a(o)):(o.push(i[f]),a(o));if(l>=e&&o.push(i[f]),f===i.length-1)return a(o);l+=Ft(i[f],i[f+1],r)}return a(i[i.length-1])}function dn(t,e,n){var r=(n=n||{}).ignoreEndVertices;if(!I(n))throw new Error("invalid options");if(!t)throw new Error("pt is required");if(!e)throw new Error("line is required");for(var i=U(t),o=V(e),s=0;s<o.length-1;s++){var a=!1;if(r&&(0===s&&(a="start"),s===o.length-2&&(a="end"),0===s&&s+1===o.length-1&&(a="both")),function(t,e,n,r){var i=n[0],o=n[1],s=t[0],a=t[1],u=e[0],c=e[1],l=u-s,f=c-a;return(n[0]-s)*f-(n[1]-a)*l==0&&(r?"start"===r?Math.abs(l)>=Math.abs(f)?l>0?s<i&&i<=u:u<=i&&i<s:f>0?a<o&&o<=c:c<=o&&o<a:"end"===r?Math.abs(l)>=Math.abs(f)?l>0?s<=i&&i<u:u<i&&i<=s:f>0?a<=o&&o<c:c<o&&o<=a:"both"===r?Math.abs(l)>=Math.abs(f)?l>0?s<i&&i<u:u<i&&i<s:f>0?a<o&&o<c:c<o&&o<a:void 0:Math.abs(l)>=Math.abs(f)?l>0?s<=i&&i<=u:u<=i&&i<=s:f>0?a<=o&&o<=c:c<=o&&o<=a)}(o[s],o[s+1],i,a))return!0}return!1}function yn(t,e){var n=K(t),r=K(e),i=$(t),o=$(e);switch(n){case"Point":switch(r){case"MultiPoint":return function(t,e){var n,r=!1;for(n=0;n<e.coordinates.length;n++)if(mn(e.coordinates[n],t.coordinates)){r=!0;break}return r}(i,o);case"LineString":return dn(i,o,{ignoreEndVertices:!0});case"Polygon":return Ct(i,o,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return function(t,e){for(var n=0;n<t.coordinates.length;n++){for(var r=!1,i=0;i<e.coordinates.length;i++)mn(t.coordinates[n],e.coordinates[i])&&(r=!0);if(!r)return!1}return!0}(i,o);case"LineString":return function(t,e){for(var n=!1,r=0;r<t.coordinates.length;r++){if(!dn(t.coordinates[r],e))return!1;n||(n=dn(t.coordinates[r],e,{ignoreEndVertices:!0}))}return n}(i,o);case"Polygon":return function(t,e){for(var n=!0,r=0;r<t.coordinates.length;r++){var i=Ct(t.coordinates[1],e);if(!i){n=!1;break}i=Ct(t.coordinates[1],e,{ignoreBoundary:!0})}return n&&i}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return function(t,e){for(var n=0;n<t.coordinates.length;n++)if(!dn(t.coordinates[n],e))return!1;return!0}(i,o);case"Polygon":return function(t,e){if(!vn(z(e),z(t)))return!1;for(var n=!1,r=0;r<t.coordinates.length-1;r++){if(!Ct(t.coordinates[r],e))return!1;n||(n=Ct(t.coordinates[r],e,{ignoreBoundary:!0})),n||(n=Ct(function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(t.coordinates[r],t.coordinates[r+1]),e,{ignoreBoundary:!0}))}return n}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":return function(t,e){var n=z(t);if(!vn(z(e),n))return!1;for(var r=0;r<t.coordinates[0].length;r++)if(!Ct(t.coordinates[0][r],e))return!1;return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function vn(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function mn(t,e){return t[0]===e[0]&&t[1]===e[1]}function _n(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i=n.mask,o=n.properties,s=[];if(null==e)throw new Error("cellSide is required");if(!E(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],l=t[2],f=t[3],h=e/Ft([a,u],[l,u],n)*(l-a),p=e/Ft([a,u],[a,f],n)*(f-u),g=l-a,d=f-u,y=Math.floor(g/h),v=(d-Math.floor(d/p)*p)/2,m=a+(g-y*h)/2;m<=l;){for(var _=u+v;_<=f;){var x=r([m,_],o);i?yn(x,i)&&s.push(x):s.push(x),_+=p}m+=h}return c(s)}function xn(t,e){if(!I(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("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return P(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e}(t,o,r)})),t}function bn(t,e){if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!bn(t[n],e[n]))return!1}else if(t[n]!==e[n])return!1;return!0}function wn(t,e){if(void 0===e&&(e=!0),3!=t.length)throw new Error("This function requires an array of three points [x,y]");return(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0])>=0==e}function En(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]instanceof Array&&e[n]instanceof Array){if(!En(t[n],e[n]))return!1}else if(t[n]!=e[n])return!1;return!0}function In(t,e){var n=[],r=Ue();return D(e,(function(e){if(n.forEach((function(t,e){t.id=e})),n.length){var i=r.search(e);if(i.features.length){var o=Nn(e,i);n=n.filter((function(t){return t.id!==o.id})),r.remove(o),O(Sn(o,e),(function(t){n.push(t),r.insert(t)}))}}else(n=Sn(t,e).features).forEach((function(t){t.bbox||(t.bbox=oe(z(t)))})),r.load(c(n))})),c(n)}function Sn(t,e){var n=[],r=V(t)[0],i=V(t)[t.geometry.coordinates.length-1];if(Pn(r,U(e))||Pn(i,U(e)))return c([t]);var o=Ue(),s=Ye(t);o.load(s);var u=o.search(e);if(!u.features.length)return c([t]);var l=Nn(e,u),f=R(s,(function(t,r,i){var o=V(r)[1],s=U(e);return i===l.id?(t.push(s),n.push(a(t)),Pn(s,o)?[s]:[s,o]):(t.push(o),t)}),[r]);return f.length>1&&n.push(a(f)),c(n)}function Nn(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 O(e,(function(e){var i=$e(e,t).properties.dist;i<r&&(n=e,r=i)})),n}function Pn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Cn(t,e,n,r,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.steps,s=i.units;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if(null==n)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if("object"!=typeof i)throw new Error("options must be an object");o=o||64;var u=Ln(n),c=Ln(r),l=t.properties;if(u===c)return a(ae(t,e,i).geometry.coordinates[0],l);for(var f=u,h=u<c?c:c+360,p=f,g=[],d=0;p<h;)g.push(se(t,e,p,s).geometry.coordinates),p=f+360*++d/o;return p>h&&g.push(se(t,e,h,s).geometry.coordinates),a(g,l)}function Ln(t){var e=t%360;return e<0&&(e+=360),e}function Mn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,r=K(t),i=V(t);if(n=n||t.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(r){case"Polygon":return On(i,n);case"MultiPolygon":var o=[];return i.forEach((function(t){o.push(On(t,n))})),c(o);default:throw new Error("geom "+r+" not supported")}}function On(t,e){return t.length>1?l(t,e):a(t[0],e)}function Rn(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,r=e.autoComplete,i=e.orderCoords;if(!t)throw new Error("lines is required");switch(r=void 0===r||r,i=void 0===i||i,K(t)){case"FeatureCollection":case"GeometryCollection":var o=[];return(t.features?t.features:t.geometries).forEach((function(t){o.push(V(Tn(t,{},r,i)))})),h(o,n)}return Tn(t,n,r,i)}function Tn(t,e,n,r){e=e||t.properties||{};var i=V(t),s=K(t);if(!i.length)throw new Error("line must contain coordinates");switch(s){case"LineString":return n&&(i=An(i)),o([i],e);case"MultiLineString":var u=[],c=0;return i.forEach((function(t){if(n&&(t=An(t)),r){var e=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.abs(e-r)*Math.abs(n-i)}(z(a(t)));e>c?(u.unshift(t),c=e):u.push(t)}else u.push(t)})),o(u,e);default:throw new Error("geometry type "+s+" is not supported")}}function An(t){var e=t[0],n=e[0],r=e[1],i=t[t.length-1],o=i[0],s=i[1];return n===o&&r===s||t.push(e),t}function Fn(t,e,n){var r,i,o,s,a,u=t.length,c=kn(t[0],e),l=[];for(n||(n=[]),r=1;r<u;r++){for(i=t[r-1],s=a=kn(o=t[r],e);;){if(!(c|s)){l.push(i),s!==a?(l.push(o),r<u-1&&(n.push(l),l=[])):r===u-1&&l.push(o);break}if(c&s)break;c?c=kn(i=Dn(i,o,c,e),e):s=kn(o=Dn(i,o,s,e),e)}c=a}return l.length&&n.push(l),n}function Dn(t,e,n,r){return 8&n?[t[0]+(e[0]-t[0])*(r[3]-t[1])/(e[1]-t[1]),r[3]]:4&n?[t[0]+(e[0]-t[0])*(r[1]-t[1])/(e[1]-t[1]),r[1]]:2&n?[r[2],t[1]+(e[1]-t[1])*(r[2]-t[0])/(e[0]-t[0])]:1&n?[r[0],t[1]+(e[1]-t[1])*(r[0]-t[0])/(e[0]-t[0])]:null}function kn(t,e){var n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function jn(t,e){for(var n=[],r=0;r<t.length;r++){var i=bs.polygon(t[r],e);i.length>0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&n.push(i))}return n}function Gn(t){return"[object Arguments]"===Object.prototype.toString.call(t)}function qn(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?(n.strict,t===e):function(t,e,n){var r,i;if(Bn(t)||Bn(e))return!1;if(t.prototype!==e.prototype)return!1;if(Gn(t))return!!Gn(e)&&qn(t=ws.call(t),e=ws.call(e),n);if(zn(t)){if(!zn(e))return!1;if(t.length!==e.length)return!1;for(r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}try{var o=Object.keys(t),s=Object.keys(e)}catch(t){return!1}if(o.length!==s.length)return!1;for(o.sort(),s.sort(),r=o.length-1;r>=0;r--)if(o[r]!==s[r])return!1;for(r=o.length-1;r>=0;r--)if(!qn(t[i=o[r]],e[i],n))return!1;return typeof t==typeof e}(t,e,n))}function Bn(t){return null==t}function zn(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}function Un(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r,i=n.tolerance||0,o=[],s=Ue();return s.load(Ye(t)),j(e,(function(t){var e=!1;O(s.search(t),(function(n){if(!1===e){var o=V(t).sort(),s=V(n).sort();qn(o,s)||(0===i?dn(o[0],n)&&dn(o[1],n):$e(n,o[0]).properties.dist<=i&&$e(n,o[1]).properties.dist<=i)?(e=!0,r=r?Vn(r,t):t):(0===i?dn(s[0],t)&&dn(s[1],t):$e(t,s[0]).properties.dist<=i&&$e(t,s[1]).properties.dist<=i)&&(r=r?Vn(r,n):n)}})),!1===e&&r&&(o.push(r),r=void 0)})),r&&o.push(r),c(o)}function Vn(t,e){var n=V(e),r=V(t),i=r[0],o=r[r.length-1],s=t.geometry.coordinates;return qn(n[0],i)?s.unshift(n[1]):qn(n[0],o)?s.push(n[1]):qn(n[1],i)?s.unshift(n[0]):qn(n[1],o)&&s.push(n[0]),t}function Xn(t){var e=t%360;return e<0&&(e+=360),e}function Yn(t,e,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.units,s=i.properties;if(!t)throw new Error("origin is required");if(null==e)throw new Error("distance is required");if(null==n)throw new Error("bearing is required");if(!(e>=0))throw new Error("distance must be greater than 0");var a=b(e,o,"meters"),u=U(t),c=function(t,e,n,r){var i=e/(r=void 0===r?wo:Number(r)),o=t[0]*Math.PI/180,s=x(t[1]),a=x(n),u=i*Math.cos(a),c=s+u;Math.abs(c)>Math.PI/2&&(c=c>0?Math.PI-c:-Math.PI-c);var l=Math.log(Math.tan(c/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),f=Math.abs(l)>1e-11?u/l:Math.cos(s);return[(180*(o+i*Math.sin(a)/f)/Math.PI+540)%360-180,180*c/Math.PI]}(u,a,n);return c[0]+=c[0]-u[0]>180?-360:u[0]-c[0]>180?360:0,r(c,s)}function Wn(t,e,n,r,i,o){for(var s=0;s<t.length;s++){var a=t[s],u=t[s+1];s===t.length-1&&(u=t[0]),r=Hn(a,u,e),n<=0&&r>0?function(t,e,n){return Hn(t,e,n)<0}(e,a,i)||(i=a):n>0&&r<=0&&(function(t,e,n){return Hn(t,e,n)>0}(e,a,o)||(o=a)),n=r}return[i,o]}function Hn(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])}function $n(t){if(!t)throw new Error("line is required");var e=t.geometry?t.geometry.type:t.type;if(!Array.isArray(t)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var n,r,i=V(t),o=0,s=1;s<i.length;)n=r||i[0],o+=((r=i[s])[0]-n[0])*(r[1]+n[1]),s++;return o>0}function Jn(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return A(t,(function(t){Jn(t,e)})),t;case"LineString":return Kn(V(t),e),t;case"Polygon":return Zn(V(t),e),t;case"MultiLineString":return V(t).forEach((function(t){Kn(t,e)})),t;case"MultiPolygon":return V(t).forEach((function(t){Zn(t,e)})),t;case"Point":case"MultiPoint":return t}}function Kn(t,e){$n(t)===e&&t.reverse()}function Zn(t,e){$n(t[0])!==e&&t[0].reverse();for(var n=1;n<t.length;n++)$n(t[n])===e&&t[n].reverse()}function Qn(t,e,n,r){r=r||{};for(var i=Object.keys(Es),o=0;o<i.length;o++){var s=i[o],a=r[s];a=null!=a?a:Es[s],Is[s]=a}Is.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+e+":"+(e+n)+"]");var u,c=function(t,e,n){for(var r=t.length-1,i=t[0].length-1,o={rows:r,cols:i,cells:[]},s=e+Math.abs(n),a=0;a<r;++a){o.cells[a]=[];for(var u=0;u<i;++u){var c=0,l=t[a+1][u],f=t[a+1][u+1],h=t[a][u+1],p=t[a][u];if(!(isNaN(l)||isNaN(f)||isNaN(h)||isNaN(p))){c|=l<e?0:l>s?128:64,c|=f<e?0:f>s?32:16,c|=h<e?0:h>s?8:4;var g=+(c|=p<e?0:p>s?2:1),d=0;if(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c){var y=(l+f+h+p)/4;d=y>s?2:y<e?0:1,34===c?1===d?c=35:0===d&&(c=136):136===c?1===d?(c=35,d=4):0===d&&(c=34):17===c?1===d?(c=155,d=4):0===d&&(c=153):68===c?1===d?(c=103,d=4):0===d&&(c=102):153===c?1===d&&(c=155):102===c?1===d&&(c=103):152===c?d<2&&(c=156,d=1):137===c?d<2&&(c=139,d=1):98===c?d<2&&(c=99,d=1):38===c?d<2&&(c=39,d=1):18===c?d>0?(c=156,d=4):c=152:33===c?d>0?(c=139,d=4):c=137:72===c?d>0?(c=99,d=4):c=98:132===c&&(d>0?(c=39,d=4):c=38)}if(0!=c&&170!=c){var v,m,_,x,b,w,E,I;v=m=_=x=b=w=E=I=.5;var S=[];1===c?(_=1-tr(e,h,p),I=1-tr(e,l,p),S.push(la[c])):169===c?(_=tr(s,p,h),I=tr(s,p,l),S.push(la[c])):4===c?(w=1-tr(e,f,h),x=tr(e,p,h),S.push(ua[c])):166===c?(w=tr(s,h,f),x=1-tr(s,h,p),S.push(ua[c])):16===c?(b=tr(e,h,f),m=tr(e,l,f),S.push(aa[c])):154===c?(b=1-tr(s,f,h),m=1-tr(s,f,l),S.push(aa[c])):64===c?(E=tr(e,p,l),v=1-tr(e,f,l),S.push(ha[c])):106===c?(E=1-tr(s,l,p),v=tr(s,l,f),S.push(ha[c])):168===c?(x=tr(s,p,h),_=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),S.push(ca[c]),S.push(la[c])):2===c?(x=1-tr(e,h,p),_=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),S.push(ca[c]),S.push(la[c])):162===c?(b=tr(s,h,f),w=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),S.push(ca[c]),S.push(la[c])):8===c?(b=1-tr(e,f,h),w=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),S.push(aa[c]),S.push(ua[c])):138===c?(b=1-tr(e,f,h),w=1-tr(s,f,h),v=1-tr(s,f,l),m=1-tr(e,f,l),S.push(aa[c]),S.push(ua[c])):32===c?(b=tr(s,h,f),w=tr(e,h,f),v=tr(e,l,f),m=tr(s,l,f),S.push(aa[c]),S.push(ua[c])):42===c?(I=1-tr(s,l,p),E=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f),S.push(fa[c]),S.push(ha[c])):128===c&&(I=tr(e,p,l),E=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l),S.push(fa[c]),S.push(ha[c])),5===c?(w=1-tr(e,f,h),I=1-tr(e,l,p),S.push(ua[c])):165===c?(w=tr(s,h,f),I=tr(s,p,l),S.push(ua[c])):20===c?(x=tr(e,p,h),m=tr(e,l,f),S.push(ca[c])):150===c?(x=1-tr(s,h,p),m=1-tr(s,f,l),S.push(ca[c])):80===c?(b=tr(e,h,f),E=tr(e,p,l),S.push(aa[c])):90===c?(b=1-tr(s,f,h),E=1-tr(s,l,p),S.push(aa[c])):65===c?(_=1-tr(e,h,p),v=1-tr(e,f,l),S.push(la[c])):105===c?(_=tr(s,p,h),v=tr(s,l,f),S.push(la[c])):160===c?(b=tr(s,h,f),w=tr(e,h,f),I=tr(e,p,l),E=tr(s,p,l),S.push(aa[c]),S.push(ua[c])):10===c?(b=1-tr(e,f,h),w=1-tr(s,f,h),I=1-tr(s,l,p),E=1-tr(e,l,p),S.push(aa[c]),S.push(ua[c])):130===c?(x=1-tr(e,h,p),_=1-tr(s,h,p),v=1-tr(s,f,l),m=1-tr(e,f,l),S.push(ca[c]),S.push(la[c])):40===c?(x=tr(s,p,h),_=tr(e,p,h),v=tr(e,l,f),m=tr(s,l,f),S.push(ca[c]),S.push(la[c])):101===c?(w=tr(s,h,f),v=tr(s,l,f),S.push(ua[c])):69===c?(w=1-tr(e,f,h),v=1-tr(e,f,l),S.push(ua[c])):149===c?(I=tr(s,p,l),m=1-tr(s,f,l),S.push(fa[c])):21===c?(I=1-tr(e,l,p),m=tr(e,l,f),S.push(fa[c])):86===c?(x=1-tr(s,h,p),E=1-tr(s,l,p),S.push(ca[c])):84===c?(x=tr(e,p,h),E=tr(e,p,l),S.push(ca[c])):89===c?(b=1-tr(s,f,h),_=tr(s,p,h),S.push(la[c])):81===c?(b=tr(e,h,f),_=1-tr(e,h,p),S.push(la[c])):96===c?(b=tr(s,h,f),w=tr(e,h,f),E=tr(e,p,l),v=tr(s,l,f),S.push(aa[c]),S.push(ua[c])):74===c?(b=1-tr(e,f,h),w=1-tr(s,f,h),E=1-tr(s,l,p),v=1-tr(e,f,l),S.push(aa[c]),S.push(ua[c])):24===c?(b=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),m=tr(e,l,f),S.push(aa[c]),S.push(la[c])):146===c?(b=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),m=1-tr(s,f,l),S.push(aa[c]),S.push(la[c])):6===c?(w=1-tr(e,f,h),x=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),S.push(ua[c]),S.push(ca[c])):164===c?(w=tr(s,h,f),x=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),S.push(ua[c]),S.push(ca[c])):129===c?(_=1-tr(e,h,p),I=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l),S.push(la[c]),S.push(fa[c])):41===c?(_=tr(s,p,h),I=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f),S.push(la[c]),S.push(fa[c])):66===c?(x=1-tr(e,h,p),_=1-tr(s,h,p),E=1-tr(s,l,p),v=1-tr(e,f,l),S.push(ca[c]),S.push(la[c])):104===c?(x=tr(s,p,h),_=tr(e,p,h),E=tr(e,p,l),v=tr(s,l,f),S.push(la[c]),S.push(pa[c])):144===c?(b=tr(e,h,f),I=tr(e,p,l),E=tr(s,p,l),m=1-tr(s,f,l),S.push(aa[c]),S.push(ha[c])):26===c?(b=1-tr(s,f,h),I=1-tr(s,l,p),E=1-tr(e,l,p),m=tr(e,l,f),S.push(aa[c]),S.push(ha[c])):36===c?(w=tr(s,h,f),x=tr(e,p,h),v=tr(e,l,f),m=tr(s,l,f),S.push(ua[c]),S.push(ca[c])):134===c?(w=1-tr(e,f,h),x=1-tr(s,h,p),v=1-tr(s,f,l),m=1-tr(e,f,l),S.push(ua[c]),S.push(ca[c])):9===c?(b=1-tr(e,f,h),w=1-tr(s,f,h),_=tr(s,p,h),I=1-tr(e,l,p),S.push(aa[c]),S.push(ua[c])):161===c?(b=tr(s,h,f),w=tr(e,h,f),_=1-tr(e,h,p),I=tr(s,p,l),S.push(aa[c]),S.push(ua[c])):37===c?(w=tr(s,h,f),I=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f),S.push(ua[c]),S.push(fa[c])):133===c?(w=1-tr(e,f,h),I=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l),S.push(ua[c]),S.push(fa[c])):148===c?(x=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),m=1-tr(s,f,l),S.push(ca[c]),S.push(ha[c])):22===c?(x=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),m=tr(e,l,f),S.push(ca[c]),S.push(ha[c])):82===c?(b=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),E=1-tr(s,l,p),S.push(aa[c]),S.push(la[c])):88===c?(b=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),E=tr(e,p,l),S.push(aa[c]),S.push(la[c])):73===c?(b=1-tr(e,f,h),w=1-tr(s,f,h),_=tr(s,p,h),v=1-tr(e,f,l),S.push(aa[c]),S.push(ua[c])):97===c?(b=tr(s,h,f),w=tr(e,h,f),_=1-tr(e,h,p),v=tr(s,l,f),S.push(aa[c]),S.push(ua[c])):145===c?(b=tr(e,h,f),_=1-tr(e,h,p),I=tr(s,p,l),m=1-tr(s,f,l),S.push(aa[c]),S.push(fa[c])):25===c?(b=1-tr(s,f,h),_=tr(s,p,h),I=1-tr(e,l,p),m=tr(e,l,f),S.push(aa[c]),S.push(fa[c])):70===c?(w=1-tr(e,f,h),x=1-tr(s,h,p),E=1-tr(s,l,p),v=1-tr(e,f,l),S.push(ua[c]),S.push(ca[c])):100===c?(w=tr(s,h,f),x=tr(e,p,h),E=tr(e,p,l),v=tr(s,l,f),S.push(ua[c]),S.push(ca[c])):34===c?(0===d?(b=1-tr(e,f,h),w=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l)):(b=tr(s,h,f),w=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f)),S.push(aa[c]),S.push(ua[c]),S.push(fa[c]),S.push(ha[c])):35===c?(4===d?(b=1-tr(e,f,h),w=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l)):(b=tr(s,h,f),w=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f)),S.push(aa[c]),S.push(ua[c]),S.push(la[c]),S.push(ha[c])):136===c?(0===d?(b=tr(s,h,f),w=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f)):(b=1-tr(e,f,h),w=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l)),S.push(aa[c]),S.push(ua[c]),S.push(fa[c]),S.push(ha[c])):153===c?(0===d?(b=tr(e,h,f),_=1-tr(e,h,p),I=1-tr(e,l,p),m=tr(e,l,f)):(b=1-tr(s,f,h),_=tr(s,p,h),I=tr(s,p,l),m=1-tr(s,f,l)),S.push(aa[c]),S.push(la[c])):102===c?(0===d?(w=1-tr(e,f,h),x=tr(e,p,h),E=tr(e,p,l),v=1-tr(e,f,l)):(w=tr(s,h,f),x=1-tr(s,h,p),E=1-tr(s,l,p),v=tr(s,l,f)),S.push(ua[c]),S.push(ha[c])):155===c?(4===d?(b=tr(e,h,f),_=1-tr(e,h,p),I=1-tr(e,l,p),m=tr(e,l,f)):(b=1-tr(s,f,h),_=tr(s,p,h),I=tr(s,p,l),m=1-tr(s,f,l)),S.push(aa[c]),S.push(fa[c])):103===c?(4===d?(w=1-tr(e,f,h),x=tr(e,p,h),E=tr(e,p,l),v=1-tr(e,f,l)):(w=tr(s,h,f),x=1-tr(s,h,p),E=1-tr(s,l,p),v=tr(s,l,f)),S.push(ua[c]),S.push(ca[c])):152===c?(0===d?(b=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),m=tr(e,l,f)):(b=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),m=1-tr(s,f,l)),S.push(aa[c]),S.push(ca[c]),S.push(la[c])):156===c?(4===d?(b=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),m=tr(e,l,f)):(b=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),m=1-tr(s,f,l)),S.push(aa[c]),S.push(la[c]),S.push(ha[c])):137===c?(0===d?(b=tr(s,h,f),w=tr(e,h,f),_=1-tr(e,h,p),I=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f)):(b=1-tr(e,f,h),w=1-tr(s,f,h),_=tr(s,p,h),I=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l)),S.push(aa[c]),S.push(ua[c]),S.push(la[c])):139===c?(4===d?(b=tr(s,h,f),w=tr(e,h,f),_=1-tr(e,h,p),I=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f)):(b=1-tr(e,f,h),w=1-tr(s,f,h),_=tr(s,p,h),I=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l)),S.push(aa[c]),S.push(ua[c]),S.push(fa[c])):98===c?(0===d?(b=1-tr(e,f,h),w=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),E=tr(e,p,l),v=1-tr(e,f,l)):(b=tr(s,h,f),w=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),E=1-tr(s,l,p),v=tr(s,l,f)),S.push(aa[c]),S.push(ua[c]),S.push(ha[c])):99===c?(4===d?(b=1-tr(e,f,h),w=1-tr(s,f,h),x=tr(s,p,h),_=tr(e,p,h),E=tr(e,p,l),v=1-tr(e,f,l)):(b=tr(s,h,f),w=tr(e,h,f),x=1-tr(e,h,p),_=1-tr(s,h,p),E=1-tr(s,l,p),v=tr(s,l,f)),S.push(aa[c]),S.push(ua[c]),S.push(la[c])):38===c?(0===d?(w=1-tr(e,f,h),x=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l)):(w=tr(s,h,f),x=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f)),S.push(ua[c]),S.push(fa[c]),S.push(ha[c])):39===c?(4===d?(w=1-tr(e,f,h),x=tr(e,p,h),I=tr(e,p,l),E=tr(s,p,l),v=1-tr(s,f,l),m=1-tr(e,f,l)):(w=tr(s,h,f),x=1-tr(s,h,p),I=1-tr(s,l,p),E=1-tr(e,l,p),v=tr(e,l,f),m=tr(s,l,f)),S.push(ua[c]),S.push(ca[c]),S.push(ha[c])):85===c&&(b=1,w=0,x=1,_=0,I=0,E=1,v=0,m=1),(v<0||v>1||m<0||m>1||b<0||b>1||x<0||x>1||I<0||I>1||E<0||E>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+g+" "+l+","+f+","+h+","+p+" "+d+" "+v+" "+m+" "+b+" "+w+" "+x+" "+_+" "+I+" "+E),o.cells[a][u]={cval:c,cval_real:g,flipped:d,topleft:v,topright:m,righttop:b,rightbottom:w,bottomright:x,bottomleft:_,leftbottom:I,lefttop:E,edges:S}}}}}return o}(t,e,n);return Is.polygons?(Is.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),u=function(t){var e=[],n=0;return t.cells.forEach((function(t,r){t.forEach((function(t,i){if(void 0!==t){var o=da[t.cval](t);"object"==typeof o&&er(o)?"object"==typeof o[0]&&er(o[0])?"object"==typeof o[0][0]&&er(o[0][0])?o.forEach((function(t){t.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=t})):(o.forEach((function(t){t[0]+=i,t[1]+=r})),e[n++]=o):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}}))})),e}(c)):(Is.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),u=function(t){for(var e=[],n=t.rows,r=t.cols,i=[],o=0;o<n;o++)for(var s=0;s<r;s++)if(void 0!==t.cells[o][s]&&t.cells[o][s].edges.length>0){var a=function(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&Ns?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&Ps?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&Ps?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&Cs?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&Ns?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&Ps?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&Ps?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&Cs?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&Ps?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.righttop],x:-1,y:0,o:1};case 9:return n&Cs?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 10:return n&Cs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.righttop],x:-1,y:0,o:1};case 11:return n&Ss?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 12:return n&Ps?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 13:return n&Cs?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 14:return n&Cs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 15:return n&Ss?{p:[1,t.rightbottom],x:-1,y:0,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 16:return n&Ps?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 17:return n&Ss?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[0,t.lefttop],x:1,y:0,o:1};case 18:return n&Cs?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 19:return n&Ss?{p:[t.bottomleft,0],x:0,y:1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 20:return n&Ss?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.leftbottom],x:1,y:0,o:0};case 21:return n&Ns?{p:[0,t.leftbottom],x:1,y:0,o:0}:{p:[t.topright,1],x:0,y:-1,o:1};case 22:return n&Ss?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[0,t.lefttop],x:1,y:0,o:1};case 23:return n&Ns?{p:[0,t.lefttop],x:1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t)}}return null}(t.cells[o][s]),u=null,c=s,l=o;null!==a&&i.push([a.p[0]+c,a.p[1]+l]);do{if(null===(u=function(t,e,n,r){var i,o,s,a,u,c=t.cval;switch(e){case-1:switch(r){case 0:i=ua[c],s=js[c],a=Gs[c],u=qs[c];break;default:i=aa[c],s=Fs[c],a=Ds[c],u=ks[c]}break;case 1:switch(r){case 0:i=fa[c],s=Js[c],a=Ks[c],u=Zs[c];break;default:i=ha[c],s=Ws[c],a=Hs[c],u=$s[c]}break;default:switch(n){case-1:switch(r){case 0:i=pa[c],s=Ls[c],a=Ms[c],u=Os[c];break;default:i=ga[c],s=Rs[c],a=Ts[c],u=As[c]}break;case 1:switch(r){case 0:i=la[c],s=Bs[c],a=zs[c],u=Us[c];break;default:i=ca[c],s=Vs[c],a=Xs[c],u=Ys[c]}}}if(o=t.edges.indexOf(i),void 0===t.edges[o])return null;switch(function(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}(t,o),c=t.cval_real,i){case 0:c&Ns?(e=t.topleft,n=1):(e=1,n=t.righttop);break;case 1:c&Ps?(e=1,n=t.rightbottom):(e=t.topleft,n=1);break;case 2:c&Ps?(e=t.topleft,n=1):(e=t.bottomright,n=0);break;case 3:c&Cs?(e=t.bottomleft,n=0):(e=t.topleft,n=1);break;case 4:c&Ns?(e=t.topright,n=1):(e=1,n=t.righttop);break;case 5:c&Ps?(e=1,n=t.rightbottom):(e=t.topright,n=1);break;case 6:c&Ps?(e=t.topright,n=1):(e=t.bottomright,n=0);break;case 7:c&Cs?(e=t.bottomleft,n=0):(e=t.topright,n=1);break;case 8:c&Ps?(e=1,n=t.righttop):(e=t.bottomright,n=0);break;case 9:c&Cs?(e=t.bottomleft,n=0):(e=1,n=t.righttop);break;case 10:c&Cs?(e=1,n=t.righttop):(e=0,n=t.leftbottom);break;case 11:c&Ss?(e=0,n=t.lefttop):(e=1,n=t.righttop);break;case 12:c&Ps?(e=1,n=t.rightbottom):(e=t.bottomright,n=0);break;case 13:c&Cs?(e=t.bottomleft,n=0):(e=1,n=t.rightbottom);break;case 14:c&Cs?(e=1,n=t.rightbottom):(e=0,n=t.leftbottom);break;case 15:c&Ss?(e=0,n=t.lefttop):(e=1,n=t.rightbottom);break;case 16:c&Ps?(e=0,n=t.leftbottom):(e=t.bottomright,n=0);break;case 17:c&Ss?(e=0,n=t.lefttop):(e=t.bottomright,n=0);break;case 18:c&Cs?(e=t.bottomleft,n=0):(e=0,n=t.leftbottom);break;case 19:c&Ss?(e=0,n=t.lefttop):(e=t.bottomleft,n=0);break;case 20:c&Ss?(e=0,n=t.leftbottom):(e=t.topleft,n=1);break;case 21:c&Ns?(e=t.topright,n=1):(e=0,n=t.leftbottom);break;case 22:c&Ss?(e=0,n=t.lefttop):(e=t.topleft,n=1);break;case 23:c&Ns?(e=t.topright,n=1):(e=0,n=t.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(t),null}return void 0!==e&&void 0!==n&&void 0!==s&&void 0!==a&&void 0!==u||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(t),console.log(e+" "+n+" "+s+" "+a+" "+u)),{p:[e,n],x:s,y:a,o:u}}(t.cells[l][c],a.x,a.y,a.o)))break;if(i.push([u.p[0]+c,u.p[1]+l]),c+=u.x,a=u,(l+=u.y)<0||l>=n||c<0||c>=r||void 0===t.cells[l][c]){var f=function(t,e,n,r,i,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+r,c=n+i,l=[],f=!1;!f;){if(void 0===t.cells[c]||void 0===t.cells[c][u])if(c-=i,u-=r,a=(s=t.cells[c][u]).cval_real,-1===i)if(0===o)if(a&Cs)l.push([u,c]),r=-1,i=0,o=0;else{if(!(a&Ps)){l.push([u+s.bottomright,c]),r=0,i=1,o=1,f=!0;break}l.push([u+1,c]),r=1,i=0,o=0}else{if(!(a&Cs)){if(a&Ps){l.push([u+s.bottomright,c]),r=0,i=1,o=1,f=!0;break}l.push([u+s.bottomleft,c]),r=0,i=1,o=0,f=!0;break}l.push([u,c]),r=-1,i=0,o=0}else if(1===i)if(0===o){if(!(a&Ns)){if(a&Ss){l.push([u+s.topleft,c+1]),r=0,i=-1,o=0,f=!0;break}l.push([u+s.topright,c+1]),r=0,i=-1,o=1,f=!0;break}l.push([u+1,c+1]),r=1,i=0,o=1}else l.push([u+1,c+1]),r=1,i=0,o=1;else if(-1===r)if(0===o){if(!(a&Ss)){if(a&Cs){l.push([u,c+s.leftbottom]),r=1,i=0,o=0,f=!0;break}l.push([u,c+s.lefttop]),r=1,i=0,o=1,f=!0;break}l.push([u,c+1]),r=0,i=1,o=0}else{if(!(a&Ss)){console.log("MarchingSquaresJS-isoBands: wtf");break}l.push([u,c+1]),r=0,i=1,o=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&Ps)){l.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,f=!0;break}l.push([u+1,c]),r=0,i=-1,o=1}else{if(!(a&Ps)){if(a&Ns){l.push([u+1,c+s.righttop]),r=-1,i=0,o=1;break}l.push([u+1,c+s.rightbottom]),r=-1,i=0,o=0,f=!0;break}l.push([u+1,c]),r=0,i=-1,o=1}}else if(a=(s=t.cells[c][u]).cval_real,-1===r)if(0===o)if(void 0!==t.cells[c-1]&&void 0!==t.cells[c-1][u])r=0,i=-1,o=1;else{if(!(a&Cs)){l.push([u+s.bottomright,c]),r=0,i=1,o=1,f=!0;break}l.push([u,c])}else{if(!(a&Ss)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+c);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c+1]&&void 0!==t.cells[c+1][u])r=0,i=1,o=0;else{if(!(a&Ns)){l.push([u+s.topleft,c+1]),r=0,i=-1,o=0,f=!0;break}l.push([u+1,c+1]),r=1,i=0,o=1}}else if(-1===i){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u+1])r=1,i=0,o=1;else{if(!(a&Ps)){l.push([u+1,c+s.righttop]),r=-1,i=0,o=1,f=!0;break}l.push([u+1,c]),r=0,i=-1,o=1}}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[c][u-1])r=-1,i=0,o=0;else{if(!(a&Ss)){l.push([u,c+s.leftbottom]),r=1,i=0,o=0,f=!0;break}l.push([u,c+1]),r=0,i=1,o=0}}if(c+=i,(u+=r)===e&&c===n)break}return{path:l,i:u,j:c,x:r,y:i,o:o}}(t,c-=u.x,l-=u.y,u.x,u.y,u.o);if(null===f)break;f.path.forEach((function(t){i.push(t)})),c=f.i,l=f.j,a=f}}while(void 0!==t.cells[l][c]&&t.cells[l][c].edges.length>0);e.push(i),i=[],t.cells[o][s].edges.length>0&&s--}return e}(c)),"function"==typeof Is.successCallback&&Is.successCallback(u),u}function tr(t,e,n){return(t-e)/(n-e)}function er(t){return t.constructor.toString().indexOf("Array")>-1}function nr(t,e,n){if(!I(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");return 0===e||(r||(r=le(t)),!1!==i&&void 0!==i||(t=Dt(t)),P(t,(function(t){var n=Je(r,t)+e,i=Ze(r,t),o=V(Yn(r,i,n));t[0]=o[0],t[1]=o[1]}))),t}function rr(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.origin,i=n.mutate;if(!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var o=Array.isArray(r)||"object"==typeof r;return!0!==i&&(t=Dt(t)),"FeatureCollection"!==t.type||o?ir(t,e,r):(O(t,(function(n,i){t.features[i]=ir(n,e,r)})),t)}function ir(t,e,n){var i="Point"===K(t);return n=function(t,e){if(null!=e||(e="centroid"),Array.isArray(e)||"object"==typeof e)return U(e);var n=t.bbox?t.bbox:z(t),i=n[0],o=n[1],s=n[2],a=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return r([i,o]);case"se":case"southeast":case"eastsouth":case"bottomright":return r([s,o]);case"nw":case"northwest":case"westnorth":case"topleft":return r([i,a]);case"ne":case"northeast":case"eastnorth":case"topright":return r([s,a]);case"center":return ce(t);case void 0:case null:case"centroid":return le(t);default:throw new Error("invalid origin")}}(t,n),1===e||i||P(t,(function(t){var r=Ze(n,t),i=Je(n,t),o=V(Yn(n,r*e,i));t[0]=o[0],t[1]=o[1],3===t.length&&(t[2]*=e)})),t}function or(t){var e=t[0],n=t[1];return[n[0]-e[0],n[1]-e[1]]}function sr(t,e){return t[0]*e[1]-e[0]*t[1]}function ar(t,e,n){var r=[],i=v(e,n),o=V(t),s=[];return o.forEach((function(t,e){if(e!==o.length-1){var n=function(t,e,n){var r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=t[0]+n*(e[1]-t[1])/r,o=e[0]+n*(e[1]-t[1])/r;return[[i,t[1]+n*(t[0]-e[0])/r],[o,e[1]+n*(t[0]-e[0])/r]]}(t,o[e+1],i);if(r.push(n),e>0){var a=r[e-1],u=function(t,e){return!function(t,e){return 0===sr(or(t),or(e))}(t,e)&&function(t,e){var n=t[0],r=or(t),i=e[0],o=or(e),s=sr(r,o);return function(t,e){return[t[0]+e[0],t[1]+e[1]]}(n,function(t,e){return[t*e[0],t*e[1]]}(sr(function(t,e){return[t[0]-e[0],t[1]-e[1]]}(i,n),o)/s,r))}(t,e)}(n,a);!1!==u&&(a[1]=u,n[0]=u),s.push(a[0]),e===o.length-2&&(s.push(n[0]),s.push(n[1]))}2===o.length&&(s.push(n[0]),s.push(n[1]))}})),a(s,t.properties)}function ur(t,e,n){var r=e[0]-t[0],i=e[1]-t[1],o=n[0]-e[0],s=n[1]-e[1];return Math.sign(r*s-o*i)}function cr(t,e){return e.geometry.coordinates[0].every((function(e){return Ct(r(e),t)}))}function lr(t,e){for(var n=0;n<t.coordinates.length-1;n++)if(function(t,e,n){var r=n[0]-t[0],i=n[1]-t[1],o=e[0]-t[0],s=e[1]-t[1];return r*s-i*o==0&&(Math.abs(o)>=Math.abs(s)?o>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])}(t.coordinates[n],t.coordinates[n+1],e.coordinates))return!0;return!1}function fr(t,e){return We(e,Mn(t)).features.length>0}function hr(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function pr(t,e){return t[0]===e[0]&&t[1]===e[1]}function gr(t,e){for(var n=!1,r=!1,i=t.coordinates.length,o=0;o<i&&!n&&!r;){for(var s=0;s<e.coordinates.length-1;s++){var a=!0;0!==s&&s!==e.coordinates.length-2||(a=!1),vr(e.coordinates[s],e.coordinates[s+1],t.coordinates[o],a)?n=!0:r=!0}o++}return n&&r}function dr(t,e){return We(t,Mn(e)).features.length>0}function yr(t,e){for(var n=!1,i=!1,o=t.coordinates[0].length,s=0;s<o&&n&&i;)Ct(r(t.coordinates[0][s]),e)?n=!0:i=!0,s++;return i&&i}function vr(t,e,n,r){var i=n[0]-t[0],o=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==i*a-o*s&&(r?Math.abs(s)>=Math.abs(a)?s>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]:Math.abs(s)>=Math.abs(a)?s>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])}function mr(t){return t.coordinates.map((function(e){return{type:t.type.replace("Multi",""),coordinates:e}}))}function _r(t,e){return t.hasOwnProperty("coordinates")?t.coordinates.length===e.coordinates.length:t.length===e.length}function xr(t,e){return Ea(t,e,{strict:!0})}function br(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");var n=K(t);if(n!==K(e))throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new Sa({precision:6}).compare(t,e))return!1;var r=0;switch(n){case"MultiPoint":var i=T(t),o=T(e);i.forEach((function(t){o.forEach((function(e){t[0]===e[0]&&t[1]===e[1]&&r++}))}));break;case"LineString":case"MultiLineString":j(t,(function(t){j(e,(function(e){Un(t,e).features.length&&r++}))}));break;case"Polygon":case"MultiPolygon":j(t,(function(t){j(e,(function(e){We(t,e).features.length&&r++}))}))}return r>0}function wr(t,e,n){n=n||[];for(var r=0;r<t;r++)n[r]=e;return n}function Er(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 Ir(t){for(var e=t,n=[];e.parent;)n.unshift(e),e=e.parent;return n}function Sr(t,e){e=e||{},this.nodes=[],this.diagonal=!!e.diagonal,this.grid=[];for(var n=0;n<t.length;n++){this.grid[n]=[];for(var r=0,i=t[n];r<i.length;r++){var o=new Nr(n,r,i[r]);this.grid[n][r]=o,this.nodes.push(o)}}this.init()}function Nr(t,e,n){this.x=t,this.y=e,this.weight=n}function Pr(t){this.content=[],this.scoreFunction=t}function Cr(t){return t[0]}function Lr(t){return t[1]}function Mr(){this._=null}function Or(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Rr(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Tr(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Ar(t){for(;t.L;)t=t.L;return t}function Fr(t,e,n,r){var i=[null,null],o=za.push(i)-1;return i.left=t,i.right=e,n&&kr(i,t,e,n),r&&kr(i,e,t,r),qa[t.index].halfedges.push(o),qa[e.index].halfedges.push(o),i}function Dr(t,e,n){var r=[e,n];return r.left=t,r}function kr(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function jr(t,e,n,r,i){var o,s=t[0],a=t[1],u=s[0],c=s[1],l=0,f=1,h=a[0]-u,p=a[1]-c;if(o=e-u,h||!(o>0)){if(o/=h,h<0){if(o<l)return;o<f&&(f=o)}else if(h>0){if(o>f)return;o>l&&(l=o)}if(o=r-u,h||!(o<0)){if(o/=h,h<0){if(o>f)return;o>l&&(l=o)}else if(h>0){if(o<l)return;o<f&&(f=o)}if(o=n-c,p||!(o>0)){if(o/=p,p<0){if(o<l)return;o<f&&(f=o)}else if(p>0){if(o>f)return;o>l&&(l=o)}if(o=i-c,p||!(o<0)){if(o/=p,p<0){if(o>f)return;o>l&&(l=o)}else if(p>0){if(o<l)return;o<f&&(f=o)}return!(l>0||f<1)||(l>0&&(t[0]=[u+l*h,c+l*p]),f<1&&(t[1]=[u+f*h,c+f*p]),!0)}}}}}function Gr(t,e,n,r,i){var o=t[1];if(o)return!0;var s,a,u=t[0],c=t.left,l=t.right,f=c[0],h=c[1],p=l[0],g=l[1],d=(f+p)/2,y=(h+g)/2;if(g===h){if(d<e||d>=r)return;if(f>p){if(u){if(u[1]>=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]<n)return}else u=[d,i];o=[d,n]}}else if(a=y-(s=(f-p)/(g-h))*d,s<-1||s>1)if(f>p){if(u){if(u[1]>=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]<n)return}else u=[(i-a)/s,i];o=[(n-a)/s,n]}else if(h<g){if(u){if(u[0]>=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]<e)return}else u=[r,s*r+a];o=[e,s*e+a]}return t[0]=u,t[1]=o,!0}function qr(t,e){var n=t.site,r=e.left,i=e.right;return n===i&&(i=r,r=n),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(n===r?(r=e[1],i=e[0]):(r=e[0],i=e[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Br(t,e){return e[+(e.left!==t.site)]}function zr(t,e){return e[+(e.left===t.site)]}function Ur(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var s=i[0],a=i[1],u=r[0]-s,c=r[1]-a,l=o[0]-s,f=o[1]-a,h=2*(u*f-c*l);if(!(h>=-Ya)){var p=u*u+c*c,g=l*l+f*f,d=(f*p-c*g)/h,y=(u*g-l*p)/h,v=Ua.pop()||new function(){Or(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=d+s,v.y=(v.cy=y+a)+Math.sqrt(d*d+y*y),t.circle=v;for(var m=null,_=Ba._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}Ba.insert(m,v),m||(ja=v)}}}}function Vr(t){var e=t.circle;e&&(e.P||(ja=e.N),Ba.remove(e),Ua.push(e),Or(e),t.circle=null)}function Xr(t){var e=Va.pop()||new function(){Or(this),this.edge=this.site=this.circle=null};return e.site=t,e}function Yr(t){Vr(t),Ga.remove(t),Va.push(t),Or(t)}function Wr(t){var e=t.circle,n=e.x,r=e.cy,i=[n,r],o=t.P,s=t.N,a=[t];Yr(t);for(var u=o;u.circle&&Math.abs(n-u.circle.x)<Xa&&Math.abs(r-u.circle.cy)<Xa;)o=u.P,a.unshift(u),Yr(u),u=o;a.unshift(u),Vr(u);for(var c=s;c.circle&&Math.abs(n-c.circle.x)<Xa&&Math.abs(r-c.circle.cy)<Xa;)s=c.N,a.push(c),Yr(c),c=s;a.push(c),Vr(c);var l,f=a.length;for(l=1;l<f;++l)c=a[l],u=a[l-1],kr(c.edge,u.site,c.site,i);u=a[0],(c=a[f-1]).edge=Fr(u.site,c.site,null,i),Ur(u),Ur(c)}function Hr(t){for(var e,n,r,i,o=t[0],s=t[1],a=Ga._;a;)if((r=$r(a,s)-o)>Xa)a=a.L;else{if(!((i=o-function(t,e){var n=t.N;if(n)return $r(n,e);var r=t.site;return r[1]===e?r[0]:1/0}(a,s))>Xa)){r>-Xa?(e=a.P,n=a):i>-Xa?(e=a,n=a.N):e=n=a;break}if(!a.R){e=a;break}a=a.R}!function(t){qa[t.index]={site:t,halfedges:[]}}(t);var u=Xr(t);if(Ga.insert(e,u),e||n){if(e===n)return Vr(e),n=Xr(e.site),Ga.insert(u,n),u.edge=n.edge=Fr(e.site,u.site),Ur(e),void Ur(n);if(n){Vr(e),Vr(n);var c=e.site,l=c[0],f=c[1],h=t[0]-l,p=t[1]-f,g=n.site,d=g[0]-l,y=g[1]-f,v=2*(h*y-p*d),m=h*h+p*p,_=d*d+y*y,x=[(y*m-p*_)/v+l,(h*_-d*m)/v+f];kr(n.edge,c,g,x),u.edge=Fr(c,t,null,x),n.edge=Fr(t,g,null,x),Ur(e),Ur(n)}else u.edge=Fr(e.site,u.site)}}function $r(t,e){var n=t.site,r=n[0],i=n[1],o=i-e;if(!o)return r;var s=t.P;if(!s)return-1/0;var a=(n=s.site)[0],u=n[1],c=u-e;if(!c)return a;var l=a-r,f=1/o-1/c,h=l/c;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*c)-u+c/2+i-o/2)))/f+r:(r+a)/2}function Jr(t,e,n){return(t[0]-n[0])*(e[1]-t[1])-(t[0]-e[0])*(n[1]-t[1])}function Kr(t,e){return e[1]-t[1]||e[0]-t[0]}function Zr(t,e){var n,r,i,o=t.sort(Kr).pop();for(za=[],qa=new Array(t.length),Ga=new Mr,Ba=new Mr;;)if(i=ja,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===n&&o[1]===r||(Hr(o),n=o[0],r=o[1]),o=t.pop();else{if(!i)break;Wr(i.arc)}if(function(){for(var t,e,n,r,i=0,o=qa.length;i<o;++i)if((t=qa[i])&&(r=(e=t.halfedges).length)){var s=new Array(r),a=new Array(r);for(n=0;n<r;++n)s[n]=n,a[n]=qr(t,za[e[n]]);for(s.sort((function(t,e){return a[e]-a[t]})),n=0;n<r;++n)a[n]=e[s[n]];for(n=0;n<r;++n)e[n]=a[n]}}(),e){var s=+e[0][0],a=+e[0][1],u=+e[1][0],c=+e[1][1];!function(t,e,n,r){for(var i,o=za.length;o--;)Gr(i=za[o],t,e,n,r)&&jr(i,t,e,n,r)&&(Math.abs(i[0][0]-i[1][0])>Xa||Math.abs(i[0][1]-i[1][1])>Xa)||delete za[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,l,f,h,p,g,d,y=qa.length,v=!0;for(i=0;i<y;++i)if(o=qa[i]){for(s=o.site,a=(u=o.halfedges).length;a--;)za[u[a]]||u.splice(a,1);for(a=0,c=u.length;a<c;)g=(p=zr(o,za[u[a]]))[0],d=p[1],f=(l=Br(o,za[u[++a%c]]))[0],h=l[1],(Math.abs(g-f)>Xa||Math.abs(d-h)>Xa)&&(u.splice(a,0,za.push(Dr(s,p,Math.abs(g-t)<Xa&&r-d>Xa?[t,Math.abs(f-t)<Xa?h:r]:Math.abs(d-r)<Xa&&n-g>Xa?[Math.abs(h-r)<Xa?f:n,r]:Math.abs(g-n)<Xa&&d-e>Xa?[n,Math.abs(f-n)<Xa?h:e]:Math.abs(d-e)<Xa&&g-t>Xa?[Math.abs(h-e)<Xa?f:t,e]:null))-1),++c);c&&(v=!1)}if(v){var m,_,x,b=1/0;for(i=0,v=null;i<y;++i)(o=qa[i])&&(x=(m=(s=o.site)[0]-t)*m+(_=s[1]-e)*_)<b&&(b=x,v=o);if(v){var w=[t,e],E=[t,r],I=[n,r],S=[n,e];v.halfedges.push(za.push(Dr(s=v.site,w,E))-1,za.push(Dr(s,E,I))-1,za.push(Dr(s,I,S))-1,za.push(Dr(s,S,w))-1)}}for(i=0;i<y;++i)(o=qa[i])&&(o.halfedges.length||delete qa[i])}(s,a,u,c)}this.edges=za,this.cells=qa,Ga=Ba=za=qa=null}function Qr(t){return(t=t.slice()).push(t[0]),o([t])}function ti(t,e,n,r){var i=(r=r||{}).steps||64,s=r.units||"kilometers",a=r.angle||0,u=r.pivot||t,c=r.properties||t.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(!I(r))throw new Error("options must be an object");if(!E(i))throw new Error("steps must be a number");if(!E(a))throw new Error("angle must be a number");var l=U(t);if("degrees"===s)var f=x(a);else e=Yn(t,e,90,{units:s}),n=Yn(t,n,0,{units:s}),e=U(e)[0]-l[0],n=U(n)[1]-l[1];for(var h=[],p=0;p<i;p+=1){var g=-360*p/i,d=e*n/Math.sqrt(Math.pow(n,2)+Math.pow(e,2)*Math.pow(ei(g),2)),y=e*n/Math.sqrt(Math.pow(e,2)+Math.pow(n,2)/Math.pow(ei(g),2));if(g<-90&&g>=-270&&(d=-d),g<-180&&g>=-360&&(y=-y),"degrees"===s){var v=d*Math.cos(f)+y*Math.sin(f),m=y*Math.cos(f)-d*Math.sin(f);d=v,y=m}h.push([d+l[0],y+l[1]])}return h.push(h[0]),"degrees"===s?o([h],c):nr(o([h],c),a,{pivot:u})}function ei(t){var e=t*Math.PI/180;return Math.tan(e)}function ni(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.properties,i=e.weight;if(!t)throw new Error("geojson is required");var o=0,s=0,a=0;return A(t,(function(t,e,n){var r=n[i];if(!E(r=null==r?1:r))throw new Error("weight value must be a number for feature index "+e);(r=Number(r))>0&&P(t,(function(t){o+=t[0]*r,s+=t[1]*r,a+=r}))})),r([o/a,s/a],n)}function ri(t,e,n,i){var o=n.properties.tolerance||.001,s=0,a=0,u=0,c=0;if(O(n,(function(e){var n=e.properties.weight,r=null==n?1:n;if(!E(r=Number(r)))throw new Error("weight value must be a number");if(r>0){c+=1;var i=r*Ft(e,t);0===i&&(i=1);var o=r/i;s+=e.geometry.coordinates[0]*o,a+=e.geometry.coordinates[1]*o,u+=o}})),c<1)throw new Error("no features to measure");var l=s/u,f=a/u;return 1===c||0===i||Math.abs(l-e[0])<o&&Math.abs(f-e[1])<o?r([l,f],{medianCandidates:n.properties.medianCandidates}):(n.properties.medianCandidates.push([l,f]),ri([l,f],t,n,i-1))}function ii(t,e){return{x:t[0]-e[0],y:t[1]-e[1]}}function oi(t){if(I(t)&&(t=t.bbox),t&&!Array.isArray(t))throw new Error("bbox is invalid");return t?function(t){return[Math.random()*(t[2]-t[0])+t[0],Math.random()*(t[3]-t[1])+t[1]]}(t):[360*ci(),180*ci()]}function si(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox;null!=t||(t=1);for(var i=[],o=0;o<t;o++)i.push(r(oi(n)));return c(i)}function ai(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_radial_length;null!=t||(t=1),E(r)||(r=10),E(i)||(i=10);for(var s=[],a=0;a<t;a++){var u=[],l=Array.apply(null,new Array(r+1)).map(Math.random);l.forEach((function(t,e,n){n[e]=e>0?t+n[e-1]:t})),l.forEach((function(t){t=2*t*Math.PI/l[l.length-1];var e=Math.random();u.push([e*i*Math.sin(t),e*i*Math.cos(t)])})),u[u.length-1]=u[0],u=u.map(function(t){return function(e){return[e[0]+t[0],e[1]+t[1]]}}(oi(n))),s.push(o([u]))}return c(s)}function ui(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.num_vertices,i=e.max_length,o=e.max_rotation;null!=t||(t=1),(!E(r)||r<2)&&(r=10),E(i)||(i=1e-4),E(o)||(o=Math.PI/8);for(var s=[],u=0;u<t;u++){for(var l=[oi(n)],f=0;f<r-1;f++){var h=(0===f?2*Math.random()*Math.PI:Math.tan((l[f][1]-l[f-1][1])/(l[f][0]-l[f-1][0])))+(Math.random()-.5)*o*2,p=Math.random()*i;l.push([l[f][0]+p*Math.cos(h),l[f][1]+p*Math.sin(h)])}s.push(a(l))}return c(s)}function ci(){return Math.random()-.5}function li(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("filter is required");var n=[];return O(t,(function(t){gi(t.properties,e)&&n.push(t)})),c(n)}function fi(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(null==e)throw new Error("property is required");for(var r=pi(t,e),i=Object.keys(r),o=0;o<i.length;o++){for(var s=i[o],a=r[s],u=[],l=0;l<a.length;l++)u.push(t.features[a[l]]);n(c(u),s,o)}}function hi(t,e,n,r){var i=r;return fi(t,e,(function(t,e,o){i=0===o&&void 0===r?t:n(i,t,e,o)})),i}function pi(t,e){var n={};return O(t,(function(t,r){var i=t.properties||{};if(i.hasOwnProperty(e)){var o=i[e];n.hasOwnProperty(o)?n[o].push(r):n[o]=[r]}})),n}function gi(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return t.hasOwnProperty(e);if(Array.isArray(e)){for(var r=0;r<e.length;r++)if(!gi(t,e[r]))return!1;return!0}return di(t,e)}function di(t,e){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r];if(t[i]!==e[i])return!1}return!0}function yi(t,e){if(!e)return{};if(!e.length)return{};for(var n={},r=0;r<e.length;r++){var i=e[r];t.hasOwnProperty(i)&&(n[i]=t[i])}return n}function vi(){}function mi(t){this.message=t||""}function _i(t){this.message=t||""}function xi(){}function bi(t){return null===t?pc:t.color}function wi(t){return null===t?null:t.parent}function Ei(t,e){null!==t&&(t.color=e)}function Ii(t){return null===t?null:t.left}function Si(t){return null===t?null:t.right}function Ni(){this.root_=null,this.size_=0}function Pi(){}function Ci(){this.array_=[],arguments[0]instanceof Zu&&this.addAll(arguments[0])}function Li(){}function Mi(t){this.message=t||""}function Oi(){this.array_=[]}function Ri(t){switch(t.type){case"Polygon":return cn(t)>1?t:null;case"MultiPolygon":var e=[];if(D(t,(function(t){cn(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}function Ti(){this.reset()}function Ai(t,e,n){var r=t.s=e+n,i=r-e,o=r-i;t.t=e-o+(n-i)}function Fi(t){return t>1?_p:t<-1?-_p:Math.asin(t)}function Di(){}function ki(t,e){t&&Ap.hasOwnProperty(t.type)&&Ap[t.type](t,e)}function ji(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function Gi(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ji(t[n],e,1);e.polygonEnd()}function qi(t){return[Np(t[1],t[0]),Fi(t[2])]}function Bi(t){var e=t[0],n=t[1],r=Pp(n);return[r*Pp(e),r*Mp(e),Mp(n)]}function zi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ui(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Vi(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Xi(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Yi(t){var e=Op(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Wi(t,e){return[t>mp?t-bp:t<-mp?t+bp:t,e]}function Hi(t,e,n){return(t%=bp)?e||n?Dp(Ji(t),Ki(e,n)):Ji(t):e||n?Ki(e,n):Wi}function $i(t){return function(e,n){return[(e+=t)>mp?e-bp:e<-mp?e+bp:e,n]}}function Ji(t){var e=$i(t);return e.invert=$i(-t),e}function Ki(t,e){function n(t,e){var n=Pp(e),a=Pp(t)*n,u=Mp(t)*n,c=Mp(e),l=c*r+a*i;return[Np(u*o-l*s,a*r-c*i),Fi(l*o+u*s)]}var r=Pp(t),i=Mp(t),o=Pp(e),s=Mp(e);return n.invert=function(t,e){var n=Pp(e),a=Pp(t)*n,u=Mp(t)*n,c=Mp(e),l=c*o-u*s;return[Np(u*o+c*s,a*r+l*i),Fi(l*r-a*i)]},n}function Zi(t,e){(e=Bi(e))[0]-=t,Yi(e);var n=function(t){return t>1?0:t<-1?mp:Math.acos(t)}(-e[1]);return((-e[2]<0?-n:n)+bp-vp)%bp}function Qi(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function to(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function eo(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,c){var l=0,f=0;if(null==i||(l=s(i,a))!==(f=s(o,a))||u(i,o)<0^a>0)do{c.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+a+4)%4)!==f);else c.point(o[0],o[1])}function s(r,i){return Ip(r[0]-t)<vp?i>0?0:3:Ip(r[0]-n)<vp?i>0?2:1:Ip(r[1]-e)<vp?i>0?1:0:i>0?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(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(s){function u(t,e){i(t,e)&&b.point(t,e)}function c(o,s){var a=i(o,s);if(f&&h.push([o,s]),_)p=o,g=s,d=a,_=!1,a&&(b.lineStart(),b.point(o,s));else if(a&&m)b.point(o,s);else{var u=[y=Math.max(Vp,Math.min(Up,y)),v=Math.max(Vp,Math.min(Up,v))],c=[o=Math.max(Vp,Math.min(Up,o)),s=Math.max(Vp,Math.min(Up,s))];jp(u,c,t,e,n,r)?(m||(b.lineStart(),b.point(u[0],u[1])),b.point(c[0],c[1]),a||b.lineEnd(),x=!1):a&&(b.lineStart(),b.point(o,s),x=!1)}y=o,v=s,m=a}var l,f,h,p,g,d,y,v,m,_,x,b=s,w=kp(),E={point:u,lineStart:function(){E.point=c,f&&f.push(h=[]),_=!0,m=!1,y=v=NaN},lineEnd:function(){l&&(c(p,g),d&&m&&w.rejoin(),l.push(w.result())),E.point=u,m&&b.lineEnd()},polygonStart:function(){b=w,l=[],f=[],x=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=f.length;n<i;++n)for(var o,s,a=f[n],u=1,c=a.length,l=a[0],h=l[0],p=l[1];u<c;++u)o=h,s=p,h=(l=a[u])[0],p=l[1],s<=r?p>r&&(h-o)*(r-s)>(p-s)*(t-o)&&++e:p<=r&&(h-o)*(r-s)<(p-s)*(t-o)&&--e;return e}(),n=x&&e,i=(l=zp(l)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&qp(l,a,e,o,s),s.polygonEnd()),b=s,l=f=h=null}};return E}}function no(t){return t.length>1}function ro(t,e){return((t=t.x)[0]<0?t[1]-_p-vp:_p-t[1])-((e=e.x)[0]<0?e[1]-_p-vp:_p-e[1])}function io(t){return function(e){var n=new oo;for(var r in t)n[r]=t[r];return n.stream=e,n}}function oo(){}function so(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),Fp(n,t.stream(Kp));var s=Kp.result(),a=Math.min(r/(s[1][0]-s[0][0]),i/(s[1][1]-s[0][1])),u=+e[0][0]+(r-a*(s[1][0]+s[0][0]))/2,c=+e[0][1]+(i-a*(s[1][1]+s[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([u,c])}function ao(t,e){return[t,Lp(Rp((_p+e)/2))]}function uo(t,e){return[Lp(Rp((_p+e)/2)),-t]}function co(t,n,r,i){var o=t.properties||{},s="Feature"===t.type?t.geometry:t;if("GeometryCollection"===s.type){var a=[];return A(t,(function(t){var e=co(t,n,r,i);e&&a.push(e)})),c(a)}var u,l=z(t),f=l[1]>50&&l[3]>50;u=f?{type:s.type,coordinates:lo(s.coordinates,ho(s))}:Qe(s);var h,p=(new nl).read(u),g=d(y(n,r),"meters"),v=Hf.bufferOp(p,g);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((v=(new rl).write(v)).coordinates))return(h=f?{type:v.type,coordinates:fo(v.coordinates,ho(s))}:tn(v)).geometry?h:e(h,o)}function lo(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return lo(t,e)}))}function fo(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return fo(t,e)}))}function ho(t){var e=ce(t).geometry.coordinates.reverse(),n=e.map((function(t){return-t}));return ig().center(e).rotate(n).scale(wo)}function po(){for(var t=new nl,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=gp.union(e,t.read(JSON.stringify(arguments[n].geometry)));return{type:"Feature",geometry:e=(new rl).write(e),properties:arguments[0].properties}}function go(t,n){var r=$(t),i=$(n);if($t(xn(i,{precision:4})).coordinates[0].length<4)return null;if($t(xn(r,{precision:4})).coordinates[0].length<4)return null;var o=new nl,s=o.read(xn(r)),a=o.read(xn(i)),u=op.intersection(s,a);return u.isEmpty()?null:e((new rl).write(u))}function yo(t,e){return function(t,e,n){var r,i;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach((function(e,n){var o=function(t,e){return t-e}(e,t);o>=0&&(void 0===i||o<i)&&(i=o,r=n)})),r}(t,e)}function vo(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties||{},i=n.triangles,s=n.mask;if(null==e)throw new Error("cellSide is required");if(!E(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(s&&-1===["Polygon","MultiPolygon"].indexOf(K(s)))throw new Error("options.mask must be a (Multi)Polygon");var a=t[0],u=t[1],l=t[2],f=t[3],h=(u+f)/2,p=(a+l)/2,g=2*e/Ft([a,h],[l,h],n)*(l-a),d=2*e/Ft([p,u],[p,f],n)*(f-u),y=g/2,v=2*y,m=Math.sqrt(3)/2*d,_=l-a,x=f-u,b=.75*v,w=m,S=(_-v)/(v-y/2),N=Math.floor(S),P=(N*b-y/2-_)/2-y/2+b/2,C=Math.floor((x-m)/m),L=(x-C*m)/2,M=C*m-x>m/2;M&&(L-=m/4);for(var O=[],R=[],T=0;T<6;T++){var A=2*Math.PI/6*T;O.push(Math.cos(A)),R.push(Math.sin(A))}for(var F=[],D=0;D<=N;D++)for(var k=0;k<=C;k++){var j=D%2==1;if(!(0===k&&j||0===k&&M)){var G=D*b+a-P,q=k*w+u+L;if(j&&(q-=m/2),!0===i)(function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=[];c.push(t),c.push([t[0]+e*i[u],t[1]+n*s[u]]),c.push([t[0]+e*i[(u+1)%6],t[1]+n*s[(u+1)%6]]),c.push(t),a.push(o([c],r))}return a})([G,q],g/2,d/2,r,O,R).forEach((function(t){s?go(s,t)&&F.push(t):F.push(t)}));else{var B=function(t,e,n,r,i,s){for(var a=[],u=0;u<6;u++){var c=t[0]+e*i[u],l=t[1]+n*s[u];a.push([c,l])}return a.push(a[0].slice()),o([a],r)}([G,q],g/2,d/2,r,O,R);s?go(s,B)&&F.push(B):F.push(B)}}}return c(F)}function mo(t){if(t.features.length<=1)return t;var e=function(t){var e=Ro(),n=[];return D(t,(function(t,e){var r=z(t);n.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:t,index:e})})),e.load(n),e}(t),n=[],r={};return D(t,(function(t,i){if(r[i])return!0;for(e.remove({index:i},_o),r[i]=!0;;){var o=z(t),s=e.search({minX:o[0],minY:o[1],maxX:o[2],maxY:o[3]});if(s.length>0){var a=s.map((function(t){return r[t.index]=!0,e.remove({index:t.index},_o),t.geojson}));a.push(t),t=po.apply(this,a)}if(0===s.length)break}n.push(t)})),c(n)}function _o(t,e){return t.index===e.index}function xo(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null==e)throw new Error("cellSide is required");if(!E(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=t[0],u=t[1],l=t[2],f=t[3],h=e/Ft([a,u],[l,u],n)*(l-a),p=e/Ft([a,u],[a,f],n)*(f-u),g=l-a,d=f-u,y=Math.floor(g/h),v=Math.floor(d/p),m=(d-v*p)/2,_=a+(g-y*h)/2,x=0;x<y;x++){for(var b=u+m,w=0;w<v;w++){var S=o([[[_,b],[_,b+p],[_+h,b+p],[_+h,b],[_,b]]],r);i?go(i,S)&&s.push(S):s.push(S),b+=p}_+=h}return c(s)}function bo(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.mask,s=[];if(null==e)throw new Error("cellSide is required");if(!E(e))throw new Error("cellSide is invalid");if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be array");if(4!==t.length)throw new Error("bbox must contain 4 numbers");if(i&&-1===["Polygon","MultiPolygon"].indexOf(K(i)))throw new Error("options.mask must be a (Multi)Polygon");for(var a=e/Ft([t[0],t[1]],[t[2],t[1]],n)*(t[2]-t[0]),u=e/Ft([t[0],t[1]],[t[0],t[3]],n)*(t[3]-t[1]),l=0,f=t[0];f<=t[2];){for(var h=0,p=t[1];p<=t[3];){var g=null,d=null;l%2==0&&h%2==0?(g=o([[[f,p],[f,p+u],[f+a,p],[f,p]]],r),d=o([[[f,p+u],[f+a,p+u],[f+a,p],[f,p+u]]],r)):l%2==0&&h%2==1?(g=o([[[f,p],[f+a,p+u],[f+a,p],[f,p]]],r),d=o([[[f,p],[f,p+u],[f+a,p+u],[f,p]]],r)):h%2==0&&l%2==1?(g=o([[[f,p],[f,p+u],[f+a,p+u],[f,p]]],r),d=o([[[f,p],[f+a,p+u],[f+a,p],[f,p]]],r)):h%2==1&&l%2==1&&(g=o([[[f,p],[f,p+u],[f+a,p],[f,p]]],r),d=o([[[f,p+u],[f+a,p+u],[f+a,p],[f,p+u]]],r)),i?(go(i,g)&&s.push(g),go(i,d)&&s.push(d)):(s.push(g),s.push(d)),p+=u,h++}l++,f+=a}return c(s)}var wo=6371008.8,Eo={meters:wo,metres:wo,millimeters:1e3*wo,millimetres:1e3*wo,centimeters:100*wo,centimetres:100*wo,kilometers:wo/1e3,kilometres:wo/1e3,miles:wo/1609.344,nauticalmiles:wo/1852,inches:39.37*wo,yards:wo/1.0936,feet:3.28084*wo,radians:1,degrees:wo/111325},Io={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/wo,degrees:1/111325},So={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006},No=Object.freeze({earthRadius:wo,factors:Eo,unitsFactors:Io,areaFactors:So,feature:e,geometry:n,point:r,points:i,polygon:o,polygons:s,lineString:a,lineStrings:u,featureCollection:c,multiLineString:l,multiPoint:f,multiPolygon:h,geometryCollection:p,round:g,radiansToLength:d,lengthToRadians:y,lengthToDegrees:v,bearingToAzimuth:m,radiansToDegrees:_,degreesToRadians:x,convertLength:b,convertArea:w,isNumber:E,isObject:I,validateBBox:S,validateId:N,radians2degrees:function(){throw new Error("method has been renamed to `radiansToDegrees`")},degrees2radians:function(){throw new Error("method has been renamed to `degreesToRadians`")},distanceToDegrees:function(){throw new Error("method has been renamed to `lengthToDegrees`")},distanceToRadians:function(){throw new Error("method has been renamed to `lengthToRadians`")},radiansToDistance:function(){throw new Error("method has been renamed to `radiansToLength`")},bearingToAngle:function(){throw new Error("method has been renamed to `bearingToAzimuth`")},convertDistance:function(){throw new Error("method has been renamed to `convertLength`")}}),Po=Object.freeze({coordEach:P,coordReduce:C,propEach:L,propReduce:M,featureEach:O,featureReduce:R,coordAll:T,geomEach:A,geomReduce:F,flattenEach:D,flattenReduce:k,segmentEach:j,segmentReduce:G,lineEach:q,lineReduce:B}),Co=Object.freeze({getCoord:U,getCoords:V,containsNumber:X,geojsonType:Y,featureOf:W,collectionOf:H,getGeom:$,getGeomType:J,getType:K}),Lo={successCallback:null,verbose:!1},Mo={},Oo=function t(e,n,r,i,o){for(r=r||0,i=i||e.length-1,o=o||function(t,e){return t<e?-1:t>e?1:0};i>r;){if(i-r>600){var s=i-r+1,a=n-r+1,u=Math.log(s),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-a*c/s+l)),Math.min(i,Math.floor(n+(s-a)*c/s+l)),o)}var f=e[n],h=r,p=i;for(rt(e,r,n),o(e[i],f)>0&&rt(e,r,i);h<p;){for(rt(e,h,p),h++,p--;o(e[h],f)<0;)h++;for(;o(e[p],f)>0;)p--}0===o(e[r],f)?rt(e,r,p):rt(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}},Ro=it;it.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!pt(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],pt(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):ht(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!pt(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],pt(t,s=e.leaf?n(o):o)){if(e.leaf||ht(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=gt([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!ht(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:ut,compareMinY:ct,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return ot(i=gt(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=gt([])).leaf=!1,i.height=r;var a,u,c,l,f=Math.ceil(o/s),h=f*Math.ceil(Math.sqrt(s));for(dt(t,e,n,h,this.compareMinX),a=e;a<=n;a+=h)for(dt(t,a,c=Math.min(a+h-1,n),f,this.compareMinY),u=a;u<=c;u+=f)l=Math.min(u+f-1,c),i.children.push(this._build(t,u,l,r-1));return ot(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,l,f;r.push(e),!e.leaf&&r.length-1!==n;){for(l=f=1/0,i=0,o=e.children.length;i<o;i++)u=lt(s=e.children[i]),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-u)<f?(f=c,l=u<l?u:l,a=s):c===f&&u<l&&(l=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),at(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split: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),s=gt(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,ot(n,this.toBBox),ot(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=gt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ot(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,l;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=st(t,0,r,this.toBBox),o=st(t,r,n,this.toBBox)),a=lt(i)+lt(o),s<u?(u=s,l=r,c=a<c?a:c):s===u&&a<c&&(c=a,l=r);return l},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:ut,i=t.leaf?this.compareMinY:ct;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,a=st(t,0,e,s),u=st(t,n-e,n,s),c=ft(a)+ft(u);for(i=e;i<n-e;i++)o=t.children[i],at(a,t.leaf?s(o):o),c+=ft(a);for(i=n-e-1;i>=e;i--)o=t.children[i],at(u,t.leaf?s(o):o),c+=ft(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)at(e[r],t)},_condense: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():ot(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var To=function(t,e,n){var r=t*e,i=Ao*t,o=i-(i-t),s=t-o,a=Ao*e,u=a-(a-e),c=e-u,l=s*c-(r-o*u-s*u-o*c);return n?(n[0]=l,n[1]=r,n):[l,r]},Ao=+(Math.pow(2,27)+1),Fo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,l=Math.abs,f=t[u],h=l(f),p=e[c],g=l(p);h<g?(o=f,(u+=1)<n&&(h=l(f=t[u]))):(o=p,(c+=1)<r&&(g=l(p=e[c]))),u<n&&h<g||c>=r?(i=f,(u+=1)<n&&(h=l(f=t[u]))):(i=p,(c+=1)<r&&(g=l(p=e[c])));for(var d,y,v=i+o,m=v-i,_=o-m,x=_,b=v;u<n&&c<r;)h<g?(i=f,(u+=1)<n&&(h=l(f=t[u]))):(i=p,(c+=1)<r&&(g=l(p=e[c]))),(_=(o=x)-(m=(v=i+o)-i))&&(s[a++]=_),x=b-((d=b+v)-(y=d-b))+(v-y),b=d;for(;u<n;)(_=(o=x)-(m=(v=(i=f)+o)-i))&&(s[a++]=_),x=b-((d=b+v)-(y=d-b))+(v-y),b=d,(u+=1)<n&&(f=t[u]);for(;c<r;)(_=(o=x)-(m=(v=(i=p)+o)-i))&&(s[a++]=_),x=b-((d=b+v)-(y=d-b))+(v-y),b=d,(c+=1)<r&&(p=e[c]);return x&&(s[a++]=x),b&&(s[a++]=b),a||(s[a++]=0),s.length=a,s},Do=function(t,e,n){var r=t+e,i=r-t,o=e-i,s=t-(r-i);return n?(n[0]=s+o,n[1]=r,n):[s+o,r]},ko=function(t,e){var n=t.length;if(1===n){var r=To(t[0],e);return r[0]?r:[r[1]]}var i=new Array(2*n),o=[.1,.1],s=[.1,.1],a=0;To(t[0],e,o),o[0]&&(i[a++]=o[0]);for(var u=1;u<n;++u){To(t[u],e,s);var c=o[1];Do(c,s[0],o),o[0]&&(i[a++]=o[0]);var l=s[1],f=o[1],h=l+f,p=f-(h-l);o[1]=h,p&&(i[a++]=p)}return o[1]&&(i[a++]=o[1]),0===a&&(i[a++]=0),i.length=a,i},jo=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],-e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,l=Math.abs,f=t[u],h=l(f),p=-e[c],g=l(p);h<g?(o=f,(u+=1)<n&&(h=l(f=t[u]))):(o=p,(c+=1)<r&&(g=l(p=-e[c]))),u<n&&h<g||c>=r?(i=f,(u+=1)<n&&(h=l(f=t[u]))):(i=p,(c+=1)<r&&(g=l(p=-e[c])));for(var d,y,v=i+o,m=v-i,_=o-m,x=_,b=v;u<n&&c<r;)h<g?(i=f,(u+=1)<n&&(h=l(f=t[u]))):(i=p,(c+=1)<r&&(g=l(p=-e[c]))),(_=(o=x)-(m=(v=i+o)-i))&&(s[a++]=_),x=b-((d=b+v)-(y=d-b))+(v-y),b=d;for(;u<n;)(_=(o=x)-(m=(v=(i=f)+o)-i))&&(s[a++]=_),x=b-((d=b+v)-(y=d-b))+(v-y),b=d,(u+=1)<n&&(f=t[u]);for(;c<r;)(_=(o=x)-(m=(v=(i=p)+o)-i))&&(s[a++]=_),x=b-((d=b+v)-(y=d-b))+(v-y),b=d,(c+=1)<r&&(p=-e[c]);return x&&(s[a++]=x),b&&(s[a++]=b),a||(s[a++]=0),s.length=a,s},Go=yt((function(t){function e(t,e){for(var n=new Array(t.length-1),r=1;r<t.length;++r)for(var i=n[r-1]=new Array(t.length-1),o=0,s=0;o<t.length;++o)o!==e&&(i[s++]=t[r][o]);return n}function n(t){return 1&t?"-":""}function r(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",r(t.slice(0,e)),",",r(t.slice(e)),")"].join("")}function i(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var o=[],s=0;s<t.length;++s)o.push(["scale(",r(i(e(t,s))),",",n(s),t[0][s],")"].join(""));return o}function o(t){for(var n=[],o=[],s=function(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var r=0;r<t;++r)e[n][r]=["m",r,"[",t-n-1,"]"].join("")}return e}(t),a=[],u=0;u<t;++u)0==(1&u)?n.push.apply(n,i(e(s,u))):o.push.apply(o,i(e(s,u))),a.push("m"+u);var c=r(n),l=r(o),f="orientation"+t+"Exact",h=["function ",f,"(",a.join(),"){var p=",c,",n=",l,",d=sub(p,n);return d[d.length-1];};return ",f].join("");return new Function("sum","prod","scale","sub",h)(Fo,To,ko,jo)}var s=o(3),a=o(4),u=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var r,i=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),a=i-o;if(i>0){if(o<=0)return a;r=i+o}else{if(!(i<0))return a;if(o>=0)return a;r=-(i+o)}var u=33306690738754716e-32*r;return a>=u||a<=-u?a:s(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],s=n[0]-r[0],u=t[1]-r[1],c=e[1]-r[1],l=n[1]-r[1],f=t[2]-r[2],h=e[2]-r[2],p=n[2]-r[2],g=o*l,d=s*c,y=s*u,v=i*l,m=i*c,_=o*u,x=f*(g-d)+h*(y-v)+p*(m-_),b=7771561172376103e-31*((Math.abs(g)+Math.abs(d))*Math.abs(f)+(Math.abs(y)+Math.abs(v))*Math.abs(h)+(Math.abs(m)+Math.abs(_))*Math.abs(p));return x>b||-x>b?x:a(t,e,n,r)}];!function(){for(;u.length<=5;)u.push(o(u.length));for(var e=[],n=["slow"],r=0;r<=5;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=5;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),n.push(i.join(""));var s=Function.apply(void 0,n);for(t.exports=s.apply(void 0,[function(t){var e=u[t.length];return e||(e=u[t.length]=o(t.length)),e.apply(void 0,t)}].concat(u)),r=0;r<=5;++r)t.exports[r]=u[r]}()})),qo=function(t){var e=t.length;if(e<3){for(var n=new Array(e),r=0;r<e;++r)n[r]=r;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:n}var i=new Array(e);for(r=0;r<e;++r)i[r]=r;i.sort((function(e,n){return t[e][0]-t[n][0]||t[e][1]-t[n][1]}));var o=[i[0],i[1]],s=[i[0],i[1]];for(r=2;r<e;++r){for(var a=i[r],u=t[a],c=o.length;c>1&&Bo(t[o[c-2]],t[o[c-1]],u)<=0;)c-=1,o.pop();for(o.push(a),c=s.length;c>1&&Bo(t[s[c-2]],t[s[c-1]],u)>=0;)c-=1,s.pop();s.push(a)}n=new Array(s.length+o.length-2);for(var l=0,f=(r=0,o.length);r<f;++r)n[l++]=o[r];for(var h=s.length-2;h>0;--h)n[l++]=s[h];return n},Bo=Go[3],zo=vt,Uo=vt;vt.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up: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},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,i)>=0)break;e[t]=a,t=o}e[t]=i}},zo.default=Uo;var Vo=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;o<e.length;s=o++){var a=e[o][0],u=e[o][1],c=e[s][0],l=e[s][1];u>r!=l>r&&n<(c-a)*(r-u)/(l-u)+a&&(i=!i)}return i},Xo=Go[3],Yo=mt,Wo=mt;Yo.default=Wo;var Ho=function(t){return t},$o=function(t){if(null==t)return Ho;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],s=t.translate[1];return function(t,a){a||(e=n=0);var u=2,c=t.length,l=new Array(c);for(l[0]=(e+=t[0])*r+o,l[1]=(n+=t[1])*i+s;u<c;)l[u]=t[u],++u;return l}},Jo=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},Ko=function(t,e){function n(t,e){for(var n in t){var i=t[n];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){r[t<0?~t:t]=1})),s.push(i)}}var r={},i={},o={},s=[],a=-1;return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,r,s=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1],e<0?[n,i]:[i,n]}(e),a=s[0],u=s[1];if(n=o[a])if(delete o[n.end],n.push(e),n.end=u,r=i[u]){delete i[r.start];var c=r===n?n:n.concat(r);i[c.start=n.start]=o[c.end=r.end]=c}else i[n.start]=o[n.end]=n;else if(n=i[u])if(delete i[n.start],n.unshift(e),n.start=a,r=o[a]){delete o[r.end];var l=r===n?n:r.concat(n);i[l.start=r.start]=o[l.end=n.end]=l}else i[n.start]=o[n.end]=n;else i[(n=[e]).start=a]=o[n.end=u]=n})),n(o,i),n(i,o),e.forEach((function(t){r[t<0?~t:t]||s.push([t])})),s},Zo=function(t){return Gt(t,qt.apply(this,arguments))},Qo=function(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var s=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=new o(t),u=t-1,c=0;c<t;++c)s[c]=i;return{set:function(r,o){for(var c=e(r)&u,l=s[c],f=0;l!=i;){if(n(l,r))return a[c]=o;if(++f>=t)throw new Error("full hashmap");l=s[c=c+1&u]}return s[c]=r,a[c]=o,o},maybeSet:function(r,o){for(var c=e(r)&u,l=s[c],f=0;l!=i;){if(n(l,r))return a[c];if(++f>=t)throw new Error("full hashmap");l=s[c=c+1&u]}return s[c]=r,a[c]=o,o},get:function(r,o){for(var c=e(r)&u,l=s[c],f=0;l!=i;){if(n(l,r))return a[c];if(++f>=t)break;l=s[c=c+1&u]}return o},keys:function(){for(var t=[],e=0,n=s.length;e<n;++e){var r=s[e];r!=i&&t.push(r)}return t}}},ts=function(t,e){return t[0]===e[0]&&t[1]===e[1]},es=new ArrayBuffer(16),ns=new Float64Array(es),rs=new Uint32Array(es),is=function(t){ns[0]=t[0],ns[1]=t[1];var e=rs[0]^rs[1];return 2147483647&(e<<5^e>>7^rs[2]^rs[3])},os=function(t){var e,n,r,i=function(t){function e(t,e,n,r){if(h[n]!==t){h[n]=t;var i=p[n];if(i>=0){var o=g[n];i===e&&o===r||i===r&&o===e||(++y,d[n]=1)}else p[n]=e,g[n]=r}}function n(t){return is(u[t])}function r(t,e){return ts(u[t],u[e])}var i,o,s,a,u=t.coordinates,c=t.lines,l=t.rings,f=function(){for(var t=Qo(1.4*u.length,n,r,Int32Array,-1,Int32Array),e=new Int32Array(u.length),i=0,o=u.length;i<o;++i)e[i]=t.maybeSet(i,i);return e}(),h=new Int32Array(u.length),p=new Int32Array(u.length),g=new Int32Array(u.length),d=new Int8Array(u.length),y=0;for(i=0,o=u.length;i<o;++i)h[i]=p[i]=g[i]=-1;for(i=0,o=c.length;i<o;++i){var v=c[i],m=v[0],_=v[1];for(s=f[m],a=f[++m],++y,d[s]=1;++m<=_;)e(i,s,s=a,a=f[m]);++y,d[a]=1}for(i=0,o=u.length;i<o;++i)h[i]=-1;for(i=0,o=l.length;i<o;++i){var x=l[i],b=x[0]+1,w=x[1];for(e(i,f[w-1],s=f[b-1],a=f[b]);++b<=w;)e(i,s,s=a,a=f[b])}h=p=g=null;var E,I=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),s=t-1,a=0;a<t;++a)o[a]=i;return{add:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)throw new Error("full hashset");u=o[a=a+1&s]}return o[a]=r,!0},has:function(r){for(var a=e(r)&s,u=o[a],c=0;u!=i;){if(n(u,r))return!0;if(++c>=t)break;u=o[a=a+1&s]}return!1},values:function(){for(var t=[],e=0,n=o.length;e<n;++e){var r=o[e];r!=i&&t.push(r)}return t}}}(1.4*y,is,ts);for(i=0,o=u.length;i<o;++i)d[E=f[i]]&&I.add(u[E]);return I}(t),o=t.coordinates,s=t.lines,a=t.rings;for(n=0,r=s.length;n<r;++n)for(var u=s[n],c=u[0],l=u[1];++c<l;)i.has(o[c])&&(e={0:c,1:u[1]},u[1]=c,u=u.next=e);for(n=0,r=a.length;n<r;++n)for(var f=a[n],h=f[0],p=h,g=f[1],d=i.has(o[h]);++p<g;)i.has(o[p])&&(d?(e={0:p,1:f[1]},f[1]=p,f=f.next=e):(function(t,e,n,r){Bt(t,e,n),Bt(t,e,e+r),Bt(t,e+r,n)}(o,h,g,g-p),o[g]=o[h],d=!0,p=h));return t},ss=function(t,e){function n(t){t&&l.hasOwnProperty(t.type)&&l[t.type](t)}function r(t){var e=[];do{var n=c.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function i(t){return t.map(r)}var o=function(t){function e(t){null!=t&&c.hasOwnProperty(t.type)&&c[t.type](t)}function n(t){var e=t[0],n=t[1];e<o&&(o=e),e>a&&(a=e),n<s&&(s=n),n>u&&(u=n)}function r(t){t.forEach(n)}function i(t){t.forEach(r)}var o=1/0,s=1/0,a=-1/0,u=-1/0,c={GeometryCollection:function(t){t.geometries.forEach(e)},Point:function(t){n(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(n)},LineString:function(t){r(t.arcs)},MultiLineString:function(t){t.arcs.forEach(r)},Polygon:function(t){t.arcs.forEach(r)},MultiPolygon:function(t){t.arcs.forEach(i)}};for(var l in t)e(t[l]);return a>=o&&u>=s?[o,s,a,u]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=zt(t[e]);return n}(t)),s=e>0&&o&&function(t,e,n){function r(t){return[Math.round((t[0]-c)*p),Math.round((t[1]-l)*g)]}function i(t,e){for(var n,r,i,o,s,a=-1,u=0,f=t.length,h=new Array(f);++a<f;)n=t[a],o=Math.round((n[0]-c)*p),s=Math.round((n[1]-l)*g),o===r&&s===i||(h[u++]=[r=o,i=s]);for(h.length=u;u<e;)u=h.push([h[0][0],h[0][1]]);return h}function o(t){return i(t,2)}function s(t){return i(t,4)}function a(t){return t.map(s)}function u(t){null!=t&&d.hasOwnProperty(t.type)&&d[t.type](t)}var c=e[0],l=e[1],f=e[2],h=e[3],p=f-c?(n-1)/(f-c):1,g=h-l?(n-1)/(h-l):1,d={GeometryCollection:function(t){t.geometries.forEach(u)},Point:function(t){t.coordinates=r(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(r)},LineString:function(t){t.arcs=o(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(o)},Polygon:function(t){t.arcs=a(t.arcs)},MultiPolygon:function(t){t.arcs=t.arcs.map(a)}};for(var y in t)u(t[y]);return{scale:[1/p,1/g],translate:[c,l]}}(t,o,e),a=function(t){function e(t){var e,n,r,i,o,s,a,u;if(r=p.get(e=c[t[0]]))for(a=0,u=r.length;a<u;++a)if(function(t,e){var n=t[0],r=e[0],i=t[1];if(n-i!=r-e[1])return!1;for(;n<=i;++n,++r)if(!ts(c[n],c[r]))return!1;return!0}(i=r[a],t))return t[0]=i[0],void(t[1]=i[1]);if(o=p.get(n=c[t[1]]))for(a=0,u=o.length;a<u;++a)if(function(t,e){var n=t[0],r=e[0],i=t[1],o=e[1];if(n-i!=r-o)return!1;for(;n<=i;++n,--o)if(!ts(c[n],c[o]))return!1;return!0}(s=o[a],t))return t[1]=s[0],void(t[0]=s[1]);r?r.push(t):p.set(e,[t]),o?o.push(t):p.set(n,[t]),g.push(t)}function n(t,e){var n=t[0],r=e[0],o=t[1]-n;if(o!==e[1]-r)return!1;for(var s=i(t),a=i(e),u=0;u<o;++u)if(!ts(c[n+(u+s)%o],c[r+(u+a)%o]))return!1;return!0}function r(t,e){var n=t[0],r=e[0],o=t[1],s=e[1],a=o-n;if(a!==s-r)return!1;for(var u=i(t),l=a-i(e),f=0;f<a;++f)if(!ts(c[n+(f+u)%a],c[s-(f+l)%a]))return!1;return!0}function i(t){for(var e=t[0],n=t[1],r=e,i=r,o=c[r];++r<n;){var s=c[r];(s[0]<o[0]||s[0]===o[0]&&s[1]<o[1])&&(i=r,o=s)}return i-e}var o,s,a,u,c=t.coordinates,l=t.lines,f=t.rings,h=l.length+f.length;for(delete t.lines,delete t.rings,a=0,u=l.length;a<u;++a)for(o=l[a];o=o.next;)++h;for(a=0,u=f.length;a<u;++a)for(s=f[a];s=s.next;)++h;var p=Qo(2*h*1.4,is,ts),g=t.arcs=[];for(a=0,u=l.length;a<u;++a){o=l[a];do{e(o)}while(o=o.next)}for(a=0,u=f.length;a<u;++a)if((s=f[a]).next)do{e(s)}while(s=s.next);else!function(t){var e,o,s,a,u;if(o=p.get(c[t[0]]))for(a=0,u=o.length;a<u;++a){if(n(s=o[a],t))return t[0]=s[0],void(t[1]=s[1]);if(r(s,t))return t[0]=s[1],void(t[1]=s[0])}if(o=p.get(e=c[t[0]+i(t)]))for(a=0,u=o.length;a<u;++a){if(n(s=o[a],t))return t[0]=s[0],void(t[1]=s[1]);if(r(s,t))return t[0]=s[1],void(t[1]=s[0])}o?o.push(t):p.set(e,[t]),g.push(t)}(s);return t}(os(function(t){function e(t){t&&c.hasOwnProperty(t.type)&&c[t.type](t)}function n(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var r={0:o-n+1,1:o};return s.push(r),r}function r(t){for(var e=0,n=t.length;e<n;++e)u[++o]=t[e];var r={0:o-n+1,1:o};return a.push(r),r}function i(t){return t.map(r)}var o=-1,s=[],a=[],u=[],c={GeometryCollection:function(t){t.geometries.forEach(e)},LineString:function(t){t.arcs=n(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(n)},Polygon:function(t){t.arcs=t.arcs.map(r)},MultiPolygon:function(t){t.arcs=t.arcs.map(i)}};for(var l in t)e(t[l]);return{type:"Topology",coordinates:u,lines:s,rings:a,objects:t}}(t))),u=a.coordinates,c=Qo(1.4*a.arcs.length,Xt,Yt);t=a.objects,a.bbox=o,a.arcs=a.arcs.map((function(t,e){return c.set(t,e),u.slice(t[0],t[1]+1)})),delete a.coordinates,u=null;var l={GeometryCollection:function(t){t.geometries.forEach(n)},LineString:function(t){t.arcs=r(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(r)},Polygon:function(t){t.arcs=t.arcs.map(r)},MultiPolygon:function(t){t.arcs=t.arcs.map(i)}};for(var f in t)n(t[f]);return s&&(a.transform=s,a.arcs=function(t){for(var e=-1,n=t.length;++e<n;){for(var r,i,o=t[e],s=0,a=1,u=o.length,c=o[0],l=c[0],f=c[1];++s<u;)r=(c=o[s])[0],i=c[1],r===l&&i===f||(o[a++]=[r-l,i-f],l=r,f=i);1===a&&(o[a++]=[0,0]),o.length=a}return t}(a.arcs)),a},as=function(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}for(this.controls.push([this.points[0],this.points[0]]),e=0;e<this.centers.length-1;e++){n=this.centers[e],r=this.centers[e+1];var i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,o=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,s=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+s)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+o),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+s)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this};as.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r);Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z))>t&&(e.push(r),n=i)}return e},as.prototype.vector=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))}},as.prototype.pos=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])};var us=he,cs=he;he.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Ne(t,0,o,n));if(i)for(var a=0,u=e.length;a<u;a++){var c=e[a]*n,l=a<u-1?e[a+1]*n:t.length;s-=Math.abs(Ne(t,c,l,n))}var f=0;for(a=0;a<r.length;a+=3){var h=r[a]*n,p=r[a+1]*n,g=r[a+2]*n;f+=Math.abs((t[h]-t[g])*(t[p+1]-t[h+1])-(t[h]-t[p])*(t[g+1]-t[h+1]))}return 0===s&&0===f?0:Math.abs((f-s)/s)},he.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n},us.default=cs,Oe.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!qe(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],qe(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):Ge(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!qe(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],qe(t,s=e.leaf?n(o):o)){if(e.leaf||Ge(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=Be([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!Ge(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:Fe,compareMinY:De,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return Re(i=Be(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=Be([])).leaf=!1,i.height=r;var a,u,c,l,f=Math.ceil(o/s),h=f*Math.ceil(Math.sqrt(s));for(ze(t,e,n,h,this.compareMinX),a=e;a<=n;a+=h)for(ze(t,a,c=Math.min(a+h-1,n),f,this.compareMinY),u=a;u<=c;u+=f)l=Math.min(u+f-1,c),i.children.push(this._build(t,u,l,r-1));return Re(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,l,f;r.push(e),!e.leaf&&r.length-1!==n;){for(l=f=1/0,i=0,o=e.children.length;i<o;i++)u=ke(s=e.children[i]),(c=function(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}(t,s)-u)<f?(f=c,l=u<l?u:l,a=s):c===f&&u<l&&(l=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),Ae(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split: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),s=Be(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,Re(n,this.toBBox),Re(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Be([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Re(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,l;for(u=c=1/0,r=e;r<=n-e;r++)s=function(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}(i=Te(t,0,r,this.toBBox),o=Te(t,r,n,this.toBBox)),a=ke(i)+ke(o),s<u?(u=s,l=r,c=a<c?a:c):s===u&&a<c&&(c=a,l=r);return l},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:Fe,i=t.leaf?this.compareMinY:De;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,a=Te(t,0,e,s),u=Te(t,n-e,n,s),c=je(a)+je(u);for(i=e;i<n-e;i++)o=t.children[i],Ae(a,t.leaf?s(o):o),c+=je(a);for(i=n-e-1;i>=e;i--)o=t.children[i],Ae(u,t.leaf?s(o):o),c+=je(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)Ae(e[r],t)},_condense: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():Re(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};var ls=Object.freeze({toMercator:Qe,toWgs84:tn}),fs=6378137,hs=function(t){function e(){for(var t=[],e=0;e<g.features.length;e++)-1==g.features[e].properties.parent&&t.push(e);if(t.length>1)for(e=0;e<t.length;e++){for(var n=-1,r=0;r<g.features.length;r++)t[e]!=r&&Ct(g.features[t[e]].geometry.coordinates[0][0],g.features[r],{ignoreBoundary:!0})&&cn(g.features[r])<1/0&&(n=r);g.features[t[e]].properties.parent=n}}function n(){for(var t=0;t<g.features.length;t++)if(-1==g.features[t].properties.parent){var e=g.features[t].properties.winding;g.features[t].properties.netWinding=e,r(t,e)}}function r(t,e){for(var n=0;n<g.features.length;n++)if(g.features[n].properties.parent==t){var i=e+g.features[n].properties.winding;g.features[n].properties.netWinding=i,r(n,i)}}if("Feature"!=t.type)throw new Error("The input must a geojson object of type Feature");if(void 0===t.geometry||null==t.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=t.geometry.type)throw new Error("The input must be a geojson Polygon");for(var i=t.geometry.coordinates.length,s=[],a=0;a<i;a++){var u=t.geometry.coordinates[a];En(u[0],u[u.length-1])||u.push(u[0]),s.push.apply(s,u.slice(0,u.length-1))}if(!function(t){for(var e={},n=1,r=0,i=t.length;r<i;++r){if(e.hasOwnProperty(t[r])){n=0;break}e[t[r]]=1}return n}(s))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var l=s.length,f=function(t,e,n){function r(t,n,r,i){var u,c,l=o[t][n],f=o[t][n+1],h=o[r][i],p=o[r][i+1],g=function(t,e,n,r){if(bn(t,n)||bn(t,r)||bn(e,n)||bn(r,n))return null;var i=t[0],o=t[1],s=e[0],a=e[1],u=n[0],c=n[1],l=r[0],f=r[1],h=(i-s)*(c-f)-(o-a)*(u-l);return 0===h?null:[((i*a-o*s)*(u-l)-(i-s)*(u*f-c*l))/h,((i*a-o*s)*(c-f)-(o-a)*(u*f-c*l))/h]}(l,f,h,p);if(null!==g&&(u=f[0]!==l[0]?(g[0]-l[0])/(f[0]-l[0]):(g[1]-l[1])/(f[1]-l[1]),c=p[0]!==h[0]?(g[0]-h[0])/(p[0]-h[0]):(g[1]-h[1])/(p[1]-h[1]),!(u>=1||u<=0||c>=1||c<=0))){var d=g,y=!a[d];y&&(a[d]=!0),e?s.push(e(g,t,n,l,f,u,r,i,h,p,c,y)):s.push(g)}}function i(t,e){var n,r,i,s,a=o[t][e],u=o[t][e+1];return a[0]<u[0]?(n=a[0],r=u[0]):(n=u[0],r=a[0]),a[1]<u[1]?(i=a[1],s=u[1]):(i=u[1],s=a[1]),{minX:n,minY:i,maxX:r,maxY:s,ring:t,edge:e}}if("Polygon"!==t.geometry.type)throw new Error("The input feature must be a Polygon");void 0===n&&(n=1);var o=t.geometry.coordinates,s=[],a={};if(n){for(var u=[],c=0;c<o.length;c++)for(var l=0;l<o[c].length-1;l++)u.push(i(c,l));var f=Ro();f.load(u)}for(var h=0;h<o.length;h++)for(var p=0;p<o[h].length-1;p++)if(n)f.search(i(h,p)).forEach((function(t){var e=t.ring,n=t.edge;r(h,p,e,n)}));else for(var g=0;g<o.length;g++)for(var d=0;d<o[g].length-1;d++)r(h,p,g,d);return e||(s={type:"Feature",geometry:{type:"MultiPoint",coordinates:s}}),s}(t,(function(t,e,n,r,i,o,s,a,u,c,l,f){return[t,e,n,r,i,o,s,a,u,c,l,f]})),h=f.length;if(0==h){var p=[];for(a=0;a<i;a++)p.push(o([t.geometry.coordinates[a]],{parent:-1,winding:function(t){for(var e=0,n=0;n<t.length-1;n++)t[n][0]<t[e][0]&&(e=n);if(wn([t[(e-1).modulo(t.length-1)],t[e],t[(e+1).modulo(t.length-1)]],!0))var r=1;else r=-1;return r}(t.geometry.coordinates[a])}));var g=c(p);return e(),n(),g}var d=[],y=[];for(a=0;a<i;a++){d.push([]);for(var v=0;v<t.geometry.coordinates[a].length-1;v++)d[a].push([new ps(t.geometry.coordinates[a][(v+1).modulo(t.geometry.coordinates[a].length-1)],1,[a,v],[a,(v+1).modulo(t.geometry.coordinates[a].length-1)],void 0)]),y.push(new gs(t.geometry.coordinates[a][v],[a,(v-1).modulo(t.geometry.coordinates[a].length-1)],[a,v],void 0,void 0,!1,!0))}for(a=0;a<h;a++)d[f[a][1]][f[a][2]].push(new ps(f[a][0],f[a][5],[f[a][1],f[a][2]],[f[a][6],f[a][7]],void 0)),f[a][11]&&y.push(new gs(f[a][0],[f[a][1],f[a][2]],[f[a][6],f[a][7]],void 0,void 0,!0,!0));var m=y.length;for(a=0;a<d.length;a++)for(v=0;v<d[a].length;v++)d[a][v].sort((function(t,e){return t.param<e.param?-1:1}));var _=[];for(a=0;a<m;a++)_.push({minX:y[a].coord[0],minY:y[a].coord[1],maxX:y[a].coord[0],maxY:y[a].coord[1],index:a});var x=Ro();for(x.load(_),a=0;a<d.length;a++)for(v=0;v<d[a].length;v++)for(var b=0;b<d[a][v].length;b++){E=b==d[a][v].length-1?d[a][(v+1).modulo(t.geometry.coordinates[a].length-1)][0].coord:d[a][v][b+1].coord;var w=x.search({minX:E[0],minY:E[1],maxX:E[0],maxY:E[1]})[0];d[a][v][b].nxtIsectAlongEdgeIn=w.index}for(a=0;a<d.length;a++)for(v=0;v<d[a].length;v++)for(b=0;b<d[a][v].length;b++){var E=d[a][v][b].coord,I=(w=x.search({minX:E[0],minY:E[1],maxX:E[0],maxY:E[1]})[0]).index;I<l?y[I].nxtIsectAlongRingAndEdge2=d[a][v][b].nxtIsectAlongEdgeIn:En(y[I].ringAndEdge1,d[a][v][b].ringAndEdgeIn)?y[I].nxtIsectAlongRingAndEdge1=d[a][v][b].nxtIsectAlongEdgeIn:y[I].nxtIsectAlongRingAndEdge2=d[a][v][b].nxtIsectAlongEdgeIn}var S=[];for(a=0,v=0;v<i;v++){var N=a;for(b=0;b<t.geometry.coordinates[v].length-1;b++)y[a].coord[0]<y[N].coord[0]&&(N=a),a++;var P=y[N].nxtIsectAlongRingAndEdge2;for(b=0;b<y.length;b++)if(y[b].nxtIsectAlongRingAndEdge1==N||y[b].nxtIsectAlongRingAndEdge2==N){var C=b;break}var L=wn([y[C].coord,y[N].coord,y[P].coord],!0)?1:-1;S.push({isect:N,parent:-1,winding:L})}for(S.sort((function(t,e){return y[t.isect].coord>y[e.isect].coord?-1:1})),p=[];S.length>0;){var M=S.pop(),O=M.isect,R=M.parent,T=M.winding,A=p.length,F=[y[O].coord],D=O;if(y[O].ringAndEdge1Walkable)var k=y[O].ringAndEdge1,j=y[O].nxtIsectAlongRingAndEdge1;else k=y[O].ringAndEdge2,j=y[O].nxtIsectAlongRingAndEdge2;for(;!En(y[O].coord,y[j].coord);){F.push(y[j].coord);var G=void 0;for(a=0;a<S.length;a++)if(S[a].isect==j){G=a;break}if(null!=G&&S.splice(G,1),En(k,y[j].ringAndEdge1)){if(k=y[j].ringAndEdge2,y[j].ringAndEdge2Walkable=!1,y[j].ringAndEdge1Walkable){var q={isect:j};wn([y[D].coord,y[j].coord,y[y[j].nxtIsectAlongRingAndEdge2].coord],1==T)?(q.parent=R,q.winding=-T):(q.parent=A,q.winding=T),S.push(q)}D=j,j=y[j].nxtIsectAlongRingAndEdge2}else k=y[j].ringAndEdge1,y[j].ringAndEdge1Walkable=!1,y[j].ringAndEdge2Walkable&&(q={isect:j},wn([y[D].coord,y[j].coord,y[y[j].nxtIsectAlongRingAndEdge1].coord],1==T)?(q.parent=R,q.winding=-T):(q.parent=A,q.winding=T),S.push(q)),D=j,j=y[j].nxtIsectAlongRingAndEdge1}F.push(y[j].coord),p.push(o([F],{index:A,parent:R,winding:T,netWinding:void 0}))}return g=c(p),e(),n(),g},ps=function(t,e,n,r,i){this.coord=t,this.param=e,this.ringAndEdgeIn=n,this.ringAndEdgeOut=r,this.nxtIsectAlongEdgeIn=i},gs=function(t,e,n,r,i,o,s){this.coord=t,this.ringAndEdge1=e,this.ringAndEdge2=n,this.nxtIsectAlongRingAndEdge1=r,this.nxtIsectAlongRingAndEdge2=i,this.ringAndEdge1Walkable=o,this.ringAndEdge2Walkable=s};Number.prototype.modulo=function(t){return(this%t+t)%t};var ds=Math.PI/180,ys=180/Math.PI,vs=function(t,e){this.lon=t,this.lat=e,this.x=ds*t,this.y=ds*e};vs.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},vs.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new vs(e,t)};var ms=function(){this.coords=[],this.length=0};ms.prototype.move_to=function(t){this.length++,this.coords.push(t)};var _s=function(t){this.properties=t||{},this.geometries=[]};_s.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;e<this.geometries.length;e++)t.push(this.geometries[e].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}},_s.prototype.wkt=function(){for(var t="",e="LINESTRING(",n=function(t){e+=t[0]+" "+t[1]+","},r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(n),t+=e.substring(0,e.length-1)+")"}return t};var xs=function(t,e,n){if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new vs(t.x,t.y),this.end=new vs(e.x,e.y),this.properties=n||{};var r=this.start.x-this.end.x,i=this.start.y-this.end.y,o=Math.pow(Math.sin(i/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(o)),this.g===Math.PI)throw new Error("it appears "+t.view()+" and "+e.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+t+" and "+e)};xs.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),n=Math.sin(t*this.g)/Math.sin(this.g),r=e*Math.cos(this.start.y)*Math.cos(this.start.x)+n*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+n*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+n*Math.sin(this.end.y),s=ys*Math.atan2(o,Math.sqrt(Math.pow(r,2)+Math.pow(i,2)));return[ys*Math.atan2(i,r),s]},xs.prototype.Arc=function(t,e){var n=[];if(!t||t<=2)n.push([this.start.lon,this.start.lat]),n.push([this.end.lon,this.end.lat]);else for(var r=1/(t-1),i=0;i<t;++i){var o=r*i,s=this.interpolate(o);n.push(s)}for(var a=!1,u=0,c=e&&e.offset?e.offset:10,l=180-c,f=-180+c,h=360-c,p=1;p<n.length;++p){var g=n[p-1][0],d=n[p][0],y=Math.abs(d-g);y>h&&(d>l&&g<f||g>l&&d<f)?a=!0:y>u&&(u=y)}var v=[];if(a&&u<c){var m=[];v.push(m);for(var _=0;_<n.length;++_){var x=parseFloat(n[_][0]);if(_>0&&Math.abs(x-n[_-1][0])>h){var b=parseFloat(n[_-1][0]),w=parseFloat(n[_-1][1]),E=parseFloat(n[_][0]),I=parseFloat(n[_][1]);if(b>-180&&b<f&&180===E&&_+1<n.length&&n[_-1][0]>-180&&n[_-1][0]<f){m.push([-180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(b>l&&b<180&&-180===E&&_+1<n.length&&n[_-1][0]>l&&n[_-1][0]<180){m.push([180,n[_][1]]),_++,m.push([n[_][0],n[_][1]]);continue}if(b<f&&E>l){var S=b;b=E,E=S;var N=w;w=I,I=N}if(b>l&&E<f&&(E+=360),b<=180&&E>=180&&b<E){var P=(180-b)/(E-b),C=P*I+(1-P)*w;m.push([n[_-1][0]>l?180:-180,C]),(m=[]).push([n[_-1][0]>l?-180:180,C]),v.push(m)}else m=[],v.push(m);m.push([x,n[_][1]])}else m.push([n[_][0],n[_][1]])}}else{var L=[];v.push(L);for(var M=0;M<n.length;++M)L.push([n[M][0],n[M][1]])}for(var O=new _s(this.properties),R=0;R<v.length;++R){var T=new ms;O.geometries.push(T);for(var A=v[R],F=0;F<A.length;++F)T.move_to(A[F])}return O};var bs=Fn;Fn.polyline=Fn,Fn.polygon=function(t,e){var n,r,i,o,s,a,u;for(r=1;r<=8;r*=2){for(n=[],o=!(kn(i=t[t.length-1],e)&r),s=0;s<t.length;s++)(u=!(kn(a=t[s],e)&r))!==o&&n.push(Dn(i,a,r,e)),u&&n.push(a),i=a,o=u;if(!(t=n).length)break}return n};var ws=Array.prototype.slice,Es={successCallback:null,verbose:!1,polygons:!1},Is={},Ss=64,Ns=16,Ps=4,Cs=1,Ls=[],Ms=[],Os=[],Rs=[],Ts=[],As=[],Fs=[],Ds=[],ks=[],js=[],Gs=[],qs=[],Bs=[],zs=[],Us=[],Vs=[],Xs=[],Ys=[],Ws=[],Hs=[],$s=[],Js=[],Ks=[],Zs=[];Fs[85]=js[85]=-1,Ds[85]=Gs[85]=0,ks[85]=qs[85]=1,Ws[85]=Js[85]=1,Hs[85]=Ks[85]=0,$s[85]=Zs[85]=1,Ls[85]=Rs[85]=0,Ms[85]=Ts[85]=-1,Os[85]=Us[85]=0,Vs[85]=Bs[85]=0,Xs[85]=zs[85]=1,As[85]=Ys[85]=1,Js[1]=Js[169]=0,Ks[1]=Ks[169]=-1,Zs[1]=Zs[169]=0,Bs[1]=Bs[169]=-1,zs[1]=zs[169]=0,Us[1]=Us[169]=0,js[4]=js[166]=0,Gs[4]=Gs[166]=-1,qs[4]=qs[166]=1,Vs[4]=Vs[166]=1,Xs[4]=Xs[166]=0,Ys[4]=Ys[166]=0,Fs[16]=Fs[154]=0,Ds[16]=Ds[154]=1,ks[16]=ks[154]=1,Rs[16]=Rs[154]=1,Ts[16]=Ts[154]=0,As[16]=As[154]=1,Ws[64]=Ws[106]=0,Hs[64]=Hs[106]=1,$s[64]=$s[106]=0,Ls[64]=Ls[106]=-1,Ms[64]=Ms[106]=0,Os[64]=Os[106]=1,Ws[2]=Ws[168]=0,Hs[2]=Hs[168]=-1,$s[2]=$s[168]=1,Js[2]=Js[168]=0,Ks[2]=Ks[168]=-1,Zs[2]=Zs[168]=0,Bs[2]=Bs[168]=-1,zs[2]=zs[168]=0,Us[2]=Us[168]=0,Vs[2]=Vs[168]=-1,Xs[2]=Xs[168]=0,Ys[2]=Ys[168]=1,Fs[8]=Fs[162]=0,Ds[8]=Ds[162]=-1,ks[8]=ks[162]=0,js[8]=js[162]=0,Gs[8]=Gs[162]=-1,qs[8]=qs[162]=1,Bs[8]=Bs[162]=1,zs[8]=zs[162]=0,Us[8]=Us[162]=1,Vs[8]=Vs[162]=1,Xs[8]=Xs[162]=0,Ys[8]=Ys[162]=0,Fs[32]=Fs[138]=0,Ds[32]=Ds[138]=1,ks[32]=ks[138]=1,js[32]=js[138]=0,Gs[32]=Gs[138]=1,qs[32]=qs[138]=0,Ls[32]=Ls[138]=1,Ms[32]=Ms[138]=0,Os[32]=Os[138]=0,Rs[32]=Rs[138]=1,Ts[32]=Ts[138]=0,As[32]=As[138]=1,Js[128]=Js[42]=0,Ks[128]=Ks[42]=1,Zs[128]=Zs[42]=1,Ws[128]=Ws[42]=0,Hs[128]=Hs[42]=1,$s[128]=$s[42]=0,Ls[128]=Ls[42]=-1,Ms[128]=Ms[42]=0,Os[128]=Os[42]=1,Rs[128]=Rs[42]=-1,Ts[128]=Ts[42]=0,As[128]=As[42]=0,js[5]=js[165]=-1,Gs[5]=Gs[165]=0,qs[5]=qs[165]=0,Js[5]=Js[165]=1,Ks[5]=Ks[165]=0,Zs[5]=Zs[165]=0,Vs[20]=Vs[150]=0,Xs[20]=Xs[150]=1,Ys[20]=Ys[150]=1,Rs[20]=Rs[150]=0,Ts[20]=Ts[150]=-1,As[20]=As[150]=1,Fs[80]=Fs[90]=-1,Ds[80]=Ds[90]=0,ks[80]=ks[90]=1,Ws[80]=Ws[90]=1,Hs[80]=Hs[90]=0,$s[80]=$s[90]=1,Bs[65]=Bs[105]=0,zs[65]=zs[105]=1,Us[65]=Us[105]=0,Ls[65]=Ls[105]=0,Ms[65]=Ms[105]=-1,Os[65]=Os[105]=0,Fs[160]=Fs[10]=-1,Ds[160]=Ds[10]=0,ks[160]=ks[10]=1,js[160]=js[10]=-1,Gs[160]=Gs[10]=0,qs[160]=qs[10]=0,Js[160]=Js[10]=1,Ks[160]=Ks[10]=0,Zs[160]=Zs[10]=0,Ws[160]=Ws[10]=1,Hs[160]=Hs[10]=0,$s[160]=$s[10]=1,Vs[130]=Vs[40]=0,Xs[130]=Xs[40]=1,Ys[130]=Ys[40]=1,Bs[130]=Bs[40]=0,zs[130]=zs[40]=1,Us[130]=Us[40]=0,Ls[130]=Ls[40]=0,Ms[130]=Ms[40]=-1,Os[130]=Os[40]=0,Rs[130]=Rs[40]=0,Ts[130]=Ts[40]=-1,As[130]=As[40]=1,js[37]=js[133]=0,Gs[37]=Gs[133]=1,qs[37]=qs[133]=1,Js[37]=Js[133]=0,Ks[37]=Ks[133]=1,Zs[37]=Zs[133]=0,Ls[37]=Ls[133]=-1,Ms[37]=Ms[133]=0,Os[37]=Os[133]=0,Rs[37]=Rs[133]=1,Ts[37]=Ts[133]=0,As[37]=As[133]=0,Vs[148]=Vs[22]=-1,Xs[148]=Xs[22]=0,Ys[148]=Ys[22]=0,Js[148]=Js[22]=0,Ks[148]=Ks[22]=-1,Zs[148]=Zs[22]=1,Ws[148]=Ws[22]=0,Hs[148]=Hs[22]=1,$s[148]=$s[22]=1,Rs[148]=Rs[22]=-1,Ts[148]=Ts[22]=0,As[148]=As[22]=1,Fs[82]=Fs[88]=0,Ds[82]=Ds[88]=-1,ks[82]=ks[88]=1,Vs[82]=Vs[88]=1,Xs[82]=Xs[88]=0,Ys[82]=Ys[88]=1,Bs[82]=Bs[88]=-1,zs[82]=zs[88]=0,Us[82]=Us[88]=1,Ws[82]=Ws[88]=0,Hs[82]=Hs[88]=-1,$s[82]=$s[88]=0,Fs[73]=Fs[97]=0,Ds[73]=Ds[97]=1,ks[73]=ks[97]=0,js[73]=js[97]=0,Gs[73]=Gs[97]=-1,qs[73]=qs[97]=0,Bs[73]=Bs[97]=1,zs[73]=zs[97]=0,Us[73]=Us[97]=0,Ls[73]=Ls[97]=1,Ms[73]=Ms[97]=0,Os[73]=Os[97]=1,Fs[145]=Fs[25]=0,Ds[145]=Ds[25]=-1,ks[145]=ks[25]=0,Bs[145]=Bs[25]=1,zs[145]=zs[25]=0,Us[145]=Us[25]=1,Js[145]=Js[25]=0,Ks[145]=Ks[25]=1,Zs[145]=Zs[25]=1,Rs[145]=Rs[25]=-1,Ts[145]=Ts[25]=0,As[145]=As[25]=0,js[70]=js[100]=0,Gs[70]=Gs[100]=1,qs[70]=qs[100]=0,Vs[70]=Vs[100]=-1,Xs[70]=Xs[100]=0,Ys[70]=Ys[100]=1,Ws[70]=Ws[100]=0,Hs[70]=Hs[100]=-1,$s[70]=$s[100]=1,Ls[70]=Ls[100]=1,Ms[70]=Ms[100]=0,Os[70]=Os[100]=0,js[101]=js[69]=0,Gs[101]=Gs[69]=1,qs[101]=qs[69]=0,Ls[101]=Ls[69]=1,Ms[101]=Ms[69]=0,Os[101]=Os[69]=0,Js[149]=Js[21]=0,Ks[149]=Ks[21]=1,Zs[149]=Zs[21]=1,Rs[149]=Rs[21]=-1,Ts[149]=Ts[21]=0,As[149]=As[21]=0,Vs[86]=Vs[84]=-1,Xs[86]=Xs[84]=0,Ys[86]=Ys[84]=1,Ws[86]=Ws[84]=0,Hs[86]=Hs[84]=-1,$s[86]=$s[84]=1,Fs[89]=Fs[81]=0,Ds[89]=Ds[81]=-1,ks[89]=ks[81]=0,Bs[89]=Bs[81]=1,zs[89]=zs[81]=0,Us[89]=Us[81]=1,Fs[96]=Fs[74]=0,Ds[96]=Ds[74]=1,ks[96]=ks[74]=0,js[96]=js[74]=-1,Gs[96]=Gs[74]=0,qs[96]=qs[74]=1,Ws[96]=Ws[74]=1,Hs[96]=Hs[74]=0,$s[96]=$s[74]=0,Ls[96]=Ls[74]=1,Ms[96]=Ms[74]=0,Os[96]=Os[74]=1,Fs[24]=Fs[146]=0,Ds[24]=Ds[146]=-1,ks[24]=ks[146]=1,Vs[24]=Vs[146]=1,Xs[24]=Xs[146]=0,Ys[24]=Ys[146]=1,Bs[24]=Bs[146]=0,zs[24]=zs[146]=1,Us[24]=Us[146]=1,Rs[24]=Rs[146]=0,Ts[24]=Ts[146]=-1,As[24]=As[146]=0,js[6]=js[164]=-1,Gs[6]=Gs[164]=0,qs[6]=qs[164]=1,Vs[6]=Vs[164]=-1,Xs[6]=Xs[164]=0,Ys[6]=Ys[164]=0,Js[6]=Js[164]=0,Ks[6]=Ks[164]=-1,Zs[6]=Zs[164]=1,Ws[6]=Ws[164]=1,Hs[6]=Hs[164]=0,$s[6]=$s[164]=0,Bs[129]=Bs[41]=0,zs[129]=zs[41]=1,Us[129]=Us[41]=1,Js[129]=Js[41]=0,Ks[129]=Ks[41]=1,Zs[129]=Zs[41]=0,Ls[129]=Ls[41]=-1,Ms[129]=Ms[41]=0,Os[129]=Os[41]=0,Rs[129]=Rs[41]=0,Ts[129]=Ts[41]=-1,As[129]=As[41]=0,Vs[66]=Vs[104]=0,Xs[66]=Xs[104]=1,Ys[66]=Ys[104]=0,Bs[66]=Bs[104]=-1,zs[66]=zs[104]=0,Us[66]=Us[104]=1,Ws[66]=Ws[104]=0,Hs[66]=Hs[104]=-1,$s[66]=$s[104]=0,Ls[66]=Ls[104]=0,Ms[66]=Ms[104]=-1,Os[66]=Os[104]=1,Fs[144]=Fs[26]=-1,Ds[144]=Ds[26]=0,ks[144]=ks[26]=0,Js[144]=Js[26]=1,Ks[144]=Ks[26]=0,Zs[144]=Zs[26]=1,Ws[144]=Ws[26]=0,Hs[144]=Hs[26]=1,$s[144]=$s[26]=1,Rs[144]=Rs[26]=-1,Ts[144]=Ts[26]=0,As[144]=As[26]=1,js[36]=js[134]=0,Gs[36]=Gs[134]=1,qs[36]=qs[134]=1,Vs[36]=Vs[134]=0,Xs[36]=Xs[134]=1,Ys[36]=Ys[134]=0,Ls[36]=Ls[134]=0,Ms[36]=Ms[134]=-1,Os[36]=Os[134]=1,Rs[36]=Rs[134]=1,Ts[36]=Ts[134]=0,As[36]=As[134]=0,Fs[9]=Fs[161]=-1,Ds[9]=Ds[161]=0,ks[9]=ks[161]=0,js[9]=js[161]=0,Gs[9]=Gs[161]=-1,qs[9]=qs[161]=0,Bs[9]=Bs[161]=1,zs[9]=zs[161]=0,Us[9]=Us[161]=0,Js[9]=Js[161]=1,Ks[9]=Ks[161]=0,Zs[9]=Zs[161]=1,Fs[136]=0,Ds[136]=1,ks[136]=1,js[136]=0,Gs[136]=1,qs[136]=0,Vs[136]=-1,Xs[136]=0,Ys[136]=1,Bs[136]=-1,zs[136]=0,Us[136]=0,Js[136]=0,Ks[136]=-1,Zs[136]=0,Ws[136]=0,Hs[136]=-1,$s[136]=1,Ls[136]=1,Ms[136]=0,Os[136]=0,Rs[136]=1,Ts[136]=0,As[136]=1,Fs[34]=0,Ds[34]=-1,ks[34]=0,js[34]=0,Gs[34]=-1,qs[34]=1,Vs[34]=1,Xs[34]=0,Ys[34]=0,Bs[34]=1,zs[34]=0,Us[34]=1,Js[34]=0,Ks[34]=1,Zs[34]=1,Ws[34]=0,Hs[34]=1,$s[34]=0,Ls[34]=-1,Ms[34]=0,Os[34]=1,Rs[34]=-1,Ts[34]=0,As[34]=0,Fs[35]=0,Ds[35]=1,ks[35]=1,js[35]=0,Gs[35]=-1,qs[35]=1,Vs[35]=1,Xs[35]=0,Ys[35]=0,Bs[35]=-1,zs[35]=0,Us[35]=0,Js[35]=0,Ks[35]=-1,Zs[35]=0,Ws[35]=0,Hs[35]=1,$s[35]=0,Ls[35]=-1,Ms[35]=0,Os[35]=1,Rs[35]=1,Ts[35]=0,As[35]=1,Fs[153]=0,Ds[153]=1,ks[153]=1,Bs[153]=-1,zs[153]=0,Us[153]=0,Js[153]=0,Ks[153]=-1,Zs[153]=0,Rs[153]=1,Ts[153]=0,As[153]=1,js[102]=0,Gs[102]=-1,qs[102]=1,Vs[102]=1,Xs[102]=0,Ys[102]=0,Ws[102]=0,Hs[102]=1,$s[102]=0,Ls[102]=-1,Ms[102]=0,Os[102]=1,Fs[155]=0,Ds[155]=-1,ks[155]=0,Bs[155]=1,zs[155]=0,Us[155]=1,Js[155]=0,Ks[155]=1,Zs[155]=1,Rs[155]=-1,Ts[155]=0,As[155]=0,js[103]=0,Gs[103]=1,qs[103]=0,Vs[103]=-1,Xs[103]=0,Ys[103]=1,Ws[103]=0,Hs[103]=-1,$s[103]=1,Ls[103]=1,Ms[103]=0,Os[103]=0,Fs[152]=0,Ds[152]=1,ks[152]=1,Vs[152]=-1,Xs[152]=0,Ys[152]=1,Bs[152]=-1,zs[152]=0,Us[152]=0,Js[152]=0,Ks[152]=-1,Zs[152]=0,Ws[152]=0,Hs[152]=-1,$s[152]=1,Rs[152]=1,Ts[152]=0,As[152]=1,Fs[156]=0,Ds[156]=-1,ks[156]=1,Vs[156]=1,Xs[156]=0,Ys[156]=1,Bs[156]=-1,zs[156]=0,Us[156]=0,Js[156]=0,Ks[156]=-1,Zs[156]=0,Ws[156]=0,Hs[156]=1,$s[156]=1,Rs[156]=-1,Ts[156]=0,As[156]=1,Fs[137]=0,Ds[137]=1,ks[137]=1,js[137]=0,Gs[137]=1,qs[137]=0,Bs[137]=-1,zs[137]=0,Us[137]=0,Js[137]=0,Ks[137]=-1,Zs[137]=0,Ls[137]=1,Ms[137]=0,Os[137]=0,Rs[137]=1,Ts[137]=0,As[137]=1,Fs[139]=0,Ds[139]=1,ks[139]=1,js[139]=0,Gs[139]=-1,qs[139]=0,Bs[139]=1,zs[139]=0,Us[139]=0,Js[139]=0,Ks[139]=1,Zs[139]=0,Ls[139]=-1,Ms[139]=0,Os[139]=0,Rs[139]=1,Ts[139]=0,As[139]=1,Fs[98]=0,Ds[98]=-1,ks[98]=0,js[98]=0,Gs[98]=-1,qs[98]=1,Vs[98]=1,Xs[98]=0,Ys[98]=0,Bs[98]=1,zs[98]=0,Us[98]=1,Ws[98]=0,Hs[98]=1,$s[98]=0,Ls[98]=-1,Ms[98]=0,Os[98]=1,Fs[99]=0,Ds[99]=1,ks[99]=0,js[99]=0,Gs[99]=-1,qs[99]=1,Vs[99]=1,Xs[99]=0,Ys[99]=0,Bs[99]=-1,zs[99]=0,Us[99]=1,Ws[99]=0,Hs[99]=-1,$s[99]=0,Ls[99]=1,Ms[99]=0,Os[99]=1,js[38]=0,Gs[38]=-1,qs[38]=1,Vs[38]=1,Xs[38]=0,Ys[38]=0,Js[38]=0,Ks[38]=1,Zs[38]=1,Ws[38]=0,Hs[38]=1,$s[38]=0,Ls[38]=-1,Ms[38]=0,Os[38]=1,Rs[38]=-1,Ts[38]=0,As[38]=0,js[39]=0,Gs[39]=1,qs[39]=1,Vs[39]=-1,Xs[39]=0,Ys[39]=0,Js[39]=0,Ks[39]=-1,Zs[39]=1,Ws[39]=0,Hs[39]=1,$s[39]=0,Ls[39]=-1,Ms[39]=0,Os[39]=1,Rs[39]=1,Ts[39]=0,As[39]=0;var Qs=function(t){return[[t.bottomleft,0],[0,0],[0,t.leftbottom]]},ta=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0]]},ea=function(t){return[[t.topright,1],[1,1],[1,t.righttop]]},na=function(t){return[[0,t.lefttop],[0,1],[t.topleft,1]]},ra=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop]]},ia=function(t){return[[t.bottomright,0],[t.bottomleft,0],[1,t.righttop],[1,t.rightbottom]]},oa=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.topleft,1],[t.topright,1]]},sa=function(t){return[[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},aa=[],ua=[],ca=[],la=[],fa=[],ha=[],pa=[],ga=[];la[1]=fa[1]=18,la[169]=fa[169]=18,ca[4]=ua[4]=12,ca[166]=ua[166]=12,aa[16]=ga[16]=4,aa[154]=ga[154]=4,ha[64]=pa[64]=22,ha[106]=pa[106]=22,ca[2]=ha[2]=17,la[2]=fa[2]=18,ca[168]=ha[168]=17,la[168]=fa[168]=18,aa[8]=la[8]=9,ua[8]=ca[8]=12,aa[162]=la[162]=9,ua[162]=ca[162]=12,aa[32]=ga[32]=4,ua[32]=pa[32]=1,aa[138]=ga[138]=4,ua[138]=pa[138]=1,fa[128]=ga[128]=21,ha[128]=pa[128]=22,fa[42]=ga[42]=21,ha[42]=pa[42]=22,ua[5]=fa[5]=14,ua[165]=fa[165]=14,ca[20]=ga[20]=6,ca[150]=ga[150]=6,aa[80]=ha[80]=11,aa[90]=ha[90]=11,la[65]=pa[65]=3,la[105]=pa[105]=3,aa[160]=ha[160]=11,ua[160]=fa[160]=14,aa[10]=ha[10]=11,ua[10]=fa[10]=14,ca[130]=ga[130]=6,la[130]=pa[130]=3,ca[40]=ga[40]=6,la[40]=pa[40]=3,ua[101]=pa[101]=1,ua[69]=pa[69]=1,fa[149]=ga[149]=21,fa[21]=ga[21]=21,ca[86]=ha[86]=17,ca[84]=ha[84]=17,aa[89]=la[89]=9,aa[81]=la[81]=9,aa[96]=pa[96]=0,ua[96]=ha[96]=15,aa[74]=pa[74]=0,ua[74]=ha[74]=15,aa[24]=ca[24]=8,la[24]=ga[24]=7,aa[146]=ca[146]=8,la[146]=ga[146]=7,ua[6]=ha[6]=15,ca[6]=fa[6]=16,ua[164]=ha[164]=15,ca[164]=fa[164]=16,la[129]=ga[129]=7,fa[129]=pa[129]=20,la[41]=ga[41]=7,fa[41]=pa[41]=20,ca[66]=pa[66]=2,la[66]=ha[66]=19,ca[104]=pa[104]=2,la[104]=ha[104]=19,aa[144]=fa[144]=10,ha[144]=ga[144]=23,aa[26]=fa[26]=10,ha[26]=ga[26]=23,ua[36]=ga[36]=5,ca[36]=pa[36]=2,ua[134]=ga[134]=5,ca[134]=pa[134]=2,aa[9]=fa[9]=10,ua[9]=la[9]=13,aa[161]=fa[161]=10,ua[161]=la[161]=13,ua[37]=ga[37]=5,fa[37]=pa[37]=20,ua[133]=ga[133]=5,fa[133]=pa[133]=20,ca[148]=fa[148]=16,ha[148]=ga[148]=23,ca[22]=fa[22]=16,ha[22]=ga[22]=23,aa[82]=ca[82]=8,la[82]=ha[82]=19,aa[88]=ca[88]=8,la[88]=ha[88]=19,aa[73]=pa[73]=0,ua[73]=la[73]=13,aa[97]=pa[97]=0,ua[97]=la[97]=13,aa[145]=la[145]=9,fa[145]=ga[145]=21,aa[25]=la[25]=9,fa[25]=ga[25]=21,ua[70]=pa[70]=1,ca[70]=ha[70]=17,ua[100]=pa[100]=1,ca[100]=ha[100]=17,aa[34]=la[34]=9,ua[34]=ca[34]=12,fa[34]=ga[34]=21,ha[34]=pa[34]=22,aa[136]=ga[136]=4,ua[136]=pa[136]=1,ca[136]=ha[136]=17,la[136]=fa[136]=18,aa[35]=ga[35]=4,ua[35]=ca[35]=12,la[35]=fa[35]=18,ha[35]=pa[35]=22,aa[153]=ga[153]=4,la[153]=fa[153]=18,ua[102]=ca[102]=12,ha[102]=pa[102]=22,aa[155]=la[155]=9,fa[155]=ga[155]=23,ua[103]=pa[103]=1,ca[103]=ha[103]=17,aa[152]=ga[152]=4,ca[152]=ha[152]=17,la[152]=fa[152]=18,aa[156]=ca[156]=8,la[156]=fa[156]=18,ha[156]=ga[156]=23,aa[137]=ga[137]=4,ua[137]=pa[137]=1,la[137]=fa[137]=18,aa[139]=ga[139]=4,ua[139]=la[139]=13,fa[139]=pa[139]=20,aa[98]=la[98]=9,ua[98]=ca[98]=12,ha[98]=pa[98]=22,aa[99]=pa[99]=0,ua[99]=ca[99]=12,la[99]=ha[99]=19,ua[38]=ca[38]=12,fa[38]=ga[38]=21,ha[38]=pa[38]=22,ua[39]=ga[39]=5,ca[39]=fa[39]=16,ha[39]=pa[39]=22;var da=[];da[1]=da[169]=Qs,da[4]=da[166]=ta,da[16]=da[154]=ea,da[64]=da[106]=na,da[168]=da[2]=ra,da[162]=da[8]=ia,da[138]=da[32]=oa,da[42]=da[128]=sa,da[5]=da[165]=function(t){return[[0,0],[0,t.leftbottom],[1,t.rightbottom],[1,0]]},da[20]=da[150]=function(t){return[[1,0],[t.bottomright,0],[t.topright,1],[1,1]]},da[80]=da[90]=function(t){return[[1,1],[1,t.righttop],[0,t.lefttop],[0,1]]},da[65]=da[105]=function(t){return[[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},da[160]=da[10]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.leftbottom],[0,t.lefttop]]},da[130]=da[40]=function(t){return[[t.topleft,1],[t.topright,1],[t.bottomright,0],[t.bottomleft,0]]},da[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},da[101]=da[69]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,1],[t.topleft,1]]},da[149]=da[21]=function(t){return[[t.topright,1],[1,1],[1,0],[0,0],[0,t.leftbottom]]},da[86]=da[84]=function(t){return[[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[1,1]]},da[89]=da[81]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,1]]},da[96]=da[74]=function(t){return[[1,t.righttop],[1,t.rightbottom],[0,t.lefttop],[0,1],[t.topleft,1]]},da[24]=da[146]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[t.topright,1]]},da[6]=da[164]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop]]},da[129]=da[41]=function(t){return[[t.topright,1],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1]]},da[66]=da[104]=function(t){return[[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},da[144]=da[26]=function(t){return[[1,1],[1,t.righttop],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},da[36]=da[134]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[t.topleft,1],[t.topright,1]]},da[9]=da[161]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom]]},da[37]=da[133]=function(t){return[[1,t.rightbottom],[1,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},da[148]=da[22]=function(t){return[[1,1],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},da[82]=da[88]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1]]},da[73]=da[97]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,1],[t.topleft,1]]},da[145]=da[25]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},da[70]=da[100]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},da[34]=function(t){return[sa(t),ia(t)]},da[35]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]},da[136]=function(t){return[oa(t),ra(t)]},da[153]=function(t){return[ea(t),Qs(t)]},da[102]=function(t){return[ta(t),na(t)]},da[155]=function(t){return[[1,1],[1,t.righttop],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topright,1]]},da[103]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.lefttop],[0,1],[t.topleft,1]]},da[152]=function(t){return[ea(t),ra(t)]},da[156]=function(t){return[[1,1],[1,t.righttop],[t.bottomright,0],[t.bottomleft,0],[0,t.leftbottom],[0,t.lefttop],[t.topright,1]]},da[137]=function(t){return[oa(t),Qs(t)]},da[139]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomleft,0],[0,0],[0,t.leftbottom],[t.topleft,1],[t.topright,1]]},da[98]=function(t){return[ia(t),na(t)]},da[99]=function(t){return[[1,t.righttop],[1,t.rightbottom],[t.bottomright,0],[t.bottomleft,0],[0,t.lefttop],[0,1],[t.topleft,1]]},da[38]=function(t){return[ta(t),sa(t)]},da[39]=function(t){return[[1,t.rightbottom],[1,0],[t.bottomright,0],[0,t.leftbottom],[0,t.lefttop],[t.topleft,1],[t.topright,1]]};var ya=function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1};ya.buildId=function(t){return t.join(",")},ya.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter((function(e){return e.from.id!==t.from.id}))},ya.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter((function(e){return e.to.id!==t.to.id}))},ya.prototype.addOuterEdge=function(t){this.outerEdges.push(t),this.outerEdgesSorted=!1},ya.prototype.sortOuterEdges=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=ur(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)},ya.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},ya.prototype.getOuterEdge=function(t){return this.sortOuterEdges(),this.outerEdges[t]},ya.prototype.addInnerEdge=function(t){this.innerEdges.push(t)};var va=function(t,e){this.from=t,this.to=e,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)};va.prototype.getSymetric=function(){return this.symetric||(this.symetric=new va(this.to,this.from),this.symetric.symetric=this),this.symetric},va.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},va.prototype.isEqual=function(t){return this.from.id===t.from.id&&this.to.id===t.to.id},va.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},va.prototype.toLineString=function(){return a([this.from.coordinates,this.to.coordinates])},va.prototype.compareTo=function(t){return ur(t.from.coordinates,t.to.coordinates,this.to.coordinates)};var ma=function(){this.edges=[],this.polygon=void 0,this.envelope=void 0},_a={length:{configurable:!0}};ma.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},ma.prototype.get=function(t){return this.edges[t]},_a.length.get=function(){return this.edges.length},ma.prototype.forEach=function(t){this.edges.forEach(t)},ma.prototype.map=function(t){return this.edges.map(t)},ma.prototype.some=function(t){return this.edges.some(t)},ma.prototype.isValid=function(){return!0},ma.prototype.isHole=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=ur(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},ma.prototype.toMultiPoint=function(){return f(this.edges.map((function(t){return t.from.coordinates})))},ma.prototype.toPolygon=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=o([t])},ma.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ie(this.toPolygon())},ma.findEdgeRingContaining=function(t,e){var n,i,o=t.getEnvelope();return e.forEach((function(e){var s=e.getEnvelope();if(i&&(n=i.getEnvelope()),!function(t,e){var n=t.geometry.coordinates.map((function(t){return t[0]})),r=t.geometry.coordinates.map((function(t){return t[1]})),i=e.geometry.coordinates.map((function(t){return t[0]})),o=e.geometry.coordinates.map((function(t){return t[1]}));return Math.max(null,n)===Math.max(null,i)&&Math.max(null,r)===Math.max(null,o)&&Math.min(null,n)===Math.min(null,i)&&Math.min(null,r)===Math.min(null,o)}(s,o)&&cr(s,o)){var a=t.map((function(t){return t.from.coordinates})).find((function(t){return!e.some((function(e){return function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t,e.from.coordinates)}))}));a&&e.inside(r(a))&&(i&&!cr(n,s)||(i=e))}})),i},ma.prototype.inside=function(t){return Ct(t,this.toPolygon())},Object.defineProperties(ma.prototype,_a);var xa=function(){this.edges=[],this.nodes={}};xa.fromGeoJson=function(t){!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 '"+t.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(t);var e=new xa;return D(t,(function(t){W(t,"LineString","Graph::fromGeoJson"),C(t,(function(t,n){if(t){var r=e.getNode(t),i=e.getNode(n);e.addEdge(r,i)}return n}))})),e},xa.prototype.getNode=function(t){var e=ya.buildId(t),n=this.nodes[e];return n||(n=this.nodes[e]=new ya(t)),n},xa.prototype.addEdge=function(t,e){var n=new va(t,e),r=n.getSymetric();this.edges.push(n),this.edges.push(r)},xa.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map((function(e){return t.nodes[e]})).forEach((function(e){return t._removeIfDangle(e)}))},xa.prototype._removeIfDangle=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)}))}},xa.prototype.deleteCutEdges=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))}))},xa.prototype._computeNextCWEdges=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}))},xa.prototype._computeNextCCWEdges=function(t,e){for(var n,r,i=t.getOuterEdges(),o=i.length-1;o>=0;--o){var s=i[o],a=s.symetric,u=void 0,c=void 0;s.label===e&&(u=s),a.label===e&&(c=a),u&&c&&(c&&(r=c),u&&(r&&(r.next=u,r=void 0),n||(n=u)))}r&&(r.next=n)},xa.prototype._findLabeledEdgeRings=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},xa.prototype.getEdgeRings=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},xa.prototype._findIntersectionNodes=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},xa.prototype._findEdgeRing=function(t){var e=t,n=new ma;do{n.push(e),e.ring=n,e=e.next}while(!t.isEqual(e));return n},xa.prototype.removeNode=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]},xa.prototype.removeEdge=function(t){this.edges=this.edges.filter((function(e){return!e.isEqual(t)})),t.deleteEdge()};var ba=yt((function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}(t.exports="function"==typeof Object.keys?Object.keys:n).shim=n})),wa=(ba.shim,yt((function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function r(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(e=t.exports=i?n:r).supported=n,e.unsupported=r}))),Ea=(wa.supported,wa.unsupported,yt((function(t){function e(t){return null==t}function n(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}var r=Array.prototype.slice,i=t.exports=function(t,o,s){return s||(s={}),t===o||(t instanceof Date&&o instanceof Date?t.getTime()===o.getTime():!t||!o||"object"!=typeof t&&"object"!=typeof o?s.strict?t===o:t==o:function(t,o,s){var a,u;if(e(t)||e(o))return!1;if(t.prototype!==o.prototype)return!1;if(wa(t))return!!wa(o)&&(t=r.call(t),o=r.call(o),i(t,o,s));if(n(t)){if(!n(o))return!1;if(t.length!==o.length)return!1;for(a=0;a<t.length;a++)if(t[a]!==o[a])return!1;return!0}try{var c=ba(t),l=ba(o)}catch(t){return!1}if(c.length!=l.length)return!1;for(c.sort(),l.sort(),a=c.length-1;a>=0;a--)if(c[a]!=l[a])return!1;for(a=c.length-1;a>=0;a--)if(u=c[a],!i(t[u],o[u],s))return!1;return typeof t==typeof o}(t,o,s))}}))),Ia=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=!(!t||!t.direction)&&t.direction,this.pseudoNode=!(!t||!t.pseudoNode)&&t.pseudoNode,this.objectComparator=t&&t.objectComparator?t.objectComparator:xr};Ia.prototype.compare=function(t,e){if(t.type!==e.type||!_r(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,0,!1);case"Polygon":return this.comparePolygon(t,e);case"Feature":return this.compareFeature(t,e);default:if(0===t.type.indexOf("Multi")){var n=this,r=mr(t),i=mr(e);return r.every((function(t){return this.some((function(e){return n.compare(t,e)}))}),i)}}return!1},Ia.prototype.compareCoord=function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toFixed(this.precision)!==e[n].toFixed(this.precision))return!1;return!0},Ia.prototype.compareLine=function(t,e,n,r){if(!_r(t,e))return!1;var i=this.pseudoNode?t:this.removePseudo(t),o=this.pseudoNode?e:this.removePseudo(e);if(!r||this.compareCoord(i[0],o[0])||(o=this.fixStartIndex(o,i))){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)}},Ia.prototype.fixStartIndex=function(t,e){for(var n,r=-1,i=0;i<t.length;i++)if(this.compareCoord(t[i],e[0])){r=i;break}return r>=0&&(n=[].concat(t.slice(r,t.length),t.slice(1,r+1))),n},Ia.prototype.comparePath=function(t,e){var n=this;return t.every((function(t,e){return n.compareCoord(t,this[e])}),e)},Ia.prototype.comparePolygon=function(t,e){if(this.compareLine(t.coordinates[0],e.coordinates[0],1,!0)){var n=t.coordinates.slice(1,t.coordinates.length),r=e.coordinates.slice(1,e.coordinates.length),i=this;return n.every((function(t){return this.some((function(e){return i.compareLine(t,e,1,!0)}))}),r)}return!1},Ia.prototype.compareFeature=function(t,e){return!(t.id!==e.id||!this.objectComparator(t.properties,e.properties)||!this.compareBBox(t,e))&&this.compare(t.geometry,e.geometry)},Ia.prototype.compareBBox=function(t,e){return!!(!t.bbox&&!e.bbox||t.bbox&&e.bbox&&this.compareCoord(t.bbox,e.bbox))},Ia.prototype.removePseudo=function(t){return t};var Sa=Ia,Na=yt((function(t){function e(t,e,n,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(t,e,n,r)}e.prototype.run=function(t,e,n,r){this._init(t,e,n,r);for(var i=0;i<this._datasetLength;i++)if(1!==this._visited[i]){this._visited[i]=1;var o=this._regionQuery(i);if(o.length<this.minPts)this.noise.push(i);else{var s=this.clusters.length;this.clusters.push([]),this._addToCluster(i,s),this._expandCluster(s,o)}}return this.clusters},e.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this.noise=[],this._datasetLength=t.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},e.prototype._expandCluster=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(1!==this._visited[r]){this._visited[r]=1;var i=this._regionQuery(r);i.length>=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n<this._datasetLength;n++)this.distance(this.dataset[t],this.dataset[n])<this.epsilon&&e.push(n);return e},e.prototype._mergeArrays=function(t,e){for(var n=e.length,r=0;r<n;r++){var i=e[r];t.indexOf(i)<0&&t.push(i)}return t},e.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=e)})),Pa=yt((function(t){function e(t,e,n){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(t,e,n)}e.prototype.init=function(t,e,n){this.assignments=[],this.centroids=[],void 0!==t&&(this.dataset=t),void 0!==e&&(this.k=e),void 0!==n&&(this.distance=n)},e.prototype.run=function(t,e){this.init(t,e);for(var n=this.dataset.length,r=0;r<this.k;r++)this.centroids[r]=this.randomCentroid();for(var i=!0;i;){i=this.assign();for(var o=0;o<this.k;o++){for(var s=new Array(l),a=0,u=0;u<l;u++)s[u]=0;for(var c=0;c<n;c++){var l=this.dataset[c].length;if(o===this.assignments[c]){for(u=0;u<l;u++)s[u]+=this.dataset[c][u];a++}}if(a>0){for(u=0;u<l;u++)s[u]/=a;this.centroids[o]=s}else this.centroids[o]=this.randomCentroid(),i=!0}}return this.getClusters()},e.prototype.randomCentroid=function(){var t,e,n=this.dataset.length-1;do{e=Math.round(Math.random()*n),t=this.dataset[e]}while(this.centroids.indexOf(t)>=0);return t},e.prototype.assign=function(){for(var t,e=!1,n=this.dataset.length,r=0;r<n;r++)(t=this.argmin(this.dataset[r],this.centroids,this.distance))!=this.assignments[r]&&(this.assignments[r]=t,e=!0);return e},e.prototype.getClusters=function(){for(var t,e=new Array(this.k),n=0;n<this.assignments.length;n++)void 0===e[t=this.assignments[n]]&&(e[t]=[]),e[t].push(n);return e},e.prototype.argmin=function(t,e,n){for(var r,i=Number.MAX_VALUE,o=0,s=e.length,a=0;a<s;a++)(r=n(t,e[a]))<i&&(i=r,o=a);return o},e.prototype.distance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ca=yt((function(t){function e(t,e,n){this._queue=[],this._priorities=[],this._sorting="desc",this._init(t,e,n)}e.prototype.insert=function(t,e){for(var n=this._queue.length,r=n;r--;){var i=this._priorities[r];"desc"===this._sorting?e>i&&(n=r):e<i&&(n=r)}this._insertAt(t,e,n)},e.prototype.remove=function(t){for(var e=this._queue.length;e--;)if(t===this._queue[e]){this._queue.splice(e,1),this._priorities.splice(e,1);break}},e.prototype.forEach=function(t){this._queue.forEach(t)},e.prototype.getElements=function(){return this._queue},e.prototype.getElementPriority=function(t){return this._priorities[t]},e.prototype.getPriorities=function(){return this._priorities},e.prototype.getElementsWithPriorities=function(){for(var t=[],e=0,n=this._queue.length;e<n;e++)t.push([this._queue[e],this._priorities[e]]);return t},e.prototype._init=function(t,e,n){if(t&&e){if(this._queue=[],this._priorities=[],t.length!==e.length)throw new Error("Arrays must have the same length");for(var r=0;r<t.length;r++)this.insert(t[r],e[r])}n&&(this._sorting=n)},e.prototype._insertAt=function(t,e,n){this._queue.length===n?(this._queue.push(t),this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},t.exports&&(t.exports=e)})),La=yt((function(t){function e(t,e,n,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(t,e,n,r)}if(t.exports)var n=Ca;e.prototype.run=function(t,e,r,i){this._init(t,e,r,i);for(var o=0,s=this.dataset.length;o<s;o++)if(1!==this._processed[o]){this._processed[o]=1,this.clusters.push([o]);var a=this.clusters.length-1;this._orderedList.push(o);var u=new n(null,null,"asc"),c=this._regionQuery(o);void 0!==this._distanceToCore(o)&&(this._updateQueue(o,c,u),this._expandCluster(a,u))}return this.clusters},e.prototype.getReachabilityPlot=function(){for(var t=[],e=0,n=this._orderedList.length;e<n;e++){var r=this._orderedList[e],i=this._reachability[r];t.push([r,i])}return t},e.prototype._init=function(t,e,n,r){if(t){if(!(t instanceof Array))throw Error("Dataset must be of type array, "+typeof t+" given");this.dataset=t,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}e&&(this.epsilon=e),n&&(this.minPts=n),r&&(this.distance=r)},e.prototype._updateQueue=function(t,e,n){var r=this;this._coreDistance=this._distanceToCore(t),e.forEach((function(e){if(void 0===r._processed[e]){var i=r.distance(r.dataset[t],r.dataset[e]),o=Math.max(r._coreDistance,i);void 0===r._reachability[e]?(r._reachability[e]=o,n.insert(e,o)):o<r._reachability[e]&&(r._reachability[e]=o,n.remove(e),n.insert(e,o))}}))},e.prototype._expandCluster=function(t,e){for(var n=e.getElements(),r=0,i=n.length;r<i;r++){var o=n[r];if(void 0===this._processed[o]){var s=this._regionQuery(o);this._processed[o]=1,this.clusters[t].push(o),this._orderedList.push(o),void 0!==this._distanceToCore(o)&&(this._updateQueue(o,s,e),this._expandCluster(t,e))}}},e.prototype._distanceToCore=function(t){for(var e=this.epsilon,n=0;n<e;n++)if(this._regionQuery(t,n).length>=this.minPts)return n},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r<i;r++)this.distance(this.dataset[t],this.dataset[r])<e&&n.push(r);return n},e.prototype._euclideanDistance=function(t,e){for(var n=0,r=Math.min(t.length,e.length);r--;)n+=(t[r]-e[r])*(t[r]-e[r]);return Math.sqrt(n)},t.exports&&(t.exports=e)})),Ma=yt((function(t){t.exports&&(t.exports={DBSCAN:Na,KMEANS:Pa,OPTICS:La,PriorityQueue:Ca})})),Oa=(Ma.DBSCAN,Ma.KMEANS,Ma.OPTICS,Ma.PriorityQueue,function(t,e,n){for(var r=t.length,i=0,o=0;o<r;o++){var s=(t[o]||0)-(e[o]||0);i+=s*s}return n?Math.sqrt(i):i}),Ra=Oa,Ta=function(t,e,n){var r=Math.abs(t-e);return n?r:r*r},Aa=Oa,Fa=function(t,e,n,r){var i=[],o=[],s=[],a=[],u=!1,c=r||1e4,l=t.length,f=t[0].length,h=f>0,p=[];if(n)i="kmrand"==n?function(t,e){for(var n={},r=[],i=e<<2,o=t.length,s=t[0].length>0;r.length<e&&i-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,r.push(a))}if(r.length<e)throw new Error("Error initializating clusters");return r}(t,e):"kmpp"==n?function(t,e){var n=t[0].length?Ra:Ta,r=[],i=t.length,o=t[0].length>0,s=t[Math.floor(Math.random()*i)];for(o&&s.join("_"),r.push(s);r.length<e;){for(var a=[],u=r.length,c=0,l=[],f=0;f<i;f++){for(var h=1/0,p=0;p<u;p++){var g=n(t[f],r[p]);g<=h&&(h=g)}a[f]=h}for(var d=0;d<i;d++)c+=a[d];for(var y=0;y<i;y++)l[y]={i:y,v:t[y],pr:a[y]/c,cs:0};l.sort((function(t,e){return t.pr-e.pr})),l[0].cs=l[0].pr;for(var v=1;v<i;v++)l[v].cs=l[v-1].cs+l[v].pr;for(var m=Math.random(),_=0;_<i-1&&l[_++].cs<m;);r.push(l[_-1].v)}return r}(t,e):n;else for(var g={};i.length<e;){var d=Math.floor(Math.random()*l);g[d]||(g[d]=!0,i.push(t[d]))}do{wr(e,0,p);for(var y=0;y<l;y++){for(var v=1/0,m=0,_=0;_<e;_++)(a=h?Aa(t[y],i[_]):Math.abs(t[y]-i[_]))<=v&&(v=a,m=_);s[y]=m,p[m]++}for(var x=[],b=(o=[],0);b<e;b++)x[b]=h?wr(f,0,x[b]):0,o[b]=i[b];if(h){for(var w=0;w<e;w++)i[w]=[];for(var E=0;E<l;E++)for(var I=x[s[E]],S=t[E],N=0;N<f;N++)I[N]+=S[N];u=!0;for(var P=0;P<e;P++){for(var C=i[P],L=x[P],M=o[P],O=p[P],R=0;R<f;R++)C[R]=L[R]/O||0;if(u)for(var T=0;T<f;T++)if(M[T]!=C[T]){u=!1;break}}}else{for(var A=0;A<l;A++)x[s[A]]+=t[A];for(var F=0;F<e;F++)i[F]=x[F]/p[F]||0;u=!0;for(var D=0;D<e;D++)if(o[D]!=i[D]){u=!1;break}}u=u||--c<=0}while(!u);return{it:1e4-c,k:e,idxs:s,centroids:i}},Da={search:function(t,e,n,r){t.cleanDirty();var i=(r=r||{}).heuristic||Da.heuristics.manhattan,o=r.closest||!1,s=new Pr((function(t){return t.f})),a=e;for(e.h=i(e,n),s.push(e);s.size()>0;){var u=s.pop();if(u===n)return Ir(u);u.closed=!0;for(var c=t.neighbors(u),l=0,f=c.length;l<f;++l){var h=c[l];if(!h.closed&&!h.isWall()){var p=u.g+h.getCost(u),g=h.visited;(!g||p<h.g)&&(h.visited=!0,h.parent=u,h.h=h.h||i(h,n),h.g=p,h.f=h.g+h.h,t.markDirty(h),o&&(h.h<a.h||h.h===a.h&&h.g<a.g)&&(a=h),g?s.rescoreElement(h):s.push(h))}}}return o?Ir(a):[]},heuristics:{manhattan:function(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},diagonal:function(t,e){var n=Math.sqrt(2),r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return 1*(r+i)+(n-2)*Math.min(r,i)}},cleanNode:function(t){t.f=0,t.g=0,t.h=0,t.visited=!1,t.closed=!1,t.parent=null}};Sr.prototype.init=function(){this.dirtyNodes=[];for(var t=0;t<this.nodes.length;t++)Da.cleanNode(this.nodes[t])},Sr.prototype.cleanDirty=function(){for(var t=0;t<this.dirtyNodes.length;t++)Da.cleanNode(this.dirtyNodes[t]);this.dirtyNodes=[]},Sr.prototype.markDirty=function(t){this.dirtyNodes.push(t)},Sr.prototype.neighbors=function(t){var e=[],n=t.x,r=t.y,i=this.grid;return i[n-1]&&i[n-1][r]&&e.push(i[n-1][r]),i[n+1]&&i[n+1][r]&&e.push(i[n+1][r]),i[n]&&i[n][r-1]&&e.push(i[n][r-1]),i[n]&&i[n][r+1]&&e.push(i[n][r+1]),this.diagonal&&(i[n-1]&&i[n-1][r-1]&&e.push(i[n-1][r-1]),i[n+1]&&i[n+1][r-1]&&e.push(i[n+1][r-1]),i[n-1]&&i[n-1][r+1]&&e.push(i[n-1][r+1]),i[n+1]&&i[n+1][r+1]&&e.push(i[n+1][r+1])),e},Sr.prototype.toString=function(){for(var t,e,n,r,i=[],o=this.grid,s=0,a=o.length;s<a;s++){for(t=[],n=0,r=(e=o[s]).length;n<r;n++)t.push(e[n].weight);i.push(t.join(" "))}return i.join("\n")},Nr.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},Nr.prototype.getCost=function(t){return t&&t.x!==this.x&&t.y!==this.y?1.41421*this.weight:this.weight},Nr.prototype.isWall=function(){return 0===this.weight},Pr.prototype={push:function(t){this.content.push(t),this.sinkDown(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(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)<this.scoreFunction(t)?this.sinkDown(e):this.bubbleUp(e))},size:function(){return this.content.length},rescoreElement:function(t){this.sinkDown(this.content.indexOf(t))},sinkDown:function(t){for(var e=this.content[t];t>0;){var n=(t+1>>1)-1,r=this.content[n];if(!(this.scoreFunction(e)<this.scoreFunction(r)))break;this.content[n]=e,this.content[t]=r,t=n}},bubbleUp:function(t){for(var e=this.content.length,n=this.content[t],r=this.scoreFunction(n);;){var i,o=t+1<<1,s=o-1,a=null;if(s<e){var u=this.content[s];(i=this.scoreFunction(u))<r&&(a=s)}if(o<e){var c=this.content[o];this.scoreFunction(c)<(null===a?r:i)&&(a=o)}if(null===a)break;this.content[t]=this.content[a],this.content[a]=n,t=a}}};var ka=function(t){return function(){return t}};Mr.prototype={constructor:Mr,insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Ar(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(Rr(this,n),n=(t=n).U),n.C=!1,r.C=!0,Tr(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(Tr(this,n),n=(t=n).U),n.C=!1,r.C=!0,Rr(this,r)),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,s=t.R;if(n=o?s?Ar(s):o:s,i?i.L===t?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=s,s.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((e=i.R).C&&(e.C=!1,i.C=!0,Rr(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Tr(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,Rr(this,i),t=this._;break}}else if((e=i.L).C&&(e.C=!1,i.C=!0,Tr(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Rr(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,Tr(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var ja,Ga,qa,Ba,za,Ua=[],Va=[],Xa=1e-6,Ya=1e-12;Zr.prototype={constructor:Zr,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return Br(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(o=(i=n.halfedges).length)for(var i,o,s,a=n.site,u=-1,c=e[i[o-1]],l=c.left===a?c.right:c.left;++u<o;)s=l,l=(c=e[i[u]]).left===a?c.right:c.left,s&&l&&r<s.index&&r<l.index&&Jr(a,s,l)<0&&t.push([a.data,s.data,l.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,e,n){for(var r,i,o=this,s=o._found||0,a=o.cells.length;!(i=o.cells[s]);)if(++s>=a)return null;var u=t-i.site[0],c=e-i.site[1],l=u*u+c*c;do{i=o.cells[r=s],s=null,i.halfedges.forEach((function(n){var r=o.edges[n],a=r.left;if(a!==i.site&&a||(a=r.right)){var u=t-a[0],c=e-a[1],f=u*u+c*c;f<l&&(l=f,s=a.index)}}))}while(null!==s);return o._found=r,null==n||l<=n*n?i.site:null}};var Wa=Object.freeze({randomPosition:oi,randomPoint:si,randomPolygon:ai,randomLineString:ui}),Ha=Object.freeze({getCluster:li,clusterEach:fi,clusterReduce:hi,createBins:pi,applyFilter:gi,propertiesContainsFilter:di,filterProperties:yi});"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var $a=function(){};$a.prototype.interfaces_=function(){return[]},$a.prototype.getClass=function(){return $a},$a.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var Ja=function(){},Ka=function(){},Za={MAX_VALUE:{configurable:!0}};Ka.isNaN=function(t){return Number.isNaN(t)},Ka.doubleToLongBits=function(t){return t},Ka.longBitsToDouble=function(t){return t},Ka.isInfinite=function(t){return!Number.isFinite(t)},Za.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(Ka,Za);var Qa=function(){},tu=function(){},eu=function(){},nu=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},ru={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};nu.prototype.setOrdinate=function(t,e){switch(t){case nu.X:this.x=e;break;case nu.Y:this.y=e;break;case nu.Z:this.z=e;break;default:throw new Ja("Invalid ordinate index: "+t)}},nu.prototype.equals2D=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!!$a.equalsWithTolerance(this.x,e.x,n)&&!!$a.equalsWithTolerance(this.y,e.y,n)}},nu.prototype.getOrdinate=function(t){switch(t){case nu.X:return this.x;case nu.Y:return this.y;case nu.Z:return this.z}throw new Ja("Invalid ordinate index: "+t)},nu.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Ka.isNaN(this.z))&&Ka.isNaN(t.z)},nu.prototype.equals=function(t){return t instanceof nu&&this.equals2D(t)},nu.prototype.equalInZ=function(t,e){return $a.equalsWithTolerance(this.z,t.z,e)},nu.prototype.compareTo=function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},nu.prototype.clone=function(){},nu.prototype.copy=function(){return new nu(this)},nu.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},nu.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},nu.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},nu.prototype.hashCode=function(){var t=17;return 37*(t=37*t+nu.hashCode(this.x))+nu.hashCode(this.y)},nu.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},nu.prototype.interfaces_=function(){return[Qa,tu,vi]},nu.prototype.getClass=function(){return nu},nu.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=Ka.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},ru.DimensionalComparator.get=function(){return iu},ru.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},ru.NULL_ORDINATE.get=function(){return Ka.NaN},ru.X.get=function(){return 0},ru.Y.get=function(){return 1},ru.Z.get=function(){return 2},Object.defineProperties(nu,ru);var iu=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new Ja("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};iu.prototype.compare=function(t,e){var n=t,r=e,i=iu.compare(n.x,r.x);if(0!==i)return i;var o=iu.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:iu.compare(n.z,r.z)},iu.prototype.interfaces_=function(){return[eu]},iu.prototype.getClass=function(){return iu},iu.compare=function(t,e){return t<e?-1:t>e?1:Ka.isNaN(t)?Ka.isNaN(e)?0:-1:Ka.isNaN(e)?1:0};var ou=function(){};ou.prototype.create=function(){},ou.prototype.interfaces_=function(){return[]},ou.prototype.getClass=function(){return ou};var su=function(){},au={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};su.prototype.interfaces_=function(){return[]},su.prototype.getClass=function(){return su},su.toLocationSymbol=function(t){switch(t){case su.EXTERIOR:return"e";case su.BOUNDARY:return"b";case su.INTERIOR:return"i";case su.NONE:return"-"}throw new Ja("Unknown location value: "+t)},au.INTERIOR.get=function(){return 0},au.BOUNDARY.get=function(){return 1},au.EXTERIOR.get=function(){return 2},au.NONE.get=function(){return-1},Object.defineProperties(su,au);var uu=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},cu=function(){},lu={LOG_10:{configurable:!0}};cu.prototype.interfaces_=function(){return[]},cu.prototype.getClass=function(){return cu},cu.log10=function(t){var e=Math.log(t);return Ka.isInfinite(e)||Ka.isNaN(e)?e:e/cu.LOG_10},cu.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},cu.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?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 r<i?i:r>o?o:r}},cu.wrap=function(t,e){return t<0?e- -t%e:t%e},cu.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=t;return e>r&&(r=e),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=i;return o>u&&(u=o),s>u&&(u=s),a>u&&(u=a),u}},cu.average=function(t,e){return(t+e)/2},lu.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(cu,lu);var fu=function(t){this.str=t};fu.prototype.append=function(t){this.str+=t},fu.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},fu.prototype.toString=function(t){return this.str};var hu=function(t){this.value=t};hu.prototype.intValue=function(){return this.value},hu.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},hu.isNaN=function(t){return Number.isNaN(t)};var pu=function(){};pu.isWhitespace=function(t){return t<=32&&t>=0||127===t},pu.toUpperCase=function(t){return t.toUpperCase()};var gu=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},du={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};gu.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},gu.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=gu.magnitude(n._hi),i=gu.TEN.pow(r);(n=n.divide(i)).gt(gu.TEN)?(n=n.divide(gu.TEN),r+=1):n.lt(gu.ONE)&&(n=n.multiply(gu.TEN),r-=1);for(var o=r+1,s=new fu,a=gu.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var c=Math.trunc(n._hi);if(c<0)break;var l=!1,f=0;c>9?(l=!0,f="9"):f="0"+c,s.append(f),n=n.subtract(gu.valueOf(c)).multiply(gu.TEN),l&&n.selfAdd(gu.TEN);var h=!0,p=gu.magnitude(n._hi);if(p<0&&Math.abs(p)>=a-u&&(h=!1),!h)break}return e[0]=r,s.toString()},gu.prototype.sqr=function(){return this.multiply(this)},gu.prototype.doubleValue=function(){return this._hi+this._lo},gu.prototype.subtract=function(){if(arguments[0]instanceof gu){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},gu.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},gu.prototype.isZero=function(){return 0===this._hi&&0===this._lo},gu.prototype.selfSubtract=function(){if(arguments[0]instanceof gu){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},gu.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},gu.prototype.min=function(t){return this.le(t)?this:t},gu.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof gu){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null,l=null,f=null;return u=this._hi/n,f=(i=(c=gu.SPLIT*u)-(i=c-u))*(s=(f=gu.SPLIT*n)-(s=f-n))-(l=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,f=u+(c=(this._hi-l-f+this._lo-u*r)/n),this._hi=f,this._lo=u-f+c,this}},gu.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},gu.prototype.divide=function(){if(arguments[0]instanceof gu){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=gu.SPLIT*o)-(e=s-o)),u=e*(r=(u=gu.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new gu(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return Ka.isNaN(c)?gu.createNaN():gu.copy(this).selfDivide(c,0)}},gu.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},gu.prototype.pow=function(t){if(0===t)return gu.valueOf(1);var e=new gu(this),n=gu.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},gu.prototype.ceil=function(){if(this.isNaN())return gu.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new gu(t,e)},gu.prototype.compareTo=function(t){var e=t;return this._hi<e._hi?-1:this._hi>e._hi?1:this._lo<e._lo?-1:this._lo>e._lo?1:0},gu.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},gu.prototype.setValue=function(){if(arguments[0]instanceof gu){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},gu.prototype.max=function(t){return this.ge(t)?this:t},gu.prototype.sqrt=function(){if(this.isZero())return gu.valueOf(0);if(this.isNegative())return gu.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=gu.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},gu.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof gu){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],l=null,f=null,h=null,p=null,g=null,d=null,y=null;p=this._hi+u,f=this._lo+c,g=p-(d=p-this._hi),h=f-(y=f-this._lo);var v=(l=p+(d=(g=u-d+(this._hi-g))+f))+(d=(h=c-y+(this._lo-h))+(d+(p-l))),m=d+(l-v);return this._hi=v,this._lo=m,this}},gu.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof gu){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null;i=(u=gu.SPLIT*this._hi)-this._hi,c=gu.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var l=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),f=c+(i=u-l);return this._hi=l,this._lo=f,this}},gu.prototype.selfSqr=function(){return this.selfMultiply(this)},gu.prototype.floor=function(){if(this.isNaN())return gu.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new gu(t,e)},gu.prototype.negate=function(){return this.isNaN()?this:new gu(-this._hi,-this._lo)},gu.prototype.clone=function(){},gu.prototype.multiply=function(){if(arguments[0]instanceof gu){var t=arguments[0];return t.isNaN()?gu.createNaN():gu.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return Ka.isNaN(e)?gu.createNaN():gu.copy(this).selfMultiply(e,0)}},gu.prototype.isNaN=function(){return Ka.isNaN(this._hi)},gu.prototype.intValue=function(){return Math.trunc(this._hi)},gu.prototype.toString=function(){var t=gu.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},gu.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+gu.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+gu.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},gu.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=gu.SPLIT*n)-(i=s-n)),o=(a=gu.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new gu(u,n-u+s)},gu.prototype.toSciNotation=function(){if(this.isZero())return gu.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=gu.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},gu.prototype.abs=function(){return this.isNaN()?gu.NaN:this.isNegative()?this.negate():new gu(this)},gu.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},gu.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},gu.prototype.add=function(){if(arguments[0]instanceof gu){var t=arguments[0];return gu.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return gu.copy(this).selfAdd(e)}},gu.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof gu){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},gu.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},gu.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},gu.prototype.trunc=function(){return this.isNaN()?gu.NaN:this.isPositive()?this.floor():this.ceil()},gu.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},gu.prototype.interfaces_=function(){return[vi,Qa,tu]},gu.prototype.getClass=function(){return gu},gu.sqr=function(t){return gu.valueOf(t).selfMultiply(t)},gu.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return gu.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new gu(e)}},gu.sqrt=function(t){return gu.valueOf(t).sqrt()},gu.parse=function(t){for(var e=0,n=t.length;pu.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new gu,s=0,a=0,u=0;!(e>=n);){var c=t.charAt(e);if(e++,pu.isDigit(c)){var l=c-"0";o.selfMultiply(gu.TEN),o.selfAdd(l),s++}else{if("."!==c){if("e"===c||"E"===c){var f=t.substring(e);try{u=hu.parseInt(f)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+f+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var h=o,p=s-a-u;if(0===p)h=o;else if(p>0){var g=gu.TEN.pow(p);h=o.divide(g)}else if(p<0){var d=gu.TEN.pow(-p);h=o.multiply(d)}return r?h.negate():h},gu.createNaN=function(){return new gu(Ka.NaN,Ka.NaN)},gu.copy=function(t){return new gu(t)},gu.magnitude=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},gu.stringOfChar=function(t,e){for(var n=new fu,r=0;r<e;r++)n.append(t);return n.toString()},du.PI.get=function(){return new gu(3.141592653589793,12246467991473532e-32)},du.TWO_PI.get=function(){return new gu(6.283185307179586,24492935982947064e-32)},du.PI_2.get=function(){return new gu(1.5707963267948966,6123233995736766e-32)},du.E.get=function(){return new gu(2.718281828459045,14456468917292502e-32)},du.NaN.get=function(){return new gu(Ka.NaN,Ka.NaN)},du.EPS.get=function(){return 123259516440783e-46},du.SPLIT.get=function(){return 134217729},du.MAX_PRINT_DIGITS.get=function(){return 32},du.TEN.get=function(){return gu.valueOf(10)},du.ONE.get=function(){return gu.valueOf(1)},du.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},du.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(gu,du);var yu=function(){},vu={DP_SAFE_EPSILON:{configurable:!0}};yu.prototype.interfaces_=function(){return[]},yu.prototype.getClass=function(){return yu},yu.orientationIndex=function(t,e,n){var r=yu.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=gu.valueOf(e.x).selfAdd(-t.x),o=gu.valueOf(e.y).selfAdd(-t.y),s=gu.valueOf(n.x).selfAdd(-e.x),a=gu.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},yu.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},yu.intersection=function(t,e,n,r){var i=gu.valueOf(r.y).selfSubtract(n.y).selfMultiply(gu.valueOf(e.x).selfSubtract(t.x)),o=gu.valueOf(r.x).selfSubtract(n.x).selfMultiply(gu.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=gu.valueOf(r.x).selfSubtract(n.x).selfMultiply(gu.valueOf(t.y).selfSubtract(n.y)),u=gu.valueOf(r.y).selfSubtract(n.y).selfMultiply(gu.valueOf(t.x).selfSubtract(n.x)),c=a.subtract(u).selfDivide(s).doubleValue(),l=gu.valueOf(t.x).selfAdd(gu.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),f=gu.valueOf(e.x).selfSubtract(t.x).selfMultiply(gu.valueOf(t.y).selfSubtract(n.y)),h=gu.valueOf(e.y).selfSubtract(t.y).selfMultiply(gu.valueOf(t.x).selfSubtract(n.x)),p=f.subtract(h).selfDivide(s).doubleValue(),g=gu.valueOf(n.y).selfAdd(gu.valueOf(r.y).selfSubtract(n.y).selfMultiply(p)).doubleValue();return new nu(l,g)},yu.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return yu.signum(s);r=i+o}else{if(!(i<0))return yu.signum(s);if(o>=0)return yu.signum(s);r=-i-o}var a=yu.DP_SAFE_EPSILON*r;return s>=a||-s>=a?yu.signum(s):2},yu.signum=function(t){return t>0?1:t<0?-1:0},vu.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(yu,vu);var mu=function(){},_u={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};_u.X.get=function(){return 0},_u.Y.get=function(){return 1},_u.Z.get=function(){return 2},_u.M.get=function(){return 3},mu.prototype.setOrdinate=function(t,e,n){},mu.prototype.size=function(){},mu.prototype.getOrdinate=function(t,e){},mu.prototype.getCoordinate=function(){},mu.prototype.getCoordinateCopy=function(t){},mu.prototype.getDimension=function(){},mu.prototype.getX=function(t){},mu.prototype.clone=function(){},mu.prototype.expandEnvelope=function(t){},mu.prototype.copy=function(){},mu.prototype.getY=function(t){},mu.prototype.toCoordinateArray=function(){},mu.prototype.interfaces_=function(){return[tu]},mu.prototype.getClass=function(){return mu},Object.defineProperties(mu,_u);var xu=function(){},bu=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(xu),wu=function(){};wu.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},wu.getProperty=function(t){return{"line.separator":"\n"}[t]};var Eu=function t(){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 e=arguments[0];this.x=e.x,this.y=e.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 t&&arguments[1]instanceof t){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 nu&&arguments[1]instanceof nu){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],c=arguments[1],l=arguments[2];this.x=u,this.y=c,this.w=l}else if(4===arguments.length){var f=arguments[0],h=arguments[1],p=arguments[2],g=arguments[3],d=f.y-h.y,y=h.x-f.x,v=f.x*h.y-h.x*f.y,m=p.y-g.y,_=g.x-p.x,x=p.x*g.y-g.x*p.y;this.x=y*x-_*v,this.y=m*v-d*x,this.w=d*_-m*y}};Eu.prototype.getY=function(){var t=this.y/this.w;if(Ka.isNaN(t)||Ka.isInfinite(t))throw new bu;return t},Eu.prototype.getX=function(){var t=this.x/this.w;if(Ka.isNaN(t)||Ka.isInfinite(t))throw new bu;return t},Eu.prototype.getCoordinate=function(){var t=new nu;return t.x=this.getX(),t.y=this.getY(),t},Eu.prototype.interfaces_=function(){return[]},Eu.prototype.getClass=function(){return Eu},Eu.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,c=n.x*r.y-r.x*n.y,l=i*u-a*o,f=(o*c-u*s)/l,h=(a*s-i*c)/l;if(Ka.isNaN(f)||Ka.isInfinite(f)||Ka.isNaN(h)||Ka.isInfinite(h))throw new bu;return new nu(f,h)};var Iu=function t(){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 nu){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){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],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},Su={serialVersionUID:{configurable:!0}};Iu.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Iu.prototype.equals=function(t){if(!(t instanceof Iu))return!1;var e=t;return this.isNull()?e.isNull():this._maxx===e.getMaxX()&&this._maxy===e.getMaxY()&&this._minx===e.getMinX()&&this._miny===e.getMinY()},Iu.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Iu;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new Iu(e,r,n,i)},Iu.prototype.isNull=function(){return this._maxx<this._minx},Iu.prototype.getMaxX=function(){return this._maxx},Iu.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof nu){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof Iu){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},Iu.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Iu){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof nu){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},Iu.prototype.getMinY=function(){return this._miny},Iu.prototype.getMinX=function(){return this._minx},Iu.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof nu){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof Iu){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this._minx=e.getMinX(),this._maxx=e.getMaxX(),this._miny=e.getMinY(),this._maxy=e.getMaxY()):(e._minx<this._minx&&(this._minx=e._minx),e._maxx>this._maxx&&(this._maxx=e._maxx),e._miny<this._miny&&(this._miny=e._miny),e._maxy>this._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},Iu.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Iu.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Iu.prototype.compareTo=function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this._minx<e._minx?-1:this._minx>e._minx?1:this._miny<e._miny?-1:this._miny>e._miny?1:this._maxx<e._maxx?-1:this._maxx>e._maxx?1:this._maxy<e._maxy?-1:this._maxy>e._maxy?1:0},Iu.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Iu.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Iu.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Iu.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Iu.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Iu.prototype.expandBy=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()}},Iu.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Iu){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof nu){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Iu.prototype.centre=function(){return this.isNull()?null:new nu((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Iu.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof nu){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Iu){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},Iu.prototype.getMaxY=function(){return this._maxy},Iu.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Iu.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+nu.hashCode(this._minx))+nu.hashCode(this._maxx))+nu.hashCode(this._miny))+nu.hashCode(this._maxy)},Iu.prototype.interfaces_=function(){return[Qa,vi]},Iu.prototype.getClass=function(){return Iu},Iu.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),l=Math.max(r.x,i.x);return!(c>u||l<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),c=Math.min(r.y,i.y),l=Math.max(r.y,i.y),c>u||l<a))}},Su.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Iu,Su);var Nu={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Pu=function(t){this.geometryFactory=t||new Jc};Pu.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=Nu.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=Nu.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Lu[n]&&(e=Lu[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},Pu.prototype.write=function(t){return this.extractGeometry(t)},Pu.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Cu[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+Cu[e].apply(this,[t])+")"};var Cu={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Cu.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Cu.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Cu.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(Cu.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Cu.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+Cu.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+Cu.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Cu.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},Lu={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(Nu.spaces);return this.geometryFactory.createPoint(new nu(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Nu.trimParens,"$1"),r.push(Lu.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Nu.spaces),r.push(new nu(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(Nu.spaces),r.push(new nu(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(Nu.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Nu.trimParens,"$1"),r.push(Lu.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(Nu.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(Nu.trimParens,"$1"),n=Lu.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(Nu.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(Nu.trimParens,"$1"),r.push(Lu.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},Mu=function(t){this.parser=new Pu(t)};Mu.prototype.write=function(t){return this.parser.write(t)},Mu.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Ou=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Ru=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ou),Tu=function(){};Tu.prototype.interfaces_=function(){return[]},Tu.prototype.getClass=function(){return Tu},Tu.shouldNeverReachHere=function(){if(0===arguments.length)Tu.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new Ru("Should never reach here"+(null!==t?": "+t:""))}},Tu.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],Tu.isTrue(t,null);else if(2===arguments.length&&(t=arguments[0],e=arguments[1],!t))throw null===e?new Ru:new Ru(e)},Tu.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],Tu.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new Ru("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var Au=function(){this._result=null,this._inputLines=Array(2).fill().map((function(){return Array(2)})),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new nu,this._intPt[1]=new nu,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Fu={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Au.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},Au.prototype.getTopologySummary=function(){var t=new fu;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},Au.prototype.computeIntersection=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)},Au.prototype.getIntersectionNum=function(){return this._result},Au.prototype.computeIntLineIndex=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)}},Au.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Au.prototype.setPrecisionModel=function(t){this._precisionModel=t},Au.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},Au.prototype.getIntersection=function(t){return this._intPt[t]},Au.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Au.prototype.hasIntersection=function(){return this._result!==Au.NO_INTERSECTION},Au.prototype.getEdgeDistance=function(t,e){return Au.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},Au.prototype.isCollinear=function(){return this._result===Au.COLLINEAR_INTERSECTION},Au.prototype.toString=function(){return Mu.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Mu.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Au.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},Au.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},Au.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},Au.prototype.interfaces_=function(){return[]},Au.prototype.getClass=function(){return Au},Au.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return Tu.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},Au.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return Tu.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},Fu.DONT_INTERSECT.get=function(){return 0},Fu.DO_INTERSECT.get=function(){return 1},Fu.COLLINEAR.get=function(){return 2},Fu.NO_INTERSECTION.get=function(){return 0},Fu.POINT_INTERSECTION.get=function(){return 1},Fu.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Au,Fu);var Du=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new Iu(this._inputLines[0][0],this._inputLines[0][1]),n=new Iu(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,Iu.intersects(n,r,e)&&0===Gu.orientationIndex(n,r,e)&&0===Gu.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=Eu.intersection(t,n,r,i)}catch(s){if(!(s instanceof bu))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new nu(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=yu.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);wu.out.println("DD in env = "+s+"  --------------------- "+o),i.distance(o)>1e-4&&wu.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new nu(t),o=new nu(e),s=new nu(n),a=new nu(r),u=new nu;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Iu.intersects(e,n,r),s=Iu.intersects(e,n,i),a=Iu.intersects(r,i,e),u=Iu.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=n.x<r.x?n.x:r.x,l=n.y<r.y?n.y:r.y,f=n.x>r.x?n.x:r.x,h=n.y>r.y?n.y:r.y,p=((o>c?o:c)+(a<f?a:f))/2,g=((s>l?s:l)+(u<h?u:h))/2;i.x=p,i.y=g,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!Iu.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=Gu.orientationIndex(e,n,r),s=Gu.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=Gu.orientationIndex(r,i,e),u=Gu.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new nu(r):0===s?this._intPt[0]=new nu(i):0===a?this._intPt[0]=new nu(e):0===u&&(this._intPt[0]=new nu(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=Gu.distancePointLine(t,n,r),s=Gu.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=Gu.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=Gu.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(Au),ku=function(){};ku.prototype.interfaces_=function(){return[]},ku.prototype.getClass=function(){return ku},ku.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ku.signOfDet2x2(r,i,o,s)},ku.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var ju=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};ju.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(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=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ku.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},ju.prototype.isPointInPolygon=function(){return this.getLocation()!==su.EXTERIOR},ju.prototype.getLocation=function(){return this._isPointOnSegment?su.BOUNDARY:this._crossingCount%2==1?su.INTERIOR:su.EXTERIOR},ju.prototype.isOnSegment=function(){return this._isPointOnSegment},ju.prototype.interfaces_=function(){return[]},ju.prototype.getClass=function(){return ju},ju.locatePointInRing=function(){if(arguments[0]instanceof nu&&uu(arguments[1],mu)){for(var t=arguments[0],e=arguments[1],n=new ju(t),r=new nu,i=new nu,o=1;o<e.size();o++)if(e.getCoordinate(o,r),e.getCoordinate(o-1,i),n.countSegment(r,i),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof nu&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],u=new ju(s),c=1;c<a.length;c++){var l=a[c],f=a[c-1];if(u.countSegment(l,f),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var Gu=function(){},qu={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu},Gu.orientationIndex=function(t,e,n){return yu.orientationIndex(t,e,n)},Gu.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(uu(arguments[0],mu)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new nu,c=new nu,l=new nu;s.getCoordinate(0,c),s.getCoordinate(1,l);var f=c.x;l.x-=f;for(var h=0,p=1;p<a-1;p++)u.y=c.y,c.x=l.x,c.y=l.y,s.getCoordinate(p+1,l),l.x-=f,h+=c.x*(u.y-l.y);return h/2}},Gu.distanceLineLine=function(t,e,n,r){if(t.equals(e))return Gu.distancePointLine(t,n,r);if(n.equals(r))return Gu.distancePointLine(r,t,e);var i=!1;if(Iu.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?cu.min(Gu.distancePointLine(t,n,r),Gu.distancePointLine(e,n,r),Gu.distancePointLine(n,t,e),Gu.distancePointLine(r,t,e)):0},Gu.isPointInRing=function(t,e){return Gu.locatePointInRing(t,e)!==su.EXTERIOR},Gu.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new nu;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,c=a-i,l=u-o;n+=Math.sqrt(c*c+l*l),i=a,o=u}return n},Gu.isCCW=function(t){var e=t.length-1;if(e<3)throw new Ja("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var l=Gu.computeOrientation(u,n,c);return 0===l?u.x>c.x:l>0},Gu.locatePointInRing=function(t,e){return ju.locatePointInRing(t,e)},Gu.distancePointLinePerpendicular=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)},Gu.computeOrientation=function(t,e,n){return Gu.orientationIndex(t,e,n)},Gu.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new Ja("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=Gu.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),c=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(c<=0)return o.distance(s);if(c>=1)return o.distance(a);var l=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(l)*Math.sqrt(u)}},Gu.isOnLine=function(t,e){for(var n=new Du,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},qu.CLOCKWISE.get=function(){return-1},qu.RIGHT.get=function(){return Gu.CLOCKWISE},qu.COUNTERCLOCKWISE.get=function(){return 1},qu.LEFT.get=function(){return Gu.COUNTERCLOCKWISE},qu.COLLINEAR.get=function(){return 0},qu.STRAIGHT.get=function(){return Gu.COLLINEAR},Object.defineProperties(Gu,qu);var Bu=function(){};Bu.prototype.filter=function(t){},Bu.prototype.interfaces_=function(){return[]},Bu.prototype.getClass=function(){return Bu};var zu=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},Uu={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};zu.prototype.isGeometryCollection=function(){return this.getSortIndex()===zu.SORTINDEX_GEOMETRYCOLLECTION},zu.prototype.getFactory=function(){return this._factory},zu.prototype.getGeometryN=function(t){return this},zu.prototype.getArea=function(){return 0},zu.prototype.isRectangle=function(){return!1},zu.prototype.equals=function(){if(arguments[0]instanceof zu){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof zu))return!1;var n=e;return this.equalsExact(n)}},zu.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},zu.prototype.geometryChanged=function(){this.apply(zu.geometryChangedFilter)},zu.prototype.geometryChangedAction=function(){this._envelope=null},zu.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},zu.prototype.getLength=function(){return 0},zu.prototype.getNumGeometries=function(){return 1},zu.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},zu.prototype.getUserData=function(){return this._userData},zu.prototype.getSRID=function(){return this._SRID},zu.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},zu.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===zu.SORTINDEX_GEOMETRYCOLLECTION)throw new Ja("This method does not support GeometryCollection arguments")},zu.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},zu.prototype.norm=function(){var t=this.copy();return t.normalize(),t},zu.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},zu.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Iu(this._envelope)},zu.prototype.setSRID=function(t){this._SRID=t},zu.prototype.setUserData=function(t){this._userData=t},zu.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},zu.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},zu.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===zu.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===zu.SORTINDEX_MULTIPOINT||this.getSortIndex()===zu.SORTINDEX_MULTILINESTRING||this.getSortIndex()===zu.SORTINDEX_MULTIPOLYGON},zu.prototype.interfaces_=function(){return[tu,Qa,vi]},zu.prototype.getClass=function(){return zu},zu.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},zu.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},Uu.serialVersionUID.get=function(){return 0x799ea46522854c00},Uu.SORTINDEX_POINT.get=function(){return 0},Uu.SORTINDEX_MULTIPOINT.get=function(){return 1},Uu.SORTINDEX_LINESTRING.get=function(){return 2},Uu.SORTINDEX_LINEARRING.get=function(){return 3},Uu.SORTINDEX_MULTILINESTRING.get=function(){return 4},Uu.SORTINDEX_POLYGON.get=function(){return 5},Uu.SORTINDEX_MULTIPOLYGON.get=function(){return 6},Uu.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},Uu.geometryChangedFilter.get=function(){return Vu},Object.defineProperties(zu,Uu);var Vu=function(){};Vu.interfaces_=function(){return[Bu]},Vu.filter=function(t){t.geometryChangedAction()};var Xu=function(){};Xu.prototype.filter=function(t){},Xu.prototype.interfaces_=function(){return[]},Xu.prototype.getClass=function(){return Xu};var Yu=function(){},Wu={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};Yu.prototype.isInBoundary=function(t){},Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu},Wu.Mod2BoundaryNodeRule.get=function(){return Hu},Wu.EndPointBoundaryNodeRule.get=function(){return $u},Wu.MultiValentEndPointBoundaryNodeRule.get=function(){return Ju},Wu.MonoValentEndPointBoundaryNodeRule.get=function(){return Ku},Wu.MOD2_BOUNDARY_RULE.get=function(){return new Hu},Wu.ENDPOINT_BOUNDARY_RULE.get=function(){return new $u},Wu.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ju},Wu.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new Ku},Wu.OGC_SFS_BOUNDARY_RULE.get=function(){return Yu.MOD2_BOUNDARY_RULE},Object.defineProperties(Yu,Wu);var Hu=function(){};Hu.prototype.isInBoundary=function(t){return t%2==1},Hu.prototype.interfaces_=function(){return[Yu]},Hu.prototype.getClass=function(){return Hu};var $u=function(){};$u.prototype.isInBoundary=function(t){return t>0},$u.prototype.interfaces_=function(){return[Yu]},$u.prototype.getClass=function(){return $u};var Ju=function(){};Ju.prototype.isInBoundary=function(t){return t>1},Ju.prototype.interfaces_=function(){return[Yu]},Ju.prototype.getClass=function(){return Ju};var Ku=function(){};Ku.prototype.isInBoundary=function(t){return 1===t},Ku.prototype.interfaces_=function(){return[Yu]},Ku.prototype.getClass=function(){return Ku};var Zu=function(){};Zu.prototype.add=function(){},Zu.prototype.addAll=function(){},Zu.prototype.isEmpty=function(){},Zu.prototype.iterator=function(){},Zu.prototype.size=function(){},Zu.prototype.toArray=function(){},Zu.prototype.remove=function(){};var Qu=function(t){function e(e){t.call(this),this.message=e||""}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={name:{configurable:!0}};return n.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(e,n),e}(Error),tc=function(){};tc.prototype.hasNext=function(){},tc.prototype.next=function(){},tc.prototype.remove=function(){};var ec=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(Zu);(mi.prototype=new Error).name="NoSuchElementException";var nc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Zu&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,Zu]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new rc(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new Qu;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(ec),rc=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new mi;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(tc),ic=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=!1,i=e.iterator();i.hasNext();)this.add(i.next(),n),r=!0;return r}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof nu&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}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 a=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c<a.length;c++)this.add(a[c],u);else for(var l=a.length-1;l>=0;l--)this.add(a[l],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof nu){var f=arguments[0],h=arguments[1];if(!arguments[2]){var p=this.size();if(p>0){if(f>0&&this.get(f-1).equals2D(h))return null;if(f<p&&this.get(f).equals2D(h))return null}}t.prototype.add.call(this,f,h)}}else if(4===arguments.length){var g=arguments[0],d=arguments[1],y=arguments[2],v=arguments[3],m=1;y>v&&(m=-1);for(var _=y;_!==v;_+=m)this.add(g[_],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new nu(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(nc),oc=function(){},sc={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};sc.ForwardComparator.get=function(){return ac},sc.BidirectionalComparator.get=function(){return uc},sc.coordArrayType.get=function(){return new Array(0).fill(null)},oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc},oc.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},oc.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(oc.indexOf(r,e)<0)return r}return null},oc.scroll=function(t,e){var n=oc.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);wu.arraycopy(t,n,r,0,t.length-n),wu.arraycopy(t,0,r,t.length-n,n),wu.arraycopy(r,0,t,0,t.length)},oc.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},oc.intersection=function(t,e){for(var n=new ic,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},oc.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},oc.removeRepeatedPoints=function(t){return oc.hasRepeatedPoints(t)?new ic(t,!1).toCoordinateArray():t},oc.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},oc.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},oc.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new nu(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new nu(r[i+u])},oc.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},oc.envelope=function(t){for(var e=new Iu,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},oc.toCoordinateArray=function(t){return t.toArray(oc.coordArrayType)},oc.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},oc.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},oc.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},oc.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},oc.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},oc.extract=function(t,e,n){e=cu.clamp(e,0,t.length);var r=(n=cu.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(oc,sc);var ac=function(){};ac.prototype.compare=function(t,e){return oc.compare(t,e)},ac.prototype.interfaces_=function(){return[eu]},ac.prototype.getClass=function(){return ac};var uc=function(){};uc.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=oc.compare(n,r);return oc.isEqualReversed(n,r)?0:i},uc.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=oc.increasingDirection(n),o=oc.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var c=n[s].compareTo(r[a]);if(0!==c)return c;s+=i,a+=o}return 0},uc.prototype.interfaces_=function(){return[eu]},uc.prototype.getClass=function(){return uc};var cc=function(){};cc.prototype.get=function(){},cc.prototype.put=function(){},cc.prototype.size=function(){},cc.prototype.values=function(){},cc.prototype.entrySet=function(){};var lc=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(cc);(_i.prototype=new Error).name="OperationNotSupported",(xi.prototype=new Zu).contains=function(){};var fc=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof Zu&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new hc(this)},e}(xi),hc=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new mi;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new _i},e}(tc),pc=0;(Ni.prototype=new lc).get=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},Ni.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:pc,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 s={key:t,left:null,right:null,value:e,parent:n,color:pc,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},Ni.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(wi(t)===Ii(wi(wi(t)))){var e=Si(wi(wi(t)));1===bi(e)?(Ei(wi(t),pc),Ei(e,pc),Ei(wi(wi(t)),1),t=wi(wi(t))):(t===Si(wi(t))&&(t=wi(t),this.rotateLeft(t)),Ei(wi(t),pc),Ei(wi(wi(t)),1),this.rotateRight(wi(wi(t))))}else{var n=Ii(wi(wi(t)));1===bi(n)?(Ei(wi(t),pc),Ei(n,pc),Ei(wi(wi(t)),1),t=wi(wi(t))):(t===Ii(wi(t))&&(t=wi(t),this.rotateRight(t)),Ei(wi(t),pc),Ei(wi(wi(t)),1),this.rotateLeft(wi(wi(t))))}this.root_.color=pc},Ni.prototype.values=function(){var t=new nc,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=Ni.successor(e));)t.add(e.value);return t},Ni.prototype.entrySet=function(){var t=new fc,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=Ni.successor(e));)t.add(e);return t},Ni.prototype.rotateLeft=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}},Ni.prototype.rotateRight=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}},Ni.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},Ni.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},Ni.prototype.size=function(){return this.size_};var gc=function(){};gc.prototype.interfaces_=function(){return[]},gc.prototype.getClass=function(){return gc},Pi.prototype=new xi,(Ci.prototype=new Pi).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},Ci.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},Ci.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},Ci.prototype.remove=function(t){throw new _i},Ci.prototype.size=function(){return this.array_.length},Ci.prototype.isEmpty=function(){return 0===this.array_.length},Ci.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},Ci.prototype.iterator=function(){return new dc(this)};var dc=function(t){this.treeSet_=t,this.position_=0};dc.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new mi;return this.treeSet_.array_[this.position_++]},dc.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},dc.prototype.remove=function(){throw new _i};var yc=function(){};yc.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},yc.asList=function(t){for(var e=new nc,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var vc=function(){},mc={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};mc.P.get=function(){return 0},mc.L.get=function(){return 1},mc.A.get=function(){return 2},mc.FALSE.get=function(){return-1},mc.TRUE.get=function(){return-2},mc.DONTCARE.get=function(){return-3},mc.SYM_FALSE.get=function(){return"F"},mc.SYM_TRUE.get=function(){return"T"},mc.SYM_DONTCARE.get=function(){return"*"},mc.SYM_P.get=function(){return"0"},mc.SYM_L.get=function(){return"1"},mc.SYM_A.get=function(){return"2"},vc.prototype.interfaces_=function(){return[]},vc.prototype.getClass=function(){return vc},vc.toDimensionSymbol=function(t){switch(t){case vc.FALSE:return vc.SYM_FALSE;case vc.TRUE:return vc.SYM_TRUE;case vc.DONTCARE:return vc.SYM_DONTCARE;case vc.P:return vc.SYM_P;case vc.L:return vc.SYM_L;case vc.A:return vc.SYM_A}throw new Ja("Unknown dimension value: "+t)},vc.toDimensionValue=function(t){switch(pu.toUpperCase(t)){case vc.SYM_FALSE:return vc.FALSE;case vc.SYM_TRUE:return vc.TRUE;case vc.SYM_DONTCARE:return vc.DONTCARE;case vc.SYM_P:return vc.P;case vc.SYM_L:return vc.L;case vc.SYM_A:return vc.A}throw new Ja("Unknown dimension symbol: "+t)},Object.defineProperties(vc,mc);var _c=function(){};_c.prototype.filter=function(t){},_c.prototype.interfaces_=function(){return[]},_c.prototype.getClass=function(){return _c};var xc=function(){};xc.prototype.filter=function(t,e){},xc.prototype.isDone=function(){},xc.prototype.isGeometryChanged=function(){},xc.prototype.interfaces_=function(){return[]},xc.prototype.getClass=function(){return xc};var bc=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new Ja("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new Iu,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();yc.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=vc.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=vc.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new Ci(yc.asList(this._geometries)),n=new Ci(yc.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o=r,s=this.getNumGeometries(),a=o.getNumGeometries(),u=0;u<s&&u<a;){var c=this.getGeometryN(u),l=o.getGeometryN(u),f=c.compareToSameClass(l,i);if(0!==f)return f;u++}return u<s?1:u<a?-1:0}},e.prototype.apply=function(){if(uu(arguments[0],Xu))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(uu(arguments[0],xc)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(uu(arguments[0],_c)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(uu(arguments[0],Bu)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Tu.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(zu),wc=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return zu.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?vc.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Ec(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[gc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(bc),Ec=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=Yu.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Ec.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Ec.prototype.getBoundary=function(){return this._geom instanceof Cc?this.boundaryLineString(this._geom):this._geom instanceof wc?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Ec.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Ec.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Ec.prototype.computeBoundaryCoordinates=function(t){var e=new nc;this._endpointMap=new Ni;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return oc.toCoordinateArray(e)},Ec.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Ic,this._endpointMap.put(t,e)),e.count++},Ec.prototype.interfaces_=function(){return[]},Ec.prototype.getClass=function(){return Ec},Ec.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new Ec(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Ec(e,n).getBoundary()}};var Ic=function(){this.count=null};Ic.prototype.interfaces_=function(){return[]},Ic.prototype.getClass=function(){return Ic};var Sc=function(){},Nc={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Sc.prototype.interfaces_=function(){return[]},Sc.prototype.getClass=function(){return Sc},Sc.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Sc.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(Sc.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Sc.NEWLINE}catch(t){if(!(t instanceof Li))throw t;Tu.shouldNeverReachHere()}return o}},Sc.split=function(t,e){for(var n=e.length,r=new nc,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u);return a},Sc.toString=function(){if(1===arguments.length){var t=arguments[0];return Sc.SIMPLE_ORDINATE_FORMAT.format(t)}},Sc.spaces=function(t){return Sc.chars(" ",t)},Nc.NEWLINE.get=function(){return wu.getProperty("line.separator")},Nc.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Sc,Nc);var Pc=function(){};Pc.prototype.interfaces_=function(){return[]},Pc.prototype.getClass=function(){return Pc},Pc.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Pc.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,mu.X)===t.getOrdinate(e-1,mu.X)&&t.getOrdinate(0,mu.Y)===t.getOrdinate(e-1,mu.Y)},Pc.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||Ka.isNaN(s)&&Ka.isNaN(a)))return!1}return!0},Pc.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Pc.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Pc.copy(e,i-1,r,o,1);return r},Pc.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Pc.swap(t,r,e-r)},Pc.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Pc.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Pc.copyCoord(t,e+o,n,r+o)},Pc.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new fu;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(Sc.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Pc.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Pc.createClosedRing(t,e,4):e.getOrdinate(0,mu.X)===e.getOrdinate(n-1,mu.X)&&e.getOrdinate(0,mu.Y)===e.getOrdinate(n-1,mu.Y)?e:Pc.createClosedRing(t,e,n+1)},Pc.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Pc.copy(e,0,r,0,i);for(var o=i;o<n;o++)Pc.copy(e,0,r,o,1);return r};var Cc=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Iu:this._points.expandEnvelope(new Iu)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Pc.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?vc.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return Gu.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Pc.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(uu(arguments[0],Xu))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(uu(arguments[0],xc)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(uu(arguments[0],_c)||uu(arguments[0],Bu))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Ec(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new Ja("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[gc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(zu),Lc=function(){};Lc.prototype.interfaces_=function(){return[]},Lc.prototype.getClass=function(){return Lc};var Mc=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Iu;var t=new Iu;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return vc.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(uu(arguments[0],Xu)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(uu(arguments[0],xc)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(uu(arguments[0],_c)||uu(arguments[0],Bu))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),Tu.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Lc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(zu),Oc=function(){};Oc.prototype.interfaces_=function(){return[]},Oc.prototype.getClass=function(){return Oc};var Rc=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new Ja("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new Ja("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(Gu.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(Gu.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),c=t.getY(a);if(u!==o==(c!==s))return!1;o=u,s=c}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);yc.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);wu.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=oc.minCoordinate(e.getCoordinates());oc.scroll(r,i),wu.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],Gu.isCCW(e.getCoordinates())===n&&oc.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[0],i=arguments[1],o=r,s=this._shell,a=o._shell,u=s.compareToSameClass(a,i);if(0!==u)return u;for(var c=this.getNumInteriorRing(),l=o.getNumInteriorRing(),f=0;f<c&&f<l;){var h=this.getInteriorRingN(f),p=o.getInteriorRingN(f),g=h.compareToSameClass(p,i);if(0!==g)return g;f++}return f<c?1:f<l?-1:0}},e.prototype.apply=function(t){if(uu(t,Xu)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(uu(t,xc)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(uu(t,_c))t.filter(this);else if(uu(t,Bu)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[Oc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(zu),Tc=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return zu.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return vc.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Lc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(bc),Ac=function(t){function e(e,n){e instanceof nu&&n instanceof Jc&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return zu.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return vc.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Pc.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new Ja("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new Ja("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Cc),Fc=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return zu.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new nc,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Oc]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(bc),Dc=function(t){this._factory=t||null,this._isUserDataCopied=!1},kc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};Dc.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},Dc.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},Dc.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof bc?this.editGeometryCollection(t,e):t instanceof Rc?this.editPolygon(t,e):t instanceof Mc||t instanceof Cc?e.edit(t,this._factory):(Tu.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},Dc.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new nc,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===Tc?this._factory.createMultiPoint(r.toArray([])):n.getClass()===wc?this._factory.createMultiLineString(r.toArray([])):n.getClass()===Fc?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},Dc.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new nc,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Dc.GeometryEditorOperation=function(){},kc.NoOpGeometryOperation.get=function(){return jc},kc.CoordinateOperation.get=function(){return Gc},kc.CoordinateSequenceOperation.get=function(){return qc},Object.defineProperties(Dc,kc);var jc=function(){};jc.prototype.edit=function(t,e){return t},jc.prototype.interfaces_=function(){return[Dc.GeometryEditorOperation]},jc.prototype.getClass=function(){return jc};var Gc=function(){};Gc.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof Ac?e.createLinearRing(n):t instanceof Cc?e.createLineString(n):t instanceof Mc?n.length>0?e.createPoint(n[0]):e.createPoint():t},Gc.prototype.interfaces_=function(){return[Dc.GeometryEditorOperation]},Gc.prototype.getClass=function(){return Gc};var qc=function(){};qc.prototype.edit=function(t,e){return t instanceof Ac?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Cc?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Mc?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},qc.prototype.interfaces_=function(){return[Dc.GeometryEditorOperation]},qc.prototype.getClass=function(){return qc};var Bc=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new nu}else if(uu(arguments[0],mu)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)this._coordinates[u]=new nu}},zc={serialVersionUID:{configurable:!0}};Bc.prototype.setOrdinate=function(t,e,n){switch(e){case mu.X:this._coordinates[t].x=n;break;case mu.Y:this._coordinates[t].y=n;break;case mu.Z:this._coordinates[t].z=n;break;default:throw new Ja("invalid ordinateIndex")}},Bc.prototype.size=function(){return this._coordinates.length},Bc.prototype.getOrdinate=function(t,e){switch(e){case mu.X:return this._coordinates[t].x;case mu.Y:return this._coordinates[t].y;case mu.Z:return this._coordinates[t].z}return Ka.NaN},Bc.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},Bc.prototype.getCoordinateCopy=function(t){return new nu(this._coordinates[t])},Bc.prototype.getDimension=function(){return this._dimension},Bc.prototype.getX=function(t){return this._coordinates[t].x},Bc.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new Bc(t,this._dimension)},Bc.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},Bc.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new Bc(t,this._dimension)},Bc.prototype.toString=function(){if(this._coordinates.length>0){var t=new fu(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},Bc.prototype.getY=function(t){return this._coordinates[t].y},Bc.prototype.toCoordinateArray=function(){return this._coordinates},Bc.prototype.interfaces_=function(){return[mu,vi]},Bc.prototype.getClass=function(){return Bc},zc.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(Bc,zc);var Uc=function(){},Vc={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Uc.prototype.readResolve=function(){return Uc.instance()},Uc.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new Bc(t)}if(uu(arguments[0],mu)){var e=arguments[0];return new Bc(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new Bc(n):new Bc(n,r)}},Uc.prototype.interfaces_=function(){return[ou,vi]},Uc.prototype.getClass=function(){return Uc},Uc.instance=function(){return Uc.instanceObject},Vc.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},Vc.instanceObject.get=function(){return new Uc},Object.defineProperties(Uc,Vc);var Xc=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new nc,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new fc;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(cc),Yc=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof Hc){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},Wc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Yc.prototype.equals=function(t){if(!(t instanceof Yc))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},Yc.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new hu(n).compareTo(new hu(r))},Yc.prototype.getScale=function(){return this._scale},Yc.prototype.isFloating=function(){return this._modelType===Yc.FLOATING||this._modelType===Yc.FLOATING_SINGLE},Yc.prototype.getType=function(){return this._modelType},Yc.prototype.toString=function(){var t="UNKNOWN";return this._modelType===Yc.FLOATING?t="Floating":this._modelType===Yc.FLOATING_SINGLE?t="Floating-Single":this._modelType===Yc.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},Yc.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return Ka.isNaN(t)||this._modelType===Yc.FLOATING_SINGLE?t:this._modelType===Yc.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof nu){var e=arguments[0];if(this._modelType===Yc.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},Yc.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===Yc.FLOATING?t=16:this._modelType===Yc.FLOATING_SINGLE?t=6:this._modelType===Yc.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},Yc.prototype.setScale=function(t){this._scale=Math.abs(t)},Yc.prototype.interfaces_=function(){return[vi,Qa]},Yc.prototype.getClass=function(){return Yc},Yc.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},Wc.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},Wc.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Yc,Wc);var Hc=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},$c={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Hc.prototype.readResolve=function(){return Hc.nameToTypeMap.get(this._name)},Hc.prototype.toString=function(){return this._name},Hc.prototype.interfaces_=function(){return[vi]},Hc.prototype.getClass=function(){return Hc},$c.serialVersionUID.get=function(){return-552860263173159e4},$c.nameToTypeMap.get=function(){return new Xc},Object.defineProperties(Hc,$c),Yc.Type=Hc,Yc.FIXED=new Hc("FIXED"),Yc.FLOATING=new Hc("FLOATING"),Yc.FLOATING_SINGLE=new Hc("FLOATING SINGLE");var Jc=function t(){this._precisionModel=new Yc,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?uu(arguments[0],ou)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Yc&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Kc={serialVersionUID:{configurable:!0}};Jc.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new nu(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new nu(t.getMinX(),t.getMinY()),new nu(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new nu(t.getMinX(),t.getMinY()),new nu(t.getMinX(),t.getMaxY()),new nu(t.getMaxX(),t.getMaxY()),new nu(t.getMaxX(),t.getMinY()),new nu(t.getMinX(),t.getMinY())]),null)},Jc.prototype.createLineString=function(t){return t?t instanceof Array?new Cc(this.getCoordinateSequenceFactory().create(t),this):uu(t,mu)?new Cc(t,this):void 0:new Cc(this.getCoordinateSequenceFactory().create([]),this)},Jc.prototype.createMultiLineString=function(){if(0===arguments.length)return new wc(null,this);if(1===arguments.length){var t=arguments[0];return new wc(t,this)}},Jc.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(Jc.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Rc)return this.createMultiPolygon(Jc.toPolygonArray(t));if(a instanceof Cc)return this.createMultiLineString(Jc.toLineStringArray(t));if(a instanceof Mc)return this.createMultiPoint(Jc.toPointArray(t));Tu.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},Jc.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},Jc.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof nu){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(uu(arguments[0],mu)){var e=arguments[0];return new Mc(e,this)}}},Jc.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Jc.prototype.createPolygon=function(){if(0===arguments.length)return new Rc(null,null,this);if(1===arguments.length){if(uu(arguments[0],mu)){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 Ac){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new Rc(r,i,this)}},Jc.prototype.getSRID=function(){return this._SRID},Jc.prototype.createGeometryCollection=function(){if(0===arguments.length)return new bc(null,this);if(1===arguments.length){var t=arguments[0];return new bc(t,this)}},Jc.prototype.createGeometry=function(t){return new Dc(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},Jc.prototype.getPrecisionModel=function(){return this._precisionModel},Jc.prototype.createLinearRing=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(uu(arguments[0],mu)){var e=arguments[0];return new Ac(e,this)}}},Jc.prototype.createMultiPolygon=function(){if(0===arguments.length)return new Fc(null,this);if(1===arguments.length){var t=arguments[0];return new Fc(t,this)}},Jc.prototype.createMultiPoint=function(){if(0===arguments.length)return new Tc(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new Tc(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(uu(arguments[0],mu)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i<n.size();i++){var o=this.getCoordinateSequenceFactory().create(1,n.getDimension());Pc.copy(n,i,o,0,1),r[i]=this.createPoint(o)}return this.createMultiPoint(r)}}},Jc.prototype.interfaces_=function(){return[vi]},Jc.prototype.getClass=function(){return Jc},Jc.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.getDefaultCoordinateSequenceFactory=function(){return Uc.instance()},Jc.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},Jc.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},Kc.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(Jc,Kc);var Zc=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Qc=function(t){this.geometryFactory=t||new Jc};Qc.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!tl[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==Zc.indexOf(n)?tl[n].apply(this,[e.coordinates]):"GeometryCollection"===n?tl[n].apply(this,[e.geometries]):tl[n].apply(this,[e])},Qc.prototype.write=function(t){var e=t.getGeometryType();if(!el[e])throw new Error("Geometry is not supported");return el[e].apply(this,[t])};var tl={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!tl[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=tl.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new nu(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new nu(t[0],t[1]),new nu(t[2],t[1]),new nu(t[2],t[3]),new nu(t[0],t[3]),new nu(t[0],t[1])])},Point:function(t){var e=new nu(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(tl.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=tl.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(tl.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=tl.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=tl.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(tl.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},el={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:el.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=el.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(el.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=el.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=el.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=el.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=el.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(el[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},nl=function(t){this.geometryFactory=t||new Jc,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Qc(this.geometryFactory)};nl.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===Yc.FIXED&&this.reducePrecision(e),e},nl.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var rl=function(){this.parser=new Qc(this.geometryFactory)};rl.prototype.write=function(t){return this.parser.write(t)};var il=function(){},ol={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il},il.opposite=function(t){return t===il.LEFT?il.RIGHT:t===il.RIGHT?il.LEFT:t},ol.ON.get=function(){return 0},ol.LEFT.get=function(){return 1},ol.RIGHT.get=function(){return 2},Object.defineProperties(il,ol),(Mi.prototype=new Error).name="EmptyStackException",(Oi.prototype=new ec).add=function(t){return this.array_.push(t),!0},Oi.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},Oi.prototype.push=function(t){return this.array_.push(t),t},Oi.prototype.pop=function(t){if(0===this.array_.length)throw new Mi;return this.array_.pop()},Oi.prototype.peek=function(){if(0===this.array_.length)throw new Mi;return this.array_[this.array_.length-1]},Oi.prototype.empty=function(){return 0===this.array_.length},Oi.prototype.isEmpty=function(){return this.empty()},Oi.prototype.search=function(t){return this.array_.indexOf(t)},Oi.prototype.size=function(){return this.array_.length},Oi.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var sl=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};sl.prototype.getCoordinate=function(){return this._minCoord},sl.prototype.getRightmostSide=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},sl.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();Tu.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=Gu.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===Gu.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===Gu.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},sl.prototype.getRightmostSideOfSegment=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=il.LEFT;return n[e].y<n[e+1].y&&(r=il.RIGHT),r},sl.prototype.getEdge=function(){return this._orientedDe},sl.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},sl.prototype.findRightmostEdgeAtNode=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)},sl.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}Tu.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)===il.LEFT&&(this._orientedDe=this._minDe.getSym())},sl.prototype.interfaces_=function(){return[]},sl.prototype.getClass=function(){return sl};var al=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new nu(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Ou),ul=function(){this.array_=[]};ul.prototype.addLast=function(t){this.array_.push(t)},ul.prototype.removeFirst=function(){return this.array_.shift()},ul.prototype.isEmpty=function(){return 0===this.array_.length};var cl=function(){this._finder=null,this._dirEdgeList=new nc,this._nodes=new nc,this._rightMostCoord=null,this._env=null,this._finder=new sl};cl.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},cl.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},cl.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new al("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},cl.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(il.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},cl.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},cl.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(il.RIGHT)>=1&&e.getDepth(il.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},cl.prototype.computeDepths=function(t){var e=new fc,n=new ul,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 s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},cl.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},cl.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Iu,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},cl.prototype.addReachable=function(t){var e=new Oi;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},cl.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(il.LEFT,t.getDepth(il.RIGHT)),e.setDepth(il.RIGHT,t.getDepth(il.LEFT))},cl.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},cl.prototype.getNodes=function(){return this._nodes},cl.prototype.getDirectedEdges=function(){return this._dirEdgeList},cl.prototype.interfaces_=function(){return[Qa]},cl.prototype.getClass=function(){return cl};var ll=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[il.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[il.ON]=o,this.location[il.LEFT]=s,this.location[il.RIGHT]=a}};ll.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},ll.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==su.NONE)return!1;return!0},ll.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===su.NONE&&(this.location[e]=t)},ll.prototype.isLine=function(){return 1===this.location.length},ll.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[il.ON]=this.location[il.ON],e[il.LEFT]=su.NONE,e[il.RIGHT]=su.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===su.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},ll.prototype.getLocations=function(){return this.location},ll.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[il.LEFT];this.location[il.LEFT]=this.location[il.RIGHT],this.location[il.RIGHT]=t},ll.prototype.toString=function(){var t=new fu;return this.location.length>1&&t.append(su.toLocationSymbol(this.location[il.LEFT])),t.append(su.toLocationSymbol(this.location[il.ON])),this.location.length>1&&t.append(su.toLocationSymbol(this.location[il.RIGHT])),t.toString()},ll.prototype.setLocations=function(t,e,n){this.location[il.ON]=t,this.location[il.LEFT]=e,this.location[il.RIGHT]=n},ll.prototype.get=function(t){return t<this.location.length?this.location[t]:su.NONE},ll.prototype.isArea=function(){return this.location.length>1},ll.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===su.NONE)return!0;return!1},ll.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(il.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},ll.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(su.NONE)},ll.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},ll.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},ll.prototype.interfaces_=function(){return[]},ll.prototype.getClass=function(){return ll};var fl=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new ll(e),this.elt[1]=new ll(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new ll(n.elt[0]),this.elt[1]=new ll(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new ll(su.NONE),this.elt[1]=new ll(su.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new ll(o,s,a),this.elt[1]=new ll(o,s,a)}else if(4===arguments.length){var u=arguments[0],c=arguments[1],l=arguments[2],f=arguments[3];this.elt[0]=new ll(su.NONE,su.NONE,su.NONE),this.elt[1]=new ll(su.NONE,su.NONE,su.NONE),this.elt[u].setLocations(c,l,f)}};fl.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},fl.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},fl.prototype.isNull=function(t){return this.elt[t].isNull()},fl.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},fl.prototype.isLine=function(t){return this.elt[t].isLine()},fl.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new ll(t.elt[e]):this.elt[e].merge(t.elt[e])},fl.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},fl.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(il.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},fl.prototype.toString=function(){var t=new fu;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},fl.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},fl.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},fl.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(il.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},fl.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},fl.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},fl.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new ll(this.elt[t].location[0]))},fl.prototype.interfaces_=function(){return[]},fl.prototype.getClass=function(){return fl},fl.toLineLabel=function(t){for(var e=new fl(su.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var hl=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new nc,this._pts=new nc,this._label=new fl(su.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new nc,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};hl.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=Gu.isCCW(this._ring.getCoordinates())},hl.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},hl.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new al("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new al("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();Tu.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},hl.prototype.getLinearRing=function(){return this._ring},hl.prototype.getCoordinate=function(t){return this._pts.get(t)},hl.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},hl.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},hl.prototype.isHole=function(){return this._isHole},hl.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},hl.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!Gu.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},hl.prototype.addHole=function(t){this._holes.add(t)},hl.prototype.isShell=function(){return null===this._shell},hl.prototype.getLabel=function(){return this._label},hl.prototype.getEdges=function(){return this._edges},hl.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},hl.prototype.getShell=function(){return this._shell},hl.prototype.mergeLabel=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[0],n=arguments[1],r=e.getLocation(n,il.RIGHT);if(r===su.NONE)return null;if(this._label.getLocation(n)===su.NONE)return this._label.setLocation(n,r),null}},hl.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},hl.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},hl.prototype.interfaces_=function(){return[]},hl.prototype.getClass=function(){return hl};var pl=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hl),gl=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new nc,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new pl(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hl),dl=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}};dl.prototype.setVisited=function(t){this._isVisited=t},dl.prototype.setInResult=function(t){this._isInResult=t},dl.prototype.isCovered=function(){return this._isCovered},dl.prototype.isCoveredSet=function(){return this._isCoveredSet},dl.prototype.setLabel=function(t){this._label=t},dl.prototype.getLabel=function(){return this._label},dl.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},dl.prototype.updateIM=function(t){Tu.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},dl.prototype.isInResult=function(){return this._isInResult},dl.prototype.isVisited=function(){return this._isVisited},dl.prototype.interfaces_=function(){return[]},dl.prototype.getClass=function(){return dl};var yl=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new fl(0,su.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=su.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==su.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new fl(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof fl)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===su.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=su.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case su.BOUNDARY:n=su.INTERIOR;break;case su.INTERIOR:default:n=su.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(dl),vl=function(){this.nodeMap=new Ni,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};vl.prototype.find=function(t){return this.nodeMap.get(t)},vl.prototype.addNode=function(){if(arguments[0]instanceof nu){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 yl){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},vl.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},vl.prototype.iterator=function(){return this.nodeMap.values().iterator()},vl.prototype.values=function(){return this.nodeMap.values()},vl.prototype.getBoundaryNodes=function(t){for(var e=new nc,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===su.BOUNDARY&&e.add(r)}return e},vl.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},vl.prototype.interfaces_=function(){return[]},vl.prototype.getClass=function(){return vl};var ml=function(){},_l={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ml.prototype.interfaces_=function(){return[]},ml.prototype.getClass=function(){return ml},ml.isNorthern=function(t){return t===ml.NE||t===ml.NW},ml.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},ml.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},ml.isInHalfPlane=function(t,e){return e===ml.SE?t===ml.SE||t===ml.SW:t===e||t===e+1},ml.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new Ja("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?ml.NE:ml.SE:e>=0?ml.NW:ml.SW}if(arguments[0]instanceof nu&&arguments[1]instanceof nu){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new Ja("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?ml.NE:ml.SE:r.y>=n.y?ml.NW:ml.SW}},_l.NE.get=function(){return 0},_l.NW.get=function(){return 1},_l.SW.get=function(){return 2},_l.SE.get=function(){return 3},Object.defineProperties(ml,_l);var xl=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};xl.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:Gu.computeOrientation(t._p0,t._p1,this._p1)},xl.prototype.getDy=function(){return this._dy},xl.prototype.getCoordinate=function(){return this._p0},xl.prototype.setNode=function(t){this._node=t},xl.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print("  "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+"   "+this._label)},xl.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},xl.prototype.getDirectedCoordinate=function(){return this._p1},xl.prototype.getDx=function(){return this._dx},xl.prototype.getLabel=function(){return this._label},xl.prototype.getEdge=function(){return this._edge},xl.prototype.getQuadrant=function(){return this._quadrant},xl.prototype.getNode=function(){return this._node},xl.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return"  "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+"   "+this._label},xl.prototype.computeLabel=function(t){},xl.prototype.init=function(t,e){this._p0=t,this._p1=e,this._dx=e.x-t.x,this._dy=e.y-t.y,this._quadrant=ml.quadrant(this._dx,this._dy),Tu.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},xl.prototype.interfaces_=function(){return[Qa]},xl.prototype.getClass=function(){return xl};var bl=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new fl(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new al("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,il.LEFT)===su.INTERIOR&&this._label.getLocation(e,il.RIGHT)===su.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[il.LEFT]+"/"+this._depth[il.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,su.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,su.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===il.LEFT&&(r=-1);var i=il.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===su.EXTERIOR&&e===su.INTERIOR?1:t===su.INTERIOR&&e===su.EXTERIOR?-1:0},e}(xl),wl=function(){};wl.prototype.createNode=function(t){return new yl(t,null)},wl.prototype.interfaces_=function(){return[]},wl.prototype.getClass=function(){return wl};var El=function(){if(this._edges=new nc,this._nodes=null,this._edgeEndList=new nc,0===arguments.length)this._nodes=new vl(new wl);else if(1===arguments.length){var t=arguments[0];this._nodes=new vl(t)}};El.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},El.prototype.find=function(t){return this._nodes.find(t)},El.prototype.addNode=function(){if(arguments[0]instanceof yl){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof nu){var e=arguments[0];return this._nodes.addNode(e)}},El.prototype.getNodeIterator=function(){return this._nodes.iterator()},El.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},El.prototype.debugPrintln=function(t){wu.out.println(t)},El.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===su.BOUNDARY},El.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},El.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&Gu.computeOrientation(t,e,r)===Gu.COLLINEAR&&ml.quadrant(t,e)===ml.quadrant(n,r)},El.prototype.getEdgeEnds=function(){return this._edgeEndList},El.prototype.debugPrint=function(t){wu.out.print(t)},El.prototype.getEdgeIterator=function(){return this._edges.iterator()},El.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},El.prototype.insertEdge=function(t){this._edges.add(t)},El.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},El.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new bl(n,!0),i=new bl(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},El.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},El.prototype.getNodes=function(){return this._nodes.values()},El.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},El.prototype.interfaces_=function(){return[]},El.prototype.getClass=function(){return El},El.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Il=function(){this._geometryFactory=null,this._shellList=new nc;var t=arguments[0];this._geometryFactory=t};Il.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Il.prototype.computePolygons=function(t){for(var e=new nc,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Il.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new al("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Il.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new nc,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Il.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Il.prototype.buildMaximalEdgeRings=function(t){for(var e=new nc,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new gl(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Il.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Il.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Il.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),c=u.getLinearRing(),l=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var f=!1;l.contains(r)&&Gu.isPointInRing(i,c.getCoordinates())&&(f=!0),f&&(null===o||s.contains(l))&&(o=u)}return o},Il.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return Tu.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Il.prototype.add=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];El.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new nc,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Il.prototype.interfaces_=function(){return[]},Il.prototype.getClass=function(){return Il};var Sl=function(){};Sl.prototype.getBounds=function(){},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl};var Nl=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};Nl.prototype.getItem=function(){return this._item},Nl.prototype.getBounds=function(){return this._bounds},Nl.prototype.interfaces_=function(){return[Sl,vi]},Nl.prototype.getClass=function(){return Nl};var Pl=function(){this._size=null,this._items=null,this._size=0,this._items=new nc,this._items.add(null)};Pl.prototype.poll=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},Pl.prototype.size=function(){return this._size},Pl.prototype.reorder=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)},Pl.prototype.clear=function(){this._size=0,this._items.clear()},Pl.prototype.isEmpty=function(){return 0===this._size},Pl.prototype.add=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)},Pl.prototype.interfaces_=function(){return[]},Pl.prototype.getClass=function(){return Pl};var Cl=function(){};Cl.prototype.visitItem=function(t){},Cl.prototype.interfaces_=function(){return[]},Cl.prototype.getClass=function(){return Cl};var Ll=function(){};Ll.prototype.insert=function(t,e){},Ll.prototype.remove=function(t,e){},Ll.prototype.query=function(){},Ll.prototype.interfaces_=function(){return[]},Ll.prototype.getClass=function(){return Ll};var Ml=function(){if(this._childBoundables=new nc,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Ol={serialVersionUID:{configurable:!0}};Ml.prototype.getLevel=function(){return this._level},Ml.prototype.size=function(){return this._childBoundables.size()},Ml.prototype.getChildBoundables=function(){return this._childBoundables},Ml.prototype.addChildBoundable=function(t){Tu.isTrue(null===this._bounds),this._childBoundables.add(t)},Ml.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ml.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ml.prototype.interfaces_=function(){return[Sl,vi]},Ml.prototype.getClass=function(){return Ml},Ol.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ml,Ol);var Rl=function(){};Rl.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Rl.min=function(t){return Rl.sort(t),t.get(0)},Rl.sort=function(t,e){var n=t.toArray();e?yc.sort(n,e):yc.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},Rl.singletonList=function(t){var e=new nc;return e.add(t),e};var Tl=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};Tl.prototype.expandToQueue=function(t,e){var n=Tl.isComposite(this._boundable1),r=Tl.isComposite(this._boundable2);if(n&&r)return Tl.area(this._boundable1)>Tl.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new Ja("neither boundable is composite")},Tl.prototype.isLeaves=function(){return!(Tl.isComposite(this._boundable1)||Tl.isComposite(this._boundable2))},Tl.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},Tl.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new Tl(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},Tl.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},Tl.prototype.getDistance=function(){return this._distance},Tl.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},Tl.prototype.interfaces_=function(){return[Qa]},Tl.prototype.getClass=function(){return Tl},Tl.area=function(t){return t.getBounds().getArea()},Tl.isComposite=function(t){return t instanceof Ml};var Al=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new nc,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];Tu.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},Fl={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};Al.prototype.getNodeCapacity=function(){return this._nodeCapacity},Al.prototype.lastNode=function(t){return t.get(t.size()-1)},Al.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Ml?t+=this.size(n):n instanceof Nl&&(t+=1)}return t}},Al.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof Nl&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},Al.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new nc:t}if(1===arguments.length){for(var e=arguments[0],n=new nc,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ml){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof Nl?n.add(i.getItem()):Tu.shouldNeverReachHere()}return n.size()<=0?null:n}},Al.prototype.insert=function(t,e){Tu.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Nl(t,e))},Al.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new nc;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(Tu.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Ml?this.boundablesAtLevel(n,s,i):(Tu.isTrue(s instanceof Nl),-1===n&&i.add(s))}return null}},Al.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new nc;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(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.query(n,this._root,r)}else if(3===arguments.length)if(uu(arguments[2],Cl)&&arguments[0]instanceof Object&&arguments[1]instanceof Ml)for(var i=arguments[0],o=arguments[1],s=arguments[2],a=o.getChildBoundables(),u=0;u<a.size();u++){var c=a.get(u);this.getIntersectsOp().intersects(c.getBounds(),i)&&(c instanceof Ml?this.query(i,c,s):c instanceof Nl?s.visitItem(c.getItem()):Tu.shouldNeverReachHere())}else if(uu(arguments[2],ec)&&arguments[0]instanceof Object&&arguments[1]instanceof Ml)for(var l=arguments[0],f=arguments[1],h=arguments[2],p=f.getChildBoundables(),g=0;g<p.size();g++){var d=p.get(g);this.getIntersectsOp().intersects(d.getBounds(),l)&&(d instanceof Ml?this.query(l,d,h):d instanceof Nl?h.add(d.getItem()):Tu.shouldNeverReachHere())}},Al.prototype.build=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},Al.prototype.getRoot=function(){return this.build(),this._root},Al.prototype.remove=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 s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Ml&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},Al.prototype.createHigherLevels=function(t,e){Tu.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},Al.prototype.depth=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 Ml){var r=this.depth(n);r>t&&(t=r)}}return t+1}},Al.prototype.createParentBoundables=function(t,e){Tu.isTrue(!t.isEmpty());var n=new nc;n.add(this.createNode(e));var r=new nc(t);Rl.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},Al.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},Al.prototype.interfaces_=function(){return[vi]},Al.prototype.getClass=function(){return Al},Al.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},Fl.IntersectsOp.get=function(){return Dl},Fl.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},Fl.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(Al,Fl);var Dl=function(){},kl=function(){};kl.prototype.distance=function(t,e){},kl.prototype.interfaces_=function(){return[]},kl.prototype.getClass=function(){return kl};var jl=function(t){function e(n){n=n||e.DEFAULT_NODE_CAPACITY,t.call(this,n)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return e.prototype.createParentBoundablesFromVerticalSlices=function(t,e){Tu.isTrue(t.length>0);for(var n=new nc,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},e.prototype.createNode=function(t){return new Gl(t)},e.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},e.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},e.prototype.getIntersectsOp=function(){return e.intersectsOp},e.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new nc;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},e.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(uu(arguments[2],Cl)&&arguments[0]instanceof Object&&arguments[1]instanceof Ml){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(uu(arguments[2],ec)&&arguments[0]instanceof Object&&arguments[1]instanceof Ml){var a=arguments[0],u=arguments[1],c=arguments[2];t.prototype.query.call(this,a,u,c)}},e.prototype.getComparator=function(){return e.yComparator},e.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},e.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},e.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},e.prototype.createParentBoundables=function(t,n){Tu.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new nc(t);Rl.sort(i,e.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,n)},e.prototype.nearestNeighbour=function(){if(1===arguments.length){if(uu(arguments[0],kl)){var t=arguments[0],n=new Tl(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(n)}if(arguments[0]instanceof Tl){var r=arguments[0];return this.nearestNeighbour(r,Ka.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof e&&uu(arguments[1],kl)){var i=arguments[0],o=arguments[1],s=new Tl(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof Tl&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],c=null,l=new Pl;for(l.add(a);!l.isEmpty()&&u>0;){var f=l.poll(),h=f.getDistance();if(h>=u)break;f.isLeaves()?(u=h,c=f):f.expandToQueue(l,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var p=arguments[0],g=arguments[1],d=arguments[2],y=new Nl(p,g),v=new Tl(this.getRoot(),y,d);return this.nearestNeighbour(v)[0]}},e.prototype.interfaces_=function(){return[Ll,vi]},e.prototype.getClass=function(){return e},e.centreX=function(t){return e.avg(t.getMinX(),t.getMaxX())},e.avg=function(t,e){return(t+e)/2},e.centreY=function(t){return e.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return Gl},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[eu]},compare:function(n,r){return t.compareDoubles(e.centreX(n.getBounds()),e.centreX(r.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[eu]},compare:function(n,r){return t.compareDoubles(e.centreY(n.getBounds()),e.centreY(r.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(e,n),e}(Al),Gl=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new Iu(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ml),ql=function(){};ql.prototype.interfaces_=function(){return[]},ql.prototype.getClass=function(){return ql},ql.relativeSign=function(t,e){return t<e?-1:t>e?1:0},ql.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=ql.relativeSign(e.x,n.x),i=ql.relativeSign(e.y,n.y);switch(t){case 0:return ql.compareValue(r,i);case 1:return ql.compareValue(i,r);case 2:return ql.compareValue(i,-r);case 3:return ql.compareValue(-r,i);case 4:return ql.compareValue(-r,-i);case 5:return ql.compareValue(-i,-r);case 6:return ql.compareValue(-i,r);case 7:return ql.compareValue(r,-i)}return Tu.shouldNeverReachHere("invalid octant value"),0},ql.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var Bl=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 nu(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};Bl.prototype.getCoordinate=function(){return this.coord},Bl.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},Bl.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:ql.compare(this._segmentOctant,this.coord,e.coord)},Bl.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},Bl.prototype.isInterior=function(){return this._isInterior},Bl.prototype.interfaces_=function(){return[Qa]},Bl.prototype.getClass=function(){return Bl};var zl=function(){this._nodeMap=new Ni,this._edge=null;var t=arguments[0];this._edge=t};zl.prototype.getSplitCoordinates=function(){var t=new ic;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()},zl.prototype.addCollapsedNodes=function(){var t=new nc;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)}},zl.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},zl.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new hu(e+1))}},zl.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new nu(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new nu(e.coord))},zl.prototype.iterator=function(){return this._nodeMap.values().iterator()},zl.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},zl.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},zl.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new hu(e[0])),r=i}},zl.prototype.getEdge=function(){return this._edge},zl.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},zl.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new nu(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new nu(e.coord)),new Yl(o,this._edge.getData())},zl.prototype.add=function(t,e){var n=new Bl(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(Tu.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},zl.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Ou("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Ou("bad split edge end point at "+i)},zl.prototype.interfaces_=function(){return[]},zl.prototype.getClass=function(){return zl};var Ul=function(){};Ul.prototype.interfaces_=function(){return[]},Ul.prototype.getClass=function(){return Ul},Ul.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new Ja("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof nu&&arguments[1]instanceof nu){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new Ja("Cannot compute the octant for two identical points "+i);return Ul.octant(s,a)}};var Vl=function(){};Vl.prototype.getCoordinates=function(){},Vl.prototype.size=function(){},Vl.prototype.getCoordinate=function(t){},Vl.prototype.isClosed=function(){},Vl.prototype.setData=function(t){},Vl.prototype.getData=function(){},Vl.prototype.interfaces_=function(){return[]},Vl.prototype.getClass=function(){return Vl};var Xl=function(){};Xl.prototype.addIntersection=function(t,e){},Xl.prototype.interfaces_=function(){return[Vl]},Xl.prototype.getClass=function(){return Xl};var Yl=function(){this._nodeList=new zl(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Yl.prototype.getCoordinates=function(){return this._pts},Yl.prototype.size=function(){return this._pts.length},Yl.prototype.getCoordinate=function(t){return this._pts[t]},Yl.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Yl.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},Yl.prototype.setData=function(t){this._data=t},Yl.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:Ul.octant(t,e)},Yl.prototype.getData=function(){return this._data},Yl.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new nu(n.getIntersection(i));this.addIntersection(o,r)}},Yl.prototype.toString=function(){return Mu.toLineString(new Bc(this._pts))},Yl.prototype.getNodeList=function(){return this._nodeList},Yl.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},Yl.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},Yl.prototype.interfaces_=function(){return[Xl]},Yl.prototype.getClass=function(){return Yl},Yl.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new nc;return Yl.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(r)};var Wl=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new nu,this.p1=new nu;else if(1===arguments.length){var t=arguments[0];this.p0=new nu(t.p0),this.p1=new nu(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new nu(e,n),this.p1=new nu(r,i)}},Hl={serialVersionUID:{configurable:!0}};Wl.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},Wl.prototype.orientationIndex=function(){if(arguments[0]instanceof Wl){var t=arguments[0],e=Gu.orientationIndex(this.p0,this.p1,t.p0),n=Gu.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof nu){var r=arguments[0];return Gu.orientationIndex(this.p0,this.p1,r)}},Wl.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},Wl.prototype.isVertical=function(){return this.p0.x===this.p1.x},Wl.prototype.equals=function(t){if(!(t instanceof Wl))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},Wl.prototype.intersection=function(t){var e=new Du;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},Wl.prototype.project=function(){if(arguments[0]instanceof nu){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new nu(t);var e=this.projectionFactor(t),n=new nu;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof Wl){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new Wl(s,a)}},Wl.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Wl.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Wl.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},Wl.prototype.distancePerpendicular=function(t){return Gu.distancePointLinePerpendicular(t,this.p0,this.p1)},Wl.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Wl.prototype.midPoint=function(){return Wl.midPoint(this.p0,this.p1)},Wl.prototype.projectionFactor=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?Ka.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},Wl.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=Ka.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},Wl.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},Wl.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},Wl.prototype.getLength=function(){return this.p0.distance(this.p1)},Wl.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},Wl.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},Wl.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&(this.p1.equals(t.p1)||this.p0.equals(t.p1))&&this.p1.equals(t.p0)},Wl.prototype.lineIntersection=function(t){try{return Eu.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof bu))throw t}return null},Wl.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},Wl.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new nu(n-u,r+a)},Wl.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},Wl.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||Ka.isNaN(e))&&(e=1),e},Wl.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Wl.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Wl.prototype.distance=function(){if(arguments[0]instanceof Wl){var t=arguments[0];return Gu.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof nu){var e=arguments[0];return Gu.distancePointLine(e,this.p0,this.p1)}},Wl.prototype.pointAlong=function(t){var e=new nu;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},Wl.prototype.hashCode=function(){var t=Ka.doubleToLongBits(this.p0.x);t^=31*Ka.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=Ka.doubleToLongBits(this.p1.x);return n^=31*Ka.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},Wl.prototype.interfaces_=function(){return[Qa,vi]},Wl.prototype.getClass=function(){return Wl},Wl.midPoint=function(t,e){return new nu((t.x+e.x)/2,(t.y+e.y)/2)},Hl.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Wl,Hl);var $l=function(){this.tempEnv1=new Iu,this.tempEnv2=new Iu,this._overlapSeg1=new Wl,this._overlapSeg2=new Wl};$l.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];t.getLineSegment(e,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},$l.prototype.interfaces_=function(){return[]},$l.prototype.getClass=function(){return $l};var Jl=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};Jl.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},Jl.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)},Jl.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},Jl.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},Jl.prototype.setId=function(t){this._id=t},Jl.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},Jl.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new Iu(t,e)}return this._env},Jl.prototype.getEndIndex=function(){return this._end},Jl.prototype.getStartIndex=function(){return this._start},Jl.prototype.getContext=function(){return this._context},Jl.prototype.getId=function(){return this._id},Jl.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],c=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var l=Math.trunc((t+e)/2),f=Math.trunc((r+i)/2);t<l&&(r<f&&this.computeOverlapsInternal(t,l,n,r,f,o),f<i&&this.computeOverlapsInternal(t,l,n,f,i,o)),l<e&&(r<f&&this.computeOverlapsInternal(l,e,n,r,f,o),f<i&&this.computeOverlapsInternal(l,e,n,f,i,o))},Jl.prototype.interfaces_=function(){return[]},Jl.prototype.getClass=function(){return Jl};var Kl=function(){};Kl.prototype.interfaces_=function(){return[]},Kl.prototype.getClass=function(){return Kl},Kl.getChainStartIndices=function(t){var e=0,n=new nc;n.add(new hu(e));do{var r=Kl.findChainEnd(t,e);n.add(new hu(r)),e=r}while(e<t.length-1);return Kl.toIntArray(n)},Kl.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=ml.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||ml.quadrant(t[i-1],t[i])===r);)i++;return i-1},Kl.getChains=function(){if(1===arguments.length){var t=arguments[0];return Kl.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new nc,i=Kl.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new Jl(e,i[o],i[o+1],n);r.add(s)}return r}},Kl.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Zl=function(){};Zl.prototype.computeNodes=function(t){},Zl.prototype.getNodedSubstrings=function(){},Zl.prototype.interfaces_=function(){return[]},Zl.prototype.getClass=function(){return Zl};var Ql=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};Ql.prototype.setSegmentIntersector=function(t){this._segInt=t},Ql.prototype.interfaces_=function(){return[Zl]},Ql.prototype.getClass=function(){return Ql};var tf=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new nc,this._index=new jl,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return Yl.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=Kl.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new ef(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return ef},Object.defineProperties(e,n),e}(Ql),ef=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3],o=e.getContext(),s=r.getContext();this._si.processIntersections(o,n,s,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}($l),nf=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}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],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},rf={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};nf.prototype.getEndCapStyle=function(){return this._endCapStyle},nf.prototype.isSingleSided=function(){return this._isSingleSided},nf.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=nf.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=nf.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==nf.JOIN_ROUND&&(this._quadrantSegments=nf.DEFAULT_QUADRANT_SEGMENTS)},nf.prototype.getJoinStyle=function(){return this._joinStyle},nf.prototype.setJoinStyle=function(t){this._joinStyle=t},nf.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},nf.prototype.getSimplifyFactor=function(){return this._simplifyFactor},nf.prototype.getQuadrantSegments=function(){return this._quadrantSegments},nf.prototype.setEndCapStyle=function(t){this._endCapStyle=t},nf.prototype.getMitreLimit=function(){return this._mitreLimit},nf.prototype.setMitreLimit=function(t){this._mitreLimit=t},nf.prototype.setSingleSided=function(t){this._isSingleSided=t},nf.prototype.interfaces_=function(){return[]},nf.prototype.getClass=function(){return nf},nf.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},rf.CAP_ROUND.get=function(){return 1},rf.CAP_FLAT.get=function(){return 2},rf.CAP_SQUARE.get=function(){return 3},rf.JOIN_ROUND.get=function(){return 1},rf.JOIN_MITRE.get=function(){return 2},rf.JOIN_BEVEL.get=function(){return 3},rf.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},rf.DEFAULT_MITRE_LIMIT.get=function(){return 5},rf.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(nf,rf);var of=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Gu.COUNTERCLOCKWISE,this._inputLine=t||null},sf={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};of.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},of.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=of.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},of.prototype.isShallowConcavity=function(t,e,n,r){return Gu.computeOrientation(t,e,n)===this._angleOrientation&&Gu.distancePointLine(e,t,n)<r},of.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/of.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},of.prototype.isConcave=function(t,e,n){return Gu.computeOrientation(t,e,n)===this._angleOrientation},of.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=Gu.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},of.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===of.DELETE;)e++;return e},of.prototype.isShallow=function(t,e,n,r){return Gu.distancePointLine(e,t,n)<r},of.prototype.collapseLine=function(){for(var t=new ic,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==of.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},of.prototype.interfaces_=function(){return[]},of.prototype.getClass=function(){return of},of.simplify=function(t,e){return new of(t).simplify(e)},sf.INIT.get=function(){return 0},sf.DELETE.get=function(){return 1},sf.KEEP.get=function(){return 1},sf.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(of,sf);var af=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new nc},uf={COORDINATE_ARRAY_TYPE:{configurable:!0}};af.prototype.getCoordinates=function(){return this._ptList.toArray(af.COORDINATE_ARRAY_TYPE)},af.prototype.setPrecisionModel=function(t){this._precisionModel=t},af.prototype.addPt=function(t){var e=new nu(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},af.prototype.revere=function(){},af.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},af.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},af.prototype.toString=function(){return(new Jc).createLineString(this.getCoordinates()).toString()},af.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new nu(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},af.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},af.prototype.interfaces_=function(){return[]},af.prototype.getClass=function(){return af},uf.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(af,uf);var cf=function(){},lf={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf},cf.toDegrees=function(t){return 180*t/Math.PI},cf.normalize=function(t){for(;t>Math.PI;)t-=cf.PI_TIMES_2;for(;t<=-Math.PI;)t+=cf.PI_TIMES_2;return t},cf.angle=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)}},cf.isAcute=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},cf.isObtuse=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},cf.interiorAngle=function(t,e,n){var r=cf.angle(e,t),i=cf.angle(e,n);return Math.abs(i-r)},cf.normalizePositive=function(t){if(t<0){for(;t<0;)t+=cf.PI_TIMES_2;t>=cf.PI_TIMES_2&&(t=0)}else{for(;t>=cf.PI_TIMES_2;)t-=cf.PI_TIMES_2;t<0&&(t=0)}return t},cf.angleBetween=function(t,e,n){var r=cf.angle(e,t),i=cf.angle(e,n);return cf.diff(r,i)},cf.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},cf.toRadians=function(t){return t*Math.PI/180},cf.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?cf.COUNTERCLOCKWISE:n<0?cf.CLOCKWISE:cf.NONE},cf.angleBetweenOriented=function(t,e,n){var r=cf.angle(e,t),i=cf.angle(e,n)-r;return i<=-Math.PI?i+cf.PI_TIMES_2:i>Math.PI?i-cf.PI_TIMES_2:i},lf.PI_TIMES_2.get=function(){return 2*Math.PI},lf.PI_OVER_2.get=function(){return Math.PI/2},lf.PI_OVER_4.get=function(){return Math.PI/4},lf.COUNTERCLOCKWISE.get=function(){return Gu.COUNTERCLOCKWISE},lf.CLOCKWISE.get=function(){return Gu.CLOCKWISE},lf.NONE.get=function(){return Gu.COLLINEAR},Object.defineProperties(cf,lf);var ff=function t(){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 Wl,this._seg1=new Wl,this._offset0=new Wl,this._offset1=new Wl,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new Du,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===nf.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},hf={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};ff.prototype.addNextSegment=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=Gu.computeOrientation(this._s0,this._s1,this._s2),r=n===Gu.CLOCKWISE&&this._side===il.LEFT||n===Gu.COUNTERCLOCKWISE&&this._side===il.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},ff.prototype.addLineEndCap=function(t,e){var n=new Wl(t,e),r=new Wl;this.computeOffsetSegment(n,il.LEFT,this._distance,r);var i=new Wl;this.computeOffsetSegment(n,il.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case nf.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,Gu.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case nf.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case nf.CAP_SQUARE:var u=new nu;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new nu(r.p1.x+u.x,r.p1.y+u.y),l=new nu(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l)}},ff.prototype.getCoordinates=function(){return this._segList.getCoordinates()},ff.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Eu.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof bu))throw t;o=new nu(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},ff.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,l=Math.atan2(c,u);r===Gu.CLOCKWISE?a<=l&&(a+=2*Math.PI):a>=l&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,l,r,i),this._segList.addPt(n)},ff.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*ff.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===nf.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===nf.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(e&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,t,this._distance),this._segList.addPt(this._offset1.p0))},ff.prototype.createSquare=function(t){this._segList.addPt(new nu(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new nu(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new nu(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new nu(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},ff.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},ff.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},ff.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},ff.prototype.initSideSegments=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)},ff.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=cf.angle(i,this._seg0.p0),s=cf.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=cf.normalize(o+s),u=cf.normalize(a+Math.PI),c=r*n,l=n-c*Math.abs(Math.sin(s)),f=i.x+c*Math.cos(u),h=i.y+c*Math.sin(u),p=new nu(f,h),g=new Wl(i,p),d=g.pointAlongOffset(1,l),y=g.pointAlongOffset(1,-l);this._side===il.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},ff.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===il.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=i*n*o/a,c=i*n*s/a;r.p0.x=t.p0.x-c,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-c,r.p1.y=t.p1.y+u},ff.prototype.addFilletArc=function(t,e,n,r,i){var o=r===Gu.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,c=0,l=new nu;c<s;){var f=e+o*c;l.x=t.x+i*Math.cos(f),l.y=t.y+i*Math.sin(f),this._segList.addPt(l),c+=u}},ff.prototype.addInsideTurn=function(t,e){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*ff.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new nu((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(n);var r=new nu((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(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},ff.prototype.createCircle=function(t){var e=new nu(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ff.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},ff.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new af,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*ff.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ff.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===nf.JOIN_BEVEL||this._bufParams.getJoinStyle()===nf.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Gu.CLOCKWISE,this._distance))},ff.prototype.closeRing=function(){this._segList.closeRing()},ff.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ff.prototype.interfaces_=function(){return[]},ff.prototype.getClass=function(){return ff},hf.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},hf.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},hf.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},hf.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ff,hf);var pf=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};pf.prototype.getOffsetCurve=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&&oc.reverse(o),o},pf.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=of.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],il.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=of.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],il.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},pf.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===il.RIGHT&&(r=-r);var i=of.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},pf.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=of.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],il.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=of.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],il.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},pf.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case nf.CAP_ROUND:e.createCircle(t);break;case nf.CAP_SQUARE:e.createSquare(t)}},pf.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===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()},pf.prototype.getBufferParameters=function(){return this._bufParams},pf.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},pf.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return pf.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},pf.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=of.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],il.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=of.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],il.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},pf.prototype.getSegGen=function(t){return new ff(this._precisionModel,this._bufParams,t)},pf.prototype.interfaces_=function(){return[]},pf.prototype.getClass=function(){return pf},pf.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new nu(t[n]);return e};var gf=function(){this._subgraphs=null,this._seg=new Wl,this._cga=new Gu;var t=arguments[0];this._subgraphs=t},df={DepthSegment:{configurable:!0}};gf.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new nc,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(uu(arguments[2],ec)&&arguments[0]instanceof nu&&arguments[1]instanceof bl){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++)if(this._seg.p0=u[c],this._seg.p1=u[c+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||Gu.computeOrientation(this._seg.p0,this._seg.p1,o)===Gu.RIGHT)){var l=s.getDepth(il.LEFT);this._seg.p0.equals(u[c])||(l=s.getDepth(il.RIGHT));var f=new yf(this._seg,l);a.add(f)}}else if(uu(arguments[2],ec)&&arguments[0]instanceof nu&&uu(arguments[1],ec))for(var h=arguments[0],p=arguments[1],g=arguments[2],d=p.iterator();d.hasNext();){var y=d.next();y.isForward()&&this.findStabbedSegments(h,y,g)}},gf.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Rl.min(e)._leftDepth},gf.prototype.interfaces_=function(){return[]},gf.prototype.getClass=function(){return gf},df.DepthSegment.get=function(){return yf},Object.defineProperties(gf,df);var yf=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new Wl(t),this._leftDepth=e};yf.prototype.compareTo=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)},yf.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},yf.prototype.toString=function(){return this._upwardSeg.toString()},yf.prototype.interfaces_=function(){return[Qa]},yf.prototype.getClass=function(){return yf};var vf=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};vf.prototype.area=function(){return vf.area(this.p0,this.p1,this.p2)},vf.prototype.signedArea=function(){return vf.signedArea(this.p0,this.p1,this.p2)},vf.prototype.interpolateZ=function(t){if(null===t)throw new Ja("Supplied point is null.");return vf.interpolateZ(t,this.p0,this.p1,this.p2)},vf.prototype.longestSideLength=function(){return vf.longestSideLength(this.p0,this.p1,this.p2)},vf.prototype.isAcute=function(){return vf.isAcute(this.p0,this.p1,this.p2)},vf.prototype.circumcentre=function(){return vf.circumcentre(this.p0,this.p1,this.p2)},vf.prototype.area3D=function(){return vf.area3D(this.p0,this.p1,this.p2)},vf.prototype.centroid=function(){return vf.centroid(this.p0,this.p1,this.p2)},vf.prototype.inCentre=function(){return vf.inCentre(this.p0,this.p1,this.p2)},vf.prototype.interfaces_=function(){return[]},vf.prototype.getClass=function(){return vf},vf.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},vf.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},vf.det=function(t,e,n,r){return t*r-e*n},vf.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,l=s*c-a*u,f=t.x-i,h=t.y-o,p=(c*f-a*h)/l,g=(-u*f+s*h)/l;return e.z+p*(n.z-e.z)+g*(r.z-e.z)},vf.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},vf.isAcute=function(t,e,n){return!!cf.isAcute(t,e,n)&&!!cf.isAcute(e,n,t)&&!!cf.isAcute(n,t,e)},vf.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,c=2*vf.det(o,s,a,u),l=vf.det(s,o*o+s*s,u,a*a+u*u),f=vf.det(o,o*o+s*s,a,a*a+u*u);return new nu(r-l/c,i+f/c)},vf.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new Eu(t.x+n/2,t.y+r/2,1),o=new Eu(t.x-r+n/2,t.y+n+r/2,1);return new Eu(i,o)},vf.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new nu(t.x+i*o,t.y+i*s)},vf.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,c=i*u-o*a,l=o*s-r*u,f=r*a-i*s,h=c*c+l*l+f*f;return Math.sqrt(h)/2},vf.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new nu(r,i)},vf.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new nu(a,u)};var mf=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new nc;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};mf.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,su.EXTERIOR,su.INTERIOR)},mf.prototype.addPolygon=function(t){var e=this._distance,n=il.LEFT;this._distance<0&&(e=-this._distance,n=il.RIGHT);var r=t.getExteriorRing(),i=oc.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,su.EXTERIOR,su.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=oc.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,il.opposite(n),su.INTERIOR,su.EXTERIOR)}},mf.prototype.isTriangleErodedCompletely=function(t,e){var n=new vf(t[0],t[1],t[2]),r=n.inCentre();return Gu.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},mf.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=oc.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,su.EXTERIOR,su.INTERIOR)},mf.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new Yl(t,new fl(0,su.BOUNDARY,e,n));this._curveList.add(r)},mf.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},mf.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<Ac.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=Ac.MINIMUM_VALID_SIZE&&Gu.isCCW(t)&&(o=i,s=r,n=il.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},mf.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Rc?this.addPolygon(t):t instanceof Cc?this.addLineString(t):t instanceof Mc?this.addPoint(t):(t instanceof Tc||t instanceof wc||t instanceof Fc||t instanceof bc)&&this.addCollection(t)},mf.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},mf.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},mf.prototype.interfaces_=function(){return[]},mf.prototype.getClass=function(){return mf};var _f=function(){};_f.prototype.locate=function(t){},_f.prototype.interfaces_=function(){return[]},_f.prototype.getClass=function(){return _f};var xf=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()};xf.prototype.next=function(){if(this._atStart)return this._atStart=!1,xf.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new mi;var t=this._parent.getGeometryN(this._index++);return t instanceof bc?(this._subcollectionIterator=new xf(t),this._subcollectionIterator.next()):t},xf.prototype.remove=function(){throw new Error(this.getClass().getName())},xf.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},xf.prototype.interfaces_=function(){return[tc]},xf.prototype.getClass=function(){return xf},xf.isAtomic=function(t){return!(t instanceof bc)};var bf=function(){this._geom=null;var t=arguments[0];this._geom=t};bf.prototype.locate=function(t){return bf.locate(t,this._geom)},bf.prototype.interfaces_=function(){return[_f]},bf.prototype.getClass=function(){return bf},bf.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&Gu.isPointInRing(t,e.getCoordinates())},bf.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!bf.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(bf.isPointInRing(t,i))return!1}return!0},bf.containsPoint=function(t,e){if(e instanceof Rc)return bf.containsPointInPolygon(t,e);if(e instanceof bc)for(var n=new xf(e);n.hasNext();){var r=n.next();if(r!==e&&bf.containsPoint(t,r))return!0}return!1},bf.locate=function(t,e){return e.isEmpty()?su.EXTERIOR:bf.containsPoint(t,e)?su.INTERIOR:su.EXTERIOR};var wf=function(){this._edgeMap=new Ni,this._edgeList=null,this._ptInAreaLocation=[su.NONE,su.NONE]};wf.prototype.getNextCW=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)},wf.prototype.propagateSideLabels=function(t){for(var e=su.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,il.LEFT)!==su.NONE&&(e=r.getLocation(t,il.LEFT))}if(e===su.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,il.ON)===su.NONE&&a.setLocation(t,il.ON,i),a.isArea(t)){var u=a.getLocation(t,il.LEFT),c=a.getLocation(t,il.RIGHT);if(c!==su.NONE){if(c!==i)throw new al("side location conflict",s.getCoordinate());u===su.NONE&&Tu.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else Tu.isTrue(a.getLocation(t,il.LEFT)===su.NONE,"found single null side"),a.setLocation(t,il.RIGHT,i),a.setLocation(t,il.LEFT,i)}}},wf.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},wf.prototype.print=function(t){wu.out.println("EdgeEndStar:   "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},wf.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},wf.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,il.LEFT);Tu.isTrue(r!==su.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();Tu.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,il.LEFT),u=s.getLocation(t,il.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},wf.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},wf.prototype.iterator=function(){return this.getEdges().iterator()},wf.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new nc(this._edgeMap.values())),this._edgeList},wf.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===su.NONE&&(this._ptInAreaLocation[t]=bf.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},wf.prototype.toString=function(){var t=new fu;t.append("EdgeEndStar:   "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},wf.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},wf.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===su.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),u=0;u<2;u++)if(a.isAnyNull(u)){var c=su.NONE;if(e[u])c=su.EXTERIOR;else{var l=s.getCoordinate();c=this.getLocation(u,l,t)}a.setAllLocationsIfNull(u,c)}},wf.prototype.getDegree=function(){return this._edgeMap.size()},wf.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},wf.prototype.interfaces_=function(){return[]},wf.prototype.getClass=function(){return wf};var Ef=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new al("no outgoing dirEdge found",this.getCoordinate());Tu.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return ml.isNorthern(i)&&ml.isNorthern(o)?n:ml.isNorthern(i)||ml.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(Tu.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){wu.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new nc;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=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)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(il.LEFT),r=t.getDepth(il.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new al("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=o;u<s;u++){var c=this._edgeList.get(u);c.setEdgeDepths(il.RIGHT,a),a=c.getDepth(il.LEFT)}return a}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,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&&(Tu.isTrue(null!==e,"found null for first outgoing dirEdge"),Tu.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=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}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=su.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=su.INTERIOR;break}if(r.isInResult()){t=su.EXTERIOR;break}}}if(t===su.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===su.INTERIOR):(s.isInResult()&&(i=su.EXTERIOR),a.isInResult()&&(i=su.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new fl(su.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==su.INTERIOR&&o!==su.BOUNDARY||this._label.setLocation(i,su.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wf),If=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new yl(t,new Ef)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wl),Sf=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Sf.prototype.compareTo=function(t){var e=t;return Sf.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Sf.prototype.interfaces_=function(){return[Qa]},Sf.prototype.getClass=function(){return Sf},Sf.orientation=function(t){return 1===oc.increasingDirection(t)},Sf.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,c=r?0:n.length-1;;){var l=t[u].compareTo(n[c]);if(0!==l)return l;var f=(u+=i)===s,h=(c+=o)===a;if(f&&!h)return-1;if(!f&&h)return 1;if(f&&h)return 0}};var Nf=function(){this._edges=new nc,this._ocaMap=new Ni};Nf.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(")  ")},Nf.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Nf.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Nf.prototype.iterator=function(){return this._edges.iterator()},Nf.prototype.getEdges=function(){return this._edges},Nf.prototype.get=function(t){return this._edges.get(t)},Nf.prototype.findEqualEdge=function(t){var e=new Sf(t.getCoordinates());return this._ocaMap.get(e)},Nf.prototype.add=function(t){this._edges.add(t);var e=new Sf(t.getCoordinates());this._ocaMap.put(e,t)},Nf.prototype.interfaces_=function(){return[]},Nf.prototype.getClass=function(){return Nf};var Pf=function(){};Pf.prototype.processIntersections=function(t,e,n,r){},Pf.prototype.isDone=function(){},Pf.prototype.interfaces_=function(){return[]},Pf.prototype.getClass=function(){return Pf};var Cf=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this._li=t};Cf.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Cf.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Cf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Cf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Cf.prototype.getLineIntersector=function(){return this._li},Cf.prototype.hasProperIntersection=function(){return this._hasProper},Cf.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Cf.prototype.hasIntersection=function(){return this._hasIntersection},Cf.prototype.isDone=function(){return!1},Cf.prototype.hasInteriorIntersection=function(){return this._hasInterior},Cf.prototype.interfaces_=function(){return[Pf]},Cf.prototype.getClass=function(){return Cf},Cf.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Lf=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new nu(t),this.segmentIndex=e,this.dist=n};Lf.prototype.getSegmentIndex=function(){return this.segmentIndex},Lf.prototype.getCoordinate=function(){return this.coord},Lf.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Lf.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Lf.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Lf.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Lf.prototype.getDistance=function(){return this.dist},Lf.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Lf.prototype.interfaces_=function(){return[Qa]},Lf.prototype.getClass=function(){return Lf};var Mf=function(){this._nodeMap=new Ni,this.edge=null;var t=arguments[0];this.edge=t};Mf.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Mf.prototype.iterator=function(){return this._nodeMap.values().iterator()},Mf.prototype.addSplitEdges=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}},Mf.prototype.addEndpoints=function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},Mf.prototype.createSplitEdge=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),s=0;o[s++]=new nu(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new Ff(o,new fl(this.edge._label))},Mf.prototype.add=function(t,e,n){var r=new Lf(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Mf.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Mf.prototype.interfaces_=function(){return[]},Mf.prototype.getClass=function(){return Mf};var Of=function(){};Of.prototype.getChainStartIndices=function(t){var e=0,n=new nc;n.add(new hu(e));do{var r=this.findChainEnd(t,e);n.add(new hu(r)),e=r}while(e<t.length-1);return Of.toIntArray(n)},Of.prototype.findChainEnd=function(t,e){for(var n=ml.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&ml.quadrant(t[r-1],t[r])===n;)r++;return r-1},Of.prototype.interfaces_=function(){return[]},Of.prototype.getClass=function(){return Of},Of.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Rf=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Iu,this.env2=new Iu;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Of;this.startIndex=e.getChainStartIndices(this.pts)};Rf.prototype.getCoordinates=function(){return this.pts},Rf.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Rf.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Rf.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],c=arguments[5],l=this.pts[i],f=this.pts[o],h=s.pts[a],p=s.pts[u];if(o-i==1&&u-a==1)return c.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(l,f),this.env2.init(h,p),!this.env1.intersects(this.env2))return null;var g=Math.trunc((i+o)/2),d=Math.trunc((a+u)/2);i<g&&(a<d&&this.computeIntersectsForChain(i,g,s,a,d,c),d<u&&this.computeIntersectsForChain(i,g,s,d,u,c)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,c),d<u&&this.computeIntersectsForChain(g,o,s,d,u,c))}},Rf.prototype.getStartIndexes=function(){return this.startIndex},Rf.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Rf.prototype.interfaces_=function(){return[]},Rf.prototype.getClass=function(){return Rf};var Tf=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},Af={NULL_VALUE:{configurable:!0}};Tf.prototype.getDepth=function(t,e){return this._depth[t][e]},Tf.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},Tf.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==Tf.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===Tf.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===Tf.NULL_VALUE}},Tf.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},Tf.prototype.getDelta=function(t){return this._depth[t][il.RIGHT]-this._depth[t][il.LEFT]},Tf.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?su.EXTERIOR:su.INTERIOR},Tf.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Tf.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==su.EXTERIOR&&r!==su.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=Tf.depthAtLocation(r):this._depth[e][n]+=Tf.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===su.INTERIOR&&this._depth[i][o]++}},Tf.prototype.interfaces_=function(){return[]},Tf.prototype.getClass=function(){return Tf},Tf.depthAtLocation=function(t){return t===su.EXTERIOR?0:t===su.INTERIOR?1:Tf.NULL_VALUE},Af.NULL_VALUE.get=function(){return-1},Object.defineProperties(Tf,Af);var Ff=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Mf(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Tf,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,fl.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(")  "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Rf(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Iu;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new nu(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new fu;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(")  "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,il.ON),e.getLocation(1,il.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,il.LEFT),e.getLocation(1,il.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,il.RIGHT),e.getLocation(1,il.RIGHT),2))},e}(dl),Df=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Nf,this._bufParams=t||null};Df.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},Df.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new fl(t.getLabel())).flip(),n.merge(r);var i=Df.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(Df.depthDelta(t.getLabel()))},Df.prototype.buildSubgraphs=function(t,e){for(var n=new nc,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new gf(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},Df.prototype.createSubgraphs=function(t){for(var e=new nc,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new cl;i.create(r),e.add(i)}}return Rl.sort(e,Rl.reverseOrder()),e},Df.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},Df.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new tf,n=new Du;return n.setPrecisionModel(t),e.setSegmentIntersector(new Cf(n)),e},Df.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new pf(n,this._bufParams),i=new mf(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new El(new If),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Il(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},Df.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new Ff(i.getCoordinates(),new fl(s));this.insertUniqueEdge(a)}}},Df.prototype.setNoder=function(t){this._workingNoder=t},Df.prototype.interfaces_=function(){return[]},Df.prototype.getClass=function(){return Df},Df.depthDelta=function(t){var e=t.getLocation(0,il.LEFT),n=t.getLocation(0,il.RIGHT);return e===su.INTERIOR&&n===su.EXTERIOR?1:e===su.EXTERIOR&&n===su.INTERIOR?-1:0},Df.convertSegStrings=function(t){for(var e=new Jc,n=new nc;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var kf=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this._noder=t,this._scaleFactor=e,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};kf.prototype.rescale=function(){if(uu(arguments[0],Zu))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&wu.out.println(n)}},kf.prototype.scale=function(){if(uu(arguments[0],Zu)){for(var t=arguments[0],e=new nc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Yl(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new nu(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return oc.removeRepeatedPoints(o)}},kf.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},kf.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},kf.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},kf.prototype.interfaces_=function(){return[Zl]},kf.prototype.getClass=function(){return kf};var jf=function(){this._li=new Du,this._segStrings=null;var t=arguments[0];this._segStrings=t},Gf={fact:{configurable:!0}};jf.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Ou("found endpt/interior pt intersection at index "+o+" :pt "+n)},jf.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(i,u,o,c);else if(4===arguments.length){var l=arguments[0],f=arguments[1],h=arguments[2],p=arguments[3];if(l===h&&f===p)return null;var g=l.getCoordinates()[f],d=l.getCoordinates()[f+1],y=h.getCoordinates()[p],v=h.getCoordinates()[p+1];if(this._li.computeIntersection(g,d,y,v),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,v)))throw new Ou("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+v)}},jf.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},jf.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},jf.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},jf.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Ou("found non-noded collapse at "+jf.fact.createLineString([t,e,n]))},jf.prototype.interfaces_=function(){return[]},jf.prototype.getClass=function(){return jf},Gf.fact.get=function(){return new Jc},Object.defineProperties(jf,Gf);var qf=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 Ja("Scale factor must be non-zero");1!==e&&(this._pt=new nu(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new nu,this._p1Scaled=new nu),this.initCorners(this._pt)},Bf={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};qf.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return Tu.isTrue(!(s&&a),"Found bad envelope test"),a},qf.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new nu(this._maxx,this._maxy),this._corner[1]=new nu(this._minx,this._maxy),this._corner[2]=new nu(this._minx,this._miny),this._corner[3]=new nu(this._maxx,this._miny)},qf.prototype.intersects=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))},qf.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},qf.prototype.getCoordinate=function(){return this._originalPt},qf.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},qf.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=qf.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Iu(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},qf.prototype.intersectsPixelClosure=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()))))},qf.prototype.intersectsToleranceSquare=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)))))},qf.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},qf.prototype.interfaces_=function(){return[]},qf.prototype.getClass=function(){return qf},Bf.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(qf,Bf);var zf=function(){this.tempEnv1=new Iu,this.selectedSegment=new Wl};zf.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},zf.prototype.interfaces_=function(){return[]},zf.prototype.getClass=function(){return zf};var Uf=function(){this._index=null;var t=arguments[0];this._index=t},Vf={HotPixelSnapAction:{configurable:!0}};Uf.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new Xf(e,n,r);return this._index.query(i,{interfaces_:function(){return[Cl]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},Uf.prototype.interfaces_=function(){return[]},Uf.prototype.getClass=function(){return Uf},Vf.HotPixelSnapAction.get=function(){return Xf},Object.defineProperties(Uf,Vf);var Xf=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],n=arguments[1],r=e.getContext();if(null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(r,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zf),Yf=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new nc};Yf.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},Yf.prototype.isDone=function(){return!1},Yf.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Yf.prototype.interfaces_=function(){return[Pf]},Yf.prototype.getClass=function(){return Yf};var Wf=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var t=arguments[0];this._pm=t,this._li=new Du,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};Wf.prototype.checkCorrectness=function(t){var e=Yl.getNodedSubstrings(t),n=new jf(e);try{n.checkValid()}catch(t){if(!(t instanceof xu))throw t;t.printStackTrace()}},Wf.prototype.getNodedSubstrings=function(){return Yl.getNodedSubstrings(this._nodedSegStrings)},Wf.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},Wf.prototype.findInteriorIntersections=function(t,e){var n=new Yf(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},Wf.prototype.computeVertexSnaps=function(){if(uu(arguments[0],Zu))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof Yl)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new qf(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},Wf.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new tf,this._pointSnapper=new Uf(this._noder.getIndex()),this.snapRound(t,this._li)},Wf.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new qf(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},Wf.prototype.interfaces_=function(){return[Zl]},Wf.prototype.getClass=function(){return Wf};var Hf=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new nf,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}},$f={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Hf.prototype.bufferFixedPrecision=function(t){var e=new kf(new Wf(new Yc(1)),t.getScale()),n=new Df(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},Hf.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=Hf.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof al))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=Hf.precisionScaleFactor(this._argGeom,this._distance,n),i=new Yc(r);this.bufferFixedPrecision(i)}},Hf.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===Yc.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},Hf.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},Hf.prototype.bufferOriginalPrecision=function(){try{var t=new Df(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Ou))throw t;this._saveException=t}},Hf.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},Hf.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},Hf.prototype.interfaces_=function(){return[]},Hf.prototype.getClass=function(){return Hf},Hf.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Hf(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof zu&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Hf(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof nf&&arguments[0]instanceof zu&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=arguments[2];return new Hf(s,u).getResultGeometry(a)}}else if(4===arguments.length){var c=arguments[0],l=arguments[1],f=arguments[2],h=arguments[3],p=new Hf(c);return p.setQuadrantSegments(f),p.setEndCapStyle(h),p.getResultGeometry(l)}},Hf.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=cu.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)},$f.CAP_ROUND.get=function(){return nf.CAP_ROUND},$f.CAP_BUTT.get=function(){return nf.CAP_FLAT},$f.CAP_FLAT.get=function(){return nf.CAP_FLAT},$f.CAP_SQUARE.get=function(){return nf.CAP_SQUARE},$f.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Hf,$f);var Jf=function(){this._pt=[new nu,new nu],this._distance=Ka.NaN,this._isNull=!0};Jf.prototype.getCoordinates=function(){return this._pt},Jf.prototype.getCoordinate=function(t){return this._pt[t]},Jf.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Jf.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Jf.prototype.getDistance=function(){return this._distance},Jf.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Jf.prototype.interfaces_=function(){return[]},Jf.prototype.getClass=function(){return Jf};var Kf=function(){};Kf.prototype.interfaces_=function(){return[]},Kf.prototype.getClass=function(){return Kf},Kf.computeDistance=function(){if(arguments[2]instanceof Jf&&arguments[0]instanceof Cc&&arguments[1]instanceof nu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new Wl,o=0;o<r.length-1;o++){i.setCoordinates(r[o],r[o+1]);var s=i.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Jf&&arguments[0]instanceof Rc&&arguments[1]instanceof nu){var a=arguments[0],u=arguments[1],c=arguments[2];Kf.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)Kf.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof Jf&&arguments[0]instanceof zu&&arguments[1]instanceof nu){var f=arguments[0],h=arguments[1],p=arguments[2];if(f instanceof Cc)Kf.computeDistance(f,h,p);else if(f instanceof Rc)Kf.computeDistance(f,h,p);else if(f instanceof bc)for(var g=f,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Kf.computeDistance(y,h,p)}else p.setMinimum(f.getCoordinate(),h)}else if(arguments[2]instanceof Jf&&arguments[0]instanceof Wl&&arguments[1]instanceof nu){var v=arguments[0],m=arguments[1],_=arguments[2],x=v.closestPoint(m);_.setMinimum(x,m)}};var Zf=function(t){this._maxPtDist=new Jf,this._inputGeom=t||null},Qf={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Zf.prototype.computeMaxMidpointDistance=function(t){var e=new eh(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Zf.prototype.computeMaxVertexDistance=function(t){var e=new th(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},Zf.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},Zf.prototype.getDistancePoints=function(){return this._maxPtDist},Zf.prototype.interfaces_=function(){return[]},Zf.prototype.getClass=function(){return Zf},Qf.MaxPointDistanceFilter.get=function(){return th},Qf.MaxMidpointDistanceFilter.get=function(){return eh},Object.defineProperties(Zf,Qf);var th=function(t){this._maxPtDist=new Jf,this._minPtDist=new Jf,this._geom=t||null};th.prototype.filter=function(t){this._minPtDist.initialize(),Kf.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},th.prototype.getMaxPointDistance=function(){return this._maxPtDist},th.prototype.interfaces_=function(){return[Xu]},th.prototype.getClass=function(){return th};var eh=function(t){this._maxPtDist=new Jf,this._minPtDist=new Jf,this._geom=t||null};eh.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new nu((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),Kf.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},eh.prototype.isDone=function(){return!1},eh.prototype.isGeometryChanged=function(){return!1},eh.prototype.getMaxPointDistance=function(){return this._maxPtDist},eh.prototype.interfaces_=function(){return[xc]},eh.prototype.getClass=function(){return eh};var nh=function(t){this._comps=t||null};nh.prototype.filter=function(t){t instanceof Rc&&this._comps.add(t)},nh.prototype.interfaces_=function(){return[_c]},nh.prototype.getClass=function(){return nh},nh.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return nh.getPolygons(t,new nc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Rc?n.add(e):e instanceof bc&&e.apply(new nh(n)),n}};var rh=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};rh.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof Ac){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Cc&&this._lines.add(t)},rh.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},rh.prototype.interfaces_=function(){return[Bu]},rh.prototype.getClass=function(){return rh},rh.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(rh.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(rh.getLines(e,n))}},rh.getLines=function(){if(1===arguments.length){var t=arguments[0];return rh.getLines(t,!1)}if(2===arguments.length){if(uu(arguments[0],Zu)&&uu(arguments[1],Zu)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();rh.getLines(i,n)}return n}if(arguments[0]instanceof zu&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new nc;return o.apply(new rh(a,s)),a}if(arguments[0]instanceof zu&&uu(arguments[1],Zu)){var u=arguments[0],c=arguments[1];return u instanceof Cc?c.add(u):u.apply(new rh(c)),c}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&uu(arguments[0],Zu)&&uu(arguments[1],Zu)){for(var l=arguments[0],f=arguments[1],h=arguments[2],p=l.iterator();p.hasNext();){var g=p.next();rh.getLines(g,f,h)}return f}if("boolean"==typeof arguments[2]&&arguments[0]instanceof zu&&uu(arguments[1],Zu)){var d=arguments[0],y=arguments[1],v=arguments[2];return d.apply(new rh(y,v)),y}}};var ih=function(){if(this._boundaryRule=Yu.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new Ja("Rule must be non-null");this._boundaryRule=t}};ih.prototype.locateInternal=function(){if(arguments[0]instanceof nu&&arguments[1]instanceof Rc){var t=arguments[0],e=arguments[1];if(e.isEmpty())return su.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===su.EXTERIOR)return su.EXTERIOR;if(r===su.BOUNDARY)return su.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===su.INTERIOR)return su.EXTERIOR;if(s===su.BOUNDARY)return su.BOUNDARY}return su.INTERIOR}if(arguments[0]instanceof nu&&arguments[1]instanceof Cc){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return su.EXTERIOR;var c=u.getCoordinates();return u.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?Gu.isOnLine(a,c)?su.INTERIOR:su.EXTERIOR:su.BOUNDARY}if(arguments[0]instanceof nu&&arguments[1]instanceof Mc){var l=arguments[0];return arguments[1].getCoordinate().equals2D(l)?su.INTERIOR:su.EXTERIOR}},ih.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?Gu.locatePointInRing(t,e.getCoordinates()):su.EXTERIOR},ih.prototype.intersects=function(t,e){return this.locate(t,e)!==su.EXTERIOR},ih.prototype.updateLocationInfo=function(t){t===su.INTERIOR&&(this._isIn=!0),t===su.BOUNDARY&&this._numBoundaries++},ih.prototype.computeLocation=function(t,e){if(e instanceof Mc&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Cc)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Rc)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof wc)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof Fc)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof bc)for(var u=new xf(e);u.hasNext();){var c=u.next();c!==e&&this.computeLocation(t,c)}},ih.prototype.locate=function(t,e){return e.isEmpty()?su.EXTERIOR:e instanceof Cc||e instanceof Rc?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?su.BOUNDARY:this._numBoundaries>0||this._isIn?su.INTERIOR:su.EXTERIOR)},ih.prototype.interfaces_=function(){return[]},ih.prototype.getClass=function(){return ih};var oh=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}},sh={INSIDE_AREA:{configurable:!0}};oh.prototype.isInsideArea=function(){return this._segIndex===oh.INSIDE_AREA},oh.prototype.getCoordinate=function(){return this._pt},oh.prototype.getGeometryComponent=function(){return this._component},oh.prototype.getSegmentIndex=function(){return this._segIndex},oh.prototype.interfaces_=function(){return[]},oh.prototype.getClass=function(){return oh},sh.INSIDE_AREA.get=function(){return-1},Object.defineProperties(oh,sh);var ah=function(t){this._pts=t||null};ah.prototype.filter=function(t){t instanceof Mc&&this._pts.add(t)},ah.prototype.interfaces_=function(){return[_c]},ah.prototype.getClass=function(){return ah},ah.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Mc?Rl.singletonList(t):ah.getPoints(t,new nc)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Mc?n.add(e):e instanceof bc&&e.apply(new ah(n)),n}};var uh=function(){this._locations=null;var t=arguments[0];this._locations=t};uh.prototype.filter=function(t){(t instanceof Mc||t instanceof Cc||t instanceof Rc)&&this._locations.add(new oh(t,0,t.getCoordinate()))},uh.prototype.interfaces_=function(){return[_c]},uh.prototype.getClass=function(){return uh},uh.getLocations=function(t){var e=new nc;return t.apply(new uh(e)),e};var ch=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new ih,this._minDistanceLocation=null,this._minDistance=Ka.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};ch.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=nh.getPolygons(this._geom[e]);if(i.size()>0){var o=uh.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&uu(arguments[0],ec)&&uu(arguments[1],ec)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var l=s.get(c),f=0;f<a.size();f++)if(this.computeContainmentDistance(l,a.get(f),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof oh&&arguments[1]instanceof Rc){var h=arguments[0],p=arguments[1],g=arguments[2],d=h.getCoordinate();if(su.EXTERIOR!==this._ptLocator.locate(d,p))return this._minDistance=0,g[0]=h,g[1]=new oh(p,d),null}},ch.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},ch.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=rh.getLines(this._geom[0]),n=rh.getLines(this._geom[1]),r=ah.getPoints(this._geom[0]),i=ah.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},ch.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},ch.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},ch.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},ch.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Cc&&arguments[1]instanceof Mc){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=Gu.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new Wl(r[o],r[o+1]).closestPoint(i);n[0]=new oh(t,o,a),n[1]=new oh(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Cc&&arguments[1]instanceof Cc){var u=arguments[0],c=arguments[1],l=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var f=u.getCoordinates(),h=c.getCoordinates(),p=0;p<f.length-1;p++)for(var g=0;g<h.length-1;g++){var d=Gu.distanceLineLine(f[p],f[p+1],h[g],h[g+1]);if(d<this._minDistance){this._minDistance=d;var y=new Wl(f[p],f[p+1]),v=new Wl(h[g],h[g+1]),m=y.closestPoints(v);l[0]=new oh(u,p,m[0]),l[1]=new oh(c,g,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},ch.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new oh(i,0,i.getCoordinate()),n[1]=new oh(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},ch.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new Ja("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},ch.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},ch.prototype.interfaces_=function(){return[]},ch.prototype.getClass=function(){return ch},ch.distance=function(t,e){return new ch(t,e).distance()},ch.isWithinDistance=function(t,e,n){return new ch(t,e,n).distance()<=n},ch.nearestPoints=function(t,e){return new ch(t,e).nearestPoints()};var lh=function(){this._pt=[new nu,new nu],this._distance=Ka.NaN,this._isNull=!0};lh.prototype.getCoordinates=function(){return this._pt},lh.prototype.getCoordinate=function(t){return this._pt[t]},lh.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},lh.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var t=arguments[0],e=arguments[1];this._pt[0].setCoordinate(t),this._pt[1].setCoordinate(e),this._distance=t.distance(e),this._isNull=!1}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},lh.prototype.toString=function(){return Mu.toLineString(this._pt[0],this._pt[1])},lh.prototype.getDistance=function(){return this._distance},lh.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},lh.prototype.interfaces_=function(){return[]},lh.prototype.getClass=function(){return lh};var fh=function(){};fh.prototype.interfaces_=function(){return[]},fh.prototype.getClass=function(){return fh},fh.computeDistance=function(){if(arguments[2]instanceof lh&&arguments[0]instanceof Cc&&arguments[1]instanceof nu)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new Wl,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof lh&&arguments[0]instanceof Rc&&arguments[1]instanceof nu){var a=arguments[0],u=arguments[1],c=arguments[2];fh.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)fh.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof lh&&arguments[0]instanceof zu&&arguments[1]instanceof nu){var f=arguments[0],h=arguments[1],p=arguments[2];if(f instanceof Cc)fh.computeDistance(f,h,p);else if(f instanceof Rc)fh.computeDistance(f,h,p);else if(f instanceof bc)for(var g=f,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);fh.computeDistance(y,h,p)}else p.setMinimum(f.getCoordinate(),h)}else if(arguments[2]instanceof lh&&arguments[0]instanceof Wl&&arguments[1]instanceof nu){var v=arguments[0],m=arguments[1],_=arguments[2],x=v.closestPoint(m);_.setMinimum(x,m)}};var hh=function(){this._g0=null,this._g1=null,this._ptDist=new lh,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},ph={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};hh.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},hh.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new Ja("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},hh.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},hh.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},hh.prototype.computeOrientedDistance=function(t,e,n){var r=new gh(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new dh(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},hh.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},hh.prototype.interfaces_=function(){return[]},hh.prototype.getClass=function(){return hh},hh.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new hh(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new hh(n,r);return o.setDensifyFraction(i),o.distance()}},ph.MaxPointDistanceFilter.get=function(){return gh},ph.MaxDensifiedByFractionDistanceFilter.get=function(){return dh},Object.defineProperties(hh,ph);var gh=function(){this._maxPtDist=new lh,this._minPtDist=new lh,this._euclideanDist=new fh,this._geom=null;var t=arguments[0];this._geom=t};gh.prototype.filter=function(t){this._minPtDist.initialize(),fh.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},gh.prototype.getMaxPointDistance=function(){return this._maxPtDist},gh.prototype.interfaces_=function(){return[Xu]},gh.prototype.getClass=function(){return gh};var dh=function(){this._maxPtDist=new lh,this._minPtDist=new lh,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};dh.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,c=new nu(a,u);this._minPtDist.initialize(),fh.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},dh.prototype.isDone=function(){return!1},dh.prototype.isGeometryChanged=function(){return!1},dh.prototype.getMaxPointDistance=function(){return this._maxPtDist},dh.prototype.interfaces_=function(){return[xc]},dh.prototype.getClass=function(){return dh};var yh=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},vh={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};yh.prototype.checkMaximumDistance=function(t,e,n){var r=new hh(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Mu.toLineString(i[0],i[1])+")"}},yh.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=yh.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),yh.VERBOSE&&wu.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},yh.prototype.checkNegativeValid=function(){if(!(this._input instanceof Rc||this._input instanceof Fc||this._input instanceof bc))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},yh.prototype.getErrorIndicator=function(){return this._errorIndicator},yh.prototype.checkMinimumDistance=function(t,e,n){var r=new ch(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Mu.toLineString(i[0],i[1])+" )"}},yh.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},yh.prototype.getErrorLocation=function(){return this._errorLocation},yh.prototype.getPolygonLines=function(t){for(var e=new nc,n=new rh(e),r=nh.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},yh.prototype.getErrorMessage=function(){return this._errMsg},yh.prototype.interfaces_=function(){return[]},yh.prototype.getClass=function(){return yh},vh.VERBOSE.get=function(){return!1},vh.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(yh,vh);var mh=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},_h={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};mh.prototype.isValid=function(){return this.checkPolygonal(),this._isValid?(this.checkExpectedEmpty(),this._isValid?(this.checkEnvelope(),this._isValid?(this.checkArea(),this._isValid?(this.checkDistance(),this._isValid):this._isValid):this._isValid):this._isValid):this._isValid},mh.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*mh.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Iu(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Iu(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},mh.prototype.checkDistance=function(){var t=new yh(this._input,this._distance,this._result);t.isValid()||(this._isValid=!1,this._errorMsg=t.getErrorMessage(),this._errorLocation=t.getErrorLocation(),this._errorIndicator=t.getErrorIndicator()),this.report("Distance")},mh.prototype.checkArea=function(){var t=this._input.getArea(),e=this._result.getArea();this._distance>0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t<e&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},mh.prototype.checkPolygonal=function(){this._result instanceof Rc||this._result instanceof Fc||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},mh.prototype.getErrorIndicator=function(){return this._errorIndicator},mh.prototype.getErrorLocation=function(){return this._errorLocation},mh.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},mh.prototype.report=function(t){if(!mh.VERBOSE)return null;wu.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},mh.prototype.getErrorMessage=function(){return this._errorMsg},mh.prototype.interfaces_=function(){return[]},mh.prototype.getClass=function(){return mh},mh.isValidMsg=function(t,e,n){var r=new mh(t,e,n);return r.isValid()?null:r.getErrorMessage()},mh.isValid=function(t,e,n){return!!new mh(t,e,n).isValid()},_h.VERBOSE.get=function(){return!1},_h.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(mh,_h);var xh=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};xh.prototype.getCoordinates=function(){return this._pts},xh.prototype.size=function(){return this._pts.length},xh.prototype.getCoordinate=function(t){return this._pts[t]},xh.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},xh.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:Ul.octant(this.getCoordinate(t),this.getCoordinate(t+1))},xh.prototype.setData=function(t){this._data=t},xh.prototype.getData=function(){return this._data},xh.prototype.toString=function(){return Mu.toLineString(new Bc(this._pts))},xh.prototype.interfaces_=function(){return[Vl]},xh.prototype.getClass=function(){return xh};var bh=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new nc,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};bh.prototype.getInteriorIntersection=function(){return this._interiorIntersection},bh.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},bh.prototype.getIntersectionSegments=function(){return this._intSegments},bh.prototype.count=function(){return this._intersectionCount},bh.prototype.getIntersections=function(){return this._intersections},bh.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},bh.prototype.setKeepIntersections=function(t){this._keepIntersections=t},bh.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},bh.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},bh.prototype.hasIntersection=function(){return null!==this._interiorIntersection},bh.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},bh.prototype.interfaces_=function(){return[Pf]},bh.prototype.getClass=function(){return bh},bh.createAllIntersectionsFinder=function(t){var e=new bh(t);return e.setFindAllIntersections(!0),e},bh.createAnyIntersectionFinder=function(t){return new bh(t)},bh.createIntersectionCounter=function(t){var e=new bh(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var wh=function(){this._li=new Du,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};wh.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},wh.prototype.getIntersections=function(){return this._segInt.getIntersections()},wh.prototype.isValid=function(){return this.execute(),this._isValid},wh.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},wh.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new bh(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new tf;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},wh.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new al(this.getErrorMessage(),this._segInt.getInteriorIntersection())},wh.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Mu.toLineString(t[0],t[1])+" and "+Mu.toLineString(t[2],t[3])},wh.prototype.interfaces_=function(){return[]},wh.prototype.getClass=function(){return wh},wh.computeIntersections=function(t){var e=new wh(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Eh=function t(){this._nv=null;var e=arguments[0];this._nv=new wh(t.toSegmentStrings(e))};Eh.prototype.checkValid=function(){this._nv.checkValid()},Eh.prototype.interfaces_=function(){return[]},Eh.prototype.getClass=function(){return Eh},Eh.toSegmentStrings=function(t){for(var e=new nc,n=t.iterator();n.hasNext();){var r=n.next();e.add(new xh(r.getCoordinates(),r))}return e},Eh.checkValid=function(t){new Eh(t).checkValid()};var Ih=function(t){this._mapOp=t};Ih.prototype.map=function(t){for(var e=new nc,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(Jc.toGeometryArray(e))},Ih.prototype.interfaces_=function(){return[]},Ih.prototype.getClass=function(){return Ih},Ih.map=function(t,e){return new Ih(e).map(t)};var Sh=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new nc,this._resultLineList=new nc;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Sh.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},Sh.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Sh.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Sh.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!op.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Sh.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},Sh.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Sh.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},Sh.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(Tu.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(op.isResultOfOp(r,e)&&e===op.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh};var Nh=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new nc;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Nh.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Nh.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==op.INTERSECTION)){var r=n.getLabel();op.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Nh.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Nh.prototype.interfaces_=function(){return[]},Nh.prototype.getClass=function(){return Nh};var Ph=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Ph.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Ph.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof Ac&&!r.isEmpty()||(n=!1);for(var i=new nc,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof Ac||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new nc;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Ph.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Ph.prototype.getInputGeometry=function(){return this._inputGeom},Ph.prototype.transformMultiLineString=function(t,e){for(var n=new nc,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Ph.prototype.transformCoordinates=function(t,e){return this.copy(t)},Ph.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Ph.prototype.transformMultiPoint=function(t,e){for(var n=new nc,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Ph.prototype.transformMultiPolygon=function(t,e){for(var n=new nc,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Ph.prototype.copy=function(t){return t.copy()},Ph.prototype.transformGeometryCollection=function(t,e){for(var n=new nc,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Jc.toGeometryArray(n)):this._factory.buildGeometry(n)},Ph.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Mc)return this.transformPoint(t,null);if(t instanceof Tc)return this.transformMultiPoint(t,null);if(t instanceof Ac)return this.transformLinearRing(t,null);if(t instanceof Cc)return this.transformLineString(t,null);if(t instanceof wc)return this.transformMultiLineString(t,null);if(t instanceof Rc)return this.transformPolygon(t,null);if(t instanceof Fc)return this.transformMultiPolygon(t,null);if(t instanceof bc)return this.transformGeometryCollection(t,null);throw new Ja("Unknown Geometry subtype: "+t.getClass().getName())},Ph.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Ph.prototype.interfaces_=function(){return[]},Ph.prototype.getClass=function(){return Ph};var Ch=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Wl,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Cc&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}};Ch.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new nu(o)),0===r&&this._isClosed&&t.set(t.size()-1,new nu(o)))}},Ch.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Ch.prototype.snapTo=function(t){var e=new ic(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Ch.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new nu(i),!1)}},Ch.prototype.findSegmentIndexToSnap=function(t,e){for(var n=Ka.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Ch.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Ch.prototype.interfaces_=function(){return[]},Ch.prototype.getClass=function(){return Ch},Ch.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Lh=function(t){this._srcGeom=t||null},Mh={SNAP_PRECISION_FACTOR:{configurable:!0}};Lh.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Oh(e,n).transform(this._srcGeom)},Lh.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Oh(t,n,!0).transform(this._srcGeom),i=r;return e&&uu(i,Oc)&&(i=r.buffer(0)),i},Lh.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Lh.prototype.extractTargetCoordinates=function(t){for(var e=new Ci,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Lh.prototype.computeMinimumSegmentLength=function(t){for(var e=Ka.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Lh.prototype.interfaces_=function(){return[]},Lh.prototype.getClass=function(){return Lh},Lh.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Lh(t);r[0]=i.snapTo(e,n);var o=new Lh(e);return r[1]=o.snapTo(r[0],n),r},Lh.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Lh.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===Yc.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Lh.computeOverlaySnapTolerance(i),Lh.computeOverlaySnapTolerance(o))}},Lh.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Lh.SNAP_PRECISION_FACTOR},Lh.snapToSelf=function(t,e,n){return new Lh(t).snapToSelf(e,n)},Mh.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Lh,Mh);var Oh=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Ch(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ph),Rh=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Rh.prototype.getCommon=function(){return Ka.longBitsToDouble(this._commonBits)},Rh.prototype.add=function(t){var e=Ka.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Rh.signExpBits(this._commonBits),this._isFirst=!1,null):Rh.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Rh.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Rh.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Rh.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=Ka.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+Ka.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+"  "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Rh.prototype.interfaces_=function(){return[]},Rh.prototype.getClass=function(){return Rh},Rh.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Rh.signExpBits=function(t){return t>>52},Rh.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Rh.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Rh.getBit(t,r)!==Rh.getBit(e,r))return n;n++}return 52};var Th=function(){this._commonCoord=null,this._ccFilter=new Fh},Ah={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};Th.prototype.addCommonBits=function(t){var e=new Dh(this._commonCoord);t.apply(e),t.geometryChanged()},Th.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new nu(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new Dh(e);return t.apply(n),t.geometryChanged(),t},Th.prototype.getCommonCoordinate=function(){return this._commonCoord},Th.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},Th.prototype.interfaces_=function(){return[]},Th.prototype.getClass=function(){return Th},Ah.CommonCoordinateFilter.get=function(){return Fh},Ah.Translater.get=function(){return Dh},Object.defineProperties(Th,Ah);var Fh=function(){this._commonBitsX=new Rh,this._commonBitsY=new Rh};Fh.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},Fh.prototype.getCommonCoordinate=function(){return new nu(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},Fh.prototype.interfaces_=function(){return[Xu]},Fh.prototype.getClass=function(){return Fh};var Dh=function(){this.trans=null;var t=arguments[0];this.trans=t};Dh.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},Dh.prototype.isDone=function(){return!1},Dh.prototype.isGeometryChanged=function(){return!0},Dh.prototype.interfaces_=function(){return[xc]},Dh.prototype.getClass=function(){return Dh};var kh=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};kh.prototype.selfSnap=function(t){return new Lh(t).snapTo(t,this._snapTolerance)},kh.prototype.removeCommonBits=function(t){this._cbr=new Th,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},kh.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},kh.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=op.overlayOp(e[0],e[1],t);return this.prepareResult(n)},kh.prototype.checkValid=function(t){t.isValid()||wu.out.println("Snapped geometry is invalid")},kh.prototype.computeSnapTolerance=function(){this._snapTolerance=Lh.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},kh.prototype.snap=function(t){var e=this.removeCommonBits(t);return Lh.snap(e[0],e[1],this._snapTolerance)},kh.prototype.interfaces_=function(){return[]},kh.prototype.getClass=function(){return kh},kh.overlayOp=function(t,e,n){return new kh(t,e).getResultGeometry(n)},kh.union=function(t,e){return kh.overlayOp(t,e,op.UNION)},kh.intersection=function(t,e){return kh.overlayOp(t,e,op.INTERSECTION)},kh.symDifference=function(t,e){return kh.overlayOp(t,e,op.SYMDIFFERENCE)},kh.difference=function(t,e){return kh.overlayOp(t,e,op.DIFFERENCE)};var jh=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};jh.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=op.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Ou))throw t;r=t}if(!n)try{e=kh.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Ou?r:t}return e},jh.prototype.interfaces_=function(){return[]},jh.prototype.getClass=function(){return jh},jh.overlayOp=function(t,e,n){return new jh(t,e).getResultGeometry(n)},jh.union=function(t,e){return jh.overlayOp(t,e,op.UNION)},jh.intersection=function(t,e){return jh.overlayOp(t,e,op.INTERSECTION)},jh.symDifference=function(t,e){return jh.overlayOp(t,e,op.SYMDIFFERENCE)},jh.difference=function(t,e){return jh.overlayOp(t,e,op.DIFFERENCE)};var Gh=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};Gh.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},Gh.prototype.interfaces_=function(){return[]},Gh.prototype.getClass=function(){return Gh};var qh=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},Bh={INSERT:{configurable:!0},DELETE:{configurable:!0}};qh.prototype.isDelete=function(){return this._eventType===qh.DELETE},qh.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},qh.prototype.getObject=function(){return this._obj},qh.prototype.compareTo=function(t){var e=t;return this._xValue<e._xValue?-1:this._xValue>e._xValue?1:this._eventType<e._eventType?-1:this._eventType>e._eventType?1:0},qh.prototype.getInsertEvent=function(){return this._insertEvent},qh.prototype.isInsert=function(){return this._eventType===qh.INSERT},qh.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},qh.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},qh.prototype.interfaces_=function(){return[Qa]},qh.prototype.getClass=function(){return qh},Bh.INSERT.get=function(){return 1},Bh.DELETE.get=function(){return 2},Object.defineProperties(qh,Bh);var zh=function(){};zh.prototype.interfaces_=function(){return[]},zh.prototype.getClass=function(){return zh};var Uh=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};Uh.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Uh.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Uh.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Uh.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},Uh.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Uh.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},Uh.prototype.hasProperIntersection=function(){return this._hasProper},Uh.prototype.hasIntersection=function(){return this._hasIntersection},Uh.prototype.isDone=function(){return this._isDone},Uh.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},Uh.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},Uh.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Uh.prototype.interfaces_=function(){return[]},Uh.prototype.getClass=function(){return Uh},Uh.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Vh=function(t){function e(){t.call(this),this.events=new nc,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Rl.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof Uh&&uu(arguments[0],ec)&&uu(arguments[1],ec)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&uu(arguments[0],ec)&&arguments[1]instanceof Uh){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new Gh(n,i),s=new qh(e,n.getMinX(i),o);this.events.add(s),this.events.add(new qh(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1],i=n.iterator();i.hasNext();){var o=i.next();this.addEdge(o,r)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zh),Xh=function(){this._min=Ka.POSITIVE_INFINITY,this._max=Ka.NEGATIVE_INFINITY},Yh={NodeComparator:{configurable:!0}};Xh.prototype.getMin=function(){return this._min},Xh.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},Xh.prototype.getMax=function(){return this._max},Xh.prototype.toString=function(){return Mu.toLineString(new nu(this._min,0),new nu(this._max,0))},Xh.prototype.interfaces_=function(){return[]},Xh.prototype.getClass=function(){return Xh},Yh.NodeComparator.get=function(){return Wh},Object.defineProperties(Xh,Yh);var Wh=function(){};Wh.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},Wh.prototype.interfaces_=function(){return[eu]},Wh.prototype.getClass=function(){return Wh};var Hh=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xh),$h=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xh),Jh=function(){this._leaves=new nc,this._root=null,this._level=0};Jh.prototype.buildTree=function(){Rl.sort(this._leaves,new Xh.NodeComparator);for(var t=this._leaves,e=null,n=new nc;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},Jh.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Hh(t,e,n))},Jh.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},Jh.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},Jh.prototype.printNode=function(t){wu.out.println(Mu.toLineString(new nu(t._min,this._level),new nu(t._max,this._level)))},Jh.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},Jh.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new $h(t.get(n),t.get(n+1));e.add(i)}}},Jh.prototype.interfaces_=function(){return[]},Jh.prototype.getClass=function(){return Jh};var Kh=function(){this._items=new nc};Kh.prototype.visitItem=function(t){this._items.add(t)},Kh.prototype.getItems=function(){return this._items},Kh.prototype.interfaces_=function(){return[Cl]},Kh.prototype.getClass=function(){return Kh};var Zh=function(){this._index=null;var t=arguments[0];if(!uu(t,Oc))throw new Ja("Argument must be Polygonal");this._index=new ep(t)},Qh={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Zh.prototype.locate=function(t){var e=new ju(t),n=new tp(e);return this._index.query(t.y,t.y,n),e.getLocation()},Zh.prototype.interfaces_=function(){return[_f]},Zh.prototype.getClass=function(){return Zh},Qh.SegmentVisitor.get=function(){return tp},Qh.IntervalIndexedGeometry.get=function(){return ep},Object.defineProperties(Zh,Qh);var tp=function(){this._counter=null;var t=arguments[0];this._counter=t};tp.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},tp.prototype.interfaces_=function(){return[Cl]},tp.prototype.getClass=function(){return tp};var ep=function(){this._index=new Jh;var t=arguments[0];this.init(t)};ep.prototype.init=function(t){for(var e=rh.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},ep.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new Wl(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},ep.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new Kh;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},ep.prototype.interfaces_=function(){return[]},ep.prototype.getClass=function(){return ep};var np=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new Xc,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new ih,2===arguments.length){var e=arguments[0],n=arguments[1],r=Yu.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;r.getLocation(t,il.ON)===su.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Uh(n,!0,!1);o.setIsDoneIfProperInt(i);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof Ac||this._parentGeom instanceof Rc||this._parentGeom instanceof Fc,u=r||!a;return s.computeIntersections(this._edges,o,u),this.addSelfIntersectionNodes(this._argIndex),o}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new Uh(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Mc){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,su.INTERIOR)}else if(arguments[0]instanceof nu){var e=arguments[0];this.insertPoint(this._argIndex,e,su.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),su.EXTERIOR,su.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,su.INTERIOR,su.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],su.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],su.BOUNDARY)},e.prototype.addLineString=function(t){var e=oc.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new Ff(e,new fl(this._argIndex,su.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),Tu.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===su.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=oc.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;Gu.isCCW(r)&&(i=n,o=e);var s=new Ff(r,new fl(this._argIndex,su.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],su.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new fl(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new Vh},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof Fc&&(this._useBoundaryDeterminationRule=!1),e instanceof Rc)this.addPolygon(e);else if(e instanceof Cc)this.addLineString(e);else if(e instanceof Mc)this.addPoint(e);else if(e instanceof Tc)this.addCollection(e);else if(e instanceof wc)this.addCollection(e);else if(e instanceof Fc)this.addCollection(e);else{if(!(e instanceof bc))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return uu(this._parentGeom,Oc)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new Zh(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?su.BOUNDARY:su.INTERIOR},e}(El),rp=function(){if(this._li=new Du,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new np(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=Yu.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new np(0,e,r),this._arg[1]=new np(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new np(0,i,s),this._arg[1]=new np(1,o,s)}};rp.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},rp.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},rp.prototype.interfaces_=function(){return[]},rp.prototype.getClass=function(){return rp};var ip=function(){};ip.prototype.interfaces_=function(){return[]},ip.prototype.getClass=function(){return ip},ip.map=function(){if(arguments[0]instanceof zu&&uu(arguments[1],ip.MapOp)){for(var t=arguments[0],e=arguments[1],n=new nc,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(uu(arguments[0],Zu)&&uu(arguments[1],ip.MapOp)){for(var o=arguments[0],s=arguments[1],a=new nc,u=o.iterator();u.hasNext();){var c=u.next(),l=s.map(c);null!==l&&a.add(l)}return a}},ip.MapOp=function(){};var op=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new ih,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Nf,this._resultPolyList=new nc,this._resultLineList=new nc,this._resultPointList=new nc,this._graph=new El(new If),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new fl(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new nc;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==su.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new nc,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var e=new nc;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Eh.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Il(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Sh(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Nh(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,il.RIGHT),i.getLocation(1,il.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(Tu.isTrue(!r.isNull(i,il.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,il.LEFT,r.getLocation(i,il.LEFT)),Tu.isTrue(!r.isNull(i,il.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,il.RIGHT,r.getLocation(i,il.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(rp);op.overlayOp=function(t,e,n){return new op(t,e).getResultGeometry(n)},op.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return op.createEmptyResult(op.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Ih.map(t,{interfaces_:function(){return[ip.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),jh.overlayOp(t,e,op.INTERSECTION)},op.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return op.createEmptyResult(op.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),jh.overlayOp(t,e,op.SYMDIFFERENCE)},op.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case op.INTERSECTION:o=Math.min(r,i);break;case op.UNION:o=Math.max(r,i);break;case op.DIFFERENCE:o=r;break;case op.SYMDIFFERENCE:o=Math.max(r,i)}return o},op.createEmptyResult=function(t,e,n,r){var i=null;switch(op.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},op.difference=function(t,e){return t.isEmpty()?op.createEmptyResult(op.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),jh.overlayOp(t,e,op.DIFFERENCE))},op.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return op.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===su.BOUNDARY&&(i=su.INTERIOR),o===su.BOUNDARY&&(o=su.INTERIOR),s){case op.INTERSECTION:return i===su.INTERIOR&&o===su.INTERIOR;case op.UNION:return i===su.INTERIOR||o===su.INTERIOR;case op.DIFFERENCE:return i===su.INTERIOR&&o!==su.INTERIOR;case op.SYMDIFFERENCE:return i===su.INTERIOR&&o!==su.INTERIOR||i!==su.INTERIOR&&o===su.INTERIOR}return!1}},op.INTERSECTION=1,op.UNION=2,op.DIFFERENCE=3,op.SYMDIFFERENCE=4;var sp=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new ih,this._seg=new Wl;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};sp.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},sp.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?su.BOUNDARY:this._ptLocator.locate(t,this._g)},sp.prototype.extractLinework=function(t){var e=new ap;t.apply(e);var n=e.getLinework(),r=Jc.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},sp.prototype.interfaces_=function(){return[]},sp.prototype.getClass=function(){return sp};var ap=function(){this._linework=null,this._linework=new nc};ap.prototype.getLinework=function(){return this._linework},ap.prototype.filter=function(t){if(t instanceof Rc){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},ap.prototype.interfaces_=function(){return[_c]},ap.prototype.getClass=function(){return ap};var up=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};up.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},up.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},up.prototype.getPoints=function(t){for(var e=new nc,n=rh.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},up.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,c=(e.x+t.x)/2,l=(e.y+t.y)/2;if(this._doLeft){var f=new nu(c-u,l+a);r.add(f)}if(this._doRight){var h=new nu(c+u,l-a);r.add(h)}},up.prototype.interfaces_=function(){return[]},up.prototype.getClass=function(){return up};var cp=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new nc;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new sp(this._geom[0],this._boundaryDistanceTolerance),new sp(this._geom[1],this._boundaryDistanceTolerance),new sp(this._geom[2],this._boundaryDistanceTolerance)]},lp={TOLERANCE:{configurable:!0}};cp.prototype.reportResult=function(t,e,n){wu.out.println("Overlay result invalid - A:"+su.toLocationSymbol(e[0])+" B:"+su.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+su.toLocationSymbol(e[2]))},cp.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},cp.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!cp.hasLocation(this._location,su.BOUNDARY)||this.isValidResult(r,this._location)}},cp.prototype.addTestPts=function(t){var e=new up(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},cp.prototype.isValidResult=function(t,e){var n=op.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===su.INTERIOR);return r||this.reportResult(t,e,n),r},cp.prototype.getInvalidLocation=function(){return this._invalidLocation},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp},cp.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},cp.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Lh.computeSizeBasedSnapTolerance(t),Lh.computeSizeBasedSnapTolerance(e))},cp.isValid=function(t,e,n,r){return new cp(t,e,r).isValid(n)},lp.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(cp,lp);var fp=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};fp.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},fp.prototype.combine=function(){for(var t=new nc,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},fp.prototype.interfaces_=function(){return[]},fp.prototype.getClass=function(){return fp},fp.combine=function(){if(1===arguments.length){var t=arguments[0];return new fp(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new fp(fp.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new fp(fp.createList(r,i,o)).combine()}},fp.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},fp.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new nc;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new nc;return s.add(r),s.add(i),s.add(o),s}};var hp=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new nc)},pp={STRTREE_NODE_CAPACITY:{configurable:!0}};hp.prototype.reduceToGeometries=function(t){for(var e=new nc,n=t.iterator();n.hasNext();){var r=n.next(),i=null;uu(r,ec)?i=this.unionTree(r):r instanceof zu&&(i=r),e.add(i)}return e},hp.prototype.extractByEnvelope=function(t,e,n){for(var r=new nc,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},hp.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return fp.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},hp.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var t=new jl(hp.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},hp.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=hp.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(hp.getGeometry(e,n),hp.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},hp.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},hp.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},hp.prototype.unionActual=function(t,e){return hp.restrictToPolygons(t.union(e))},hp.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},hp.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new nc,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),fp.combine(r)},hp.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},hp.prototype.interfaces_=function(){return[]},hp.prototype.getClass=function(){return hp},hp.restrictToPolygons=function(t){if(uu(t,Oc))return t;var e=nh.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(Jc.toPolygonArray(e))},hp.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},hp.union=function(t){return new hp(t).union()},pp.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(hp,pp);var gp=function(){};gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return op.createEmptyResult(op.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),jh.overlayOp(t,e,op.UNION)};var dp=function(){return new Ti};Ti.prototype={constructor:Ti,reset:function(){this.s=this.t=0},add:function(t){Ai(yp,t,this.t),Ai(this,yp.s,this.s),this.s?this.t+=yp.t:this.s=yp.t},valueOf:function(){return this.s}};var yp=new Ti,vp=1e-6,mp=Math.PI,_p=mp/2,xp=mp/4,bp=2*mp,wp=180/mp,Ep=mp/180,Ip=Math.abs,Sp=Math.atan,Np=Math.atan2,Pp=Math.cos,Cp=Math.exp,Lp=Math.log,Mp=Math.sin,Op=Math.sqrt,Rp=Math.tan,Tp={Feature:function(t,e){ki(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)ki(n[r].geometry,e)}},Ap={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){ji(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ji(n[r],e,0)},Polygon:function(t,e){Gi(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Gi(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)ki(n[r],e)}},Fp=function(t,e){t&&Tp.hasOwnProperty(t.type)?Tp[t.type](t,e):ki(t,e)},Dp=(dp(),dp(),dp(),function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n});Wi.invert=Wi;var kp=function(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Di,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},jp=function(t,e,n,r,i,o){var s,a=t[0],u=t[1],c=0,l=1,f=e[0]-a,h=e[1]-u;if(s=n-a,f||!(s>0)){if(s/=f,f<0){if(s<c)return;s<l&&(l=s)}else if(f>0){if(s>l)return;s>c&&(c=s)}if(s=i-a,f||!(s<0)){if(s/=f,f<0){if(s>l)return;s>c&&(c=s)}else if(f>0){if(s<c)return;s<l&&(l=s)}if(s=r-u,h||!(s>0)){if(s/=h,h<0){if(s<c)return;s<l&&(l=s)}else if(h>0){if(s>l)return;s>c&&(c=s)}if(s=o-u,h||!(s<0)){if(s/=h,h<0){if(s>l)return;s>c&&(c=s)}else if(h>0){if(s<c)return;s<l&&(l=s)}return c>0&&(t[0]=a+c*f,t[1]=u+c*h),l<1&&(e[0]=a+l*f,e[1]=u+l*h),!0}}}}},Gp=function(t,e){return Ip(t[0]-e[0])<vp&&Ip(t[1]-e[1])<vp},qp=function(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(Gp(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new Qi(r,t,null,!0)),u.push(n.o=new Qi(r,null,n,!1)),a.push(n=new Qi(s,t,null,!1)),u.push(n.o=new Qi(s,null,n,!0))}})),a.length){for(u.sort(e),to(a),to(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var c,l,f=a[0];;){for(var h=f,p=!0;h.v;)if((h=h.n)===f)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,s=c.length;o<s;++o)i.point((l=c[o])[0],l[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(c=h.p.z,o=c.length-1;o>=0;--o)i.point((l=c[o])[0],l[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}},Bp=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},zp=(function(t){1===t.length&&(t=function(t){return function(e,n){return Bp(t(e),n)}}(t))}(Bp),function(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--s]=r[e];return n}),Up=1e9,Vp=-Up,Xp=dp(),Yp=(dp(),function(t){return t}),Wp=(dp(),dp(),1/0),Hp=Wp,$p=-Wp,Jp=$p,Kp={point:function(t,e){t<Wp&&(Wp=t),t>$p&&($p=t),e<Hp&&(Hp=e),e>Jp&&(Jp=e)},lineStart:Di,lineEnd:Di,polygonStart:Di,polygonEnd:Di,result:function(){var t=[[Wp,Hp],[$p,Jp]];return $p=Jp=-(Hp=Wp=1/0),t}},Zp=(dp(),function(t,e,n,r){return function(i,o){function s(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function a(t,e){var n=i(t,e);y.point(n[0],n[1])}function u(){b.point=a,y.lineStart()}function c(){b.point=s,y.lineEnd()}function l(t,e){d.push([t,e]);var n=i(t,e);_.point(n[0],n[1])}function f(){_.lineStart(),d=[]}function h(){l(d[0][0],d[0][1]),_.lineEnd();var t,e,n,r,i=_.clean(),s=m.result(),a=s.length;if(d.pop(),p.push(d),d=null,a)if(1&i){if((e=(n=s[0]).length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else a>1&&2&i&&s.push(s.pop().concat(s.shift())),g.push(s.filter(no))}var p,g,d,y=e(o),v=i.invert(r[0],r[1]),m=kp(),_=e(m),x=!1,b={point:s,lineStart:u,lineEnd:c,polygonStart:function(){b.point=l,b.lineStart=f,b.lineEnd=h,g=[],p=[]},polygonEnd:function(){b.point=s,b.lineStart=u,b.lineEnd=c,g=zp(g);var t=function(t,e){var n=e[0],r=e[1],i=[Mp(n),-Pp(n),0],o=0,s=0;Xp.reset();for(var a=0,u=t.length;a<u;++a)if(l=(c=t[a]).length)for(var c,l,f=c[l-1],h=f[0],p=f[1]/2+xp,g=Mp(p),d=Pp(p),y=0;y<l;++y,h=m,g=x,d=b,f=v){var v=c[y],m=v[0],_=v[1]/2+xp,x=Mp(_),b=Pp(_),w=m-h,E=w>=0?1:-1,I=E*w,S=I>mp,N=g*x;if(Xp.add(Np(N*E*Mp(I),d*b+N*Pp(I))),o+=S?w+E*bp:w,S^h>=n^m>=n){var P=Ui(Bi(f),Bi(v));Yi(P);var C=Ui(i,P);Yi(C);var L=(S^w>=0?-1:1)*Fi(C[2]);(r>L||r===L&&(P[0]||P[1]))&&(s+=S^w>=0?1:-1)}}return(o<-vp||o<vp&&Xp<-vp)^1&s}(p,v);g.length?(x||(o.polygonStart(),x=!0),qp(g,ro,t,n,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),g=p=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return b}}),Qp=Zp((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a=o>0?mp:-mp,u=Ip(o-n);Ip(u-mp)<vp?(t.point(n,r=(r+s)/2>0?_p:-_p),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),e=0):i!==a&&u>=mp&&(Ip(n-i)<vp&&(n-=i*vp),Ip(o-a)<vp&&(o-=a*vp),r=function(t,e,n,r){var i,o,s=Mp(t-n);return Ip(s)>vp?Sp((Mp(e)*(o=Pp(r))*Mp(n)-Mp(r)*(i=Pp(e))*Mp(t))/(i*o*s)):(e+r)/2}(n,r,o,s),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),e=0),t.point(n=o,r=s),i=a},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*_p,r.point(-mp,i),r.point(0,i),r.point(mp,i),r.point(mp,0),r.point(mp,-i),r.point(0,-i),r.point(-mp,-i),r.point(-mp,0),r.point(-mp,i);else if(Ip(t[0]-e[0])>vp){var o=t[0]<e[0]?mp:-mp;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-mp,-_p]),tg=function(t,e){function n(t,e){return Pp(t)*Pp(e)>o}function r(t,e,n){var r=[1,0,0],i=Ui(Bi(t),Bi(e)),s=zi(i,i),a=i[0],u=s-a*a;if(!u)return!n&&t;var c=o*s/u,l=-o*a/u,f=Ui(r,i),h=Xi(r,c);Vi(h,Xi(i,l));var p=f,g=zi(h,p),d=zi(p,p),y=g*g-d*(zi(h,h)-1);if(!(y<0)){var v=Op(y),m=Xi(p,(-g-v)/d);if(Vi(m,h),m=qi(m),!n)return m;var _,x=t[0],b=e[0],w=t[1],E=e[1];b<x&&(_=x,x=b,b=_);var I=b-x,S=Ip(I-mp)<vp;if(!S&&E<w&&(_=w,w=E,E=_),S||I<vp?S?w+E>0^m[1]<(Ip(m[0]-x)<vp?w:E):w<=m[1]&&m[1]<=E:I>mp^(x<=m[0]&&m[0]<=b)){var N=Xi(p,(-g+v)/d);return Vi(N,h),[m,qi(N)]}}}function i(e,n){var r=s?t:mp-t,i=0;return e<-r?i|=1:e>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var o=Pp(t),s=o>0,a=Ip(o)>vp;return Zp(n,(function(t){var e,o,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(f,h){var p,g=[f,h],d=n(f,h),y=s?d?0:i(f,h):d?i(f+(f<0?mp:-mp),h):0;if(!e&&(c=u=d)&&t.lineStart(),d!==u&&(!(p=r(e,g))||Gp(e,p)||Gp(g,p))&&(g[0]+=vp,g[1]+=vp,d=n(g[0],g[1])),d!==u)l=0,d?(t.lineStart(),p=r(g,e),t.point(p[0],p[1])):(p=r(e,g),t.point(p[0],p[1]),t.lineEnd()),e=p;else if(a&&e&&s^d){var v;y&o||!(v=r(g,e,!0))||(l=0,s?(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])))}!d||e&&Gp(e,g)||t.point(g[0],g[1]),e=g,u=d,o=y},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Pp(e),a=Mp(e),u=r*n;null==i?(i=e+r*bp,o=e-u/2):(i=Zi(s,i),o=Zi(s,o),(r>0?i<o:i>o)&&(i+=r*bp));for(var c,l=i;r>0?l>o:l<o;l-=u)c=qi([s,-a*Pp(l),-a*Mp(l)]),t.point(c[0],c[1])}}(o,t,e,i,n,r)}),s?[0,-t]:[-mp,t-mp])};oo.prototype={constructor:oo,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var eg=Pp(30*Ep),ng=function(t,e){return+e?function(t,e){function n(r,i,o,s,a,u,c,l,f,h,p,g,d,y){var v=c-r,m=l-i,_=v*v+m*m;if(_>4*e&&d--){var x=s+h,b=a+p,w=u+g,E=Op(x*x+b*b+w*w),I=Fi(w/=E),S=Ip(Ip(w)-1)<vp||Ip(o-f)<vp?(o+f)/2:Np(b,x),N=t(S,I),P=N[0],C=N[1],L=P-r,M=C-i,O=m*L-v*M;(O*O/_>e||Ip((v*L+m*M)/_-.5)>.3||s*h+a*p+u*g<eg)&&(n(r,i,o,s,a,u,P,C,S,x/=E,b/=E,w,d,y),y.point(P,C),n(P,C,S,x,b,w,c,l,f,h,p,g,d,y))}}return function(e){function r(n,r){n=t(n,r),e.point(n[0],n[1])}function i(){v=NaN,w.point=o,e.lineStart()}function o(r,i){var o=Bi([r,i]),s=t(r,i);n(v,m,y,_,x,b,v=s[0],m=s[1],y=r,_=o[0],x=o[1],b=o[2],16,e),e.point(v,m)}function s(){w.point=r,e.lineEnd()}function a(){i(),w.point=u,w.lineEnd=c}function u(t,e){o(l=t,e),f=v,h=m,p=_,g=x,d=b,w.point=o}function c(){n(v,m,y,_,x,b,f,h,l,p,g,d,16,e),w.lineEnd=s,s()}var l,f,h,p,g,d,y,v,m,_,x,b,w={point:r,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),w.lineStart=a},polygonEnd:function(){e.polygonEnd(),w.lineStart=i}};return w}}(t,e):function(t){return io({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)},rg=io({point:function(t,e){this.stream.point(t*Ep,e*Ep)}});ao.invert=function(t,e){return[t,2*Sp(Cp(e))-_p]},uo.invert=function(t,e){return[-e,2*Sp(Cp(t))-_p]};var ig=function(){var t=function(t){function e(){var e=mp*a(),s=o(function(t){function e(e){return(e=t(e[0]*Ep,e[1]*Ep))[0]*=wp,e[1]*=wp,e}return t=Hi(t[0]*Ep,t[1]*Ep,t.length>2?t[2]*Ep:0),e.invert=function(e){return(e=t.invert(e[0]*Ep,e[1]*Ep))[0]*=wp,e[1]*=wp,e},e}(o.rotate()).invert([0,0]));return c(null==l?[[s[0]-e,s[1]-e],[s[0]+e,s[1]+e]]:t===ao?[[Math.max(s[0]-e,l),n],[Math.min(s[0]+e,r),i]]:[[l,Math.max(s[1]-e,n)],[r,Math.min(s[1]+e,i)]])}var n,r,i,o=function(t){return function(t){function e(t){return[(t=c(t[0]*Ep,t[1]*Ep))[0]*d+s,a-t[1]*d]}function n(t,e){return[(t=o(t,e))[0]*d+s,a-t[1]*d]}function r(){c=Dp(u=Hi(x,b,w),o);var t=o(m,_);return s=y-t[0]*d,a=v+t[1]*d,i()}function i(){return p=g=null,e}var o,s,a,u,c,l,f,h,p,g,d=150,y=480,v=250,m=0,_=0,x=0,b=0,w=0,E=null,I=Qp,S=null,N=Yp,P=.5,C=ng(n,P);return e.stream=function(t){return p&&g===t?p:p=rg(I(u,C(N(g=t))))},e.clipAngle=function(t){return arguments.length?(I=+t?tg(E=t*Ep,6*Ep):(E=null,Qp),i()):E*wp},e.clipExtent=function(t){return arguments.length?(N=null==t?(S=l=f=h=null,Yp):eo(S=+t[0][0],l=+t[0][1],f=+t[1][0],h=+t[1][1]),i()):null==S?null:[[S,l],[f,h]]},e.scale=function(t){return arguments.length?(d=+t,r()):d},e.translate=function(t){return arguments.length?(y=+t[0],v=+t[1],r()):[y,v]},e.center=function(t){return arguments.length?(m=t[0]%360*Ep,_=t[1]%360*Ep,r()):[m*wp,_*wp]},e.rotate=function(t){return arguments.length?(x=t[0]%360*Ep,b=t[1]%360*Ep,w=t.length>2?t[2]%360*Ep:0,r()):[x*wp,b*wp,w*wp]},e.precision=function(t){return arguments.length?(C=ng(n,P=t*t),i()):Op(P)},e.fitExtent=function(t,n){return so(e,t,n)},e.fitSize=function(t,n){return function(t,e,n){return so(t,[[0,0],e],n)}(e,t,n)},function(){return o=t.apply(this,arguments),e.invert=o.invert&&function(t){return(t=c.invert((t[0]-s)/d,(a-t[1])/d))&&[t[0]*wp,t[1]*wp]},r()}}((function(){return t}))()}(t),s=o.center,a=o.scale,u=o.translate,c=o.clipExtent,l=null;return o.scale=function(t){return arguments.length?(a(t),e()):a()},o.translate=function(t){return arguments.length?(u(t),e()):u()},o.center=function(t){return arguments.length?(s(t),e()):s()},o.clipExtent=function(t){return arguments.length?(null==t?l=n=r=i=null:(l=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),e()):null==l?null:[[l,n],[r,i]]},e()}(uo),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};t.projection=ls,t.random=Wa,t.clusters=Ha,t.helpers=No,t.invariant=Co,t.meta=Po,t.isolines=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(H(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks must be an Array");if(!I(i))throw new Error("commonProperties must be an Object");if(!Array.isArray(o))throw new Error("breaksProperties must be an Array");var s=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;H(t,"Point","input must contain Points");for(var o=function(t,e){var n={};return O(t,(function(t){var e=V(t)[1];n[e]||(n[e]=[]),n[e].push(t)})),Object.keys(n).map((function(t){return n[t].sort((function(t,e){return V(t)[0]-V(e)[0]}))})).sort((function(t,n){return e?V(t[0])[1]-V(n[0])[1]:V(n[0])[1]-V(t[0])[1]}))}(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],c=[],l=0;l<u.length;l++){var f=u[l];f.properties[n]?c.push(f.properties[n]):c.push(0),!0===i&&(f.properties.matrixPosition=[a,l])}s.push(c)}return s}(t,{zProperty:r,flip:!0});return c(function(t,e,n){var r=z(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,l=i/u,f=o/c,h=function(t){t[0]=t[0]*l+s,t[1]=t[1]*f+a};return t.forEach((function(t){P(t,h)})),t}(function(t,e,n,r,i){for(var o=[],s=1;s<e.length;s++){var a=+e[s],u=Object.assign({},r,i[s]);u[n]=a;var c=l(Z(t,a),u);o.push(c)}return o}(s,e,r,i,o),s,t))},t.convex=Pt,t.pointsWithinPolygon=Mt,t.concave=function(t,n){if(!I(n=n||{}))throw new Error("options is invalid");if(!t)throw new Error("points is required");var r=n.maxEdge||1/0;if(!E(r))throw new Error("maxEdge is invalid");var i=Ot(function(t){var e=[],n={};return O(t,(function(t){if(t.geometry){var r=t.geometry.coordinates.join("-");n.hasOwnProperty(r)||(e.push(t),n[r]=!0)}})),c(e)}(t));if(i.features=i.features.filter((function(t){var e=t.geometry.coordinates[0][0],i=t.geometry.coordinates[0][1],o=t.geometry.coordinates[0][2],s=Ft(e,i,n),a=Ft(i,o,n),u=Ft(e,o,n);return s<=r&&a<=r&&u<=r})),i.features.length<1)return null;var o=Ht(i,n);return 1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),e(o)},t.collect=function(t,e,n,r){var i=Ro(6),o=e.features.map((function(t){return{minX:t.geometry.coordinates[0],minY:t.geometry.coordinates[1],maxX:t.geometry.coordinates[0],maxY:t.geometry.coordinates[1],property:t.properties[n]}}));return i.load(o),t.features.forEach((function(t){t.properties||(t.properties={});var e=z(t),n=[];i.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}).forEach((function(e){Ct([e.minX,e.minY],t)&&n.push(e.property)})),t.properties[r]=n})),t},t.flip=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.mutate;if(!t)throw new Error("geojson is required");return!1!==n&&void 0!==n||(t=Dt(t)),P(t,(function(t){var e=t[0],n=t[1];t[0]=n,t[1]=e})),t},t.simplify=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=void 0!==e.tolerance?e.tolerance:1,r=e.highQuality||!1,i=e.mutate||!1;if(!t)throw new Error("geojson is required");if(n&&n<0)throw new Error("invalid tolerance");return!0!==i&&(t=Dt(t)),A(t,(function(t){!function(t,e,n){var r=t.type;if("Point"===r||"MultiPoint"===r)return t;$t(t,!0);var i=t.coordinates;switch(r){case"LineString":t.coordinates=te(i,e,n);break;case"MultiLineString":t.coordinates=i.map((function(t){return te(t,e,n)}));break;case"Polygon":t.coordinates=ee(i,e,n);break;case"MultiPolygon":t.coordinates=i.map((function(t){return ee(t,e,n)}))}}(t,n,r)})),t},t.bezierSpline=ne,t.tag=function(t,e,n,r){return t=Dt(t),e=Dt(e),O(t,(function(t){t.properties||(t.properties={}),O(e,(function(e){void 0===t.properties[r]&&Ct(t,e)&&(t.properties[r]=e.properties[n])}))})),t},t.sample=function(t,e){if(!t)throw new Error("featurecollection is required");if(null==e)throw new Error("num is required");if("number"!=typeof e)throw new Error("num must be a number");return c(function(t,e){for(var n,r,i=t.slice(0),o=t.length,s=o-e;o-- >s;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=ie,t.square=oe,t.circle=ae,t.midpoint=function(t,e){return se(t,Ft(t,e)/2,ue(t,e))},t.center=ce,t.centerOfMass=function t(e,n){switch(K(e)){case"Point":return e;case"Polygon":var i=[];P(e,(function(t){i.push(t)}));var o,s,a,u,c,l,f,h,p=le(e,n),g=p.geometry.coordinates,d=0,y=0,v=0,m=i.map((function(t){return[t[0]-g[0],t[1]-g[1]]}));for(o=0;o<i.length-1;o++)u=(s=m[o])[0],l=s[1],c=(a=m[o+1])[0],v+=h=u*(f=a[1])-c*l,d+=(u+c)*h,y+=(l+f)*h;if(0===v)return p;var _=1/(.5*v*6);return r([g[0]+_*d,g[1]+_*y],n);default:var x=Pt(e);return x?t(x,n):le(e,n)}},t.centroid=le,t.combine=function(t){function n(t,e,n){n?r[e].coordinates=r[e].coordinates.concat(t.geometry.coordinates):r[e].coordinates.push(t.geometry.coordinates),r[e].properties.push(t.properties)}var r={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},i=Object.keys(r).reduce((function(t,e){return t[e.replace("Multi","")]=e,t}),{});return O(t,(function(t){t.geometry&&(r[t.geometry.type]?n(t,t.geometry.type,!0):i[t.geometry.type]&&n(t,i[t.geometry.type],!1))})),c(Object.keys(r).filter((function(t){return r[t].coordinates.length})).sort().map((function(t){return e({type:t,coordinates:r[t].coordinates},{collectedProperties:r[t].properties})})))},t.distance=Ft,t.explode=fe,t.bbox=z,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=Pe(t.geometry.coordinates):t.geometry.coordinates.forEach((function(t){e.features=e.features.concat(Pe(t))})),e},t.bboxPolygon=re,t.booleanPointInPolygon=Ct,t.nearestPoint=Ce,t.nearestPointOnLine=$e,t.nearestPointToLine=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=n.properties||{};if(!t)throw new Error("points is required");if(!(t=function(t){var e=[];switch(t.geometry?t.geometry.type:t.type){case"GeometryCollection":return A(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)).features.length)throw new Error("points must contain features");if(!e)throw new Error("line is required");if("LineString"!==K(e))throw new Error("line must be a LineString");var o=1/0,s=null;return O(t,(function(t){var n=on(t,e,{units:r});n<o&&(o=n,s=t)})),s&&(s.properties=Object.assign({dist:o},s.properties,i)),s},t.planepoint=function(t,e){var n=U(t),r=$(e).coordinates[0];if(r.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var i=e.properties||{},o=i.a,s=i.b,a=i.c,u=n[0],c=n[1],l=r[0][0],f=r[0][1],h=void 0!==o?o:r[0][2],p=r[1][0],g=r[1][1],d=void 0!==s?s:r[1][2],y=r[2][0],v=r[2][1],m=void 0!==a?a:r[2][2];return(m*(u-l)*(c-g)+h*(u-p)*(c-v)+d*(u-y)*(c-f)-d*(u-l)*(c-v)-m*(u-p)*(c-f)-h*(u-y)*(c-g))/((u-l)*(c-g)+(u-p)*(c-v)+(u-y)*(c-f)-(u-l)*(c-v)-(u-p)*(c-f)-(u-y)*(c-g))},t.tin=Ot,t.bearing=ue,t.destination=se,t.kinks=function(t){var e,n,i={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach((function(t){e.forEach((function(e){for(var n=0;n<t.length-1;n++)for(var o=n;o<e.length-1;o++){if(t===e){if(1===Math.abs(n-o))continue;if(0===n&&o===t.length-2&&t[n][0]===t[t.length-1][0]&&t[n][1]===t[t.length-1][1])continue}var s=function(t,e,n,r,i,o,s,a){var u,c,l,f,h={x:null,y:null,onLine1:!1,onLine2:!1};return 0==(u=(a-o)*(n-t)-(s-i)*(r-e))?null!==h.x&&null!==h.y&&h:(f=(n-t)*(c=e-o)-(r-e)*(l=t-i),c=((s-i)*c-(a-o)*l)/u,l=f/u,h.x=t+c*(n-t),h.y=e+c*(r-e),c>=0&&c<=1&&(h.onLine1=!0),l>=0&&l<=1&&(h.onLine2=!0),!(!h.onLine1||!h.onLine2)&&[h.x,h.y])}(t[n][0],t[n][1],t[n+1][0],t[n+1][1],e[o][0],e[o][1],e[o+1][0],e[o+1][1]);s&&i.features.push(r([s[0],s[1]]))}}))})),i},t.pointOnFeature=an,t.area=cn,t.along=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var i;if("Feature"===t.type)i=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");i=t.coordinates}if(!E(e))throw new Error("distance must be a number");for(var o=0,s=0;s<i.length&&!(e>=o&&s===i.length-1);s++){if(o>=e){var a=e-o;if(a){var u=ue(i[s],i[s-1])-180;return se(i[s],a,u,n)}return r(i[s])}o+=Ft(i[s],i[s+1],n)}return r(i[i.length-1])},t.length=pn,t.lineSlice=function(t,e,n){var r=V(n);if("LineString"!==K(n))throw new Error("line must be a LineString");for(var i,o=$e(n,t),s=$e(n,e),u=[(i=o.properties.index<=s.properties.index?[o,s]:[s,o])[0].geometry.coordinates],c=i[0].properties.index+1;c<i[1].properties.index+1;c++)u.push(r[c]);return u.push(i[1].geometry.coordinates),a(u,n.properties)},t.lineSliceAlong=gn,t.pointGrid=_n,t.truncate=xn,t.flatten=function(t){if(!t)throw new Error("geojson is required");var e=[];return D(t,(function(t){e.push(t)})),c(e)},t.lineIntersect=We,t.lineChunk=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units,i=n.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var o=[];return D(t,(function(t){i&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,n,r){var i=pn(t,{units:n});if(i<=e)return r(t);var o=i/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var s=0;s<o;s++)r(gn(t,e*s,e*(s+1),{units:n}))}(t,e,r,(function(t){o.push(t)}))})),c(o)},t.unkinkPolygon=function(t){var e=[];return D(t,(function(t){"Polygon"===t.geometry.type&&O(hs(t),(function(n){e.push(o(n.geometry.coordinates,t.properties))}))})),c(e)},t.greatCircle=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.properties,i=n.npoints,o=n.offset;return t=U(t),e=U(e),r=r||{},i=i||100,o=o||10,new xs({x:t[0],y:t[1]},{x:e[0],y:e[1]},r).Arc(i,{offset:o}).json()},t.lineSegment=Ye,t.lineSplit=function(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");var n=K(t),r=K(e);if("LineString"!==n)throw new Error("line must be LineString");if("FeatureCollection"===r)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===r)throw new Error("splitter cannot be a GeometryCollection");var i=xn(e,{precision:7});switch(r){case"Point":return Sn(t,i);case"MultiPoint":return In(t,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return In(t,We(t,i))}},t.lineArc=Cn,t.polygonToLine=Mn,t.lineToPolygon=Rn,t.bboxClip=function(t,e){var n=function(t){return t.geometry?t.geometry.type:t.type}(t),r=V(t),i=t.properties;switch(n){case"LineString":case"MultiLineString":var s=[];return"LineString"===n&&(r=[r]),r.forEach((function(t){bs(t,e,s)})),1===s.length?a(s[0],i):l(s,i);case"Polygon":return o(jn(r,e),i);case"MultiPolygon":return h(r.map((function(t){return jn(t,e)})),i);default:throw new Error("geometry "+n+" not supported")}},t.lineOverlap=Un,t.sector=function(t,e,n,r,i){if(!I(i=i||{}))throw new Error("options is invalid");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"!=typeof i)throw new Error("options must be an object");if(Xn(n)===Xn(r))return ae(t,e,i);var s=V(t),a=[[s]];return P(Cn(t,e,n,r,i),(function(t){a[0].push(t)})),a[0].push(s),o(a)},t.rhumbBearing=Je,t.rhumbDistance=Ze,t.rhumbDestination=Yn,t.polygonTangents=function(t,e){var n,i,o,s=V(t),a=V(e);switch(K(e)){case"Polygon":n=a[0][0],i=a[0][0],o=Hn(a[0][0],a[0][a[0].length-1],s);var u=Wn(a[0],s,o,void 0,n,i);n=u[0],i=u[1];break;case"MultiPolygon":n=a[0][0][0],i=a[0][0][0],o=Hn(a[0][0][0],a[0][0][a[0][0].length-1],s),a.forEach((function(t){var e=Wn(t[0],s,o,void 0,n,i);n=e[0],i=e[1]}))}return c([r(n),r(i)])},t.rewind=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.reverse||!1,r=e.mutate||!1;if(!t)throw new Error("<geojson> is required");if("boolean"!=typeof n)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof r)throw new Error("<mutate> must be a boolean");!1===r&&(t=Dt(t));var i=[];switch(t.type){case"GeometryCollection":return A(t,(function(t){Jn(t,n)})),t;case"FeatureCollection":return O(t,(function(t){O(Jn(t,n),(function(t){i.push(t)}))})),c(i)}return Jn(t,n)},t.isobands=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},s=n.breaksProperties||[];if(H(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!I(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(s))throw new Error("breaksProperties is not an Array");var a=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;H(t,"Point","input must contain Points");for(var o=function(t,e){var n={};return O(t,(function(t){var e=V(t)[1];n[e]||(n[e]=[]),n[e].push(t)})),Object.keys(n).map((function(t){return n[t].sort((function(t,e){return V(t)[0]-V(e)[0]}))})).sort((function(t,n){return e?V(t[0])[1]-V(n[0])[1]:V(n[0])[1]-V(t[0])[1]}))}(t,r),s=[],a=0;a<o.length;a++){for(var u=o[a],c=[],l=0;l<u.length;l++){var f=u[l];f.properties[n]?c.push(f.properties[n]):c.push(0),!0===i&&(f.properties.matrixPosition=[a,l])}s.push(c)}return s}(t,{zProperty:r,flip:!0}),u=function(t,e,n){for(var r=[],i=1;i<e.length;i++){var s=+e[i-1],a=+e[i],u=function(t){for(var e=t.map((function(t){return{lrCoordinates:t,grouped:!1}})),n=[];!function(t){for(var e=0;e<t.length;e++)if(!1===t[e].grouped)return!1;return!0}(e);)for(var r=0;r<e.length;r++)if(!e[r].grouped){var i=[];i.push(e[r].lrCoordinates),e[r].grouped=!0;for(var s=o([e[r].lrCoordinates]),a=r+1;a<e.length;a++)e[a].grouped||function(t,e){for(var n=fe(t),r=0;r<n.features.length;r++)if(!Ct(n.features[r],e))return!1;return!0}(o([e[a].lrCoordinates]),s)&&(i.push(e[a].lrCoordinates),e[a].grouped=!0);n.push(i)}return n}(function(t){var e=[],n=[];t.forEach((function(t){var r=cn(o([t]));n.push(r),e.push({ring:t,area:r})})),n.sort((function(t,e){return e-t}));var r=[];return n.forEach((function(t){for(var n=0;n<e.length;n++)if(e[n].area===t){r.push(e[n].ring),e.splice(n,1);break}})),r}(Qn(t,s,a-s))),c={};c.groupedRings=u,c[n]=s+"-"+a,r.push(c)}return r}(a,e,r);return c((u=function(t,e,n){var r=z(n),i=r[2]-r[0],o=r[3]-r[1],s=r[0],a=r[1],u=e[0].length-1,c=e.length-1,l=i/u,f=o/c,h=function(t){t[0]=t[0]*l+s,t[1]=t[1]*f+a};return t.forEach((function(t){t.groupedRings.forEach((function(t){t.forEach((function(t){t.forEach(h)}))}))})),t}(u,a,t)).map((function(t,e){if(s[e]&&!I(s[e]))throw new Error("Each mappedProperty is required to be an Object");var n=Object.assign({},i,s[e]);return n[r]=t[r],h(t.groupedRings,n)})))},t.transformRotate=nr,t.transformScale=rr,t.transformTranslate=function(t,e,n,r){if(!I(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation,s=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=-n),!1!==s&&void 0!==s||(t=Dt(t)),P(t,(function(t){var r=V(Yn(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)})),t},t.lineOffset=function(t,e,n){if(!I(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");var i=K(t),o=t.properties;switch(i){case"LineString":return ar(t,e,r);case"MultiLineString":var s=[];return D(t,(function(t){s.push(ar(t,e,r).geometry.coordinates)})),l(s,o);default:throw new Error("geometry "+i+" is not supported")}},t.polygonize=function(t){var e=xa.fromGeoJson(t);e.deleteDangles(),e.deleteCutEdges();var n=[],r=[];return e.getEdgeRings().filter((function(t){return t.isValid()})).forEach((function(t){t.isHole()?n.push(t):r.push(t)})),n.forEach((function(t){ma.findEdgeRingContaining(t,r)&&r.push(t)})),c(r.map((function(t){return t.toPolygon()})))},t.booleanDisjoint=function(t,e){var n;return D(t,(function(t){D(e,(function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return!function(t,e){return t[0]===e[0]&&t[1]===e[1]}(t.coordinates,e.coordinates);case"LineString":return!lr(e,t);case"Polygon":return!Ct(t,e)}break;case"LineString":switch(e.type){case"Point":return!lr(t,e);case"LineString":return!function(t,e){return We(t,e).features.length>0}(t,e);case"Polygon":return!fr(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Ct(e,t);case"LineString":return!fr(t,e);case"Polygon":return!function(t,e){for(var n=0;n<t.coordinates[0].length;n++)if(Ct(t.coordinates[0][n],e))return!0;for(var r=0;r<e.coordinates[0].length;r++)if(Ct(e.coordinates[0][r],t))return!0;return!1}(e,t)}}}(t.geometry,e.geometry)}))})),n},t.booleanContains=function(t,e){var n=K(t),r=K(e),i=$(t),o=$(e),s=V(t),a=V(e);switch(n){case"Point":switch(r){case"Point":return pr(s,a);default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"Point":return function(t,e){var n,r=!1;for(n=0;n<t.coordinates.length;n++)if(pr(t.coordinates[n],e.coordinates)){r=!0;break}return r}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++){for(var r=!1,i=0;i<t.coordinates.length;i++)if(pr(e.coordinates[n],t.coordinates[i])){r=!0;break}if(!r)return!1}return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"Point":return dn(o,i,{ignoreEndVertices:!0});case"LineString":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(dn({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!0})&&(n=!0),!dn({type:"Point",coordinates:e.coordinates[r]},t,{ignoreEndVertices:!1}))return!1;return n}(i,o);case"MultiPoint":return function(t,e){for(var n=!1,r=0;r<e.coordinates.length;r++)if(dn(e.coordinates[r],t,{ignoreEndVertices:!0})&&(n=!0),!dn(e.coordinates[r],t))return!1;return!!n}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Point":return Ct(o,i,{ignoreBoundary:!0});case"LineString":return function(t,e){var n=!1,r=0;if(!hr(z(t),z(e)))return!1;for(;r<e.coordinates.length-1;r++)if(Ct({type:"Point",coordinates:function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(e.coordinates[r],e.coordinates[r+1])},t,{ignoreBoundary:!0})){n=!0;break}return n}(i,o);case"Polygon":return function(t,e){if(!hr(z(t),z(e)))return!1;for(var n=0;n<e.coordinates[0].length;n++)if(!Ct(e.coordinates[0][n],t))return!1;return!0}(i,o);case"MultiPoint":return function(t,e){for(var n=0;n<e.coordinates.length;n++)if(!Ct(e.coordinates[n],t,{ignoreBoundary:!0}))return!1;return!0}(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},t.booleanCrosses=function(t,e){var n=K(t),r=K(e),i=$(t),o=$(e);switch(n){case"MultiPoint":switch(r){case"LineString":return gr(i,o);case"Polygon":return yr(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"MultiPoint":return gr(o,i);case"LineString":return function(t,e){if(We(t,e).features.length>0)for(var n=0;n<t.coordinates.length-1;n++)for(var r=0;r<e.coordinates.length-1;r++){var i=!0;if(0!==r&&r!==e.coordinates.length-2||(i=!1),vr(t.coordinates[n],t.coordinates[n+1],e.coordinates[r],i))return!0}return!1}(i,o);case"Polygon":return dr(i,o);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"MultiPoint":return yr(o,i);case"LineString":return dr(o,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},t.booleanClockwise=$n,t.booleanOverlap=br,t.booleanPointOnLine=dn,t.booleanEqual=function(t,e){if(!t)throw new Error("feature1 is required");if(!e)throw new Error("feature2 is required");return K(t)===K(e)&&new Sa({precision:6}).compare($t(t),$t(e))},t.booleanWithin=yn,t.clone=Dt,t.cleanCoords=$t,t.clustersDbscan=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.minPoints,i=n.units;if(H(t,"Point","Input must contain Points"),null==e)throw new Error("maxDistance is required");if(!(Math.sign(e)>0))throw new Error("Invalid maxDistance");if(!(null==r||Math.sign(r)>0))throw new Error("Invalid minPoints");t=Dt(t),r=r||3;var o=new Ma.DBSCAN,s=-1;return o.run(T(t),b(e,i),r,Ft).forEach((function(e){s++,e.forEach((function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster=s,n.properties.dbscan="core"}))})),o.noise.forEach((function(e){var n=t.features[e];n.properties||(n.properties={}),n.properties.cluster?n.properties.dbscan="edge":n.properties.dbscan="noise"})),t},t.clustersKmeans=function(t,e){if("object"!=typeof(e=e||{}))throw new Error("options is invalid");var n=e.numberOfClusters,r=e.mutate;H(t,"Point","Input must contain Points");var i=t.features.length;(n=n||Math.round(Math.sqrt(i/2)))>i&&(n=i),!1!==r&&void 0!==r||(t=Dt(t));var o=T(t),s=o.slice(0,n),a=Fa(o,n,s),u={};return a.centroids.forEach((function(t,e){u[e]=t})),O(t,(function(t,e){var n=a.idxs[e];t.properties.cluster=n,t.properties.centroid=u[n]})),t},t.pointToLineDistance=on,t.booleanParallel=function(t,e){if(!t)throw new Error("line1 is required");if(!e)throw new Error("line2 is required");if("LineString"!==Er(t,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==Er(e,"line2"))throw new Error("line2 must be a LineString");for(var n=Ye($t(t)).features,r=Ye($t(e)).features,i=0;i<n.length;i++){var o=n[i].geometry.coordinates;if(!r[i])break;if(!function(t,e){return m(Je(t[0],t[1]))===m(Je(e[0],e[1]))}(o,r[i].geometry.coordinates))return!1}return!0},t.shortestPath=function(t,n,i){if(!I(i=i||{}))throw new Error("options is invalid");var o=i.resolution,s=i.minDistance,u=i.obstacles||c([]);if(!t)throw new Error("start is required");if(!n)throw new Error("end is required");if(o&&!E(o)||o<=0)throw new Error("options.resolution must be a number, greater than 0");if(s)throw new Error("options.minDistance is not yet implemented");var l=U(t),f=U(n);switch(t=r(l),n=r(f),K(u)){case"FeatureCollection":if(0===u.features.length)return a([l,f]);break;case"Polygon":u=c([e($(u))]);break;default:throw new Error("invalid obstacles")}var h=u;h.features.push(t),h.features.push(n);var p=z(rr(re(z(h)),1.15));o||(o=Ft([p[0],p[1]],[p[2],p[1]],i)/100),h.features.pop(),h.features.pop();for(var g=p[0],d=p[1],y=p[2],v=p[3],m=o/Ft([g,d],[y,d],i)*(y-g),_=o/Ft([g,d],[g,v],i)*(v-d),x=y-g,b=v-d,w=(x-Math.floor(x/m)*m)/2,S=[],N=[],P=[],C=[],L=1/0,M=1/0,O=v-(b-Math.floor(b/_)*_)/2,R=0;O>=d;){for(var T=[],A=[],F=g+w,D=0;F<=y;){var k=r([F,O]),j=function(t,e){for(var n=0;n<e.features.length;n++)if(Ct(t,e.features[n]))return!0;return!1}(k,u);T.push(j?0:1),A.push(F+"|"+O);var G=Ft(k,t);!j&&G<L&&(L=G,P={x:D,y:R});var q=Ft(k,n);!j&&q<M&&(M=q,C={x:D,y:R}),F+=m,D++}N.push(T),S.push(A),O-=_,R++}var B=new Sr(N,{diagonal:!0}),V=B.grid[P.y][P.x],X=B.grid[C.y][C.x],Y=[l];return Da.search(B,V,X).forEach((function(t){var e=S[t.x][t.y].split("|");Y.push([+e[0],+e[1]])})),Y.push(f),$t(a(Y))},t.voronoi=function(t,e){if(!I(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 H(t,"Point","points"),c(function(){function t(t){return new Zr(t.map((function(r,i){var o=[Math.round(e(r,i,t)/Xa)*Xa,Math.round(n(r,i,t)/Xa)*Xa];return o.index=i,o.data=r,o})),r)}var e=Cr,n=Lr,r=null;return t.polygons=function(e){return t(e).polygons()},t.links=function(e){return t(e).links()},t.triangles=function(e){return t(e).triangles()},t.x=function(n){return arguments.length?(e="function"==typeof n?n:ka(+n),t):e},t.y=function(e){return arguments.length?(n="function"==typeof e?e:ka(+e),t):n},t.extent=function(e){return arguments.length?(r=null==e?null:[[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]],t):r&&[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},t.size=function(e){return arguments.length?(r=null==e?null:[[0,0],[+e[0],+e[1]]],t):r&&[r[1][0]-r[0][0],r[1][1]-r[0][1]]},t}().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(Qr))},t.ellipse=ti,t.centerMean=ni,t.centerMedian=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.counter||10;if(!E(n))throw new Error("counter must be a number");var r=e.weight,i=ni(t,{weight:e.weight}),o=c([]);return O(t,(function(t){o.features.push(le(t,{weight:t.properties[r]}))})),o.properties={tolerance:e.tolerance,medianCandidates:[]},ri(i.geometry.coordinates,[0,0],o,n)},t.standardDeviationalEllipse=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.steps||64,r=e.weight,i=e.properties||{};if(!E(n))throw new Error("steps must be a number");if(!I(i))throw new Error("properties must be a number");var o=T(t).length,s=ni(t,{weight:r}),a=0,u=0,l=0;O(t,(function(t){var e=t.properties[r]||1,n=ii(V(t),V(s));a+=Math.pow(n.x,2)*e,u+=Math.pow(n.y,2)*e,l+=n.x*n.y*e}));var f=a-u,h=Math.sqrt(Math.pow(f,2)+4*Math.pow(l,2)),p=2*l,g=Math.atan((f+h)/p),d=180*g/Math.PI,y=0,v=0,m=0;O(t,(function(t){var e=t.properties[r]||1,n=ii(V(t),V(s));y+=Math.pow(n.x*Math.cos(g)-n.y*Math.sin(g),2)*e,v+=Math.pow(n.x*Math.sin(g)+n.y*Math.cos(g),2)*e,m+=e}));var _=Math.sqrt(2*y/m),x=Math.sqrt(2*v/m),b=ti(s,_,x,{units:"degrees",angle:d,steps:n,properties:i}),w=Mt(t,c([b])),S={meanCenterCoordinates:V(s),semiMajorAxis:_,semiMinorAxis:x,numberOfFeatures:o,angle:d,percentageWithinEllipse:100*T(w).length/o};return b.properties.standardDeviationalEllipse=S,b},t.difference=function(t,n){var r=$(t),i=$(n),o=t.properties||{};if(r=Ri(r),i=Ri(i),!r)return null;if(!i)return e(r,o);var s=new nl,a=s.read(r),u=s.read(i),c=op.difference(a,u);return c.isEmpty()?null:e((new rl).write(c),o)},t.buffer=function(t,e,n){var r=(n=n||{}).units,i=n.steps||64;if(!t)throw new Error("geojson is required");if("object"!=typeof 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");i=i||64,r=r||"kilometers";var o=[];switch(t.type){case"GeometryCollection":return A(t,(function(t){var n=co(t,e,r,i);n&&o.push(n)})),c(o);case"FeatureCollection":return O(t,(function(t){var n=co(t,e,r,i);n&&O(n,(function(t){t&&o.push(t)}))})),c(o)}return co(t,e,r,i)},t.union=po,t.intersect=go,t.dissolve=function(t,e){if(!I(e=e||{}))throw new Error("options is invalid");var n=e.propertyName;H(t,"Polygon","dissolve");var r=Dt(t),i=r.features,o=[];i.forEach((function(t,e){t.properties.origIndexPosition=e}));var s=Ue();for(var u in s.load(r),i){var c=i[u],l=!1;if(s.search(c).features.forEach((function(t){c=i[u];var e=t.properties.origIndexPosition;if(o.length>0&&0!==e)if(e>o[o.length-1])e-=o.length;else{var r=yo(e,o);0!==r&&(e-=r)}if(e!==+u){var f=i[e];f&&c&&(void 0!==n&&f.properties[n]!==c.properties[n]||br(c,f)&&function(t,e){return We(a(T(t)),a(T(e))).features.length>0}(c,f)&&(i[u]=po(c,f),o.push(t.properties.origIndexPosition),o.sort((function(t,e){return t-e})),s.remove(t),i.splice(e,1),c.properties.origIndexPosition=u,s.remove(c,(function(t,e){return t.properties.origIndexPosition===e.properties.origIndexPosition})),l=!0))}})),l){if(!c)continue;c.properties.origIndexPosition=u,s.insert(c),u--}}return i.forEach((function(t){delete t.properties.origIndexPosition,delete t.bbox})),r},t.hexGrid=vo,t.mask=function(t,e){var n=function(t){return o(t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(e),r=function(t){var e=[],n=[];return D(t,(function(t){var r=t.geometry.coordinates,i=r[0],s=r.slice(1);e.push(o([i])),s.forEach((function(t){n.push(o([t]))}))})),[c(e),c(n)]}(t),i=r[0],s=r[1];return function(t,e,n){var r=[];return r.push(t.geometry.coordinates[0]),D(e,(function(t){r.push(t.geometry.coordinates[0])})),D(n,(function(t){r.push(t.geometry.coordinates[0])})),o(r)}(n,i=mo(i),s=mo(s))},t.squareGrid=xo,t.triangleGrid=bo,t.interpolate=function(t,e,n){if("object"!=typeof(n=n||{}))throw new Error("options is invalid");var r=n.gridType,i=n.property,o=n.weight;if(!t)throw new Error("points is required");if(H(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==o&&"number"!=typeof o)throw new Error("weight must be a number");i=i||"elevation",r=r||"square",o=o||1;var s,a=z(t);switch(r){case"point":case"points":s=_n(a,e,n);break;case"square":case"squares":s=xo(a,e,n);break;case"hex":case"hexes":s=vo(a,e,n);break;case"triangle":case"triangles":s=bo(a,e,n);break;default:throw new Error("invalid gridType")}var u=[];return O(s,(function(e){var s=0,a=0;O(t,(function(t){var u,c=Ft("point"===r?e:le(e),t,n);if(void 0!==i&&(u=t.properties[i]),void 0===u&&(u=t.geometry.coordinates[2]),void 0===u)throw new Error("zValue is missing");0===c&&(s=u);var l=1/Math.pow(c,o);a+=l,s+=l*u}));var c=Dt(e);c.properties[i]=s/a,u.push(c)})),c(u)},t.pointOnSurface=an,t.polygonToLineString=Mn,t.lineStringToPolygon=Rn,t.inside=Ct,t.within=Mt,t.bezier=ne,t.nearest=Ce,t.pointOnLine=$e,t.lineDistance=pn,t.radians2degrees=_,t.degrees2radians=x,t.distanceToDegrees=v,t.distanceToRadians=y,t.radiansToDistance=d,t.bearingToAngle=m,t.convertDistance=b,t.toMercator=Qe,t.toWgs84=tn,t.randomPosition=oi,t.randomPoint=si,t.randomPolygon=ai,t.randomLineString=ui,t.getCluster=li,t.clusterEach=fi,t.clusterReduce=hi,t.createBins=pi,t.applyFilter=gi,t.propertiesContainsFilter=di,t.filterProperties=yi,t.earthRadius=wo,t.factors=Eo,t.unitsFactors=Io,t.areaFactors=So,t.feature=e,t.geometry=n,t.point=r,t.points=i,t.polygon=o,t.polygons=s,t.lineString=a,t.lineStrings=u,t.featureCollection=c,t.multiLineString=l,t.multiPoint=f,t.multiPolygon=h,t.geometryCollection=p,t.round=g,t.radiansToLength=d,t.lengthToRadians=y,t.lengthToDegrees=v,t.bearingToAzimuth=m,t.radiansToDegrees=_,t.degreesToRadians=x,t.convertLength=b,t.convertArea=w,t.isNumber=E,t.isObject=I,t.validateBBox=S,t.validateId=N,t.getCoord=U,t.getCoords=V,t.containsNumber=X,t.geojsonType=Y,t.featureOf=W,t.collectionOf=H,t.getGeom=$,t.getGeomType=J,t.getType=K,t.coordEach=P,t.coordReduce=C,t.propEach=L,t.propReduce=M,t.featureEach=O,t.featureReduce=R,t.coordAll=T,t.geomEach=A,t.geomReduce=F,t.flattenEach=D,t.flattenReduce=k,t.segmentEach=j,t.segmentReduce=G,t.lineEach=q,t.lineReduce=B,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){var r=n(8).f,i=n(14),o=n(5)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(20),i=n(5)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e,n){var r=n(0),i=n(24),o=n(3),s=n(73),a="["+s+"]",u=RegExp("^"+a+a+"*"),c=RegExp(a+a+"*$"),l=function(t,e,n){var i={},a=o((function(){return!!s[t]()||"​…"!="​…"[t]()})),u=i[t]=a?e(f):s[t];n&&(i[n]=u),r(r.P+r.F*a,"String",i)},f=l.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(c,"")),t};t.exports=l},function(t,e){t.exports={}},function(t,e,n){var r=n(18),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(29)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(20);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";var r=n(1);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){var r=n(1),i=n(10),o=n(5)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||null==(n=r(s)[o])?e:i(n)}},function(t,e,n){var r=n(15),i=n(6),o=n(35);t.exports=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),l=o(s,c);if(t&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(20);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(21),i=n(24);t.exports=function(t){return function(e,n){var o,s,a=String(i(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u))<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):s-56320+(o-55296<<10)+65536}}},function(t,e,n){var r=n(4),i=n(20),o=n(5)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){var r=n(5)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],s=o[r]();s.next=function(){return{done:n=!0}},o[r]=function(){return s},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var r=n(45),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},function(t,e,n){"use strict";n(114);var r=n(12),i=n(11),o=n(3),s=n(24),a=n(5),u=n(88),c=a("species"),l=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var h=a(t),p=!o((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),g=p?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[h](""),!e})):void 0;if(!p||!g||"replace"===t&&!l||"split"===t&&!f){var d=/./[h],y=n(s,h,""[t],(function(t,e,n,r,i){return e.exec===u?p&&!i?{done:!0,value:d.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),v=y[0],m=y[1];r(String.prototype,t,v),i(RegExp.prototype,h,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},function(t,e,n){var r=n(2).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){"use strict";var r=n(2),i=n(0),o=n(12),s=n(41),a=n(30),u=n(40),c=n(39),l=n(4),f=n(3),h=n(58),p=n(44),g=n(74);t.exports=function(t,e,n,d,y,v){var m=r[t],_=m,x=y?"set":"add",b=_&&_.prototype,w={},E=function(t){var e=b[t];o(b,t,"delete"==t||"has"==t?function(t){return!(v&&!l(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return v&&!l(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof _&&(v||b.forEach&&!f((function(){(new _).entries().next()})))){var I=new _,S=I[x](v?{}:-0,1)!=I,N=f((function(){I.has(1)})),P=h((function(t){new _(t)})),C=!v&&f((function(){for(var t=new _,e=5;e--;)t[x](e,e);return!t.has(-0)}));P||((_=e((function(e,n){c(e,_,t);var r=g(new m,e,_);return null!=n&&u(n,y,r[x],r),r}))).prototype=b,b.constructor=_),(N||C)&&(E("delete"),E("has"),y&&E("get")),(C||S)&&E(x),v&&b.clear&&delete b.clear}else _=d.getConstructor(e,t,y,x),s(_.prototype,n),a.NEED=!0;return p(_,t),w[t]=_,i(i.G+i.W+i.F*(_!=m),w),v||d.setStrong(_,t,y),_}},function(t,e,n){for(var r,i=n(2),o=n(11),s=n(33),a=s("typed_array"),u=s("view"),c=!(!i.ArrayBuffer||!i.DataView),l=c,f=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(r=i[h[f++]])?(o(r.prototype,a,!0),o(r.prototype,u,!0)):l=!1;t.exports={ABV:c,CONSTR:l,TYPED:a,VIEW:u}},function(t,e,n){"use strict";t.exports=n(29)||!n(3)((function(){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete n(2)[t]}))},function(t,e,n){"use strict";var r=n(0);t.exports=function(t){r(r.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,n){"use strict";var r=n(0),i=n(10),o=n(19),s=n(40);t.exports=function(t){r(r.S,t,{from:function(t){var e,n,r,a,u=arguments[1];return i(this),(e=void 0!==u)&&i(u),null==t?new this:(n=[],e?(r=0,a=o(u,arguments[2],2),s(t,!1,(function(t){n.push(a(t,r++))}))):s(t,!1,n.push,n),new this(n))}})}},function(t,e,n){var r=n(4),i=n(2).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(2),i=n(18),o=n(29),s=n(96),a=n(8).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){var r=n(48)("keys"),i=n(33);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(2).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(4),i=n(1),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(19)(Function.call,n(16).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,n){var r=n(4),i=n(72).set;t.exports=function(t,e,n){var o,s=e.constructor;return s!==n&&"function"==typeof s&&(o=s.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},function(t,e,n){"use strict";var r=n(21),i=n(24);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e,n){"use strict";var r=n(29),i=n(0),o=n(12),s=n(11),a=n(47),u=n(79),c=n(44),l=n(17),f=n(5)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,g,d,y,v){u(n,e,g);var m,_,x,b=function(t){if(!h&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",E="values"==d,I=!1,S=t.prototype,N=S[f]||S["@@iterator"]||d&&S[d],P=N||b(d),C=d?E?b("entries"):P:void 0,L="Array"==e&&S.entries||N;if(L&&(x=l(L.call(new t)))!==Object.prototype&&x.next&&(c(x,w,!0),r||"function"==typeof x[f]||s(x,f,p)),E&&N&&"values"!==N.name&&(I=!0,P=function(){return N.call(this)}),r&&!v||!h&&!I&&S[f]||s(S,f,P),a[e]=P,a[w]=p,d)if(m={values:E?P:b("values"),keys:y?P:b("keys"),entries:C},v)for(_ in m)_ in S||o(S,_,m[_]);else i(i.P+i.F*(h||I),e,m);return m}},function(t,e,n){"use strict";var r=n(36),i=n(32),o=n(44),s={};n(11)(s,n(5)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(s,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(57),i=n(24);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var r=n(5)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){var r=n(47),i=n(5)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){"use strict";var r=n(8),i=n(32);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){var r=n(45),i=n(5)("iterator"),o=n(47);t.exports=n(18).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(227);t.exports=function(t,e){return new(r(t))(e)}},function(t,e,n){"use strict";var r=n(9),i=n(35),o=n(6);t.exports=function(t){for(var e=r(this),n=o(e.length),s=arguments.length,a=i(s>1?arguments[1]:void 0,n),u=s>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>a;)e[a++]=t;return e}},function(t,e,n){"use strict";var r=n(31),i=n(113),o=n(47),s=n(15);t.exports=n(78)(Array,"Array",(function(t,e){this._t=s(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";var r,i,o=n(51),s=RegExp.prototype.exec,a=String.prototype.replace,u=s,c=(r=/a/,i=/b*/g,s.call(r,"a"),s.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),l=void 0!==/()??/.exec("")[1];(c||l)&&(u=function(t){var e,n,r,i,u=this;return l&&(n=new RegExp("^"+u.source+"$(?!\\s)",o.call(u))),c&&(e=u.lastIndex),r=s.call(u,t),c&&r&&(u.lastIndex=u.global?r.index+r[0].length:e),l&&r&&r.length>1&&a.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=u},function(t,e,n){"use strict";var r=n(56)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){var r,i,o,s=n(19),a=n(103),u=n(71),c=n(67),l=n(2),f=l.process,h=l.setImmediate,p=l.clearImmediate,g=l.MessageChannel,d=l.Dispatch,y=0,v={},m=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},_=function(t){m.call(t.data)};h&&p||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++y]=function(){a("function"==typeof t?t:Function(t),e)},r(y),y},p=function(t){delete v[t]},"process"==n(20)(f)?r=function(t){f.nextTick(s(m,t,1))}:d&&d.now?r=function(t){d.now(s(m,t,1))}:g?(o=(i=new g).port2,i.port1.onmessage=_,r=s(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",_,!1)):r="onreadystatechange"in c("script")?function(t){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),m.call(t)}}:function(t){setTimeout(s(m,t,1),0)}),t.exports={set:h,clear:p}},function(t,e,n){var r=n(2),i=n(90).set,o=r.MutationObserver||r.WebKitMutationObserver,s=r.process,a=r.Promise,u="process"==n(20)(s);t.exports=function(){var t,e,n,c=function(){var r,i;for(u&&(r=s.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){s.nextTick(c)};else if(!o||r.navigator&&r.navigator.standalone)if(a&&a.resolve){var l=a.resolve(void 0);n=function(){l.then(c)}}else n=function(){i.call(r,c)};else{var f=!0,h=document.createTextNode("");new o(c).observe(h,{characterData:!0}),n=function(){h.data=f=!f}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e,n){"use strict";var r=n(10);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},function(t,e,n){"use strict";var r=n(2),i=n(7),o=n(29),s=n(63),a=n(11),u=n(41),c=n(3),l=n(39),f=n(21),h=n(6),p=n(123),g=n(37).f,d=n(8).f,y=n(86),v=n(44),m=r.ArrayBuffer,_=r.DataView,x=r.Math,b=r.RangeError,w=r.Infinity,E=m,I=x.abs,S=x.pow,N=x.floor,P=x.log,C=x.LN2,L=i?"_b":"buffer",M=i?"_l":"byteLength",O=i?"_o":"byteOffset";function R(t,e,n){var r,i,o,s=new Array(n),a=8*n-e-1,u=(1<<a)-1,c=u>>1,l=23===e?S(2,-24)-S(2,-77):0,f=0,h=t<0||0===t&&1/t<0?1:0;for((t=I(t))!=t||t===w?(i=t!=t?1:0,r=u):(r=N(P(t)/C),t*(o=S(2,-r))<1&&(r--,o*=2),(t+=r+c>=1?l/o:l*S(2,1-c))*o>=2&&(r++,o/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(t*o-1)*S(2,e),r+=c):(i=t*S(2,c-1)*S(2,e),r=0));e>=8;s[f++]=255&i,i/=256,e-=8);for(r=r<<e|i,a+=e;a>0;s[f++]=255&r,r/=256,a-=8);return s[--f]|=128*h,s}function T(t,e,n){var r,i=8*n-e-1,o=(1<<i)-1,s=o>>1,a=i-7,u=n-1,c=t[u--],l=127&c;for(c>>=7;a>0;l=256*l+t[u],u--,a-=8);for(r=l&(1<<-a)-1,l>>=-a,a+=e;a>0;r=256*r+t[u],u--,a-=8);if(0===l)l=1-s;else{if(l===o)return r?NaN:c?-w:w;r+=S(2,e),l-=s}return(c?-1:1)*r*S(2,l-e)}function A(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function F(t){return[255&t]}function D(t){return[255&t,t>>8&255]}function k(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function j(t){return R(t,52,8)}function G(t){return R(t,23,4)}function q(t,e,n){d(t.prototype,e,{get:function(){return this[n]}})}function B(t,e,n,r){var i=p(+n);if(i+e>t[M])throw b("Wrong index!");var o=t[L]._b,s=i+t[O],a=o.slice(s,s+e);return r?a:a.reverse()}function z(t,e,n,r,i,o){var s=p(+n);if(s+e>t[M])throw b("Wrong index!");for(var a=t[L]._b,u=s+t[O],c=r(+i),l=0;l<e;l++)a[u+l]=c[o?l:e-l-1]}if(s.ABV){if(!c((function(){m(1)}))||!c((function(){new m(-1)}))||c((function(){return new m,new m(1.5),new m(NaN),"ArrayBuffer"!=m.name}))){for(var U,V=(m=function(t){return l(this,m),new E(p(t))}).prototype=E.prototype,X=g(E),Y=0;X.length>Y;)(U=X[Y++])in m||a(m,U,E[U]);o||(V.constructor=m)}var W=new _(new m(2)),H=_.prototype.setInt8;W.setInt8(0,2147483648),W.setInt8(1,2147483649),!W.getInt8(0)&&W.getInt8(1)||u(_.prototype,{setInt8:function(t,e){H.call(this,t,e<<24>>24)},setUint8:function(t,e){H.call(this,t,e<<24>>24)}},!0)}else m=function(t){l(this,m,"ArrayBuffer");var e=p(t);this._b=y.call(new Array(e),0),this[M]=e},_=function(t,e,n){l(this,_,"DataView"),l(t,m,"DataView");var r=t[M],i=f(e);if(i<0||i>r)throw b("Wrong offset!");if(i+(n=void 0===n?r-i:h(n))>r)throw b("Wrong length!");this[L]=t,this[O]=i,this[M]=n},i&&(q(m,"byteLength","_l"),q(_,"buffer","_b"),q(_,"byteLength","_l"),q(_,"byteOffset","_o")),u(_.prototype,{getInt8:function(t){return B(this,1,t)[0]<<24>>24},getUint8:function(t){return B(this,1,t)[0]},getInt16:function(t){var e=B(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=B(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return A(B(this,4,t,arguments[1]))},getUint32:function(t){return A(B(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return T(B(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return T(B(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){z(this,1,t,F,e)},setUint8:function(t,e){z(this,1,t,F,e)},setInt16:function(t,e){z(this,2,t,D,e,arguments[2])},setUint16:function(t,e){z(this,2,t,D,e,arguments[2])},setInt32:function(t,e){z(this,4,t,k,e,arguments[2])},setUint32:function(t,e){z(this,4,t,k,e,arguments[2])},setFloat32:function(t,e){z(this,4,t,G,e,arguments[2])},setFloat64:function(t,e){z(this,8,t,j,e,arguments[2])}});v(m,"ArrayBuffer"),v(_,"DataView"),a(_.prototype,s.VIEW,!0),e.ArrayBuffer=m,e.DataView=_},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){t.exports=!n(7)&&!n(3)((function(){return 7!=Object.defineProperty(n(67)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){e.f=n(5)},function(t,e,n){var r=n(14),i=n(15),o=n(53)(!1),s=n(69)("IE_PROTO");t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)n!=s&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},function(t,e,n){var r=n(8),i=n(1),o=n(34);t.exports=n(7)?Object.defineProperties:function(t,e){i(t);for(var n,s=o(e),a=s.length,u=0;a>u;)r.f(t,n=s[u++],e[n]);return t}},function(t,e,n){var r=n(15),i=n(37).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return s.slice()}}(t):i(r(t))}},function(t,e,n){"use strict";var r=n(7),i=n(34),o=n(54),s=n(50),a=n(9),u=n(49),c=Object.assign;t.exports=!c||n(3)((function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r}))?function(t,e){for(var n=a(t),c=arguments.length,l=1,f=o.f,h=s.f;c>l;)for(var p,g=u(arguments[l++]),d=f?i(g).concat(f(g)):i(g),y=d.length,v=0;y>v;)p=d[v++],r&&!h.call(g,p)||(n[p]=g[p]);return n}:c},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var r=n(10),i=n(4),o=n(103),s=[].slice,a={},u=function(t,e,n){if(!(e in a)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";a[e]=Function("F,a","return new F("+r.join(",")+")")}return a[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=s.call(arguments,1),a=function(){var r=n.concat(s.call(arguments));return this instanceof a?u(e,r.length,r):o(e,r,t)};return i(e.prototype)&&(a.prototype=e.prototype),a}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(2).parseInt,i=n(46).trim,o=n(73),s=/^[-+]?0[xX]/;t.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(t,e){var n=i(String(t),3);return r(n,e>>>0||(s.test(n)?16:10))}:r},function(t,e,n){var r=n(2).parseFloat,i=n(46).trim;t.exports=1/r(n(73)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=r(e);return 0===n&&"-"==e.charAt(0)?-0:n}:r},function(t,e,n){var r=n(20);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=r(t))throw TypeError(e);return+t}},function(t,e,n){var r=n(4),i=Math.floor;t.exports=function(t){return!r(t)&&isFinite(t)&&i(t)===t}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){var r=n(76),i=Math.pow,o=i(2,-52),s=i(2,-23),a=i(2,127)*(2-s),u=i(2,-126);t.exports=Math.fround||function(t){var e,n,i=Math.abs(t),c=r(t);return i<u?c*(i/u/s+1/o-1/o)*u*s:(n=(e=(1+s/o)*i)-(e-i))>a||n!=n?c*(1/0):c*n}},function(t,e,n){var r=n(1);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){var r=n(10),i=n(9),o=n(49),s=n(6);t.exports=function(t,e,n,a,u){r(e);var c=i(t),l=o(c),f=s(c.length),h=u?f-1:0,p=u?-1:1;if(n<2)for(;;){if(h in l){a=l[h],h+=p;break}if(h+=p,u?h<0:f<=h)throw TypeError("Reduce of empty array with no initial value")}for(;u?h>=0:f>h;h+=p)h in l&&(a=e(a,l[h],h,c));return a}},function(t,e,n){"use strict";var r=n(9),i=n(35),o=n(6);t.exports=[].copyWithin||function(t,e){var n=r(this),s=o(n.length),a=i(t,s),u=i(e,s),c=arguments.length>2?arguments[2]:void 0,l=Math.min((void 0===c?s:i(c,s))-u,s-a),f=1;for(u<a&&a<u+l&&(f=-1,u+=l-1,a+=l-1);l-- >0;)u in n?n[a]=n[u]:delete n[a],a+=f,u+=f;return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var r=n(88);n(0)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(t,e,n){n(7)&&"g"!=/./g.flags&&n(8).f(RegExp.prototype,"flags",{configurable:!0,get:n(51)})},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(1),i=n(4),o=n(92);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var r=n(119),i=n(42);t.exports=n(62)("Map",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=r.getEntry(i(this,"Map"),t);return e&&e.v},set:function(t,e){return r.def(i(this,"Map"),0===t?0:t,e)}},r,!0)},function(t,e,n){"use strict";var r=n(8).f,i=n(36),o=n(41),s=n(19),a=n(39),u=n(40),c=n(78),l=n(113),f=n(38),h=n(7),p=n(30).fastKey,g=n(42),d=h?"_s":"size",y=function(t,e){var n,r=p(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var l=t((function(t,r){a(t,l,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[d]=0,null!=r&&u(r,n,t[c],t)}));return o(l.prototype,{clear:function(){for(var t=g(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[d]=0},delete:function(t){var n=g(this,e),r=y(n,t);if(r){var i=r.n,o=r.p;delete n._i[r.i],r.r=!0,o&&(o.n=i),i&&(i.p=o),n._f==r&&(n._f=i),n._l==r&&(n._l=o),n[d]--}return!!r},forEach:function(t){g(this,e);for(var n,r=s(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!y(g(this,e),t)}}),h&&r(l.prototype,"size",{get:function(){return g(this,e)[d]}}),l},def:function(t,e,n){var r,i,o=y(t,e);return o?o.v=n:(t._l=o={i:i=p(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=o),r&&(r.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=g(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?l(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,l(1))}),n?"entries":"values",!n,!0),f(e)}}},function(t,e,n){"use strict";var r=n(119),i=n(42);t.exports=n(62)("Set",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"Set"),t=0===t?0:t,t)}},r)},function(t,e,n){"use strict";var r,i=n(2),o=n(26)(0),s=n(12),a=n(30),u=n(100),c=n(122),l=n(4),f=n(42),h=n(42),p=!i.ActiveXObject&&"ActiveXObject"in i,g=a.getWeak,d=Object.isExtensible,y=c.ufstore,v=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},m={get:function(t){if(l(t)){var e=g(t);return!0===e?y(f(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(f(this,"WeakMap"),t,e)}},_=t.exports=n(62)("WeakMap",v,m,c,!0,!0);h&&p&&(u((r=c.getConstructor(v,"WeakMap")).prototype,m),a.NEED=!0,o(["delete","has","get","set"],(function(t){var e=_.prototype,n=e[t];s(e,t,(function(e,i){if(l(e)&&!d(e)){this._f||(this._f=new r);var o=this._f[t](e,i);return"set"==t?this:o}return n.call(this,e,i)}))})))},function(t,e,n){"use strict";var r=n(41),i=n(30).getWeak,o=n(1),s=n(4),a=n(39),u=n(40),c=n(26),l=n(14),f=n(42),h=c(5),p=c(6),g=0,d=function(t){return t._l||(t._l=new y)},y=function(){this.a=[]},v=function(t,e){return h(t.a,(function(t){return t[0]===e}))};y.prototype={get:function(t){var e=v(this,t);if(e)return e[1]},has:function(t){return!!v(this,t)},set:function(t,e){var n=v(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var c=t((function(t,r){a(t,c,e,"_i"),t._t=e,t._i=g++,t._l=void 0,null!=r&&u(r,n,t[o],t)}));return r(c.prototype,{delete:function(t){if(!s(t))return!1;var n=i(t);return!0===n?d(f(this,e)).delete(t):n&&l(n,this._i)&&delete n[this._i]},has:function(t){if(!s(t))return!1;var n=i(t);return!0===n?d(f(this,e)).has(t):n&&l(n,this._i)}}),c},def:function(t,e,n){var r=i(o(e),!0);return!0===r?d(t).set(e,n):r[t._i]=n,t},ufstore:d}},function(t,e,n){var r=n(21),i=n(6);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},function(t,e,n){var r=n(37),i=n(54),o=n(1),s=n(2).Reflect;t.exports=s&&s.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){"use strict";var r=n(55),i=n(4),o=n(6),s=n(19),a=n(5)("isConcatSpreadable");t.exports=function t(e,n,u,c,l,f,h,p){for(var g,d,y=l,v=0,m=!!h&&s(h,p,3);v<c;){if(v in u){if(g=m?m(u[v],v,n):u[v],d=!1,i(g)&&(d=void 0!==(d=g[a])?!!d:r(g)),d&&f>0)y=t(e,n,g,o(g.length),y,f-1)-1;else{if(y>=9007199254740991)throw TypeError();e[y]=g}y++}v++}return y}},function(t,e,n){var r=n(6),i=n(75),o=n(24);t.exports=function(t,e,n,s){var a=String(o(t)),u=a.length,c=void 0===n?" ":String(n),l=r(e);if(l<=u||""==c)return a;var f=l-u,h=i.call(c,Math.ceil(f/c.length));return h.length>f&&(h=h.slice(0,f)),s?h+a:a+h}},function(t,e,n){var r=n(7),i=n(34),o=n(15),s=n(50).f;t.exports=function(t){return function(e){for(var n,a=o(e),u=i(a),c=u.length,l=0,f=[];c>l;)n=u[l++],r&&!s.call(a,n)||f.push(t?[n,a[n]]:a[n]);return f}}},function(t,e,n){var r=n(45),i=n(129);t.exports=function(t){return function(){if(r(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},function(t,e,n){var r=n(40);t.exports=function(t,e){var n=[];return r(t,!1,n.push,n,e),n}},function(t,e){t.exports=Math.scale||function(t,e,n,r,i){return 0===arguments.length||t!=t||e!=e||n!=n||r!=r||i!=i?NaN:t===1/0||t===-1/0?t:(t-e)*(i-r)/(n-e)+r}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function o(){}function s(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,s=new Array(o);r<o;r++)s[r]=n[r].fn;return s},c.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,r,o,s){var a=i?i+t:t;if(!this._events[a])return!1;var u,c,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,o),!0;case 6:return l.fn.call(l.context,e,n,r,o,s),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var h,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),f){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,n);break;case 4:l[c].fn.call(l[c].context,e,n,r);break;default:if(!u)for(h=1,u=new Array(f-1);h<f;h++)u[h-1]=arguments[h];l[c].fn.apply(l[c].context,u)}}return!0},c.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,r){var o=i?i+t:t;if(!this._events[o])return this;if(!e)return u(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||r&&!s.once||n&&s.context!==n||u(this,o);else{for(var a=0,c=[],l=s.length;a<l;a++)(s[a].fn!==e||r&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[o]=1===c.length?c[0]:c:u(this,o)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&u(this,e)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,t.exports=c},function(t,e,n){var r=n(337);t.exports="string"==typeof r?r:r.toString()},function(t,e,n){var r=n(339);t.exports="string"==typeof r?r:r.toString()},function(t,e,n){n(135),t.exports=n(341)},function(t,e,n){"use strict";(function(t){if(n(136),n(333),n(334),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;function e(t,e,n){t[e]||Object.defineProperty(t,e,{writable:!0,configurable:!0,value:n})}e(String.prototype,"padLeft","".padStart),e(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach((function(t){[][t]&&e(Array,t,Function.call.bind([][t]))}))}).call(this,n(94))},function(t,e,n){n(137),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189),n(190),n(191),n(192),n(193),n(194),n(195),n(196),n(197),n(198),n(199),n(200),n(201),n(202),n(203),n(204),n(205),n(206),n(207),n(208),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(217),n(218),n(220),n(221),n(222),n(223),n(224),n(225),n(226),n(228),n(229),n(230),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(87),n(241),n(114),n(242),n(115),n(243),n(244),n(245),n(246),n(247),n(118),n(120),n(121),n(248),n(249),n(250),n(251),n(252),n(253),n(254),n(255),n(256),n(257),n(258),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(289),n(290),n(291),n(292),n(293),n(294),n(295),n(296),n(297),n(298),n(299),n(300),n(301),n(302),n(303),n(304),n(305),n(306),n(307),n(308),n(309),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(321),n(322),n(323),n(324),n(325),n(326),n(327),n(328),n(329),n(330),n(331),n(332),t.exports=n(18)},function(t,e,n){"use strict";var r=n(2),i=n(14),o=n(7),s=n(0),a=n(12),u=n(30).KEY,c=n(3),l=n(48),f=n(44),h=n(33),p=n(5),g=n(96),d=n(68),y=n(139),v=n(55),m=n(1),_=n(4),x=n(9),b=n(15),w=n(23),E=n(32),I=n(36),S=n(99),N=n(16),P=n(54),C=n(8),L=n(34),M=N.f,O=C.f,R=S.f,T=r.Symbol,A=r.JSON,F=A&&A.stringify,D=p("_hidden"),k=p("toPrimitive"),j={}.propertyIsEnumerable,G=l("symbol-registry"),q=l("symbols"),B=l("op-symbols"),z=Object.prototype,U="function"==typeof T&&!!P.f,V=r.QObject,X=!V||!V.prototype||!V.prototype.findChild,Y=o&&c((function(){return 7!=I(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=M(z,e);r&&delete z[e],O(t,e,n),r&&t!==z&&O(z,e,r)}:O,W=function(t){var e=q[t]=I(T.prototype);return e._k=t,e},H=U&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},$=function(t,e,n){return t===z&&$(B,e,n),m(t),e=w(e,!0),m(n),i(q,e)?(n.enumerable?(i(t,D)&&t[D][e]&&(t[D][e]=!1),n=I(n,{enumerable:E(0,!1)})):(i(t,D)||O(t,D,E(1,{})),t[D][e]=!0),Y(t,e,n)):O(t,e,n)},J=function(t,e){m(t);for(var n,r=y(e=b(e)),i=0,o=r.length;o>i;)$(t,n=r[i++],e[n]);return t},K=function(t){var e=j.call(this,t=w(t,!0));return!(this===z&&i(q,t)&&!i(B,t))&&(!(e||!i(this,t)||!i(q,t)||i(this,D)&&this[D][t])||e)},Z=function(t,e){if(t=b(t),e=w(e,!0),t!==z||!i(q,e)||i(B,e)){var n=M(t,e);return!n||!i(q,e)||i(t,D)&&t[D][e]||(n.enumerable=!0),n}},Q=function(t){for(var e,n=R(b(t)),r=[],o=0;n.length>o;)i(q,e=n[o++])||e==D||e==u||r.push(e);return r},tt=function(t){for(var e,n=t===z,r=R(n?B:b(t)),o=[],s=0;r.length>s;)!i(q,e=r[s++])||n&&!i(z,e)||o.push(q[e]);return o};U||(a((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===z&&e.call(B,n),i(this,D)&&i(this[D],t)&&(this[D][t]=!1),Y(this,t,E(1,n))};return o&&X&&Y(z,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",(function(){return this._k})),N.f=Z,C.f=$,n(37).f=S.f=Q,n(50).f=K,P.f=tt,o&&!n(29)&&a(z,"propertyIsEnumerable",K,!0),g.f=function(t){return W(p(t))}),s(s.G+s.W+s.F*!U,{Symbol:T});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)p(et[nt++]);for(var rt=L(p.store),it=0;rt.length>it;)d(rt[it++]);s(s.S+s.F*!U,"Symbol",{for:function(t){return i(G,t+="")?G[t]:G[t]=T(t)},keyFor:function(t){if(!H(t))throw TypeError(t+" is not a symbol!");for(var e in G)if(G[e]===t)return e},useSetter:function(){X=!0},useSimple:function(){X=!1}}),s(s.S+s.F*!U,"Object",{create:function(t,e){return void 0===e?I(t):J(I(t),e)},defineProperty:$,defineProperties:J,getOwnPropertyDescriptor:Z,getOwnPropertyNames:Q,getOwnPropertySymbols:tt});var ot=c((function(){P.f(1)}));s(s.S+s.F*ot,"Object",{getOwnPropertySymbols:function(t){return P.f(x(t))}}),A&&s(s.S+s.F*(!U||c((function(){var t=T();return"[null]"!=F([t])||"{}"!=F({a:t})||"{}"!=F(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(_(e)||void 0!==t)&&!H(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!H(e))return e}),r[1]=e,F.apply(A,r)}}),T.prototype[k]||n(11)(T.prototype,k,T.prototype.valueOf),f(T,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(t,e,n){t.exports=n(48)("native-function-to-string",Function.toString)},function(t,e,n){var r=n(34),i=n(54),o=n(50);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var s,a=n(t),u=o.f,c=0;a.length>c;)u.call(t,s=a[c++])&&e.push(s);return e}},function(t,e,n){var r=n(0);r(r.S,"Object",{create:n(36)})},function(t,e,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperty:n(8).f})},function(t,e,n){var r=n(0);r(r.S+r.F*!n(7),"Object",{defineProperties:n(98)})},function(t,e,n){var r=n(15),i=n(16).f;n(25)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},function(t,e,n){var r=n(9),i=n(17);n(25)("getPrototypeOf",(function(){return function(t){return i(r(t))}}))},function(t,e,n){var r=n(9),i=n(34);n(25)("keys",(function(){return function(t){return i(r(t))}}))},function(t,e,n){n(25)("getOwnPropertyNames",(function(){return n(99).f}))},function(t,e,n){var r=n(4),i=n(30).onFreeze;n(25)("freeze",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},function(t,e,n){var r=n(4),i=n(30).onFreeze;n(25)("seal",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},function(t,e,n){var r=n(4),i=n(30).onFreeze;n(25)("preventExtensions",(function(t){return function(e){return t&&r(e)?t(i(e)):e}}))},function(t,e,n){var r=n(4);n(25)("isFrozen",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},function(t,e,n){var r=n(4);n(25)("isSealed",(function(t){return function(e){return!r(e)||!!t&&t(e)}}))},function(t,e,n){var r=n(4);n(25)("isExtensible",(function(t){return function(e){return!!r(e)&&(!t||t(e))}}))},function(t,e,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(100)})},function(t,e,n){var r=n(0);r(r.S,"Object",{is:n(101)})},function(t,e,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(72).set})},function(t,e,n){"use strict";var r=n(45),i={};i[n(5)("toStringTag")]="z",i+""!="[object z]"&&n(12)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,e,n){var r=n(0);r(r.P,"Function",{bind:n(102)})},function(t,e,n){var r=n(8).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(7)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,e,n){"use strict";var r=n(4),i=n(17),o=n(5)("hasInstance"),s=Function.prototype;o in s||n(8).f(s,o,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var r=n(0),i=n(104);r(r.G+r.F*(parseInt!=i),{parseInt:i})},function(t,e,n){var r=n(0),i=n(105);r(r.G+r.F*(parseFloat!=i),{parseFloat:i})},function(t,e,n){"use strict";var r=n(2),i=n(14),o=n(20),s=n(74),a=n(23),u=n(3),c=n(37).f,l=n(16).f,f=n(8).f,h=n(46).trim,p=r.Number,g=p,d=p.prototype,y="Number"==o(n(36)(d)),v="trim"in String.prototype,m=function(t){var e=a(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=v?e.trim():h(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var s,u=e.slice(2),c=0,l=u.length;c<l;c++)if((s=u.charCodeAt(c))<48||s>i)return NaN;return parseInt(u,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(y?u((function(){d.valueOf.call(n)})):"Number"!=o(n))?s(new g(m(e)),n,p):m(e)};for(var _,x=n(7)?c(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),b=0;x.length>b;b++)i(g,_=x[b])&&!i(p,_)&&f(p,_,l(g,_));p.prototype=d,d.constructor=p,n(12)(r,"Number",p)}},function(t,e,n){"use strict";var r=n(0),i=n(21),o=n(106),s=n(75),a=1..toFixed,u=Math.floor,c=[0,0,0,0,0,0],l="Number.toFixed: incorrect invocation!",f=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*c[n],c[n]=r%1e7,r=u(r/1e7)},h=function(t){for(var e=6,n=0;--e>=0;)n+=c[e],c[e]=u(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==c[t]){var n=String(c[t]);e=""===e?n:e+s.call("0",7-n.length)+n}return e},g=function(t,e,n){return 0===e?n:e%2==1?g(t,e-1,n*t):g(t*t,e/2,n)};r(r.P+r.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(3)((function(){a.call({})}))),"Number",{toFixed:function(t){var e,n,r,a,u=o(this,l),c=i(t),d="",y="0";if(c<0||c>20)throw RangeError(l);if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(d="-",u=-u),u>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(u*g(2,69,1))-69)<0?u*g(2,-e,1):u/g(2,e,1),n*=4503599627370496,(e=52-e)>0){for(f(0,n),r=c;r>=7;)f(1e7,0),r-=7;for(f(g(10,r,1),0),r=e-1;r>=23;)h(1<<23),r-=23;h(1<<r),f(1,1),h(2),y=p()}else f(0,n),f(1<<-e,0),y=p()+s.call("0",c);return y=c>0?d+((a=y.length)<=c?"0."+s.call("0",c-a)+y:y.slice(0,a-c)+"."+y.slice(a-c)):d+y}})},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(106),s=1..toPrecision;r(r.P+r.F*(i((function(){return"1"!==s.call(1,void 0)}))||!i((function(){s.call({})}))),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?s.call(e):s.call(e,t)}})},function(t,e,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){var r=n(0),i=n(2).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},function(t,e,n){var r=n(0);r(r.S,"Number",{isInteger:n(107)})},function(t,e,n){var r=n(0);r(r.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var r=n(0),i=n(107),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},function(t,e,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var r=n(0),i=n(105);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(t,e,n){var r=n(0),i=n(104);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(t,e,n){var r=n(0),i=n(108),o=Math.sqrt,s=Math.acosh;r(r.S+r.F*!(s&&710==Math.floor(s(Number.MAX_VALUE))&&s(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},function(t,e,n){var r=n(0),i=Math.asinh;r(r.S+r.F*!(i&&1/i(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},function(t,e,n){var r=n(0),i=Math.atanh;r(r.S+r.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,n){var r=n(0),i=n(76);r(r.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,n){var r=n(0);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,n){var r=n(0),i=Math.exp;r(r.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},function(t,e,n){var r=n(0),i=n(77);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,e,n){var r=n(0);r(r.S,"Math",{fround:n(109)})},function(t,e,n){var r=n(0),i=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,o=0,s=0,a=arguments.length,u=0;s<a;)u<(n=i(arguments[s++]))?(o=o*(r=u/n)*r+1,u=n):o+=n>0?(r=n/u)*r:n;return u===1/0?1/0:u*Math.sqrt(o)}})},function(t,e,n){var r=n(0),i=Math.imul;r(r.S+r.F*n(3)((function(){return-5!=i(4294967295,5)||2!=i.length})),"Math",{imul:function(t,e){var n=+t,r=+e,i=65535&n,o=65535&r;return 0|i*o+((65535&n>>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(t,e,n){var r=n(0);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,e,n){var r=n(0);r(r.S,"Math",{log1p:n(108)})},function(t,e,n){var r=n(0);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){var r=n(0);r(r.S,"Math",{sign:n(76)})},function(t,e,n){var r=n(0),i=n(77),o=Math.exp;r(r.S+r.F*n(3)((function(){return-2e-17!=!Math.sinh(-2e-17)})),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,e,n){var r=n(0),i=n(77),o=Math.exp;r(r.S,"Math",{tanh:function(t){var e=i(t=+t),n=i(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},function(t,e,n){var r=n(0);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,n){var r=n(0),i=n(35),o=String.fromCharCode,s=String.fromCodePoint;r(r.S+r.F*(!!s&&1!=s.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,s=0;r>s;){if(e=+arguments[s++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){var r=n(0),i=n(15),o=n(6);r(r.S,"String",{raw:function(t){for(var e=i(t.raw),n=o(e.length),r=arguments.length,s=[],a=0;n>a;)s.push(String(e[a++])),a<r&&s.push(String(arguments[a]));return s.join("")}})},function(t,e,n){"use strict";n(46)("trim",(function(t){return function(){return t(this,3)}}))},function(t,e,n){"use strict";var r=n(56)(!0);n(78)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},function(t,e,n){"use strict";var r=n(0),i=n(56)(!1);r(r.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r=n(0),i=n(6),o=n(80),s="".endsWith;r(r.P+r.F*n(81)("endsWith"),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=i(e.length),a=void 0===n?r:Math.min(i(n),r),u=String(t);return s?s.call(e,u,a):e.slice(a-u.length,a)===u}})},function(t,e,n){"use strict";var r=n(0),i=n(80);r(r.P+r.F*n(81)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(0);r(r.P,"String",{repeat:n(75)})},function(t,e,n){"use strict";var r=n(0),i=n(6),o=n(80),s="".startsWith;r(r.P+r.F*n(81)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return s?s.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n(13)("anchor",(function(t){return function(e){return t(this,"a","name",e)}}))},function(t,e,n){"use strict";n(13)("big",(function(t){return function(){return t(this,"big","","")}}))},function(t,e,n){"use strict";n(13)("blink",(function(t){return function(){return t(this,"blink","","")}}))},function(t,e,n){"use strict";n(13)("bold",(function(t){return function(){return t(this,"b","","")}}))},function(t,e,n){"use strict";n(13)("fixed",(function(t){return function(){return t(this,"tt","","")}}))},function(t,e,n){"use strict";n(13)("fontcolor",(function(t){return function(e){return t(this,"font","color",e)}}))},function(t,e,n){"use strict";n(13)("fontsize",(function(t){return function(e){return t(this,"font","size",e)}}))},function(t,e,n){"use strict";n(13)("italics",(function(t){return function(){return t(this,"i","","")}}))},function(t,e,n){"use strict";n(13)("link",(function(t){return function(e){return t(this,"a","href",e)}}))},function(t,e,n){"use strict";n(13)("small",(function(t){return function(){return t(this,"small","","")}}))},function(t,e,n){"use strict";n(13)("strike",(function(t){return function(){return t(this,"strike","","")}}))},function(t,e,n){"use strict";n(13)("sub",(function(t){return function(){return t(this,"sub","","")}}))},function(t,e,n){"use strict";n(13)("sup",(function(t){return function(){return t(this,"sup","","")}}))},function(t,e,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(23);r(r.P+r.F*n(3)((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})),"Date",{toJSON:function(t){var e=i(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},function(t,e,n){var r=n(0),i=n(216);r(r.P+r.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(t,e,n){"use strict";var r=n(3),i=Date.prototype.getTime,o=Date.prototype.toISOString,s=function(t){return t>9?t:"0"+t};t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-50000000000001))}))||!r((function(){o.call(new Date(NaN))}))?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+s(t.getUTCMonth()+1)+"-"+s(t.getUTCDate())+"T"+s(t.getUTCHours())+":"+s(t.getUTCMinutes())+":"+s(t.getUTCSeconds())+"."+(n>99?n:"0"+s(n))+"Z"}:o},function(t,e,n){var r=Date.prototype,i=r.toString,o=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(12)(r,"toString",(function(){var t=o.call(this);return t==t?i.call(this):"Invalid Date"}))},function(t,e,n){var r=n(5)("toPrimitive"),i=Date.prototype;r in i||n(11)(i,r,n(219))},function(t,e,n){"use strict";var r=n(1),i=n(23);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(r(this),"number"!=t)}},function(t,e,n){var r=n(0);r(r.S,"Array",{isArray:n(55)})},function(t,e,n){"use strict";var r=n(19),i=n(0),o=n(9),s=n(110),a=n(82),u=n(6),c=n(83),l=n(84);i(i.S+i.F*!n(58)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,f,h=o(t),p="function"==typeof this?this:Array,g=arguments.length,d=g>1?arguments[1]:void 0,y=void 0!==d,v=0,m=l(h);if(y&&(d=r(d,g>2?arguments[2]:void 0,2)),null==m||p==Array&&a(m))for(n=new p(e=u(h.length));e>v;v++)c(n,v,y?d(h[v],v):h[v]);else for(f=m.call(h),n=new p;!(i=f.next()).done;v++)c(n,v,y?s(f,d,[i.value,v],!0):i.value);return n.length=v,n}})},function(t,e,n){"use strict";var r=n(0),i=n(83);r(r.S+r.F*n(3)((function(){function t(){}return!(Array.of.call(t)instanceof t)})),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)i(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){"use strict";var r=n(0),i=n(15),o=[].join;r(r.P+r.F*(n(49)!=Object||!n(22)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},function(t,e,n){"use strict";var r=n(0),i=n(71),o=n(20),s=n(35),a=n(6),u=[].slice;r(r.P+r.F*n(3)((function(){i&&u.call(i)})),"Array",{slice:function(t,e){var n=a(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return u.call(this,t,e);for(var i=s(t,n),c=s(e,n),l=a(c-i),f=new Array(l),h=0;h<l;h++)f[h]="String"==r?this.charAt(i+h):this[i+h];return f}})},function(t,e,n){"use strict";var r=n(0),i=n(10),o=n(9),s=n(3),a=[].sort,u=[1,2,3];r(r.P+r.F*(s((function(){u.sort(void 0)}))||!s((function(){u.sort(null)}))||!n(22)(a)),"Array",{sort:function(t){return void 0===t?a.call(o(this)):a.call(o(this),i(t))}})},function(t,e,n){"use strict";var r=n(0),i=n(26)(0),o=n(22)([].forEach,!0);r(r.P+r.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},function(t,e,n){var r=n(4),i=n(55),o=n(5)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){"use strict";var r=n(0),i=n(26)(1);r(r.P+r.F*!n(22)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(0),i=n(26)(2);r(r.P+r.F*!n(22)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(0),i=n(26)(3);r(r.P+r.F*!n(22)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(0),i=n(26)(4);r(r.P+r.F*!n(22)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(0),i=n(111);r(r.P+r.F*!n(22)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},function(t,e,n){"use strict";var r=n(0),i=n(111);r(r.P+r.F*!n(22)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},function(t,e,n){"use strict";var r=n(0),i=n(53)(!1),o=[].indexOf,s=!!o&&1/[1].indexOf(1,-0)<0;r(r.P+r.F*(s||!n(22)(o)),"Array",{indexOf:function(t){return s?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},function(t,e,n){"use strict";var r=n(0),i=n(15),o=n(21),s=n(6),a=[].lastIndexOf,u=!!a&&1/[1].lastIndexOf(1,-0)<0;r(r.P+r.F*(u||!n(22)(a)),"Array",{lastIndexOf:function(t){if(u)return a.apply(this,arguments)||0;var e=i(this),n=s(e.length),r=n-1;for(arguments.length>1&&(r=Math.min(r,o(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},function(t,e,n){var r=n(0);r(r.P,"Array",{copyWithin:n(112)}),n(31)("copyWithin")},function(t,e,n){var r=n(0);r(r.P,"Array",{fill:n(86)}),n(31)("fill")},function(t,e,n){"use strict";var r=n(0),i=n(26)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(31)("find")},function(t,e,n){"use strict";var r=n(0),i=n(26)(6),o="findIndex",s=!0;o in[]&&Array(1)[o]((function(){s=!1})),r(r.P+r.F*s,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(31)(o)},function(t,e,n){n(38)("Array")},function(t,e,n){var r=n(2),i=n(74),o=n(8).f,s=n(37).f,a=n(57),u=n(51),c=r.RegExp,l=c,f=c.prototype,h=/a/g,p=/a/g,g=new c(h)!==h;if(n(7)&&(!g||n(3)((function(){return p[n(5)("match")]=!1,c(h)!=h||c(p)==p||"/a/i"!=c(h,"i")})))){c=function(t,e){var n=this instanceof c,r=a(t),o=void 0===e;return!n&&r&&t.constructor===c&&o?t:i(g?new l(r&&!o?t.source:t,e):l((r=t instanceof c)?t.source:t,r&&o?u.call(t):e),n?this:f,c)};for(var d=function(t){t in c||o(c,t,{configurable:!0,get:function(){return l[t]},set:function(e){l[t]=e}})},y=s(l),v=0;y.length>v;)d(y[v++]);f.constructor=c,c.prototype=f,n(12)(r,"RegExp",c)}n(38)("RegExp")},function(t,e,n){"use strict";n(115);var r=n(1),i=n(51),o=n(7),s=/./.toString,a=function(t){n(12)(RegExp.prototype,"toString",t,!0)};n(3)((function(){return"/a/b"!=s.call({source:"a",flags:"b"})}))?a((function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)})):"toString"!=s.name&&a((function(){return s.call(this)}))},function(t,e,n){"use strict";var r=n(1),i=n(6),o=n(89),s=n(59);n(60)("match",1,(function(t,e,n,a){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var u=r(t),c=String(this);if(!u.global)return s(u,c);var l=u.unicode;u.lastIndex=0;for(var f,h=[],p=0;null!==(f=s(u,c));){var g=String(f[0]);h[p]=g,""===g&&(u.lastIndex=o(c,i(u.lastIndex),l)),p++}return 0===p?null:h}]}))},function(t,e,n){"use strict";var r=n(1),i=n(9),o=n(6),s=n(21),a=n(89),u=n(59),c=Math.max,l=Math.min,f=Math.floor,h=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g;n(60)("replace",2,(function(t,e,n,g){return[function(r,i){var o=t(this),s=null==r?void 0:r[e];return void 0!==s?s.call(r,o,i):n.call(String(o),r,i)},function(t,e){var i=g(n,t,this,e);if(i.done)return i.value;var f=r(t),h=String(this),p="function"==typeof e;p||(e=String(e));var y=f.global;if(y){var v=f.unicode;f.lastIndex=0}for(var m=[];;){var _=u(f,h);if(null===_)break;if(m.push(_),!y)break;""===String(_[0])&&(f.lastIndex=a(h,o(f.lastIndex),v))}for(var x,b="",w=0,E=0;E<m.length;E++){_=m[E];for(var I=String(_[0]),S=c(l(s(_.index),h.length),0),N=[],P=1;P<_.length;P++)N.push(void 0===(x=_[P])?x:String(x));var C=_.groups;if(p){var L=[I].concat(N,S,h);void 0!==C&&L.push(C);var M=String(e.apply(void 0,L))}else M=d(I,h,S,N,C,e);S>=w&&(b+=h.slice(w,S)+M,w=S+I.length)}return b+h.slice(w)}];function d(t,e,r,o,s,a){var u=r+t.length,c=o.length,l=p;return void 0!==s&&(s=i(s),l=h),n.call(a,l,(function(n,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(u);case"<":a=s[i.slice(1,-1)];break;default:var l=+i;if(0===l)return n;if(l>c){var h=f(l/10);return 0===h?n:h<=c?void 0===o[h-1]?i.charAt(1):o[h-1]+i.charAt(1):n}a=o[l-1]}return void 0===a?"":a}))}}))},function(t,e,n){"use strict";var r=n(1),i=n(101),o=n(59);n(60)("search",1,(function(t,e,n,s){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=s(n,t,this);if(e.done)return e.value;var a=r(t),u=String(this),c=a.lastIndex;i(c,0)||(a.lastIndex=0);var l=o(a,u);return i(a.lastIndex,c)||(a.lastIndex=c),null===l?-1:l.index}]}))},function(t,e,n){"use strict";var r=n(57),i=n(1),o=n(52),s=n(89),a=n(6),u=n(59),c=n(88),l=n(3),f=Math.min,h=[].push,p="length",g=!l((function(){RegExp(4294967295,"y")}));n(60)("split",2,(function(t,e,n,l){var d;return d="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[p]||2!="ab".split(/(?:ab)*/)[p]||4!=".".split(/(.?)(.?)/)[p]||".".split(/()()/)[p]>1||"".split(/.?/)[p]?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);for(var o,s,a,u=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,g=void 0===e?4294967295:e>>>0,d=new RegExp(t.source,l+"g");(o=c.call(d,i))&&!((s=d.lastIndex)>f&&(u.push(i.slice(f,o.index)),o[p]>1&&o.index<i[p]&&h.apply(u,o.slice(1)),a=o[0][p],f=s,u[p]>=g));)d.lastIndex===o.index&&d.lastIndex++;return f===i[p]?!a&&d.test("")||u.push(""):u.push(i.slice(f)),u[p]>g?u.slice(0,g):u}:"0".split(void 0,0)[p]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):d.call(String(i),n,r)},function(t,e){var r=l(d,t,this,e,d!==n);if(r.done)return r.value;var c=i(t),h=String(this),p=o(c,RegExp),y=c.unicode,v=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(g?"y":"g"),m=new p(g?c:"^(?:"+c.source+")",v),_=void 0===e?4294967295:e>>>0;if(0===_)return[];if(0===h.length)return null===u(m,h)?[h]:[];for(var x=0,b=0,w=[];b<h.length;){m.lastIndex=g?b:0;var E,I=u(m,g?h:h.slice(b));if(null===I||(E=f(a(m.lastIndex+(g?0:b)),h.length))===x)b=s(h,b,y);else{if(w.push(h.slice(x,b)),w.length===_)return w;for(var S=1;S<=I.length-1;S++)if(w.push(I[S]),w.length===_)return w;b=x=E}}return w.push(h.slice(x)),w}]}))},function(t,e,n){"use strict";var r,i,o,s,a=n(29),u=n(2),c=n(19),l=n(45),f=n(0),h=n(4),p=n(10),g=n(39),d=n(40),y=n(52),v=n(90).set,m=n(91)(),_=n(92),x=n(116),b=n(61),w=n(117),E=u.TypeError,I=u.process,S=I&&I.versions,N=S&&S.v8||"",P=u.Promise,C="process"==l(I),L=function(){},M=i=_.f,O=!!function(){try{var t=P.resolve(1),e=(t.constructor={})[n(5)("species")]=function(t){t(L,L)};return(C||"function"==typeof PromiseRejectionEvent)&&t.then(L)instanceof e&&0!==N.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),R=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},T=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){for(var r=t._v,i=1==t._s,o=0,s=function(e){var n,o,s,a=i?e.ok:e.fail,u=e.resolve,c=e.reject,l=e.domain;try{a?(i||(2==t._h&&D(t),t._h=1),!0===a?n=r:(l&&l.enter(),n=a(r),l&&(l.exit(),s=!0)),n===e.promise?c(E("Promise-chain cycle")):(o=R(n))?o.call(n,u,c):u(n)):c(r)}catch(t){l&&!s&&l.exit(),c(t)}};n.length>o;)s(n[o++]);t._c=[],t._n=!1,e&&!t._h&&A(t)}))}},A=function(t){v.call(u,(function(){var e,n,r,i=t._v,o=F(t);if(o&&(e=x((function(){C?I.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=C||F(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},F=function(t){return 1!==t._h&&0===(t._a||t._c).length},D=function(t){v.call(u,(function(){var e;C?I.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})}))},k=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),T(e,!0))},j=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw E("Promise can't be resolved itself");(e=R(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,c(j,r,1),c(k,r,1))}catch(t){k.call(r,t)}})):(n._v=t,n._s=1,T(n,!1))}catch(t){k.call({_w:n,_d:!1},t)}}};O||(P=function(t){g(this,P,"Promise","_h"),p(t),r.call(this);try{t(c(j,this,1),c(k,this,1))}catch(t){k.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(41)(P.prototype,{then:function(t,e){var n=M(y(this,P));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=C?I.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&T(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=c(j,t,1),this.reject=c(k,t,1)},_.f=M=function(t){return t===P||t===s?new o(t):i(t)}),f(f.G+f.W+f.F*!O,{Promise:P}),n(44)(P,"Promise"),n(38)("Promise"),s=n(18).Promise,f(f.S+f.F*!O,"Promise",{reject:function(t){var e=M(this);return(0,e.reject)(t),e.promise}}),f(f.S+f.F*(a||!O),"Promise",{resolve:function(t){return w(a&&this===s?P:this,t)}}),f(f.S+f.F*!(O&&n(58)((function(t){P.all(t).catch(L)}))),"Promise",{all:function(t){var e=this,n=M(e),r=n.resolve,i=n.reject,o=x((function(){var n=[],o=0,s=1;d(t,!1,(function(t){var a=o++,u=!1;n.push(void 0),s++,e.resolve(t).then((function(t){u||(u=!0,n[a]=t,--s||r(n))}),i)})),--s||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=M(e),r=n.reject,i=x((function(){d(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(t,e,n){"use strict";var r=n(122),i=n(42);n(62)("WeakSet",(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{add:function(t){return r.def(i(this,"WeakSet"),t,!0)}},r,!1,!0)},function(t,e,n){"use strict";var r=n(0),i=n(63),o=n(93),s=n(1),a=n(35),u=n(6),c=n(4),l=n(2).ArrayBuffer,f=n(52),h=o.ArrayBuffer,p=o.DataView,g=i.ABV&&l.isView,d=h.prototype.slice,y=i.VIEW;r(r.G+r.W+r.F*(l!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,"ArrayBuffer",{isView:function(t){return g&&g(t)||c(t)&&y in t}}),r(r.P+r.U+r.F*n(3)((function(){return!new h(2).slice(1,void 0).byteLength})),"ArrayBuffer",{slice:function(t,e){if(void 0!==d&&void 0===e)return d.call(s(this),t);for(var n=s(this).byteLength,r=a(t,n),i=a(void 0===e?n:e,n),o=new(f(this,h))(u(i-r)),c=new p(this),l=new p(o),g=0;r<i;)l.setUint8(g++,c.getUint8(r++));return o}}),n(38)("ArrayBuffer")},function(t,e,n){var r=n(0);r(r.G+r.W+r.F*!n(63).ABV,{DataView:n(93).DataView})},function(t,e,n){n(27)("Int8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){n(27)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){n(27)("Uint8",1,(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},function(t,e,n){n(27)("Int16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){n(27)("Uint16",2,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){n(27)("Int32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){n(27)("Uint32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){n(27)("Float32",4,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){n(27)("Float64",8,(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){var r=n(0),i=n(10),o=n(1),s=(n(2).Reflect||{}).apply,a=Function.apply;r(r.S+r.F*!n(3)((function(){s((function(){}))})),"Reflect",{apply:function(t,e,n){var r=i(t),u=o(n);return s?s(r,e,u):a.call(r,e,u)}})},function(t,e,n){var r=n(0),i=n(36),o=n(10),s=n(1),a=n(4),u=n(3),c=n(102),l=(n(2).Reflect||{}).construct,f=u((function(){function t(){}return!(l((function(){}),[],t)instanceof t)})),h=!u((function(){l((function(){}))}));r(r.S+r.F*(f||h),"Reflect",{construct:function(t,e){o(t),s(e);var n=arguments.length<3?t:o(arguments[2]);if(h&&!f)return l(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var u=n.prototype,p=i(a(u)?u:Object.prototype),g=Function.apply.call(t,p,e);return a(g)?g:p}})},function(t,e,n){var r=n(8),i=n(0),o=n(1),s=n(23);i(i.S+i.F*n(3)((function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})})),"Reflect",{defineProperty:function(t,e,n){o(t),e=s(e,!0),o(n);try{return r.f(t,e,n),!0}catch(t){return!1}}})},function(t,e,n){var r=n(0),i=n(16).f,o=n(1);r(r.S,"Reflect",{deleteProperty:function(t,e){var n=i(o(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=function(t){this._t=i(t),this._i=0;var e,n=this._k=[];for(e in t)n.push(e)};n(79)(o,"Object",(function(){var t,e=this._k;do{if(this._i>=e.length)return{value:void 0,done:!0}}while(!((t=e[this._i++])in this._t));return{value:t,done:!1}})),r(r.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,e,n){var r=n(16),i=n(17),o=n(14),s=n(0),a=n(4),u=n(1);s(s.S,"Reflect",{get:function t(e,n){var s,c,l=arguments.length<3?e:arguments[2];return u(e)===l?e[n]:(s=r.f(e,n))?o(s,"value")?s.value:void 0!==s.get?s.get.call(l):void 0:a(c=i(e))?t(c,n,l):void 0}})},function(t,e,n){var r=n(16),i=n(0),o=n(1);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(o(t),e)}})},function(t,e,n){var r=n(0),i=n(17),o=n(1);r(r.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},function(t,e,n){var r=n(0);r(r.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var r=n(0),i=n(1),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},function(t,e,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(124)})},function(t,e,n){var r=n(0),i=n(1),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,e,n){var r=n(8),i=n(16),o=n(17),s=n(14),a=n(0),u=n(32),c=n(1),l=n(4);a(a.S,"Reflect",{set:function t(e,n,a){var f,h,p=arguments.length<4?e:arguments[3],g=i.f(c(e),n);if(!g){if(l(h=o(e)))return t(h,n,a,p);g=u(0)}if(s(g,"value")){if(!1===g.writable||!l(p))return!1;if(f=i.f(p,n)){if(f.get||f.set||!1===f.writable)return!1;f.value=a,r.f(p,n,f)}else r.f(p,n,u(0,a));return!0}return void 0!==g.set&&(g.set.call(p,a),!0)}})},function(t,e,n){var r=n(0),i=n(72);i&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){i.check(t,e);try{return i.set(t,e),!0}catch(t){return!1}}})},function(t,e,n){"use strict";var r=n(0),i=n(53)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(31)("includes")},function(t,e,n){"use strict";var r=n(0),i=n(125),o=n(9),s=n(6),a=n(10),u=n(85);r(r.P,"Array",{flatMap:function(t){var e,n,r=o(this);return a(t),e=s(r.length),n=u(r,0),i(n,r,r,e,0,1,t,arguments[1]),n}}),n(31)("flatMap")},function(t,e,n){"use strict";var r=n(0),i=n(125),o=n(9),s=n(6),a=n(21),u=n(85);r(r.P,"Array",{flatten:function(){var t=arguments[0],e=o(this),n=s(e.length),r=u(e,0);return i(r,e,e,n,0,void 0===t?1:a(t)),r}}),n(31)("flatten")},function(t,e,n){"use strict";var r=n(0),i=n(56)(!0);r(r.P,"String",{at:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r=n(0),i=n(126),o=n(61),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*s,"String",{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,n){"use strict";var r=n(0),i=n(126),o=n(61),s=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);r(r.P+r.F*s,"String",{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,e,n){"use strict";n(46)("trimLeft",(function(t){return function(){return t(this,1)}}),"trimStart")},function(t,e,n){"use strict";n(46)("trimRight",(function(t){return function(){return t(this,2)}}),"trimEnd")},function(t,e,n){"use strict";var r=n(0),i=n(24),o=n(6),s=n(57),a=n(51),u=RegExp.prototype,c=function(t,e){this._r=t,this._s=e};n(79)(c,"RegExp String",(function(){var t=this._r.exec(this._s);return{value:t,done:null===t}})),r(r.P,"String",{matchAll:function(t){if(i(this),!s(t))throw TypeError(t+" is not a regexp!");var e=String(this),n="flags"in u?String(t.flags):a.call(t),r=new RegExp(t.source,~n.indexOf("g")?n:"g"+n);return r.lastIndex=o(t.lastIndex),new c(r,e)}})},function(t,e,n){n(68)("asyncIterator")},function(t,e,n){n(68)("observable")},function(t,e,n){var r=n(0),i=n(124),o=n(15),s=n(16),a=n(83);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),u=s.f,c=i(r),l={},f=0;c.length>f;)void 0!==(n=u(r,e=c[f++]))&&a(l,e,n);return l}})},function(t,e,n){var r=n(0),i=n(127)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},function(t,e,n){var r=n(0),i=n(127)(!0);r(r.S,"Object",{entries:function(t){return i(t)}})},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(10),s=n(8);n(7)&&r(r.P+n(64),"Object",{__defineGetter__:function(t,e){s.f(i(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(10),s=n(8);n(7)&&r(r.P+n(64),"Object",{__defineSetter__:function(t,e){s.f(i(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(23),s=n(17),a=n(16).f;n(7)&&r(r.P+n(64),"Object",{__lookupGetter__:function(t){var e,n=i(this),r=o(t,!0);do{if(e=a(n,r))return e.get}while(n=s(n))}})},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(23),s=n(17),a=n(16).f;n(7)&&r(r.P+n(64),"Object",{__lookupSetter__:function(t){var e,n=i(this),r=o(t,!0);do{if(e=a(n,r))return e.set}while(n=s(n))}})},function(t,e,n){var r=n(0);r(r.P+r.R,"Map",{toJSON:n(128)("Map")})},function(t,e,n){var r=n(0);r(r.P+r.R,"Set",{toJSON:n(128)("Set")})},function(t,e,n){n(65)("Map")},function(t,e,n){n(65)("Set")},function(t,e,n){n(65)("WeakMap")},function(t,e,n){n(65)("WeakSet")},function(t,e,n){n(66)("Map")},function(t,e,n){n(66)("Set")},function(t,e,n){n(66)("WeakMap")},function(t,e,n){n(66)("WeakSet")},function(t,e,n){var r=n(0);r(r.G,{global:n(2)})},function(t,e,n){var r=n(0);r(r.S,"System",{global:n(2)})},function(t,e,n){var r=n(0),i=n(20);r(r.S,"Error",{isError:function(t){return"Error"===i(t)}})},function(t,e,n){var r=n(0);r(r.S,"Math",{clamp:function(t,e,n){return Math.min(n,Math.max(e,t))}})},function(t,e,n){var r=n(0);r(r.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(t,e,n){var r=n(0),i=180/Math.PI;r(r.S,"Math",{degrees:function(t){return t*i}})},function(t,e,n){var r=n(0),i=n(130),o=n(109);r(r.S,"Math",{fscale:function(t,e,n,r,s){return o(i(t,e,n,r,s))}})},function(t,e,n){var r=n(0);r(r.S,"Math",{iaddh:function(t,e,n,r){var i=t>>>0,o=n>>>0;return(e>>>0)+(r>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,e,n){var r=n(0);r(r.S,"Math",{isubh:function(t,e,n,r){var i=t>>>0,o=n>>>0;return(e>>>0)-(r>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,e,n){var r=n(0);r(r.S,"Math",{imulh:function(t,e){var n=+t,r=+e,i=65535&n,o=65535&r,s=n>>16,a=r>>16,u=(s*o>>>0)+(i*o>>>16);return s*a+(u>>16)+((i*a>>>0)+(65535&u)>>16)}})},function(t,e,n){var r=n(0);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,e,n){var r=n(0),i=Math.PI/180;r(r.S,"Math",{radians:function(t){return t*i}})},function(t,e,n){var r=n(0);r(r.S,"Math",{scale:n(130)})},function(t,e,n){var r=n(0);r(r.S,"Math",{umulh:function(t,e){var n=+t,r=+e,i=65535&n,o=65535&r,s=n>>>16,a=r>>>16,u=(s*o>>>0)+(i*o>>>16);return s*a+(u>>>16)+((i*a>>>0)+(65535&u)>>>16)}})},function(t,e,n){var r=n(0);r(r.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:t>0}})},function(t,e,n){"use strict";var r=n(0),i=n(18),o=n(2),s=n(52),a=n(117);r(r.P+r.R,"Promise",{finally:function(t){var e=s(this,i.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return a(e,t()).then((function(){return n}))}:t,n?function(n){return a(e,t()).then((function(){throw n}))}:t)}})},function(t,e,n){"use strict";var r=n(0),i=n(92),o=n(116);r(r.S,"Promise",{try:function(t){var e=i.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){var r=n(28),i=n(1),o=r.key,s=r.set;r.exp({defineMetadata:function(t,e,n,r){s(t,e,i(n),o(r))}})},function(t,e,n){var r=n(28),i=n(1),o=r.key,s=r.map,a=r.store;r.exp({deleteMetadata:function(t,e){var n=arguments.length<3?void 0:o(arguments[2]),r=s(i(e),n,!1);if(void 0===r||!r.delete(t))return!1;if(r.size)return!0;var u=a.get(e);return u.delete(n),!!u.size||a.delete(e)}})},function(t,e,n){var r=n(28),i=n(1),o=n(17),s=r.has,a=r.get,u=r.key,c=function(t,e,n){if(s(t,e,n))return a(t,e,n);var r=o(e);return null!==r?c(t,r,n):void 0};r.exp({getMetadata:function(t,e){return c(t,i(e),arguments.length<3?void 0:u(arguments[2]))}})},function(t,e,n){var r=n(120),i=n(129),o=n(28),s=n(1),a=n(17),u=o.keys,c=o.key,l=function(t,e){var n=u(t,e),o=a(t);if(null===o)return n;var s=l(o,e);return s.length?n.length?i(new r(n.concat(s))):s:n};o.exp({getMetadataKeys:function(t){return l(s(t),arguments.length<2?void 0:c(arguments[1]))}})},function(t,e,n){var r=n(28),i=n(1),o=r.get,s=r.key;r.exp({getOwnMetadata:function(t,e){return o(t,i(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,n){var r=n(28),i=n(1),o=r.keys,s=r.key;r.exp({getOwnMetadataKeys:function(t){return o(i(t),arguments.length<2?void 0:s(arguments[1]))}})},function(t,e,n){var r=n(28),i=n(1),o=n(17),s=r.has,a=r.key,u=function(t,e,n){if(s(t,e,n))return!0;var r=o(e);return null!==r&&u(t,r,n)};r.exp({hasMetadata:function(t,e){return u(t,i(e),arguments.length<3?void 0:a(arguments[2]))}})},function(t,e,n){var r=n(28),i=n(1),o=r.has,s=r.key;r.exp({hasOwnMetadata:function(t,e){return o(t,i(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,n){var r=n(28),i=n(1),o=n(10),s=r.key,a=r.set;r.exp({metadata:function(t,e){return function(n,r){a(t,e,(void 0!==r?i:o)(n),s(r))}}})},function(t,e,n){var r=n(0),i=n(91)(),o=n(2).process,s="process"==n(20)(o);r(r.G,{asap:function(t){var e=s&&o.domain;i(e?e.bind(t):t)}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(18),s=n(91)(),a=n(5)("observable"),u=n(10),c=n(1),l=n(39),f=n(41),h=n(11),p=n(40),g=p.RETURN,d=function(t){return null==t?void 0:u(t)},y=function(t){var e=t._c;e&&(t._c=void 0,e())},v=function(t){return void 0===t._o},m=function(t){v(t)||(t._o=void 0,y(t))},_=function(t,e){c(t),this._c=void 0,this._o=t,t=new x(this);try{var n=e(t),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:u(n),this._c=n)}catch(e){return void t.error(e)}v(this)&&y(this)};_.prototype=f({},{unsubscribe:function(){m(this)}});var x=function(t){this._s=t};x.prototype=f({},{next:function(t){var e=this._s;if(!v(e)){var n=e._o;try{var r=d(n.next);if(r)return r.call(n,t)}catch(t){try{m(e)}finally{throw t}}}},error:function(t){var e=this._s;if(v(e))throw t;var n=e._o;e._o=void 0;try{var r=d(n.error);if(!r)throw t;t=r.call(n,t)}catch(t){try{y(e)}finally{throw t}}return y(e),t},complete:function(t){var e=this._s;if(!v(e)){var n=e._o;e._o=void 0;try{var r=d(n.complete);t=r?r.call(n,t):void 0}catch(t){try{y(e)}finally{throw t}}return y(e),t}}});var b=function(t){l(this,b,"Observable","_f")._f=u(t)};f(b.prototype,{subscribe:function(t){return new _(t,this._f)},forEach:function(t){var e=this;return new(o.Promise||i.Promise)((function(n,r){u(t);var i=e.subscribe({next:function(e){try{return t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:n})}))}}),f(b,{from:function(t){var e="function"==typeof this?this:b,n=d(c(t)[a]);if(n){var r=c(n.call(t));return r.constructor===e?r:new e((function(t){return r.subscribe(t)}))}return new e((function(e){var n=!1;return s((function(){if(!n){try{if(p(t,!1,(function(t){if(e.next(t),n)return g}))===g)return}catch(t){if(n)throw t;return void e.error(t)}e.complete()}})),function(){n=!0}}))},of:function(){for(var t=0,e=arguments.length,n=new Array(e);t<e;)n[t]=arguments[t++];return new("function"==typeof this?this:b)((function(t){var e=!1;return s((function(){if(!e){for(var r=0;r<n.length;++r)if(t.next(n[r]),e)return;t.complete()}})),function(){e=!0}}))}}),h(b.prototype,a,(function(){return this})),r(r.G,{Observable:b}),n(38)("Observable")},function(t,e,n){var r=n(2),i=n(0),o=n(61),s=[].slice,a=/MSIE .\./.test(o),u=function(t){return function(e,n){var r=arguments.length>2,i=!!r&&s.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,i)}:e,n)}};i(i.G+i.B+i.F*a,{setTimeout:u(r.setTimeout),setInterval:u(r.setInterval)})},function(t,e,n){var r=n(0),i=n(90);r(r.G+r.B,{setImmediate:i.set,clearImmediate:i.clear})},function(t,e,n){for(var r=n(87),i=n(34),o=n(12),s=n(2),a=n(11),u=n(47),c=n(5),l=c("iterator"),f=c("toStringTag"),h=u.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},g=i(p),d=0;d<g.length;d++){var y,v=g[d],m=p[v],_=s[v],x=_&&_.prototype;if(x&&(x[l]||a(x,l,h),x[f]||a(x,f,v),u[v]=h,m))for(y in r)x[y]||o(x,y,r[y],!0)}},function(t,e,n){(function(e){!function(e){"use strict";var n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",u="object"==typeof t,c=e.regeneratorRuntime;if(c)u&&(t.exports=c);else{(c=e.regeneratorRuntime=u?t.exports:{}).wrap=d;var l={},f={};f[o]=function(){return this};var h=Object.getPrototypeOf,p=h&&h(h(N([])));p&&p!==n&&r.call(p,o)&&(f=p);var g=_.prototype=v.prototype=Object.create(f);m.prototype=g.constructor=_,_.constructor=m,_[a]=m.displayName="GeneratorFunction",c.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},c.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},c.awrap=function(t){return{__await:t}},x(b.prototype),b.prototype[s]=function(){return this},c.AsyncIterator=b,c.async=function(t,e,n,r){var i=new b(d(t,e,n,r));return c.isGeneratorFunction(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(g),g[a]="Generator",g[o]=function(){return this},g.toString=function(){return"[object Generator]"},c.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=N,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=w(s,n);if(a){if(a===l)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=y(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,s),o}function y(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function v(){}function m(){}function _(){}function x(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function b(t){function n(e,i,o,s){var a=y(t[e],t,i);if("throw"!==a.type){var u=a.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?Promise.resolve(c.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):Promise.resolve(c).then((function(t){u.value=t,o(u)}),s)}s(a.arg)}var i;"object"==typeof e.process&&e.process.domain&&(n=e.process.domain.bind(n)),this._invoke=function(t,e){function r(){return new Promise((function(r,i){n(t,e,r,i)}))}return i=i?i.then(r,r):r()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=y(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function N(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}}("object"==typeof e?e:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,n(94))},function(t,e,n){n(335),t.exports=n(18).RegExp.escape},function(t,e,n){var r=n(0),i=n(336)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(t){return i(t)}})},function(t,e){t.exports=function(t,e){var n=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,n)}}},function(t,e,n){(e=n(338)(!1)).push([t.i,"#homogeneousFieldBox {\r\n\tdisplay: none;\r\n\tposition: absolute!important;\r\n\tz-index: 5002;\r\n\ttop: 50px;\r\n\tleft: 60px;\r\n\twidth: 340px;\r\n\theight: 450px;\r\n\toverflow: hidden;\r\n\tbackground: rgba(8, 48, 78, .9);\r\n\tborder: 1px solid #20a8b1;\r\n\tcolor: #ffffff;\r\n\tpadding: 8px;\r\n\tfont-size: 13px;\r\n\t-webkit-touch-callout: none;\r\n\t-webkit-user-select: none;\r\n\t-khtml-user-select: none;\r\n\t-moz-user-select: none;\r\n\t-ms-user-select: none;\r\n\tuser-select: none\r\n}\r\n\r\n#homogeneousFieldBox a.btn {\r\n    color: #ffce00;\r\n}\r\n\r\n#homogeneousFieldBox #homogeneousFieldTopBar {\r\n\theight: 15px!important\r\n}\r\n\r\n#homogeneousFieldBox #homogeneousFieldTopBar * {\r\n\theight: 14px!important\r\n}\r\n\r\n#homogeneousFieldBox .handle {\r\n\twidth: 89%;\r\n\ttext-align: center;\r\n\tcolor: #fff;\r\n\tline-height: 6px;\r\n\tcursor: move;\r\n\tfloat: right\r\n}\r\n\r\n#homogeneousFieldBox #homogeneousFieldTopBar .btn {\r\n\tdisplay: block;\r\n\twidth: 10%;\r\n\tcursor: pointer;\r\n\tcolor: #20a8b1;\r\n\tfont-weight: 700;\r\n\ttext-align: center;\r\n\tline-height: 13px;\r\n\tfont-size: 18px;\r\n\tborder: 1px solid #20a8b1;\r\n\tfloat: left\r\n}\r\n\r\n#homogeneousFieldBox #homogeneousFieldTopBar .btn:hover {\r\n\tcolor: #ffce00;\r\n\ttext-decoration: none\r\n}\r\n\r\n#homogeneousFieldBox #homogeneousFieldTitle {\r\n\tfont-size: 12px;\r\n\tpadding-top: 5px\r\n}\r\n\r\n#homogeneousFieldControls {\r\n    clear: both;\r\n    padding-top: 8px;\r\n    border-bottom: 1px solid #20a8b1;\r\n}\r\n\r\n#homogeneousFieldPortals {\r\n\theight: 50px;\r\n\tborder-top: 1px solid #20a8b1;\r\n\twhite-space: nowrap;\r\n\toverflow: hidden;\r\n}\r\n\r\n#homogeneousFieldSearch {\r\n    border-bottom: 1px solid #20a8b1;\r\n}\r\n\r\n#homogeneousFieldContent {\r\n    border-bottom: 1px solid #20a8b1;\r\n}\r\n\r\n#homogeneousFieldPlanControls {\r\n    border-bottom: 1px solid #20a8b1;\r\n}\r\n\r\n#homogeneousFieldData {\r\n\theight: 300px;\r\n\twidth: 100%;\r\n    overflow-x: hidden;\r\n    overflow-y: auto;\r\n    font-size: 12px;\r\n    border-bottom: 1px solid #20a8b1;\r\n}\r\n\r\n.homogeneousFieldLinkItem {\r\n    white-space: nowrap;\r\n    cursor: pointer;\r\n}\r\n\r\n.homogeneousFieldLinkItem.selected {\r\n    background-color: darkcyan;\r\n}\r\n\r\n#homogeneousFieldToolbox {\r\n}\r\n\r\n#homogeneousFieldToolbox label {\r\n\tcolor: #ffce00;\r\n}\r\n\r\n#homogeneousFieldColorizeTeams {\r\n\tvertical-align: -2px;\r\n}\r\n\r\n#homogeneousFieldProgress {\r\n    position: absolute;\r\n    background: rgba(0, 0, 0, 0.5);\r\n    display: none;\r\n    width: 100%;\r\n    height: 100%;\r\n    left: 0;\r\n    top: 0;\r\n    right: 0;\r\n    bottom: 0;\r\n    text-align: center;\r\n    padding-top: 200px;\r\n    box-sizing: border-box;\r\n}\r\n\r\n#homogeneousFieldBlackControls {\r\n\tposition: absolute;\r\n    background: rgba(0, 0, 0, 0.75);\r\n\tdisplay: none;\r\n\tpadding-top: 4px;\r\n\tpadding-bottom: 4px;\r\n\tpadding-left: 8px;\r\n    width: 100%;\r\n    left: 0;\r\n    top: 50px;\r\n    right: 0;\r\n\tbox-sizing: border-box;\r\n\toverflow-x: hidden;\r\n\toverflow-y: hidden;\r\n}\r\n\r\n#homogeneousFieldBlackControls > a.btn {\r\n\tcolor: #ffffff;\r\n}\r\n\r\n#homogeneousFieldBlackList {\r\n\tposition: absolute;\r\n    background: rgba(0, 0, 0, 0.75);\r\n\tdisplay: none;\r\n\tpadding: 8px;\r\n    width: 100%;\r\n    height: 400px;\r\n    left: 0;\r\n    top: 70px;\r\n    right: 0;\r\n\tbox-sizing: border-box;\r\n\toverflow-x: hidden;\r\n\toverflow-y: auto;\r\n}\r\n\r\n#homogeneousFieldCenter {\r\n\tposition: absolute;\r\n    background: rgba(0, 0, 0, 0.75);\r\n\tdisplay: none;\r\n\tpadding: 8px;\r\n    width: 100%;\r\n    height: 420px;\r\n    left: 0;\r\n    top: 50px;\r\n    right: 0;\r\n\tbox-sizing: border-box;\r\n\toverflow-x: hidden;\r\n\toverflow-y: auto;\r\n}\r\n\r\n.homogeneousFieldBlackListPortal {\r\n\twidth: 320;\r\n\toverflow: hidden;\r\n\twhite-space: nowrap;\r\n}\r\n\r\n.homogeneousFieldCenterPortal {\r\n\twidth: 320;\r\n\toverflow: hidden;\r\n\twhite-space: nowrap;\r\n}\r\n\r\n.homogeneousFieldSelectedPortal {\r\n\twidth: 320;\r\n\toverflow: hidden;\r\n\twhite-space: nowrap;\r\n}\r\n\r\n.homogeneousFieldRemoveButton {\r\n\tcolor: #ff9999;\r\n\tmargin-right: 9px;\r\n}\r\n\r\n.homogeneousFieldTeam0 {\r\n\tcolor: #ffffff;\r\n}\r\n\r\n.homogeneousFieldTeam1 {\r\n\tcolor: #ffcccc;\r\n}\r\n\r\n.homogeneousFieldTeam2 {\r\n\tcolor: #ccffcc;\r\n}\r\n\r\n.homogeneousFieldTeam3 {\r\n\tcolor: #ccccff;\r\n}\r\n\r\n.homogeneousFieldPortalNumber {\r\n\tcolor: #ffffff;\r\n\tfont-size: 14px;\r\n\ttext-shadow: -1px -1px 1px #000000, 0px -1px 1px #000000, 1px -1px 1px #000000, 1px 0px 1px #000000, 1px 1px 1px #000000, 0px 1px 1px #000000, -1px 1px 1px #000000, -1px 0px 1px #000000;\r\n\ttransform: translate(-50%, -50%);\r\n}\r\n\r\n#homogeneousFieldImportInput {\r\n    visibility: hidden;\r\n    width: 2px;\r\n    height: 1px;\r\n}\r\n\r\n.homogeneousFieldAutoScrollContainer {\r\n\tfloat: right;\r\n    display: flex;\r\n    align-items: center;\r\n}\r\n\r\n.homogeneousFieldKeysIcon {\r\n    background-color: rgba(163, 30, 30, 0.95);\r\n    font-size: 11px;\r\n    text-align: center;\r\n    padding: 2px;\r\n    color: #ffffff;\r\n    cursor: default;\r\n    border-radius: 6px;\r\n}\r\n\r\n@media only screen and (max-width: 480px) {\r\n\t#homogeneousFieldBox {\r\n\t\ttransform: scale(0.85, 0.85);\r\n\t\tleft: 20px;\r\n\t}\r\n}",""]),t.exports=e},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=(s=r,a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),u="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(u," */")),o=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([i]).join("\n")}var s,a,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<this.length;o++){var s=this[o][0];null!=s&&(i[s]=!0)}for(var a=0;a<t.length;a++){var u=[].concat(t[a]);r&&i[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},function(t,e){t.exports='<div id="homogeneousFieldBox">\r\n    <div id="homogeneousFieldTopBar">\r\n        <a id="homogeneousFieldMin" class="btn" onclick="window.plugin.homogeneousField.hideBox();return false;" title="Minimize">-</a>\r\n        <div class="handle"><div id="homogeneousFieldTitle" class="ui-dialog-title ui-dialog-title-active">Homogeneous field</div></div>\r\n    </div>\r\n    <div id="homogeneousFieldControls">\r\n        <a class="btn" onclick="window.plugin.homogeneousField.startSelectPortals();return false;">Set corners</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.selectCenter();return false;">Center</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.startSelectBlackList();return false;">Black list</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.reset();return false;">Reset</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.import();return false;">Import</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.export();return false;">Export</a>\r\n\r\n        <input type="file" id="homogeneousFieldImportInput" visbility="hidden" onchange="window.plugin.homogeneousField.doImport();return false;"/>\r\n\r\n        <div id="homogeneousFieldPortals"></div>\r\n    </div>\r\n    <div id="homogeneousFieldSearch">\r\n        Search:\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL2();return false;">L2</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL3();return false;">L3</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL4();return false;">L4</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL5();return false;">L5</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL5v2();return false;">L5v2</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL6();return false;">L6</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL6v2();return false;">L6v2</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL7();return false;" title="Event only">L7</a>\r\n        ::\r\n        <a class="btn" onclick="window.plugin.homogeneousField.calcL8();return false;" title="Event only">L8</a>\r\n    </div>\r\n    <div id="homogeneousFieldContent">\r\n        <div id="homogeneousFieldPlanControls">\r\n            <a class="btn" onclick="window.plugin.homogeneousField.showPlan();return false;">Plan</a>\r\n            ::\r\n            <a class="btn" onclick="window.plugin.homogeneousField.showKeys();return false;">Keys</a>\r\n            ::\r\n            <a class="btn" onclick="window.plugin.homogeneousField.showSbuls();return false;">Sbuls</a>\r\n            <div class="homogeneousFieldAutoScrollContainer">\r\n                <input type="checkbox" id="homogeneousFieldAutoScroll" onclick="window.plugin.homogeneousField.updateAutoScroll();"/>\r\n                <label for="homogeneousFieldAutoScroll">Auto scroll</label>\r\n            </div>\r\n        </div>\r\n        <div id="homogeneousFieldData">\r\n            <div id="homogeneousFieldLinkPlan"></div>\r\n            <div id="homogeneousFieldKeys"></div>\r\n            <div id="homogeneousFieldSbuls"></div>\r\n        </div>\r\n    </div>\r\n    <div id="homogeneousFieldToolbox">\r\n        <a class="btn" onclick="window.plugin.homogeneousField.copyPlan();return false;">Copy</a>\r\n        ::\r\n        <a class="btn" id="homogeneousFieldToggleAnimation" onclick="window.plugin.homogeneousField.toggleAnimation();return false;">Play</a>\r\n        ::\r\n        <a class="btn" id="homogeneousFieldExportDrawTools" onclick="window.plugin.homogeneousField.exportDrawTools();return false;">To DrawTools</a>\r\n        ::\r\n        <input type="checkbox" id="homogeneousFieldColorizeTeams" onclick="window.plugin.homogeneousField.updateColorizeTeams();"/>\r\n        <label for="homogeneousFieldColorizeTeams">Teams</label>\r\n        ::\r\n        <input type="checkbox" id="homogeneousFieldDebug" onclick="window.plugin.homogeneousField.updateDebug();"/>\r\n        <label for="homogeneousFieldDebug">Debug</label>\r\n    </div>\r\n\r\n    <div id="homogeneousFieldProgress">100%</div>\r\n\r\n    <div id="homogeneousFieldBlackControls">\r\n        <a class="btn" onclick="window.plugin.homogeneousField.importBookmarks();return false;">Import from bookmarks</a>\r\n    </div>\r\n    <div id="homogeneousFieldBlackList"></div>\r\n\r\n    <div id="homogeneousFieldCenter"></div>\r\n</div>'},function(t,e,n){"use strict";var r=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,e){var n,i,o;return e=e||{},n=JSON.stringify([1],void 0,void 0===e.indent?2:e.indent).slice(2,-3),i=""===n?1/0:void 0===e.maxLength?80:e.maxLength,o=e.replacer,function t(e,s,a){var u,c,l,f,h,p,g,d,y,v,m,_;if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===(m=JSON.stringify(e,o)))return m;if(g=i-s.length-a,m.length<=g&&(y=m.replace(r,(function(t,e){return e||t+" "}))).length<=g)return y;if(null!=o&&(e=JSON.parse(m),o=void 0),"object"==typeof e&&null!==e){if(d=s+n,l=[],c=0,Array.isArray(e))for(v="[",u="]",g=e.length;c<g;c++)l.push(t(e[c],d,c===g-1?0:1)||"null");else for(v="{",u="}",g=(p=Object.keys(e)).length;c<g;c++)f=p[c],h=JSON.stringify(f)+": ",void 0!==(_=t(e[f],d,h.length+(c===g-1?0:1)))&&l.push(h+_);if(l.length>0)return[v,n+l.join(",\n"+d),u].join("\n"+s)}return m}(t,"",0)}},function(t,e,n){"use strict";n.r(e);var r=n(43),i=n(131),o=n.n(i);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function t(e,n){var i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];s(this,t),this.points=e,this.portals=n,this.geom=Object(r.polygon)([[[this.points[0]._latlng.lng,this.points[0]._latlng.lat],[this.points[1]._latlng.lng,this.points[1]._latlng.lat],[this.points[2]._latlng.lng,this.points[2]._latlng.lat],[this.points[0]._latlng.lng,this.points[0]._latlng.lat]]]);var a=Object(r.centerOfMass)(this.geom);this.centerLng=a.geometry.coordinates[0],this.centerLat=a.geometry.coordinates[1],this.innerPortals=HomogeneousPluginUtils.getPortalInTriangle(this.points,this.portals,o),this.innerPortals.sort((function(t,e){var n=Math.abs(t._latlng.lng-i.centerLng)+Math.abs(t._latlng.lat-i.centerLat),r=Math.abs(e._latlng.lng-i.centerLng)+Math.abs(e._latlng.lat-i.centerLat);return n<r?-1:n>r?1:0}))};function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n="",r="",i=0,o=0;e&&e.options&&(r=e.options.guid,e._latlng&&(i=e._latlng.lat,o=e._latlng.lng),e.options.data&&e.options.data.title&&(n=e.options.data.title)),this.options={data:{title:n},guid:r},this._latlng={lat:i,lng:o}}var e,n,r;return e=t,r=[{key:"fromData",value:function(e){return new t({options:{guid:e.guid,data:{title:decodeURIComponent(e.title)}},_latlng:{lat:e.lat,lng:e.lng}})}}],(n=[{key:"getLatLng",value:function(){return{lat:this._latlng.lat,lng:this._latlng.lng}}},{key:"getDataForSave",value:function(){return{guid:this.options.guid,title:encodeURIComponent(this.options.data.title),lat:this._latlng.lat,lng:this._latlng.lng}}}])&&u(e.prototype,n),r&&u(e,r),t}();function l(t){return(l="function"==typeof Symbol&&"symbol"==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 f(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function h(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){f(o,r,i,s,a,"next",t)}function a(t){f(o,r,i,s,a,"throw",t)}s(void 0)}))}}function p(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,e){if(!t)return;if("string"==typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(t,e)}(t))){var e=0,n=function(){};return{s:n,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:n}}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 r,i,o=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function v(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var w=[0,0,1,4,13,40,121],E=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e)}(l,t);var e,n,r,i,o,s,u=(e=l,function(){var t,n=x(e);if(_()){var r=x(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return v(this,t)});function l(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(d(this,l),(n=u.call(this)).level=1,n.type="",n.linkScheme=[],n.scheme=[],n.portalsList=[],n.linkingPlan=[],n.teamsPortals=[],n.teamsPlan=[],n.searchScheme=n.searchScheme.bind(m(n)),!t.length)return v(n);t=ge.normalizePortalsList(t),n.corners=[];var o,s=p(t);try{for(s.s();!(o=s.n()).done;){var f=o.value;n.corners.push(new c(f))}}catch(t){s.e(t)}finally{s.f()}if(n.triangle=new a(n.corners,n.getFakePortals(e),r),n.portals=n.triangle.innerPortals,n.center=null,i){var h,g=p(n.portals);try{for(g.s();!(h=g.n()).done;){var y=h.value;if(y.options.guid===i){n.center=y;break}}}catch(t){g.e(t)}finally{g.f()}}return n}return n=l,r=[{key:"getFakePortals",value:function(t){for(var e={},n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];e[i]=new c(t[i])}return e}},{key:"search",value:(s=h(regeneratorRuntime.mark((function t(){var e,n,r,i,o,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.scheme=[],t.next=3,this.searchScheme(this.triangle,this.level,this.scheme);case 3:if(this.scheme=t.sent,!this.scheme){t.next=37;break}this.portalsList=[].concat(this.corners),this.fillPortalsList(this.scheme),e=p(this.linkScheme),t.prev=8,e.s();case 10:if((n=e.n()).done){t.next=27;break}if(r=n.value,i=[this.portalsList[r[0]],this.portalsList[r[1]]],this.linkingPlan.push(i),!this.teamsPortals.length){t.next=25;break}o=-1,s=0;case 17:if(!(s<this.teamsPortals.length)){t.next=24;break}if(!(this.teamsPortals[s].indexOf(r[0])>=0)){t.next=21;break}return o=s,t.abrupt("break",24);case 21:s++,t.next=17;break;case 24:o>=0?(this.teamsPlan[o]||(this.teamsPlan[o]=[]),this.teamsPlan[o].push(i)):console.warn("No team link",r[0],r[1]);case 25:t.next=10;break;case 27:t.next=32;break;case 29:t.prev=29,t.t0=t.catch(8),e.e(t.t0);case 32:return t.prev=32,e.f(),t.finish(32);case 35:t.next=40;break;case 37:this.scheme=[],this.portalsList=[],this.linkingPlan=[];case 40:this.emit("finish");case 41:case"end":return t.stop()}}),t,this,[[8,29,32,35]])}))),function(){return s.apply(this,arguments)})},{key:"fillPortalsList",value:function(t){var e,n=p(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.center&&this.portalsList.push(r.center),r.scheme&&this.fillPortalsList(r.scheme),Array.isArray(r)&&this.fillPortalsList(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"freeMainThread",value:function(){return new Promise((function(t){setTimeout(t,16)}))}},{key:"searchScheme",value:(o=h(regeneratorRuntime.mark((function t(e,n){var r,i,o,s,u,c,l,f,h,g,d,y,v,m,_,x,b,E,I=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=I.length>2&&void 0!==I[2]?I[2]:[],i=w[n],!(e.innerPortals.length<i)){t.next=4;break}return t.abrupt("return",null);case 4:if(!(n<2)){t.next=7;break}return r.push({center:null,scheme:[e]}),t.abrupt("return",r);case 7:o=e.points.slice(),s=0,u=e.innerPortals,this.center&&n===this.level&&(u=[this.center]),c=p(u),t.prev=12,c.s();case 14:if((l=c.n()).done){t.next=53;break}if(f=l.value,n!==this.level){t.next=20;break}return this.emit("progress",s/e.innerPortals.length),t.next=20,this.freeMainThread();case 20:if(s++,h=[o[0],o[1],f],g=new a(h,this.portals),d=[o[1],o[2],f],y=new a(d,this.portals),v=[o[2],o[0],f],m=new a(v,this.portals),_=w[n-1],!(g.innerPortals.length<_)){t.next=30;break}return t.abrupt("continue",51);case 30:if(!(y.innerPortals.length<_)){t.next=32;break}return t.abrupt("continue",51);case 32:if(!(m.innerPortals.length<_)){t.next=34;break}return t.abrupt("continue",51);case 34:return t.next=36,this.searchScheme(g,n-1,[]);case 36:if(x=t.sent){t.next=39;break}return t.abrupt("continue",51);case 39:return t.next=41,this.searchScheme(y,n-1,[]);case 41:if(b=t.sent){t.next=44;break}return t.abrupt("continue",51);case 44:return t.next=46,this.searchScheme(m,n-1,[]);case 46:if(E=t.sent){t.next=49;break}return t.abrupt("continue",51);case 49:return r.push({center:f,scheme:[x,b,E]}),t.abrupt("return",r);case 51:t.next=14;break;case 53:t.next=58;break;case 55:t.prev=55,t.t0=t.catch(12),c.e(t.t0);case 58:return t.prev=58,c.f(),t.finish(58);case 61:return t.abrupt("return",null);case 62:case"end":return t.stop()}}),t,this,[[12,55,58,61]])}))),function(t,e){return o.apply(this,arguments)})},{key:"getDataForSave",value:function(){var t={};t.type=this.type;var e=function(e){for(var n=0;n<t.portalsList.length;n++)if(t.portalsList[n].guid===e)return n;return-1};t.portalsList=[];var n,r=p(this.portalsList);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.portalsList.push(i.getDataForSave())}}catch(t){r.e(t)}finally{r.f()}t.linkingPlan=[];var o,s=p(this.linkingPlan);try{for(s.s();!(o=s.n()).done;){var a=o.value;t.linkingPlan.push([e(a[0].options.guid),e(a[1].options.guid)])}}catch(t){s.e(t)}finally{s.f()}t.teamsPortals=[];var u,c=p(this.teamsPortals);try{for(c.s();!(u=c.n()).done;){var l=u.value;t.teamsPortals.push(l.slice())}}catch(t){c.e(t)}finally{c.f()}t.teamsPlan=[];var f,h=p(this.teamsPlan);try{for(h.s();!(f=h.n()).done;){var g,d=f.value,y=[],v=p(d);try{for(v.s();!(g=v.n()).done;){var m=g.value;y.push([e(m[0].options.guid),e(m[1].options.guid)])}}catch(t){v.e(t)}finally{v.f()}t.teamsPlan.push(y)}}catch(t){h.e(t)}finally{h.f()}return t}}],i=[{key:"translateLinks",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[3],o=[],s=p(t);try{for(s.s();!(n=s.n()).done;){var a=n.value,u=[];i.indexOf(a[0])<0?u[0]=a[0]+e:u[0]=a[0],i.indexOf(a[1])<0?u[1]=a[1]+e:u[1]=a[1],o.push(u)}}catch(t){s.e(t)}finally{s.f()}if(r){var c,l="",f=p(o);try{for(f.s();!(c=f.n()).done;){var h=c.value;l+="["+h[0]+", "+h[1]+"],\n"}}catch(t){f.e(t)}finally{f.f()}console.log(l)}return o}}],r&&y(n.prototype,r),i&&y(n,i),l}(o.a);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 S(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function C(t,e,n){return(C="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=R(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function M(t,e){return!e||"object"!==I(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function O(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function R(t){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var A=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&T(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=R(e);if(O()){var r=R(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return M(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return N(this,u),(r=a.call(this,t,e,n,i)).level=2,r.type="2",r.linkScheme=[[1,3],[1,2],[3,2],[0,1],[0,2],[0,3]],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,C(R(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){S(i,n,r,s,a,"next",t)}function a(t){S(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&P(n.prototype,r),i&&P(n,i),u}(E);function F(t){return(F="function"==typeof Symbol&&"symbol"==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 D(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function k(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function G(t,e,n){return(G="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=z(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function q(t,e){return!e||"object"!==F(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function B(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function z(t){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function U(t,e){return(U=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var V=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&U(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=z(e);if(B()){var r=z(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return q(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return k(this,u),(r=a.call(this,t,e,n,i)).level=3,r.type="3",r.linkScheme=[[3,4],[3,5],[3,6],[0,1],[1,2],[2,0],[2,3],[0,3],[1,3],[1,4],[1,5],[2,5],[2,6],[0,6],[0,4]],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,G(z(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){D(i,n,r,s,a,"next",t)}function a(t){D(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&j(n.prototype,r),i&&j(n,i),u}(E);function X(t){return(X="function"==typeof Symbol&&"symbol"==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 Y(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function W(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function J(t,e,n){return(J="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Q(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function K(t,e){return!e||"object"!==X(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Z(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function Q(t){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function tt(t,e){return(tt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var et=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&tt(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=Q(e);if(Z()){var r=Q(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return K(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return W(this,u),(r=a.call(this,t,e,n,i)).level=4,r.type="4",r.linkScheme=[[4,3],[4,5],[4,6],[4,7],[7,3],[6,3],[8,3],[8,9],[8,10],[8,11],[11,3],[10,3],[12,3],[12,13],[12,14],[12,15],[15,3],[14,3],[0,1],[1,2],[2,0],[2,3],[0,3],[1,3],[1,4],[1,8],[2,8],[2,12],[0,12],[0,4],[0,7],[0,14],[0,5],[0,13],[1,6],[1,11],[1,5],[1,9],[2,10],[2,15],[2,9],[2,13]],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,J(Q(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){Y(i,n,r,s,a,"next",t)}function a(t){Y(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&H(n.prototype,r),i&&H(n,i),u}(E);function nt(t){return(nt="function"==typeof Symbol&&"symbol"==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 rt(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function it(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function st(t,e,n){return(st="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ct(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function at(t,e){return!e||"object"!==nt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ut(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function ct(t){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function lt(t,e){return(lt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ft=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&lt(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=ct(e);if(ut()){var r=ct(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return at(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return it(this,u),(r=a.call(this,t,e,n,i)).level=5,r.type="5",r.linkScheme=[[16,3],[13,16],[13,3],[4,13],[4,3],[4,16],[4,11],[4,8],[4,7],[11,3],[9,4],[9,3],[9,11],[5,4],[5,7],[5,8],[5,6],[14,13],[14,3],[15,4],[15,13],[12,4],[12,9],[10,9],[10,3],[42,3],[39,42],[39,3],[30,39],[30,3],[30,42],[30,37],[30,34],[30,33],[37,3],[35,30],[35,3],[35,37],[31,30],[31,33],[31,34],[31,32],[40,39],[40,3],[41,30],[41,39],[38,30],[38,35],[36,35],[36,3],[29,3],[26,29],[26,3],[17,26],[17,3],[17,29],[17,24],[17,21],[17,20],[24,3],[22,17],[22,3],[22,24],[18,17],[18,20],[18,21],[18,19],[27,26],[27,3],[28,17],[28,26],[25,17],[25,22],[23,22],[23,3],[2,1],[1,0],[0,2],[0,3],[2,3],[1,3],[1,4],[1,17],[2,17],[2,30],[0,30],[0,4],[0,5],[0,13],[0,35],[0,31],[1,5],[1,9],[1,26],[1,18],[2,18],[2,22],[2,39],[2,31],[2,19],[2,20],[2,25],[2,23],[2,40],[2,41],[2,34],[2,32],[0,32],[0,33],[0,38],[0,36],[0,14],[0,15],[0,8],[0,6],[1,6],[1,7],[1,12],[1,10],[1,27],[1,28],[1,21],[1,19]],r.teamsPortals=[[0,4,5,6,7,8,9,10,11,12,13,14,15,16],[2,30,31,32,33,34,35,36,37,38,39,40,41,42],[1,17,18,19,20,21,22,23,24,25,26,27,28,29]],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,st(ct(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){rt(i,n,r,s,a,"next",t)}function a(t){rt(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&ot(n.prototype,r),i&&ot(n,i),u}(E);function ht(t){return(ht="function"==typeof Symbol&&"symbol"==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 pt(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function gt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yt(t,e,n){return(yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_t(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function vt(t,e){return!e||"object"!==ht(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function mt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function _t(t){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function xt(t,e){return(xt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var bt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xt(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=_t(e);if(mt()){var r=_t(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return gt(this,u),(r=a.call(this,t,e,n,i)).level=5,r.type="5v2",r.linkScheme=[[1,2],[19,1],[19,2],[18,1],[18,2],[18,19],[21,1],[21,18],[20,2],[20,18],[17,1],[17,2],[17,18],[17,21],[17,20],[28,1],[28,17],[26,1],[26,17],[26,28],[25,2],[25,17],[22,2],[22,17],[22,25],[23,2],[23,22],[24,17],[24,22],[29,17],[29,26],[27,1],[27,26],[3,1],[3,2],[3,17],[3,26],[3,22],[3,27],[3,29],[3,24],[3,23],[10,1],[10,3],[9,1],[9,3],[9,10],[12,1],[12,9],[11,9],[11,3],[4,1],[4,3],[4,9],[4,11],[4,12],[7,1],[7,4],[5,1],[5,4],[5,7],[6,1],[6,5],[8,5],[8,4],[16,3],[16,4],[13,3],[13,4],[13,16],[15,4],[15,13],[14,13],[14,3],[40,2],[40,3],[39,2],[39,3],[39,40],[42,3],[42,39],[41,2],[41,39],[30,2],[30,3],[30,39],[30,42],[30,41],[34,2],[34,30],[31,2],[31,30],[31,34],[32,31],[32,2],[33,31],[33,30],[37,3],[37,30],[35,3],[35,30],[35,37],[38,30],[38,35],[36,3],[36,35],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,13],[0,8],[0,15],[0,14],[0,30],[0,31],[0,32],[0,35],[0,33],[0,38],[0,36]],r.teamsPortals=[[0,1,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,21,26,27,28,29],[2,3,17,20,22,23,24,25,30,31,32,33,34,35,36,37,38,39,40,41,42]],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,yt(_t(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){pt(i,n,r,s,a,"next",t)}function a(t){pt(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&dt(n.prototype,r),i&&dt(n,i),u}(E);function wt(t){return(wt="function"==typeof Symbol&&"symbol"==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 Et(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function It(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function St(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Nt(t,e,n){return(Nt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Lt(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function Pt(t,e){return!e||"object"!==wt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function Lt(t){return(Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Mt(t,e){return(Mt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Ot=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Mt(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=Lt(e);if(Ct()){var r=Lt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return Pt(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return It(this,u),(r=a.call(this,t,e,n,i)).level=6,r.type="6",r.linkScheme=[[4,3],[4,31],[4,43],[4,40],[4,41],[4,18],[4,25],[4,23],[24,4],[41,3],[40,3],[40,41],[40,43],[40,42],[42,3],[31,3],[31,40],[31,43],[31,42],[24,3],[23,3],[23,24],[23,25],[23,26],[26,3],[18,3],[18,23],[18,25],[18,26],[5,4],[5,17],[5,14],[5,12],[5,10],[17,4],[14,4],[14,17],[12,4],[10,4],[10,12],[6,5],[6,7],[9,6],[9,5],[8,6],[8,5],[30,4],[30,18],[27,4],[27,18],[27,30],[21,18],[21,3],[19,18],[19,3],[19,21],[38,4],[38,31],[36,4],[36,31],[36,38],[35,31],[35,3],[32,31],[32,3],[32,35],[33,32],[33,3],[34,32],[34,31],[39,36],[39,31],[37,36],[37,4],[15,14],[15,4],[16,14],[16,5],[13,5],[13,10],[11,10],[11,4],[28,4],[28,27],[29,27],[29,18],[22,18],[22,19],[20,19],[20,3],[84,3],[84,111],[84,123],[84,120],[84,121],[84,98],[84,105],[84,103],[104,84],[121,3],[120,3],[120,121],[120,123],[120,122],[122,3],[111,3],[111,120],[111,123],[111,122],[104,3],[103,3],[103,104],[103,105],[103,106],[106,3],[98,3],[98,103],[98,105],[98,106],[85,84],[85,97],[85,94],[85,92],[85,90],[97,84],[94,84],[94,97],[92,84],[90,84],[90,92],[86,85],[86,87],[89,86],[89,85],[88,86],[88,85],[110,84],[110,98],[107,84],[107,98],[107,110],[101,98],[101,3],[99,98],[99,3],[99,101],[118,84],[118,111],[116,84],[116,111],[116,118],[115,111],[115,3],[112,111],[112,3],[112,115],[113,112],[113,3],[114,112],[114,111],[119,116],[119,111],[117,116],[117,84],[95,94],[95,84],[96,94],[96,85],[93,85],[93,90],[91,90],[91,84],[108,84],[108,107],[109,107],[109,98],[102,98],[102,99],[100,99],[100,3],[44,3],[44,71],[44,83],[44,80],[44,81],[44,58],[44,65],[44,63],[64,44],[81,3],[80,3],[80,81],[80,83],[80,82],[82,3],[71,3],[71,80],[71,83],[71,82],[64,3],[63,3],[63,64],[63,65],[63,66],[66,3],[58,3],[58,63],[58,65],[58,66],[45,44],[45,57],[45,54],[45,52],[45,50],[57,44],[54,44],[54,57],[52,44],[50,44],[50,52],[46,45],[46,47],[49,46],[49,45],[48,46],[48,45],[70,44],[70,58],[67,44],[67,58],[67,70],[61,58],[61,3],[59,58],[59,3],[59,61],[78,44],[78,71],[76,44],[76,71],[76,78],[75,71],[75,3],[72,71],[72,3],[72,75],[73,72],[73,3],[74,72],[74,71],[79,76],[79,71],[77,76],[77,44],[55,54],[55,44],[56,54],[56,45],[53,45],[53,50],[51,50],[51,44],[68,44],[68,67],[69,67],[69,58],[62,58],[62,59],[60,59],[60,3],[2,0],[0,1],[1,2],[1,3],[2,3],[0,3],[0,4],[0,84],[1,4],[1,44],[2,44],[2,84],[2,45],[2,58],[2,111],[2,85],[0,85],[0,98],[0,31],[0,5],[1,5],[1,18],[1,71],[1,45],[1,6],[1,10],[1,27],[1,19],[1,72],[1,76],[1,54],[1,46],[2,46],[2,50],[2,67],[2,59],[2,112],[2,116],[2,94],[2,86],[0,86],[0,90],[0,107],[0,99],[0,32],[0,36],[0,14],[0,6],[0,7],[0,9],[0,16],[0,15],[0,37],[0,39],[0,34],[0,33],[0,100],[0,102],[0,109],[0,108],[0,91],[0,93],[0,88],[0,87],[1,7],[1,8],[1,13],[1,11],[1,28],[1,29],[1,22],[1,20],[1,73],[1,74],[1,79],[1,77],[1,55],[1,56],[1,49],[1,47],[2,47],[2,48],[2,53],[2,51],[2,68],[2,69],[2,62],[2,60],[2,113],[2,114],[2,119],[2,117],[2,95],[2,96],[2,89],[2,87]],r.teamsPortals=[[0,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],[2,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123],[1,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83]],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Nt(Lt(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){Et(i,n,r,s,a,"next",t)}function a(t){Et(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&St(n.prototype,r),i&&St(n,i),u}(E);function Rt(t){return(Rt="function"==typeof Symbol&&"symbol"==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 Tt(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function At(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ft(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Dt(t,e,n){return(Dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Gt(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function kt(t,e){return!e||"object"!==Rt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function jt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function Gt(t){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qt(t,e){return(qt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Bt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&qt(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=Gt(e);if(jt()){var r=Gt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return kt(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return At(this,u),(r=a.call(this,t,e,n,i)).level=6,r.type="6v2",r.linkScheme=[[1,2],[47,1],[47,2],[46,1],[46,2],[46,47],[49,46],[49,1],[48,46],[48,2],[45,1],[45,2],[45,46],[45,49],[45,48],[56,45],[56,1],[53,45],[53,2],[54,45],[54,1],[54,56],[50,45],[50,2],[50,53],[57,54],[57,45],[52,45],[52,50],[55,54],[55,1],[51,50],[51,2],[44,1],[44,2],[44,45],[44,54],[44,50],[44,55],[44,57],[44,52],[44,51],[77,1],[77,44],[68,2],[68,44],[76,1],[76,44],[76,77],[67,44],[67,2],[67,68],[79,76],[79,1],[78,76],[78,44],[71,44],[71,1],[71,76],[71,79],[71,78],[70,44],[70,67],[69,67],[69,2],[58,44],[58,2],[58,67],[58,70],[58,69],[74,71],[74,1],[72,71],[72,1],[72,74],[73,1],[73,72],[75,71],[75,72],[83,71],[83,44],[80,71],[80,44],[80,83],[82,80],[82,71],[81,80],[81,44],[65,44],[65,58],[63,44],[63,58],[63,65],[64,63],[64,44],[66,63],[66,58],[62,58],[62,2],[59,58],[59,2],[59,62],[61,58],[61,59],[60,59],[60,2],[3,1],[3,2],[3,44],[3,71],[3,58],[3,72],[3,80],[3,63],[3,59],[3,73],[3,75],[3,82],[3,81],[3,64],[3,66],[3,61],[3,60],[20,1],[20,3],[19,1],[19,3],[19,20],[22,19],[22,1],[21,19],[21,3],[18,1],[18,3],[18,19],[18,22],[18,21],[29,1],[29,18],[27,1],[27,18],[27,29],[26,18],[26,3],[23,18],[23,3],[23,26],[28,27],[28,1],[30,27],[30,18],[25,18],[25,23],[24,23],[24,3],[4,1],[4,3],[4,18],[4,27],[4,23],[4,28],[4,30],[4,25],[4,24],[113,3],[113,2],[112,3],[112,2],[112,113],[115,112],[115,3],[114,112],[114,2],[111,3],[111,2],[111,112],[111,115],[111,114],[122,3],[122,111],[120,3],[120,111],[120,122],[119,111],[119,2],[116,111],[116,2],[116,119],[117,116],[117,2],[118,111],[118,116],[123,120],[123,111],[121,120],[121,3],[84,3],[84,2],[84,111],[84,120],[84,116],[84,121],[84,123],[84,118],[84,117],[11,1],[11,4],[10,1],[10,4],[10,11],[13,10],[13,1],[12,10],[12,4],[5,1],[5,4],[5,10],[5,13],[5,12],[8,5],[8,1],[6,5],[6,1],[6,8],[7,1],[7,6],[9,6],[9,5],[17,5],[17,4],[14,5],[14,4],[14,17],[16,5],[16,14],[15,14],[15,4],[41,4],[41,3],[40,4],[40,3],[40,41],[42,40],[42,3],[43,4],[43,40],[31,3],[31,4],[31,40],[31,43],[31,42],[38,4],[38,31],[36,4],[36,31],[36,38],[37,4],[37,36],[39,36],[39,31],[35,31],[35,3],[32,31],[32,3],[32,35],[34,31],[34,32],[33,32],[33,3],[104,84],[104,3],[103,84],[103,3],[103,104],[106,103],[106,3],[105,103],[105,84],[98,3],[98,84],[98,103],[98,106],[98,105],[101,3],[101,98],[99,3],[99,98],[99,101],[100,99],[100,3],[102,99],[102,98],[110,98],[110,84],[107,98],[107,84],[107,110],[109,107],[109,98],[108,107],[108,84],[95,84],[95,2],[94,84],[94,2],[94,95],[97,84],[97,94],[96,94],[96,2],[85,84],[85,2],[85,94],[85,97],[85,96],[92,84],[92,85],[90,84],[90,85],[90,92],[91,90],[91,84],[93,90],[93,85],[89,85],[89,2],[86,85],[86,2],[86,89],[87,86],[87,2],[88,85],[88,86],[0,1],[0,2],[0,3],[0,4],[0,84],[0,5],[0,31],[0,98],[0,85],[0,6],[0,14],[0,36],[0,32],[0,99],[0,107],[0,90],[0,86],[0,7],[0,9],[0,16],[0,15],[0,37],[0,39],[0,34],[0,33],[0,100],[0,102],[0,109],[0,108],[0,91],[0,93],[0,88],[0,87]],r.teamsPortals=[[0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,49,54,55,56,57,71,72,73,74,75,76,77,78,79,80,81,82,83],[2,44,45,48,50,51,52,53,58,59,60,61,62,63,64,65,66,67,68,69,70,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123]],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Dt(Gt(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){Tt(i,n,r,s,a,"next",t)}function a(t){Tt(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&Ft(n.prototype,r),i&&Ft(n,i),u}(E);function zt(t){return(zt="function"==typeof Symbol&&"symbol"==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 Ut(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function Vt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yt(t,e,n){return(Yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$t(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function Wt(t,e){return!e||"object"!==zt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Ht(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function $t(t){return($t=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Jt(t,e){return(Jt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Kt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Jt(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=$t(e);if(Ht()){var r=$t(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return Wt(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return Vt(this,u),(r=a.call(this,t,e,n,i)).level=7,r.type="7",r.linkScheme=[[0,1],[1,2],[2,0],[3,0],[3,1],[3,2],[4,0],[4,1],[4,3],[5,0],[5,1],[5,4],[6,0],[6,1],[6,5],[7,0],[7,1],[7,6],[8,0],[8,1],[8,7],[9,1],[9,6],[9,7],[10,6],[10,0],[10,7],[11,1],[11,5],[11,6],[12,1],[12,5],[12,11],[13,5],[13,6],[13,11],[14,6],[14,1],[14,11],[15,5],[15,0],[15,6],[16,5],[16,0],[16,15],[17,0],[17,6],[17,15],[18,6],[18,5],[18,15],[19,1],[19,4],[19,5],[20,1],[20,4],[20,19],[21,1],[21,4],[21,20],[22,4],[22,19],[22,20],[23,19],[23,1],[23,20],[24,4],[24,5],[24,19],[25,4],[25,5],[25,24],[26,5],[26,19],[26,24],[27,19],[27,4],[27,24],[28,5],[28,1],[28,19],[29,5],[29,1],[29,28],[30,1],[30,19],[30,28],[31,19],[31,5],[31,28],[32,4],[32,0],[32,5],[33,4],[33,0],[33,32],[34,4],[34,0],[34,33],[35,0],[35,32],[35,33],[36,32],[36,4],[36,33],[37,0],[37,5],[37,32],[38,0],[38,5],[38,37],[39,5],[39,32],[39,37],[40,32],[40,0],[40,37],[41,5],[41,4],[41,32],[42,5],[42,4],[42,41],[43,4],[43,32],[43,41],[44,32],[44,5],[44,41],[45,1],[45,3],[45,4],[46,1],[46,3],[46,45],[47,1],[47,3],[47,46],[48,1],[48,3],[48,47],[49,3],[49,46],[49,47],[50,46],[50,1],[50,47],[51,3],[51,45],[51,46],[52,3],[52,45],[52,51],[53,45],[53,46],[53,51],[54,46],[54,3],[54,51],[55,45],[55,1],[55,46],[56,45],[56,1],[56,55],[57,1],[57,46],[57,55],[58,46],[58,45],[58,55],[59,3],[59,4],[59,45],[60,3],[60,4],[60,59],[61,3],[61,4],[61,60],[62,4],[62,59],[62,60],[63,59],[63,3],[63,60],[64,4],[64,45],[64,59],[65,4],[65,45],[65,64],[66,45],[66,59],[66,64],[67,59],[67,4],[67,64],[68,45],[68,3],[68,59],[69,45],[69,3],[69,68],[70,3],[70,59],[70,68],[71,59],[71,45],[71,68],[72,4],[72,1],[72,45],[73,4],[73,1],[73,72],[74,4],[74,1],[74,73],[75,1],[75,72],[75,73],[76,72],[76,4],[76,73],[77,1],[77,45],[77,72],[78,1],[78,45],[78,77],[79,45],[79,72],[79,77],[80,72],[80,1],[80,77],[81,45],[81,4],[81,72],[82,45],[82,4],[82,81],[83,4],[83,72],[83,81],[84,72],[84,45],[84,81],[85,3],[85,0],[85,4],[86,3],[86,0],[86,85],[87,3],[87,0],[87,86],[88,3],[88,0],[88,87],[89,0],[89,86],[89,87],[90,86],[90,3],[90,87],[91,0],[91,85],[91,86],[92,0],[92,85],[92,91],[93,85],[93,86],[93,91],[94,86],[94,0],[94,91],[95,85],[95,3],[95,86],[96,85],[96,3],[96,95],[97,3],[97,86],[97,95],[98,86],[98,85],[98,95],[99,0],[99,4],[99,85],[100,0],[100,4],[100,99],[101,0],[101,4],[101,100],[102,4],[102,99],[102,100],[103,99],[103,0],[103,100],[104,4],[104,85],[104,99],[105,4],[105,85],[105,104],[106,85],[106,99],[106,104],[107,99],[107,4],[107,104],[108,85],[108,0],[108,99],[109,85],[109,0],[109,108],[110,0],[110,99],[110,108],[111,99],[111,85],[111,108],[112,4],[112,3],[112,85],[113,4],[113,3],[113,112],[114,4],[114,3],[114,113],[115,3],[115,112],[115,113],[116,112],[116,4],[116,113],[117,3],[117,85],[117,112],[118,3],[118,85],[118,117],[119,85],[119,112],[119,117],[120,112],[120,3],[120,117],[121,85],[121,4],[121,112],[122,85],[122,4],[122,121],[123,4],[123,112],[123,121],[124,112],[124,85],[124,121],[125,1],[125,2],[125,3],[126,1],[126,2],[126,125],[127,1],[127,2],[127,126],[128,1],[128,2],[128,127],[129,1],[129,2],[129,128],[130,2],[130,127],[130,128],[131,127],[131,1],[131,128],[132,2],[132,126],[132,127],[133,2],[133,126],[133,132],[134,126],[134,127],[134,132],[135,127],[135,2],[135,132],[136,126],[136,1],[136,127],[137,126],[137,1],[137,136],[138,1],[138,127],[138,136],[139,127],[139,126],[139,136],[140,2],[140,125],[140,126],[141,2],[141,125],[141,140],[142,2],[142,125],[142,141],[143,125],[143,140],[143,141],[144,140],[144,2],[144,141],[145,125],[145,126],[145,140],[146,125],[146,126],[146,145],[147,126],[147,140],[147,145],[148,140],[148,125],[148,145],[149,126],[149,2],[149,140],[150,126],[150,2],[150,149],[151,2],[151,140],[151,149],[152,140],[152,126],[152,149],[153,125],[153,1],[153,126],[154,125],[154,1],[154,153],[155,125],[155,1],[155,154],[156,1],[156,153],[156,154],[157,153],[157,125],[157,154],[158,1],[158,126],[158,153],[159,1],[159,126],[159,158],[160,126],[160,153],[160,158],[161,153],[161,1],[161,158],[162,126],[162,125],[162,153],[163,126],[163,125],[163,162],[164,125],[164,153],[164,162],[165,153],[165,126],[165,162],[166,2],[166,3],[166,125],[167,2],[167,3],[167,166],[168,2],[168,3],[168,167],[169,2],[169,3],[169,168],[170,3],[170,167],[170,168],[171,167],[171,2],[171,168],[172,3],[172,166],[172,167],[173,3],[173,166],[173,172],[174,166],[174,167],[174,172],[175,167],[175,3],[175,172],[176,166],[176,2],[176,167],[177,166],[177,2],[177,176],[178,2],[178,167],[178,176],[179,167],[179,166],[179,176],[180,3],[180,125],[180,166],[181,3],[181,125],[181,180],[182,3],[182,125],[182,181],[183,125],[183,180],[183,181],[184,180],[184,3],[184,181],[185,125],[185,166],[185,180],[186,125],[186,166],[186,185],[187,166],[187,180],[187,185],[188,180],[188,125],[188,185],[189,166],[189,3],[189,180],[190,166],[190,3],[190,189],[191,3],[191,180],[191,189],[192,180],[192,166],[192,189],[193,125],[193,2],[193,166],[194,125],[194,2],[194,193],[195,125],[195,2],[195,194],[196,2],[196,193],[196,194],[197,193],[197,125],[197,194],[198,2],[198,166],[198,193],[199,2],[199,166],[199,198],[200,166],[200,193],[200,198],[201,193],[201,2],[201,198],[202,166],[202,125],[202,193],[203,166],[203,125],[203,202],[204,125],[204,193],[204,202],[205,193],[205,166],[205,202],[206,3],[206,1],[206,125],[207,3],[207,1],[207,206],[208,3],[208,1],[208,207],[209,3],[209,1],[209,208],[210,1],[210,207],[210,208],[211,207],[211,3],[211,208],[212,1],[212,206],[212,207],[213,1],[213,206],[213,212],[214,206],[214,207],[214,212],[215,207],[215,1],[215,212],[216,206],[216,3],[216,207],[217,206],[217,3],[217,216],[218,3],[218,207],[218,216],[219,207],[219,206],[219,216],[220,1],[220,125],[220,206],[221,1],[221,125],[221,220],[222,1],[222,125],[222,221],[223,125],[223,220],[223,221],[224,220],[224,1],[224,221],[225,125],[225,206],[225,220],[226,125],[226,206],[226,225],[227,206],[227,220],[227,225],[228,220],[228,125],[228,225],[229,206],[229,1],[229,220],[230,206],[230,1],[230,229],[231,1],[231,220],[231,229],[232,220],[232,206],[232,229],[233,125],[233,3],[233,206],[234,125],[234,3],[234,233],[235,125],[235,3],[235,234],[236,3],[236,233],[236,234],[237,233],[237,125],[237,234],[238,3],[238,206],[238,233],[239,3],[239,206],[239,238],[240,206],[240,233],[240,238],[241,233],[241,3],[241,238],[242,206],[242,125],[242,233],[243,206],[243,125],[243,242],[244,125],[244,233],[244,242],[245,233],[245,206],[245,242],[246,2],[246,0],[246,3],[247,2],[247,0],[247,246],[248,2],[248,0],[248,247],[249,2],[249,0],[249,248],[250,2],[250,0],[250,249],[251,0],[251,248],[251,249],[252,248],[252,2],[252,249],[253,0],[253,247],[253,248],[254,0],[254,247],[254,253],[255,247],[255,248],[255,253],[256,248],[256,0],[256,253],[257,247],[257,2],[257,248],[258,247],[258,2],[258,257],[259,2],[259,248],[259,257],[260,248],[260,247],[260,257],[261,0],[261,246],[261,247],[262,0],[262,246],[262,261],[263,0],[263,246],[263,262],[264,246],[264,261],[264,262],[265,261],[265,0],[265,262],[266,246],[266,247],[266,261],[267,246],[267,247],[267,266],[268,247],[268,261],[268,266],[269,261],[269,246],[269,266],[270,247],[270,0],[270,261],[271,247],[271,0],[271,270],[272,0],[272,261],[272,270],[273,261],[273,247],[273,270],[274,246],[274,2],[274,247],[275,246],[275,2],[275,274],[276,246],[276,2],[276,275],[277,2],[277,274],[277,275],[278,274],[278,246],[278,275],[279,2],[279,247],[279,274],[280,2],[280,247],[280,279],[281,247],[281,274],[281,279],[282,274],[282,2],[282,279],[283,247],[283,246],[283,274],[284,247],[284,246],[284,283],[285,246],[285,274],[285,283],[286,274],[286,247],[286,283],[287,0],[287,3],[287,246],[288,0],[288,3],[288,287],[289,0],[289,3],[289,288],[290,0],[290,3],[290,289],[291,3],[291,288],[291,289],[292,288],[292,0],[292,289],[293,3],[293,287],[293,288],[294,3],[294,287],[294,293],[295,287],[295,288],[295,293],[296,288],[296,3],[296,293],[297,287],[297,0],[297,288],[298,287],[298,0],[298,297],[299,0],[299,288],[299,297],[300,288],[300,287],[300,297],[301,3],[301,246],[301,287],[302,3],[302,246],[302,301],[303,3],[303,246],[303,302],[304,246],[304,301],[304,302],[305,301],[305,3],[305,302],[306,246],[306,287],[306,301],[307,246],[307,287],[307,306],[308,287],[308,301],[308,306],[309,301],[309,246],[309,306],[310,287],[310,3],[310,301],[311,287],[311,3],[311,310],[312,3],[312,301],[312,310],[313,301],[313,287],[313,310],[314,246],[314,0],[314,287],[315,246],[315,0],[315,314],[316,246],[316,0],[316,315],[317,0],[317,314],[317,315],[318,314],[318,246],[318,315],[319,0],[319,287],[319,314],[320,0],[320,287],[320,319],[321,287],[321,314],[321,319],[322,314],[322,0],[322,319],[323,287],[323,246],[323,314],[324,287],[324,246],[324,323],[325,246],[325,314],[325,323],[326,314],[326,287],[326,323],[327,3],[327,2],[327,246],[328,3],[328,2],[328,327],[329,3],[329,2],[329,328],[330,3],[330,2],[330,329],[331,2],[331,328],[331,329],[332,328],[332,3],[332,329],[333,2],[333,327],[333,328],[334,2],[334,327],[334,333],[335,327],[335,328],[335,333],[336,328],[336,2],[336,333],[337,327],[337,3],[337,328],[338,327],[338,3],[338,337],[339,3],[339,328],[339,337],[340,328],[340,327],[340,337],[341,2],[341,246],[341,327],[342,2],[342,246],[342,341],[343,2],[343,246],[343,342],[344,246],[344,341],[344,342],[345,341],[345,2],[345,342],[346,246],[346,327],[346,341],[347,246],[347,327],[347,346],[348,327],[348,341],[348,346],[349,341],[349,246],[349,346],[350,327],[350,2],[350,341],[351,327],[351,2],[351,350],[352,2],[352,341],[352,350],[353,341],[353,327],[353,350],[354,246],[354,3],[354,327],[355,246],[355,3],[355,354],[356,246],[356,3],[356,355],[357,3],[357,354],[357,355],[358,354],[358,246],[358,355],[359,3],[359,327],[359,354],[360,3],[360,327],[360,359],[361,327],[361,354],[361,359],[362,354],[362,3],[362,359],[363,327],[363,246],[363,354],[364,327],[364,246],[364,363],[365,246],[365,354],[365,363],[366,354],[366,327],[366,363]],r.teamsPortals=[],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Yt($t(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){Ut(i,n,r,s,a,"next",t)}function a(t){Ut(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&Xt(n.prototype,r),i&&Xt(n,i),u}(E);function Zt(t){return(Zt="function"==typeof Symbol&&"symbol"==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 Qt(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ne(t,e,n){return(ne="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=oe(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function re(t,e){return!e||"object"!==Zt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function ie(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function oe(t){return(oe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function se(t,e){return(se=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&se(t,e)}(u,t);var e,n,r,i,o,s,a=(e=u,function(){var t,n=oe(e);if(ie()){var r=oe(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return re(this,t)});function u(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return te(this,u),(r=a.call(this,t,e,n,i)).level=8,r.type="8",r.linkScheme=[[0,1],[1,2],[2,0],[3,0],[3,1],[3,2],[4,0],[4,1],[4,3],[5,0],[5,1],[5,4],[6,0],[6,1],[6,5],[7,0],[7,1],[7,6],[8,0],[8,1],[8,7],[9,0],[9,1],[9,8],[10,1],[10,7],[10,8],[11,7],[11,0],[11,8],[12,1],[12,6],[12,7],[13,1],[13,6],[13,12],[14,6],[14,7],[14,12],[15,7],[15,1],[15,12],[16,6],[16,0],[16,7],[17,6],[17,0],[17,16],[18,0],[18,7],[18,16],[19,7],[19,6],[19,16],[20,1],[20,5],[20,6],[21,1],[21,5],[21,20],[22,1],[22,5],[22,21],[23,5],[23,20],[23,21],[24,20],[24,1],[24,21],[25,5],[25,6],[25,20],[26,5],[26,6],[26,25],[27,6],[27,20],[27,25],[28,20],[28,5],[28,25],[29,6],[29,1],[29,20],[30,6],[30,1],[30,29],[31,1],[31,20],[31,29],[32,20],[32,6],[32,29],[33,5],[33,0],[33,6],[34,5],[34,0],[34,33],[35,5],[35,0],[35,34],[36,0],[36,33],[36,34],[37,33],[37,5],[37,34],[38,0],[38,6],[38,33],[39,0],[39,6],[39,38],[40,6],[40,33],[40,38],[41,33],[41,0],[41,38],[42,6],[42,5],[42,33],[43,6],[43,5],[43,42],[44,5],[44,33],[44,42],[45,33],[45,6],[45,42],[46,1],[46,4],[46,5],[47,1],[47,4],[47,46],[48,1],[48,4],[48,47],[49,1],[49,4],[49,48],[50,4],[50,47],[50,48],[51,47],[51,1],[51,48],[52,4],[52,46],[52,47],[53,4],[53,46],[53,52],[54,46],[54,47],[54,52],[55,47],[55,4],[55,52],[56,46],[56,1],[56,47],[57,46],[57,1],[57,56],[58,1],[58,47],[58,56],[59,47],[59,46],[59,56],[60,4],[60,5],[60,46],[61,4],[61,5],[61,60],[62,4],[62,5],[62,61],[63,5],[63,60],[63,61],[64,60],[64,4],[64,61],[65,5],[65,46],[65,60],[66,5],[66,46],[66,65],[67,46],[67,60],[67,65],[68,60],[68,5],[68,65],[69,46],[69,4],[69,60],[70,46],[70,4],[70,69],[71,4],[71,60],[71,69],[72,60],[72,46],[72,69],[73,5],[73,1],[73,46],[74,5],[74,1],[74,73],[75,5],[75,1],[75,74],[76,1],[76,73],[76,74],[77,73],[77,5],[77,74],[78,1],[78,46],[78,73],[79,1],[79,46],[79,78],[80,46],[80,73],[80,78],[81,73],[81,1],[81,78],[82,46],[82,5],[82,73],[83,46],[83,5],[83,82],[84,5],[84,73],[84,82],[85,73],[85,46],[85,82],[86,4],[86,0],[86,5],[87,4],[87,0],[87,86],[88,4],[88,0],[88,87],[89,4],[89,0],[89,88],[90,0],[90,87],[90,88],[91,87],[91,4],[91,88],[92,0],[92,86],[92,87],[93,0],[93,86],[93,92],[94,86],[94,87],[94,92],[95,87],[95,0],[95,92],[96,86],[96,4],[96,87],[97,86],[97,4],[97,96],[98,4],[98,87],[98,96],[99,87],[99,86],[99,96],[100,0],[100,5],[100,86],[101,0],[101,5],[101,100],[102,0],[102,5],[102,101],[103,5],[103,100],[103,101],[104,100],[104,0],[104,101],[105,5],[105,86],[105,100],[106,5],[106,86],[106,105],[107,86],[107,100],[107,105],[108,100],[108,5],[108,105],[109,86],[109,0],[109,100],[110,86],[110,0],[110,109],[111,0],[111,100],[111,109],[112,100],[112,86],[112,109],[113,5],[113,4],[113,86],[114,5],[114,4],[114,113],[115,5],[115,4],[115,114],[116,4],[116,113],[116,114],[117,113],[117,5],[117,114],[118,4],[118,86],[118,113],[119,4],[119,86],[119,118],[120,86],[120,113],[120,118],[121,113],[121,4],[121,118],[122,86],[122,5],[122,113],[123,86],[123,5],[123,122],[124,5],[124,113],[124,122],[125,113],[125,86],[125,122],[126,1],[126,3],[126,4],[127,1],[127,3],[127,126],[128,1],[128,3],[128,127],[129,1],[129,3],[129,128],[130,1],[130,3],[130,129],[131,3],[131,128],[131,129],[132,128],[132,1],[132,129],[133,3],[133,127],[133,128],[134,3],[134,127],[134,133],[135,127],[135,128],[135,133],[136,128],[136,3],[136,133],[137,127],[137,1],[137,128],[138,127],[138,1],[138,137],[139,1],[139,128],[139,137],[140,128],[140,127],[140,137],[141,3],[141,126],[141,127],[142,3],[142,126],[142,141],[143,3],[143,126],[143,142],[144,126],[144,141],[144,142],[145,141],[145,3],[145,142],[146,126],[146,127],[146,141],[147,126],[147,127],[147,146],[148,127],[148,141],[148,146],[149,141],[149,126],[149,146],[150,127],[150,3],[150,141],[151,127],[151,3],[151,150],[152,3],[152,141],[152,150],[153,141],[153,127],[153,150],[154,126],[154,1],[154,127],[155,126],[155,1],[155,154],[156,126],[156,1],[156,155],[157,1],[157,154],[157,155],[158,154],[158,126],[158,155],[159,1],[159,127],[159,154],[160,1],[160,127],[160,159],[161,127],[161,154],[161,159],[162,154],[162,1],[162,159],[163,127],[163,126],[163,154],[164,127],[164,126],[164,163],[165,126],[165,154],[165,163],[166,154],[166,127],[166,163],[167,3],[167,4],[167,126],[168,3],[168,4],[168,167],[169,3],[169,4],[169,168],[170,3],[170,4],[170,169],[171,4],[171,168],[171,169],[172,168],[172,3],[172,169],[173,4],[173,167],[173,168],[174,4],[174,167],[174,173],[175,167],[175,168],[175,173],[176,168],[176,4],[176,173],[177,167],[177,3],[177,168],[178,167],[178,3],[178,177],[179,3],[179,168],[179,177],[180,168],[180,167],[180,177],[181,4],[181,126],[181,167],[182,4],[182,126],[182,181],[183,4],[183,126],[183,182],[184,126],[184,181],[184,182],[185,181],[185,4],[185,182],[186,126],[186,167],[186,181],[187,126],[187,167],[187,186],[188,167],[188,181],[188,186],[189,181],[189,126],[189,186],[190,167],[190,4],[190,181],[191,167],[191,4],[191,190],[192,4],[192,181],[192,190],[193,181],[193,167],[193,190],[194,126],[194,3],[194,167],[195,126],[195,3],[195,194],[196,126],[196,3],[196,195],[197,3],[197,194],[197,195],[198,194],[198,126],[198,195],[199,3],[199,167],[199,194],[200,3],[200,167],[200,199],[201,167],[201,194],[201,199],[202,194],[202,3],[202,199],[203,167],[203,126],[203,194],[204,167],[204,126],[204,203],[205,126],[205,194],[205,203],[206,194],[206,167],[206,203],[207,4],[207,1],[207,126],[208,4],[208,1],[208,207],[209,4],[209,1],[209,208],[210,4],[210,1],[210,209],[211,1],[211,208],[211,209],[212,208],[212,4],[212,209],[213,1],[213,207],[213,208],[214,1],[214,207],[214,213],[215,207],[215,208],[215,213],[216,208],[216,1],[216,213],[217,207],[217,4],[217,208],[218,207],[218,4],[218,217],[219,4],[219,208],[219,217],[220,208],[220,207],[220,217],[221,1],[221,126],[221,207],[222,1],[222,126],[222,221],[223,1],[223,126],[223,222],[224,126],[224,221],[224,222],[225,221],[225,1],[225,222],[226,126],[226,207],[226,221],[227,126],[227,207],[227,226],[228,207],[228,221],[228,226],[229,221],[229,126],[229,226],[230,207],[230,1],[230,221],[231,207],[231,1],[231,230],[232,1],[232,221],[232,230],[233,221],[233,207],[233,230],[234,126],[234,4],[234,207],[235,126],[235,4],[235,234],[236,126],[236,4],[236,235],[237,4],[237,234],[237,235],[238,234],[238,126],[238,235],[239,4],[239,207],[239,234],[240,4],[240,207],[240,239],[241,207],[241,234],[241,239],[242,234],[242,4],[242,239],[243,207],[243,126],[243,234],[244,207],[244,126],[244,243],[245,126],[245,234],[245,243],[246,234],[246,207],[246,243],[247,3],[247,0],[247,4],[248,3],[248,0],[248,247],[249,3],[249,0],[249,248],[250,3],[250,0],[250,249],[251,3],[251,0],[251,250],[252,0],[252,249],[252,250],[253,249],[253,3],[253,250],[254,0],[254,248],[254,249],[255,0],[255,248],[255,254],[256,248],[256,249],[256,254],[257,249],[257,0],[257,254],[258,248],[258,3],[258,249],[259,248],[259,3],[259,258],[260,3],[260,249],[260,258],[261,249],[261,248],[261,258],[262,0],[262,247],[262,248],[263,0],[263,247],[263,262],[264,0],[264,247],[264,263],[265,247],[265,262],[265,263],[266,262],[266,0],[266,263],[267,247],[267,248],[267,262],[268,247],[268,248],[268,267],[269,248],[269,262],[269,267],[270,262],[270,247],[270,267],[271,248],[271,0],[271,262],[272,248],[272,0],[272,271],[273,0],[273,262],[273,271],[274,262],[274,248],[274,271],[275,247],[275,3],[275,248],[276,247],[276,3],[276,275],[277,247],[277,3],[277,276],[278,3],[278,275],[278,276],[279,275],[279,247],[279,276],[280,3],[280,248],[280,275],[281,3],[281,248],[281,280],[282,248],[282,275],[282,280],[283,275],[283,3],[283,280],[284,248],[284,247],[284,275],[285,248],[285,247],[285,284],[286,247],[286,275],[286,284],[287,275],[287,248],[287,284],[288,0],[288,4],[288,247],[289,0],[289,4],[289,288],[290,0],[290,4],[290,289],[291,0],[291,4],[291,290],[292,4],[292,289],[292,290],[293,289],[293,0],[293,290],[294,4],[294,288],[294,289],[295,4],[295,288],[295,294],[296,288],[296,289],[296,294],[297,289],[297,4],[297,294],[298,288],[298,0],[298,289],[299,288],[299,0],[299,298],[300,0],[300,289],[300,298],[301,289],[301,288],[301,298],[302,4],[302,247],[302,288],[303,4],[303,247],[303,302],[304,4],[304,247],[304,303],[305,247],[305,302],[305,303],[306,302],[306,4],[306,303],[307,247],[307,288],[307,302],[308,247],[308,288],[308,307],[309,288],[309,302],[309,307],[310,302],[310,247],[310,307],[311,288],[311,4],[311,302],[312,288],[312,4],[312,311],[313,4],[313,302],[313,311],[314,302],[314,288],[314,311],[315,247],[315,0],[315,288],[316,247],[316,0],[316,315],[317,247],[317,0],[317,316],[318,0],[318,315],[318,316],[319,315],[319,247],[319,316],[320,0],[320,288],[320,315],[321,0],[321,288],[321,320],[322,288],[322,315],[322,320],[323,315],[323,0],[323,320],[324,288],[324,247],[324,315],[325,288],[325,247],[325,324],[326,247],[326,315],[326,324],[327,315],[327,288],[327,324],[328,4],[328,3],[328,247],[329,4],[329,3],[329,328],[330,4],[330,3],[330,329],[331,4],[331,3],[331,330],[332,3],[332,329],[332,330],[333,329],[333,4],[333,330],[334,3],[334,328],[334,329],[335,3],[335,328],[335,334],[336,328],[336,329],[336,334],[337,329],[337,3],[337,334],[338,328],[338,4],[338,329],[339,328],[339,4],[339,338],[340,4],[340,329],[340,338],[341,329],[341,328],[341,338],[342,3],[342,247],[342,328],[343,3],[343,247],[343,342],[344,3],[344,247],[344,343],[345,247],[345,342],[345,343],[346,342],[346,3],[346,343],[347,247],[347,328],[347,342],[348,247],[348,328],[348,347],[349,328],[349,342],[349,347],[350,342],[350,247],[350,347],[351,328],[351,3],[351,342],[352,328],[352,3],[352,351],[353,3],[353,342],[353,351],[354,342],[354,328],[354,351],[355,247],[355,4],[355,328],[356,247],[356,4],[356,355],[357,247],[357,4],[357,356],[358,4],[358,355],[358,356],[359,355],[359,247],[359,356],[360,4],[360,328],[360,355],[361,4],[361,328],[361,360],[362,328],[362,355],[362,360],[363,355],[363,4],[363,360],[364,328],[364,247],[364,355],[365,328],[365,247],[365,364],[366,247],[366,355],[366,364],[367,355],[367,328],[367,364],[368,1],[368,2],[368,3],[369,1],[369,2],[369,368],[370,1],[370,2],[370,369],[371,1],[371,2],[371,370],[372,1],[372,2],[372,371],[373,1],[373,2],[373,372],[374,2],[374,371],[374,372],[375,371],[375,1],[375,372],[376,2],[376,370],[376,371],[377,2],[377,370],[377,376],[378,370],[378,371],[378,376],[379,371],[379,2],[379,376],[380,370],[380,1],[380,371],[381,370],[381,1],[381,380],[382,1],[382,371],[382,380],[383,371],[383,370],[383,380],[384,2],[384,369],[384,370],[385,2],[385,369],[385,384],[386,2],[386,369],[386,385],[387,369],[387,384],[387,385],[388,384],[388,2],[388,385],[389,369],[389,370],[389,384],[390,369],[390,370],[390,389],[391,370],[391,384],[391,389],[392,384],[392,369],[392,389],[393,370],[393,2],[393,384],[394,370],[394,2],[394,393],[395,2],[395,384],[395,393],[396,384],[396,370],[396,393],[397,369],[397,1],[397,370],[398,369],[398,1],[398,397],[399,369],[399,1],[399,398],[400,1],[400,397],[400,398],[401,397],[401,369],[401,398],[402,1],[402,370],[402,397],[403,1],[403,370],[403,402],[404,370],[404,397],[404,402],[405,397],[405,1],[405,402],[406,370],[406,369],[406,397],[407,370],[407,369],[407,406],[408,369],[408,397],[408,406],[409,397],[409,370],[409,406],[410,2],[410,368],[410,369],[411,2],[411,368],[411,410],[412,2],[412,368],[412,411],[413,2],[413,368],[413,412],[414,368],[414,411],[414,412],[415,411],[415,2],[415,412],[416,368],[416,410],[416,411],[417,368],[417,410],[417,416],[418,410],[418,411],[418,416],[419,411],[419,368],[419,416],[420,410],[420,2],[420,411],[421,410],[421,2],[421,420],[422,2],[422,411],[422,420],[423,411],[423,410],[423,420],[424,368],[424,369],[424,410],[425,368],[425,369],[425,424],[426,368],[426,369],[426,425],[427,369],[427,424],[427,425],[428,424],[428,368],[428,425],[429,369],[429,410],[429,424],[430,369],[430,410],[430,429],[431,410],[431,424],[431,429],[432,424],[432,369],[432,429],[433,410],[433,368],[433,424],[434,410],[434,368],[434,433],[435,368],[435,424],[435,433],[436,424],[436,410],[436,433],[437,369],[437,2],[437,410],[438,369],[438,2],[438,437],[439,369],[439,2],[439,438],[440,2],[440,437],[440,438],[441,437],[441,369],[441,438],[442,2],[442,410],[442,437],[443,2],[443,410],[443,442],[444,410],[444,437],[444,442],[445,437],[445,2],[445,442],[446,410],[446,369],[446,437],[447,410],[447,369],[447,446],[448,369],[448,437],[448,446],[449,437],[449,410],[449,446],[450,368],[450,1],[450,369],[451,368],[451,1],[451,450],[452,368],[452,1],[452,451],[453,368],[453,1],[453,452],[454,1],[454,451],[454,452],[455,451],[455,368],[455,452],[456,1],[456,450],[456,451],[457,1],[457,450],[457,456],[458,450],[458,451],[458,456],[459,451],[459,1],[459,456],[460,450],[460,368],[460,451],[461,450],[461,368],[461,460],[462,368],[462,451],[462,460],[463,451],[463,450],[463,460],[464,1],[464,369],[464,450],[465,1],[465,369],[465,464],[466,1],[466,369],[466,465],[467,369],[467,464],[467,465],[468,464],[468,1],[468,465],[469,369],[469,450],[469,464],[470,369],[470,450],[470,469],[471,450],[471,464],[471,469],[472,464],[472,369],[472,469],[473,450],[473,1],[473,464],[474,450],[474,1],[474,473],[475,1],[475,464],[475,473],[476,464],[476,450],[476,473],[477,369],[477,368],[477,450],[478,369],[478,368],[478,477],[479,369],[479,368],[479,478],[480,368],[480,477],[480,478],[481,477],[481,369],[481,478],[482,368],[482,450],[482,477],[483,368],[483,450],[483,482],[484,450],[484,477],[484,482],[485,477],[485,368],[485,482],[486,450],[486,369],[486,477],[487,450],[487,369],[487,486],[488,369],[488,477],[488,486],[489,477],[489,450],[489,486],[490,2],[490,3],[490,368],[491,2],[491,3],[491,490],[492,2],[492,3],[492,491],[493,2],[493,3],[493,492],[494,2],[494,3],[494,493],[495,3],[495,492],[495,493],[496,492],[496,2],[496,493],[497,3],[497,491],[497,492],[498,3],[498,491],[498,497],[499,491],[499,492],[499,497],[500,492],[500,3],[500,497],[501,491],[501,2],[501,492],[502,491],[502,2],[502,501],[503,2],[503,492],[503,501],[504,492],[504,491],[504,501],[505,3],[505,490],[505,491],[506,3],[506,490],[506,505],[507,3],[507,490],[507,506],[508,490],[508,505],[508,506],[509,505],[509,3],[509,506],[510,490],[510,491],[510,505],[511,490],[511,491],[511,510],[512,491],[512,505],[512,510],[513,505],[513,490],[513,510],[514,491],[514,3],[514,505],[515,491],[515,3],[515,514],[516,3],[516,505],[516,514],[517,505],[517,491],[517,514],[518,490],[518,2],[518,491],[519,490],[519,2],[519,518],[520,490],[520,2],[520,519],[521,2],[521,518],[521,519],[522,518],[522,490],[522,519],[523,2],[523,491],[523,518],[524,2],[524,491],[524,523],[525,491],[525,518],[525,523],[526,518],[526,2],[526,523],[527,491],[527,490],[527,518],[528,491],[528,490],[528,527],[529,490],[529,518],[529,527],[530,518],[530,491],[530,527],[531,3],[531,368],[531,490],[532,3],[532,368],[532,531],[533,3],[533,368],[533,532],[534,3],[534,368],[534,533],[535,368],[535,532],[535,533],[536,532],[536,3],[536,533],[537,368],[537,531],[537,532],[538,368],[538,531],[538,537],[539,531],[539,532],[539,537],[540,532],[540,368],[540,537],[541,531],[541,3],[541,532],[542,531],[542,3],[542,541],[543,3],[543,532],[543,541],[544,532],[544,531],[544,541],[545,368],[545,490],[545,531],[546,368],[546,490],[546,545],[547,368],[547,490],[547,546],[548,490],[548,545],[548,546],[549,545],[549,368],[549,546],[550,490],[550,531],[550,545],[551,490],[551,531],[551,550],[552,531],[552,545],[552,550],[553,545],[553,490],[553,550],[554,531],[554,368],[554,545],[555,531],[555,368],[555,554],[556,368],[556,545],[556,554],[557,545],[557,531],[557,554],[558,490],[558,3],[558,531],[559,490],[559,3],[559,558],[560,490],[560,3],[560,559],[561,3],[561,558],[561,559],[562,558],[562,490],[562,559],[563,3],[563,531],[563,558],[564,3],[564,531],[564,563],[565,531],[565,558],[565,563],[566,558],[566,3],[566,563],[567,531],[567,490],[567,558],[568,531],[568,490],[568,567],[569,490],[569,558],[569,567],[570,558],[570,531],[570,567],[571,368],[571,2],[571,490],[572,368],[572,2],[572,571],[573,368],[573,2],[573,572],[574,368],[574,2],[574,573],[575,2],[575,572],[575,573],[576,572],[576,368],[576,573],[577,2],[577,571],[577,572],[578,2],[578,571],[578,577],[579,571],[579,572],[579,577],[580,572],[580,2],[580,577],[581,571],[581,368],[581,572],[582,571],[582,368],[582,581],[583,368],[583,572],[583,581],[584,572],[584,571],[584,581],[585,2],[585,490],[585,571],[586,2],[586,490],[586,585],[587,2],[587,490],[587,586],[588,490],[588,585],[588,586],[589,585],[589,2],[589,586],[590,490],[590,571],[590,585],[591,490],[591,571],[591,590],[592,571],[592,585],[592,590],[593,585],[593,490],[593,590],[594,571],[594,2],[594,585],[595,571],[595,2],[595,594],[596,2],[596,585],[596,594],[597,585],[597,571],[597,594],[598,490],[598,368],[598,571],[599,490],[599,368],[599,598],[600,490],[600,368],[600,599],[601,368],[601,598],[601,599],[602,598],[602,490],[602,599],[603,368],[603,571],[603,598],[604,368],[604,571],[604,603],[605,571],[605,598],[605,603],[606,598],[606,368],[606,603],[607,571],[607,490],[607,598],[608,571],[608,490],[608,607],[609,490],[609,598],[609,607],[610,598],[610,571],[610,607],[611,3],[611,1],[611,368],[612,3],[612,1],[612,611],[613,3],[613,1],[613,612],[614,3],[614,1],[614,613],[615,3],[615,1],[615,614],[616,1],[616,613],[616,614],[617,613],[617,3],[617,614],[618,1],[618,612],[618,613],[619,1],[619,612],[619,618],[620,612],[620,613],[620,618],[621,613],[621,1],[621,618],[622,612],[622,3],[622,613],[623,612],[623,3],[623,622],[624,3],[624,613],[624,622],[625,613],[625,612],[625,622],[626,1],[626,611],[626,612],[627,1],[627,611],[627,626],[628,1],[628,611],[628,627],[629,611],[629,626],[629,627],[630,626],[630,1],[630,627],[631,611],[631,612],[631,626],[632,611],[632,612],[632,631],[633,612],[633,626],[633,631],[634,626],[634,611],[634,631],[635,612],[635,1],[635,626],[636,612],[636,1],[636,635],[637,1],[637,626],[637,635],[638,626],[638,612],[638,635],[639,611],[639,3],[639,612],[640,611],[640,3],[640,639],[641,611],[641,3],[641,640],[642,3],[642,639],[642,640],[643,639],[643,611],[643,640],[644,3],[644,612],[644,639],[645,3],[645,612],[645,644],[646,612],[646,639],[646,644],[647,639],[647,3],[647,644],[648,612],[648,611],[648,639],[649,612],[649,611],[649,648],[650,611],[650,639],[650,648],[651,639],[651,612],[651,648],[652,1],[652,368],[652,611],[653,1],[653,368],[653,652],[654,1],[654,368],[654,653],[655,1],[655,368],[655,654],[656,368],[656,653],[656,654],[657,653],[657,1],[657,654],[658,368],[658,652],[658,653],[659,368],[659,652],[659,658],[660,652],[660,653],[660,658],[661,653],[661,368],[661,658],[662,652],[662,1],[662,653],[663,652],[663,1],[663,662],[664,1],[664,653],[664,662],[665,653],[665,652],[665,662],[666,368],[666,611],[666,652],[667,368],[667,611],[667,666],[668,368],[668,611],[668,667],[669,611],[669,666],[669,667],[670,666],[670,368],[670,667],[671,611],[671,652],[671,666],[672,611],[672,652],[672,671],[673,652],[673,666],[673,671],[674,666],[674,611],[674,671],[675,652],[675,368],[675,666],[676,652],[676,368],[676,675],[677,368],[677,666],[677,675],[678,666],[678,652],[678,675],[679,611],[679,1],[679,652],[680,611],[680,1],[680,679],[681,611],[681,1],[681,680],[682,1],[682,679],[682,680],[683,679],[683,611],[683,680],[684,1],[684,652],[684,679],[685,1],[685,652],[685,684],[686,652],[686,679],[686,684],[687,679],[687,1],[687,684],[688,652],[688,611],[688,679],[689,652],[689,611],[689,688],[690,611],[690,679],[690,688],[691,679],[691,652],[691,688],[692,368],[692,3],[692,611],[693,368],[693,3],[693,692],[694,368],[694,3],[694,693],[695,368],[695,3],[695,694],[696,3],[696,693],[696,694],[697,693],[697,368],[697,694],[698,3],[698,692],[698,693],[699,3],[699,692],[699,698],[700,692],[700,693],[700,698],[701,693],[701,3],[701,698],[702,692],[702,368],[702,693],[703,692],[703,368],[703,702],[704,368],[704,693],[704,702],[705,693],[705,692],[705,702],[706,3],[706,611],[706,692],[707,3],[707,611],[707,706],[708,3],[708,611],[708,707],[709,611],[709,706],[709,707],[710,706],[710,3],[710,707],[711,611],[711,692],[711,706],[712,611],[712,692],[712,711],[713,692],[713,706],[713,711],[714,706],[714,611],[714,711],[715,692],[715,3],[715,706],[716,692],[716,3],[716,715],[717,3],[717,706],[717,715],[718,706],[718,692],[718,715],[719,611],[719,368],[719,692],[720,611],[720,368],[720,719],[721,611],[721,368],[721,720],[722,368],[722,719],[722,720],[723,719],[723,611],[723,720],[724,368],[724,692],[724,719],[725,368],[725,692],[725,724],[726,692],[726,719],[726,724],[727,719],[727,368],[727,724],[728,692],[728,611],[728,719],[729,692],[729,611],[729,728],[730,611],[730,719],[730,728],[731,719],[731,692],[731,728],[732,2],[732,0],[732,3],[733,2],[733,0],[733,732],[734,2],[734,0],[734,733],[735,2],[735,0],[735,734],[736,2],[736,0],[736,735],[737,2],[737,0],[737,736],[738,0],[738,735],[738,736],[739,735],[739,2],[739,736],[740,0],[740,734],[740,735],[741,0],[741,734],[741,740],[742,734],[742,735],[742,740],[743,735],[743,0],[743,740],[744,734],[744,2],[744,735],[745,734],[745,2],[745,744],[746,2],[746,735],[746,744],[747,735],[747,734],[747,744],[748,0],[748,733],[748,734],[749,0],[749,733],[749,748],[750,0],[750,733],[750,749],[751,733],[751,748],[751,749],[752,748],[752,0],[752,749],[753,733],[753,734],[753,748],[754,733],[754,734],[754,753],[755,734],[755,748],[755,753],[756,748],[756,733],[756,753],[757,734],[757,0],[757,748],[758,734],[758,0],[758,757],[759,0],[759,748],[759,757],[760,748],[760,734],[760,757],[761,733],[761,2],[761,734],[762,733],[762,2],[762,761],[763,733],[763,2],[763,762],[764,2],[764,761],[764,762],[765,761],[765,733],[765,762],[766,2],[766,734],[766,761],[767,2],[767,734],[767,766],[768,734],[768,761],[768,766],[769,761],[769,2],[769,766],[770,734],[770,733],[770,761],[771,734],[771,733],[771,770],[772,733],[772,761],[772,770],[773,761],[773,734],[773,770],[774,0],[774,732],[774,733],[775,0],[775,732],[775,774],[776,0],[776,732],[776,775],[777,0],[777,732],[777,776],[778,732],[778,775],[778,776],[779,775],[779,0],[779,776],[780,732],[780,774],[780,775],[781,732],[781,774],[781,780],[782,774],[782,775],[782,780],[783,775],[783,732],[783,780],[784,774],[784,0],[784,775],[785,774],[785,0],[785,784],[786,0],[786,775],[786,784],[787,775],[787,774],[787,784],[788,732],[788,733],[788,774],[789,732],[789,733],[789,788],[790,732],[790,733],[790,789],[791,733],[791,788],[791,789],[792,788],[792,732],[792,789],[793,733],[793,774],[793,788],[794,733],[794,774],[794,793],[795,774],[795,788],[795,793],[796,788],[796,733],[796,793],[797,774],[797,732],[797,788],[798,774],[798,732],[798,797],[799,732],[799,788],[799,797],[800,788],[800,774],[800,797],[801,733],[801,0],[801,774],[802,733],[802,0],[802,801],[803,733],[803,0],[803,802],[804,0],[804,801],[804,802],[805,801],[805,733],[805,802],[806,0],[806,774],[806,801],[807,0],[807,774],[807,806],[808,774],[808,801],[808,806],[809,801],[809,0],[809,806],[810,774],[810,733],[810,801],[811,774],[811,733],[811,810],[812,733],[812,801],[812,810],[813,801],[813,774],[813,810],[814,732],[814,2],[814,733],[815,732],[815,2],[815,814],[816,732],[816,2],[816,815],[817,732],[817,2],[817,816],[818,2],[818,815],[818,816],[819,815],[819,732],[819,816],[820,2],[820,814],[820,815],[821,2],[821,814],[821,820],[822,814],[822,815],[822,820],[823,815],[823,2],[823,820],[824,814],[824,732],[824,815],[825,814],[825,732],[825,824],[826,732],[826,815],[826,824],[827,815],[827,814],[827,824],[828,2],[828,733],[828,814],[829,2],[829,733],[829,828],[830,2],[830,733],[830,829],[831,733],[831,828],[831,829],[832,828],[832,2],[832,829],[833,733],[833,814],[833,828],[834,733],[834,814],[834,833],[835,814],[835,828],[835,833],[836,828],[836,733],[836,833],[837,814],[837,2],[837,828],[838,814],[838,2],[838,837],[839,2],[839,828],[839,837],[840,828],[840,814],[840,837],[841,733],[841,732],[841,814],[842,733],[842,732],[842,841],[843,733],[843,732],[843,842],[844,732],[844,841],[844,842],[845,841],[845,733],[845,842],[846,732],[846,814],[846,841],[847,732],[847,814],[847,846],[848,814],[848,841],[848,846],[849,841],[849,732],[849,846],[850,814],[850,733],[850,841],[851,814],[851,733],[851,850],[852,733],[852,841],[852,850],[853,841],[853,814],[853,850],[854,0],[854,3],[854,732],[855,0],[855,3],[855,854],[856,0],[856,3],[856,855],[857,0],[857,3],[857,856],[858,0],[858,3],[858,857],[859,3],[859,856],[859,857],[860,856],[860,0],[860,857],[861,3],[861,855],[861,856],[862,3],[862,855],[862,861],[863,855],[863,856],[863,861],[864,856],[864,3],[864,861],[865,855],[865,0],[865,856],[866,855],[866,0],[866,865],[867,0],[867,856],[867,865],[868,856],[868,855],[868,865],[869,3],[869,854],[869,855],[870,3],[870,854],[870,869],[871,3],[871,854],[871,870],[872,854],[872,869],[872,870],[873,869],[873,3],[873,870],[874,854],[874,855],[874,869],[875,854],[875,855],[875,874],[876,855],[876,869],[876,874],[877,869],[877,854],[877,874],[878,855],[878,3],[878,869],[879,855],[879,3],[879,878],[880,3],[880,869],[880,878],[881,869],[881,855],[881,878],[882,854],[882,0],[882,855],[883,854],[883,0],[883,882],[884,854],[884,0],[884,883],[885,0],[885,882],[885,883],[886,882],[886,854],[886,883],[887,0],[887,855],[887,882],[888,0],[888,855],[888,887],[889,855],[889,882],[889,887],[890,882],[890,0],[890,887],[891,855],[891,854],[891,882],[892,855],[892,854],[892,891],[893,854],[893,882],[893,891],[894,882],[894,855],[894,891],[895,3],[895,732],[895,854],[896,3],[896,732],[896,895],[897,3],[897,732],[897,896],[898,3],[898,732],[898,897],[899,732],[899,896],[899,897],[900,896],[900,3],[900,897],[901,732],[901,895],[901,896],[902,732],[902,895],[902,901],[903,895],[903,896],[903,901],[904,896],[904,732],[904,901],[905,895],[905,3],[905,896],[906,895],[906,3],[906,905],[907,3],[907,896],[907,905],[908,896],[908,895],[908,905],[909,732],[909,854],[909,895],[910,732],[910,854],[910,909],[911,732],[911,854],[911,910],[912,854],[912,909],[912,910],[913,909],[913,732],[913,910],[914,854],[914,895],[914,909],[915,854],[915,895],[915,914],[916,895],[916,909],[916,914],[917,909],[917,854],[917,914],[918,895],[918,732],[918,909],[919,895],[919,732],[919,918],[920,732],[920,909],[920,918],[921,909],[921,895],[921,918],[922,854],[922,3],[922,895],[923,854],[923,3],[923,922],[924,854],[924,3],[924,923],[925,3],[925,922],[925,923],[926,922],[926,854],[926,923],[927,3],[927,895],[927,922],[928,3],[928,895],[928,927],[929,895],[929,922],[929,927],[930,922],[930,3],[930,927],[931,895],[931,854],[931,922],[932,895],[932,854],[932,931],[933,854],[933,922],[933,931],[934,922],[934,895],[934,931],[935,732],[935,0],[935,854],[936,732],[936,0],[936,935],[937,732],[937,0],[937,936],[938,732],[938,0],[938,937],[939,0],[939,936],[939,937],[940,936],[940,732],[940,937],[941,0],[941,935],[941,936],[942,0],[942,935],[942,941],[943,935],[943,936],[943,941],[944,936],[944,0],[944,941],[945,935],[945,732],[945,936],[946,935],[946,732],[946,945],[947,732],[947,936],[947,945],[948,936],[948,935],[948,945],[949,0],[949,854],[949,935],[950,0],[950,854],[950,949],[951,0],[951,854],[951,950],[952,854],[952,949],[952,950],[953,949],[953,0],[953,950],[954,854],[954,935],[954,949],[955,854],[955,935],[955,954],[956,935],[956,949],[956,954],[957,949],[957,854],[957,954],[958,935],[958,0],[958,949],[959,935],[959,0],[959,958],[960,0],[960,949],[960,958],[961,949],[961,935],[961,958],[962,854],[962,732],[962,935],[963,854],[963,732],[963,962],[964,854],[964,732],[964,963],[965,732],[965,962],[965,963],[966,962],[966,854],[966,963],[967,732],[967,935],[967,962],[968,732],[968,935],[968,967],[969,935],[969,962],[969,967],[970,962],[970,732],[970,967],[971,935],[971,854],[971,962],[972,935],[972,854],[972,971],[973,854],[973,962],[973,971],[974,962],[974,935],[974,971],[975,3],[975,2],[975,732],[976,3],[976,2],[976,975],[977,3],[977,2],[977,976],[978,3],[978,2],[978,977],[979,3],[979,2],[979,978],[980,2],[980,977],[980,978],[981,977],[981,3],[981,978],[982,2],[982,976],[982,977],[983,2],[983,976],[983,982],[984,976],[984,977],[984,982],[985,977],[985,2],[985,982],[986,976],[986,3],[986,977],[987,976],[987,3],[987,986],[988,3],[988,977],[988,986],[989,977],[989,976],[989,986],[990,2],[990,975],[990,976],[991,2],[991,975],[991,990],[992,2],[992,975],[992,991],[993,975],[993,990],[993,991],[994,990],[994,2],[994,991],[995,975],[995,976],[995,990],[996,975],[996,976],[996,995],[997,976],[997,990],[997,995],[998,990],[998,975],[998,995],[999,976],[999,2],[999,990],[1e3,976],[1e3,2],[1e3,999],[1001,2],[1001,990],[1001,999],[1002,990],[1002,976],[1002,999],[1003,975],[1003,3],[1003,976],[1004,975],[1004,3],[1004,1003],[1005,975],[1005,3],[1005,1004],[1006,3],[1006,1003],[1006,1004],[1007,1003],[1007,975],[1007,1004],[1008,3],[1008,976],[1008,1003],[1009,3],[1009,976],[1009,1008],[1010,976],[1010,1003],[1010,1008],[1011,1003],[1011,3],[1011,1008],[1012,976],[1012,975],[1012,1003],[1013,976],[1013,975],[1013,1012],[1014,975],[1014,1003],[1014,1012],[1015,1003],[1015,976],[1015,1012],[1016,2],[1016,732],[1016,975],[1017,2],[1017,732],[1017,1016],[1018,2],[1018,732],[1018,1017],[1019,2],[1019,732],[1019,1018],[1020,732],[1020,1017],[1020,1018],[1021,1017],[1021,2],[1021,1018],[1022,732],[1022,1016],[1022,1017],[1023,732],[1023,1016],[1023,1022],[1024,1016],[1024,1017],[1024,1022],[1025,1017],[1025,732],[1025,1022],[1026,1016],[1026,2],[1026,1017],[1027,1016],[1027,2],[1027,1026],[1028,2],[1028,1017],[1028,1026],[1029,1017],[1029,1016],[1029,1026],[1030,732],[1030,975],[1030,1016],[1031,732],[1031,975],[1031,1030],[1032,732],[1032,975],[1032,1031],[1033,975],[1033,1030],[1033,1031],[1034,1030],[1034,732],[1034,1031],[1035,975],[1035,1016],[1035,1030],[1036,975],[1036,1016],[1036,1035],[1037,1016],[1037,1030],[1037,1035],[1038,1030],[1038,975],[1038,1035],[1039,1016],[1039,732],[1039,1030],[1040,1016],[1040,732],[1040,1039],[1041,732],[1041,1030],[1041,1039],[1042,1030],[1042,1016],[1042,1039],[1043,975],[1043,2],[1043,1016],[1044,975],[1044,2],[1044,1043],[1045,975],[1045,2],[1045,1044],[1046,2],[1046,1043],[1046,1044],[1047,1043],[1047,975],[1047,1044],[1048,2],[1048,1016],[1048,1043],[1049,2],[1049,1016],[1049,1048],[1050,1016],[1050,1043],[1050,1048],[1051,1043],[1051,2],[1051,1048],[1052,1016],[1052,975],[1052,1043],[1053,1016],[1053,975],[1053,1052],[1054,975],[1054,1043],[1054,1052],[1055,1043],[1055,1016],[1055,1052],[1056,732],[1056,3],[1056,975],[1057,732],[1057,3],[1057,1056],[1058,732],[1058,3],[1058,1057],[1059,732],[1059,3],[1059,1058],[1060,3],[1060,1057],[1060,1058],[1061,1057],[1061,732],[1061,1058],[1062,3],[1062,1056],[1062,1057],[1063,3],[1063,1056],[1063,1062],[1064,1056],[1064,1057],[1064,1062],[1065,1057],[1065,3],[1065,1062],[1066,1056],[1066,732],[1066,1057],[1067,1056],[1067,732],[1067,1066],[1068,732],[1068,1057],[1068,1066],[1069,1057],[1069,1056],[1069,1066],[1070,3],[1070,975],[1070,1056],[1071,3],[1071,975],[1071,1070],[1072,3],[1072,975],[1072,1071],[1073,975],[1073,1070],[1073,1071],[1074,1070],[1074,3],[1074,1071],[1075,975],[1075,1056],[1075,1070],[1076,975],[1076,1056],[1076,1075],[1077,1056],[1077,1070],[1077,1075],[1078,1070],[1078,975],[1078,1075],[1079,1056],[1079,3],[1079,1070],[1080,1056],[1080,3],[1080,1079],[1081,3],[1081,1070],[1081,1079],[1082,1070],[1082,1056],[1082,1079],[1083,975],[1083,732],[1083,1056],[1084,975],[1084,732],[1084,1083],[1085,975],[1085,732],[1085,1084],[1086,732],[1086,1083],[1086,1084],[1087,1083],[1087,975],[1087,1084],[1088,732],[1088,1056],[1088,1083],[1089,732],[1089,1056],[1089,1088],[1090,1056],[1090,1083],[1090,1088],[1091,1083],[1091,732],[1091,1088],[1092,1056],[1092,975],[1092,1083],[1093,1056],[1093,975],[1093,1092],[1094,975],[1094,1083],[1094,1092],[1095,1083],[1095,1056],[1095,1092]],r.teamsPortals=[],r}return n=u,(r=[{key:"search",value:(o=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ne(oe(u.prototype),"search",this).call(this);case 2:case"end":return t.stop()}}),t,this)})),s=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function s(t){Qt(i,n,r,s,a,"next",t)}function a(t){Qt(i,n,r,s,a,"throw",t)}s(void 0)}))},function(){return s.apply(this,arguments)})}])&&ee(n.prototype,r),i&&ee(n,i),u}(E),ue=n(132),ce=n.n(ue),le=n(133),fe=n.n(le);function he(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var pe=n(340),ge=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,i;return e=t,i=[{key:"getPortalInTriangle",value:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e=t.normalizePortalsList(e);for(var o=Object(r.polygon)([[[e[0]._latlng.lng,e[0]._latlng.lat],[e[1]._latlng.lng,e[1]._latlng.lat],[e[2]._latlng.lng,e[2]._latlng.lat],[e[0]._latlng.lng,e[0]._latlng.lat]]]),s=[],a=Object.keys(n),u=0,c=a;u<c.length;u++){var l=c[u],f=n[l];i.indexOf(l)<0&&Object(r.booleanContains)(o,Object(r.point)([f._latlng.lng,f._latlng.lat]))&&s.push(f)}return s}},{key:"normalizePortalsList",value:function(t){for(var e=[],n=0;n<t.length;n++)"string"==typeof t[n]?e[n]=window.portals[t[n]]:e[n]=t[n];return e}},{key:"getSchemeFromData",value:function(t){var e=null;switch(t.type){case"2":e=new A([],[]);break;case"3":e=new V([],[]);break;case"4":e=new et([],[]);break;case"5":e=new ft([],[]);break;case"5v2":e=new bt([],[]);break;case"6":e=new Ot([],[]);break;case"6v2":e=new Bt([],[]);break;case"7":e=new Kt([],[]);break;case"8":e=new ae([],[]);break;default:e=new E([],[])}for(var n=function(t){return e.portalsList[t]},r=0;r<t.portalsList.length;r++){var i=t.portalsList[r];e.portalsList[r]=c.fromData(i)}for(var o=0;o<t.linkingPlan.length;o++){var s=t.linkingPlan[o];e.linkingPlan[o]=[n(s[0]),n(s[1])]}for(var a=0;a<t.teamsPortals.length;a++){var u=t.teamsPortals[a];e.teamsPortals[a]=u.slice()}for(var l=0;l<t.teamsPlan.length;l++){for(var f=t.teamsPlan[l],h=[],p=0;p<f.length;p++){var g=f[p];h[p]=[n(g[0]),n(g[1])]}e.teamsPlan[l]=h}return e}},{key:"stringify",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return pe(t,{indent:e})}},{key:"SCHEME",get:function(){return E}},{key:"L2",get:function(){return A}},{key:"L3",get:function(){return V}},{key:"L4",get:function(){return et}},{key:"L5",get:function(){return ft}},{key:"L5v2",get:function(){return bt}},{key:"L6",get:function(){return Ot}},{key:"L6v2",get:function(){return Bt}},{key:"L7",get:function(){return Kt}},{key:"L8",get:function(){return ae}},{key:"ui",get:function(){return fe.a}},{key:"css",get:function(){return ce.a}},{key:"Triangle",get:function(){return a}}],(n=null)&&he(e.prototype,n),i&&he(e,i),t}();window.HomogeneousPluginUtils=ge;var de=document.createElement("script"),ye={};"undefined"!=typeof GM_info&&GM_info&&GM_info.script&&(ye.script={version:GM_info.script.version,name:GM_info.script.name,description:GM_info.script.description});var ve=document.createTextNode("("+function(t){var e,n,r,i,o,s;"function"!=typeof window.plugin&&(window.plugin=function(){}),t.buildName="Calc and draw homogeneous fields",t.dateTimeVersion="20200311140700",t.pluginId="iitc-plugin-homogeneous-field@odrick";var a="iitc-plugin-homogeneous-field-saved-data",u=0,c=0,l=[],f=[],h=[],p=-1,g=[],d=[],y=null,v=null,m={portals:"",links:"",teams:"",keys:"",sbuls:""},_=0,x=[],b={},w=[];b.addStartPortal=function(t){w.length>=3||w.push(t)},b.getPortalsInTriangle=function(t){return HomogeneousPluginUtils.getPortalInTriangle(t,window.portals)},b.calcL2=function(){E(HomogeneousPluginUtils.L2)},b.calcL3=function(){E(HomogeneousPluginUtils.L3)},b.calcL4=function(){E(HomogeneousPluginUtils.L4)},b.calcL5=function(){E(HomogeneousPluginUtils.L5)},b.calcL5v2=function(){E(HomogeneousPluginUtils.L5v2)},b.calcL6=function(){E(HomogeneousPluginUtils.L6)},b.calcL6v2=function(){E(HomogeneousPluginUtils.L6v2)},b.calcL7=function(){E(HomogeneousPluginUtils.L7)},b.calcL8=function(){E(HomogeneousPluginUtils.L8)};var E=function(t){if((1===u||3===u)&&3===l.length){u=2,$("#homogeneousFieldProgress").show(),$("#homogeneousFieldProgress").html("Prepearing..."),e.clearLayers(),tt(),A(),U(),J();for(var n=[],r=0;r<l.length;r++){var i=l[r].guid;if(!window.portals[i])return u=1,$("#homogeneousFieldProgress").hide(),void alert("Portals not loaded");n.push(i)}for(var s=[],a=0;a<d.length;a++)s.push(d[a].guid);var c=y?y.guid:"",f=new t(n,window.portals,s,c);f.on("progress",(function(t){$("#homogeneousFieldProgress").html("Searching: ".concat(Math.floor(100*t),"%"))})),f.once("finish",(function(){u=3,0===f.linkingPlan.length&&alert("Field not found"),I(o=f),it(),$("#homogeneousFieldProgress").hide()})),f.search()}},I=function(t){D(t),X(t),Z(t),Q(t),z(t),Y(t),tt(),$("#homogeneousFieldData").scrollTop($("#homogeneousFieldData")[0].scrollHeight)},S=!1;b.toggleBox=function(){(S=!S)?($("#homogeneousFieldBox").show(),window.isSmartphone()&&window.show("map")):$("#homogeneousFieldBox").hide()},b.hideBox=function(){S=!1,$("#homogeneousFieldBox").hide()};var N=function(t){return t.indexOf(u)>=0&&(u=o?3:l.length?1:0,tt(),!0)};b.startSelectPortals=function(){N([4,5])||0===u&&(u=1,tt())},b.startSelectBlackList=function(){N([4])||(u=4,tt())},b.selectCenter=function(){N([5])||(u=5,tt())},b.reset=function(){u=0,l=[],f=[],d=[],y=null,o=null,clearTimeout(v),v=null,$("#homogeneousFieldToggleAnimation").html("Play"),e.clearLayers(),n.clearLayers(),O(),T(),R(),tt(),it()},b.showPlan=function(){c=0,tt()},b.showKeys=function(){c=1,tt()},b.showSbuls=function(){c=2,tt()};var P=function(t,e){for(var n=0;n<t.length;n++)if(t[n].guid===e)return t[n];return null};b.handlePortalSelect=function(t){var e=t.selectedPortalGuid;if(1===u){if(P(l,e))return;if(l.length>=3)return;l.push({guid:e,name:j(e),location:k(e)}),O(),tt()}if(4===u){if(P(d,e))return;d.push({guid:e,name:j(e),location:k(e)}),T(),tt()}5===u&&(y={guid:e,name:j(e),location:k(e)},R(),tt()),it()},b.removePortal=function(t){if(1===u||3===u){var r=P(l,t);r&&l.splice(l.indexOf(r),1),3===u&&(u=1,o=null,e.clearLayers(),n.clearLayers()),O(),tt(),it()}},b.removeBlackList=function(t){if(4===u){var e=P(d,t);e&&d.splice(d.indexOf(e),1),T(),tt(),it()}},b.jumpToLink=function(t){v||C(t,!$("#homogeneousFieldAutoScroll").prop("checked"))};var C=function(t){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0,i=0;i<f.length;i++){for(var o=f[i],s=r<=t,a=0;a<o.length;a++){var u=o[a];e.removeLayer(u),s&&e.addLayer(u)}r++}r=0,p=-1;for(var c=0;c<h.length;c++){var l=h[c];r===t?(p=r,l.addClass("selected"),n||l[0].scrollIntoView()):l.removeClass("selected"),r++}};b.toggleAnimation=function(){if(v)return clearTimeout(v),v=null,void $("#homogeneousFieldToggleAnimation").html("Play");$("#homogeneousFieldToggleAnimation").html("Stop"),p>=h.length-1&&(p=-1),function t(){if(++p>=h.length)return clearTimeout(v),v=null,p=h.length-1,void $("#homogeneousFieldToggleAnimation").html("Play");C(p),v=setTimeout(t,500)}()};var M=function(t){o&&(v||("ArrowRight"===t.code&&++p>=h.length-1&&(p=h.length-1),"ArrowLeft"===t.code&&--p<0&&(p=0),C(p)))};b.updateColorizeTeams=function(){clearTimeout(v),v=null,$("#homogeneousFieldToggleAnimation").html("Play"),I(o)},b.updateDebug=function(){clearTimeout(v),v=null,$("#homogeneousFieldToggleAnimation").html("Play"),I(o)};var O=function(){$("#homogeneousFieldPortals").html(""),r.clearLayers();for(var t=0;t<l.length;t++){var e=l[t],n=e.guid;$("#homogeneousFieldPortals").append('<div class="homogeneousFieldSelectedPortal"><a onclick="window.plugin.homogeneousField.removePortal(\''.concat(n,'\')" class="homogeneousFieldRemoveButton">X</a>').concat(B(e.name,n),"</div>")),L.circleMarker(e.location,{color:"#6633ff",opacity:1,weight:2,fill:!0,dashArray:"5, 5",interactive:!1,clickable:!1,radius:15}).addTo(r)}for(var i=[],o=0;o<l.length;o++)i.push(l[o].location);3===i.length&&i.push(i[0]),L.geodesicPolyline(i,{color:"#6633ff",opacity:1,weight:2,fill:!1,dashArray:"5, 5",interactive:!1,clickable:!1}).addTo(r)},R=function(){if($("#homogeneousFieldCenter").html(""),centerLayer.clearLayers(),y){var t=y,e=t.guid,n=$('<div class="homogeneousFieldCenterPortal"><a onclick="window.plugin.homogeneousField.removeCenterPortal()" class="homogeneousFieldRemoveButton">X</a>'.concat(B(t.name,e),"</div>"));$("#homogeneousFieldCenter").append(n),L.circleMarker(t.location,{color:"#FFD700",opacity:1,weight:12,fill:!0,interactive:!1,clickable:!1,radius:8}).addTo(centerLayer)}},T=function(){$("#homogeneousFieldBlackList").html(""),i.clearLayers();for(var t=0;t<d.length;t++){var e=d[t],n=e.guid,r=$('<div class="homogeneousFieldBlackListPortal"><a onclick="window.plugin.homogeneousField.removeBlackList(\''.concat(n,'\')" class="homogeneousFieldRemoveButton">X</a>').concat(B(e.name,n),"</div>"));$("#homogeneousFieldBlackList").append(r),r[0].scrollIntoView(),L.circleMarker(e.location,{color:"#000000",opacity:1,weight:12,fill:!0,interactive:!1,clickable:!1,radius:8}).addTo(i)}};b.removeCenterPortal=function(){y=null,R(),it()};var A=function(){$("#homogeneousFieldLinkPlan").html("")},F=function(t,e){if(t.teamsPlan.length){for(var n=0;n<t.teamsPlan.length;n++)for(var r=0;r<t.teamsPlan[n].length;r++){var i=t.teamsPlan[n][r];if(e[0].options.guid===i[0].options.guid&&e[1].options.guid===i[1].options.guid)return n+1}return 0}return 0},D=function(t){function e(e){for(var n=0;n<t.portalsList.length;n++){if(t.portalsList[n].options.guid===e.options.guid)return n}return-1}A(),m.links="LINKS:\n";var n=$("#homogeneousFieldColorizeTeams").prop("checked"),r=$("#homogeneousFieldDebug").prop("checked");h=[];for(var i=0,o=0;o<t.linkingPlan.length;o++){var s=t.linkingPlan[o],a="".concat(q(s[0])," -> ").concat(q(s[1]));r&&(a="[".concat(e(s[0]),", ").concat(e(s[1]),"] ").concat(a));var u=$('<div class="homogeneousFieldLinkItem" onclick="window.plugin.homogeneousField.jumpToLink('.concat(i,');return false;">').concat(a,"</div>"));if(n){var c=F(t,s);u.addClass("homogeneousFieldTeam"+c)}$("#homogeneousFieldLinkPlan").append(u),h[i]=u,a.links+="".concat(G(s[0])," -> ").concat(G(s[1]))+"\n",i++}m.links+="\n";var l=h[h.length-1];l&&(l.addClass("selected"),p=h.length-1)};updateLinkingText=function(t){if(t){m.links="LINKS:\n";for(var e=0;e<t.linkingPlan.length;e++){var n=t.linkingPlan[e];m.links+="".concat(G(n[0])," -> ").concat(G(n[1]))+"\n"}if(m.links+="\n",m.teams="",t.teamsPlan.length)for(var r=0;r<t.teamsPlan.length;r++){m.teams+="*** TEAM "+(r+1)+" ***\n\n",m.teams+="Links:\n";for(var i=0;i<t.teamsPlan[r].length;i++){var o=t.teamsPlan[r][i];m.teams+="".concat(G(o[0])," -> ").concat(G(o[1]))+"\n"}m.teams+="\n",m.teams+="Keys:\n";for(var s=V(t.teamsPlan[r]),a=0;a<s.length;a++){var u=s[a];m.teams+="".concat(u.title,": ").concat(u.keys)+"\n"}m.teams+="\n\n"}}};var k=function(t){var e=window.portals[t];return{lat:e._latlng.lat,lng:e._latlng.lng}},j=function(t){var e=window.portals[t];return G(e)},G=function(t){if(t&&t.options&&t.options.data&&t.options.data.title)return t.options.data.title;var e=window.portals[t.options.guid];if(e&&e.options&&e.options.data&&e.options.data.title)return e.options.data.title;var n=t.getLatLng();return n.lat+","+n.lng},q=function(t){var e=G(t);return e=B(e,t.options.guid)},B=function(t,e){_++;var n="homogeneousFieldUpdatable_".concat(_);return t='<span id="'.concat(n,'" style="cursor: pointer" title="Ctrl+Click to select portal on map" onclick="return window.plugin.homogeneousField.selectPortalOnClick(event, \'').concat(e,"')\">").concat(t,"</span>"),x.push({guid:e,id:n}),t},z=function(t){for(var n=$("#homogeneousFieldDebug").prop("checked"),r=0;r<t.portalsList.length;r++){var i=t.portalsList[r].getLatLng();if(n)L.marker(i,{icon:L.divIcon({className:"homogeneousFieldPortalNumber",iconAnchor:[4,10],html:String(r)})}).addTo(e)}},U=function(){$("#homogeneousFieldKeys").html("")},V=function(t,e){for(var n={},r={},i=0;i<t.length;i++){var o=t[i],s=o[1].options.guid;n[s]||(n[s]=0),n[s]++,r[s]=o[1]}for(var a=[],u=Object.keys(n),c=0;c<u.length;c++){var l=u[c],f="";f=e?q(r[l]):G(r[l]),a.push({title:f,guid:l,keys:n[l],lat:r[l]._latlng.lat,lng:r[l]._latlng.lng})}return a.sort((function(t,e){return t.keys>e.keys?-1:t.keys<e.keys?1:0})),a},X=function(t){var e=V(t.linkingPlan,!0);U();for(var n=0;n<e.length;n++){var r=e[n],i="<div>".concat(r.title,": ").concat(r.keys,"</div>");$("#homogeneousFieldKeys").append(i)}},Y=function(t){var e=V(t.linkingPlan);n.clearLayers();for(var r=0;r<e.length;r++){var i=e[r],o=L.marker(new L.LatLng(i.lat,i.lng),{icon:L.divIcon({className:"homogeneousFieldKeysIcon",iconAnchor:[12,-10],tooltipAnchor:[0,0],iconSize:[20,14],html:i.keys+"",clickable:!0}),guid:i.guid+"_homogeneous_keys",clickable:!0});o.addTo(n),o._portalGuid=i.guid,o.bindTooltip&&!window.isSmartphone()?(o.bindTooltip(i.title+": "+i.keys,{permanent:!1,direction:"top"}),o.addEventListener("click",W)):(o._toolTipContent=i.title+": "+i.keys,o.addEventListener("click",H))}},W=function(t){t&&t.target&&t.target._portalGuid&&(window.selectPortal(t.target._portalGuid),window.renderPortalDetails(t.target._portalGuid))},H=function(t){W(t);var e=t.target;s.setContent(e._toolTipContent),s.setLatLng(e.getLatLng()),map.openPopup(s)},J=function(){$("#homogeneousFieldSbuls").html("")},K=function(t){for(var e={},n={},r=0;r<t.linkingPlan.length;r++){var i=t.linkingPlan[r],o=i[0].options.guid;e[o]||(e[o]=0),e[o]++,n[o]=i[0]}for(var s=[],a=Object.keys(e),u=0;u<a.length;u++){var c=a[u];e[c]>8&&s.push({title:G(n[c]),outs:e[c],guid:c})}return s.sort((function(t,e){return t.outs>e.outs?-1:t.outs<e.outs?1:0})),s},Z=function(t){var e=K(t);J();for(var n=0;n<e.length;n++){var r=e[n],i="<div>".concat(B(r.title,r.guid),": ").concat(Math.ceil((r.outs-8)/8),"</div>");$("#homogeneousFieldSbuls").append(i)}},Q=function(t){var n=[],r=[];function i(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];e.indexOf(r[0])<0&&e.push(r[0]),e.indexOf(r[1])<0&&e.push(r[1])}return e.sort((function(t,e){return t.options.guid>e.options.guid?1:t.options.guid<e.options.guid?-1:0})),e}function o(t){for(var e=0;e<r.length;e++){var n=r[e];if(n!==t){for(var i=!0,o=0;o<3;o++)t[o]!==n[o]&&(i=!1);if(i)return!0}}return!1}function s(e){for(var s=[],a=0;a<t.portalsList.length;a++){var u=t.portalsList[a];if(!(e.indexOf(u)>=0)){for(var c=[].concat(e,u),l=[],f=0;f<n.length;f++){var h=n[f];c.indexOf(h[0])>=0&&c.indexOf(h[1])>=0&&l.push(h)}if(3===l.length){var p=i(l);o(p)||(r.push(p),s.push(p))}}}for(var g=[],d=0;d<s.length;d++)for(var y=s[d],v=0;v<s.length;v++){var m=s[v];if(d!==v)HomogeneousPluginUtils.getPortalInTriangle(y,m).length>0&&g.push(m)}for(var _=0;_<g.length;_++){var x=g[_];r.splice(r.indexOf(x,1)),s.splice(s.indexOf(x,1))}return s}e.clearLayers(),f=[],g=[];for(var a=0;a<t.linkingPlan.length;a++){var u=t.linkingPlan[a],c=[];n.push(u);var l="#ff3333";if($("#homogeneousFieldColorizeTeams").prop("checked")){var h=F(t,u);2===h&&(l="#339933"),3===h&&(l="#333399")}g.push({type:"polyline",latLngs:[{lat:u[0].getLatLng().lat,lng:u[0].getLatLng().lng},{lat:u[1].getLatLng().lat,lng:u[1].getLatLng().lng}],color:"#a24ac3"});var p=L.geodesicPolyline([u[0].getLatLng(),u[1].getLatLng()],{color:l,opacity:1,weight:2,fill:!0,interactive:!1,clickable:!1});p.addTo(e),c.push(p);for(var d=s(u),y=0;y<d.length;y++){var v=d[y],m=L.geodesicPolyline([v[0].getLatLng(),v[1].getLatLng(),v[2].getLatLng(),v[0].getLatLng()],{color:l,opacity:.5,weight:2,fill:!0,interactive:!1,clickable:!1});m.addTo(e),c.push(m),g.push({type:"polygon",latLngs:[{lat:v[0].getLatLng().lat,lng:v[0].getLatLng().lng},{lat:v[1].getLatLng().lat,lng:v[1].getLatLng().lng},{lat:v[2].getLatLng().lat,lng:v[2].getLatLng().lng}],color:"#a24ac3"})}f.push(c)}};b.exportDrawTools=function(){window.plugin.drawTools&&g.length&&(window.plugin.drawTools.drawnItems.clearLayers(),window.plugin.drawTools.import(g),window.plugin.drawTools.save())};var tt=function(){0===u&&($("#homogeneousFieldPortals").hide(),$("#homogeneousFieldSearch").hide(),$("#homogeneousFieldContent").hide(),$("#homogeneousFieldToolbox").hide(),$("#homogeneousFieldBlackList").hide(),$("#homogeneousFieldBlackControls").hide(),$("#homogeneousFieldCenter").hide()),1===u&&($("#homogeneousFieldPortals").show(),3===l.length?$("#homogeneousFieldSearch").show():$("#homogeneousFieldSearch").hide(),$("#homogeneousFieldContent").hide(),$("#homogeneousFieldToolbox").hide(),$("#homogeneousFieldBlackList").hide(),$("#homogeneousFieldBlackControls").hide(),$("#homogeneousFieldCenter").hide()),2===u&&($("#homogeneousFieldPortals").show(),$("#homogeneousFieldSearch").show(),$("#homogeneousFieldContent").hide(),$("#homogeneousFieldToolbox").hide(),$("#homogeneousFieldBlackList").hide(),$("#homogeneousFieldBlackControls").hide(),$("#homogeneousFieldCenter").hide()),3===u&&($("#homogeneousFieldPortals").show(),$("#homogeneousFieldSearch").show(),$("#homogeneousFieldContent").show(),$("#homogeneousFieldToolbox").show(),$("#homogeneousFieldBlackList").hide(),$("#homogeneousFieldBlackControls").hide(),$("#homogeneousFieldCenter").hide()),4===u&&($("#homogeneousFieldBlackList").show(),$("#homogeneousFieldBlackControls").show(),$("#homogeneousFieldCenter").hide()),5===u&&($("#homogeneousFieldCenter").show(),$("#homogeneousFieldBlackList").hide(),$("#homogeneousFieldBlackControls").hide()),$("#homogeneousFieldLinkPlan").hide(),$("#homogeneousFieldKeys").hide(),$("#homogeneousFieldSbuls").hide(),0===c&&$("#homogeneousFieldLinkPlan").show(),1===c&&$("#homogeneousFieldKeys").show(),2===c&&$("#homogeneousFieldSbuls").show(),0===l.length&&$("#homogeneousFieldPortals").html("<br/>Select 3 corner portals on map")};b.copyPlan=function(){!function(t){if(t){m.portals="PORTALS:\n";for(var e=0;e<t.portalsList.length;e++){var n=t.portalsList[e],r=n.getLatLng();m.portals+=G(n)+": https://intel.ingress.com/?pll=".concat(r.lat,",").concat(r.lng)+"\n"}m.portals+="\n"}}(o),updateLinkingText(o),function(t){if(t){var e=V(t.linkingPlan);m.keys="KEYS:\n";for(var n=0;n<e.length;n++){var r=e[n];m.keys+="".concat(r.title,": ").concat(r.keys)+"\n"}m.keys+="\n"}}(o),function(t){if(t){var e=K(t);m.sbuls="SBULS:\n";for(var n=0;n<e.length;n++){var r=e[n];m.sbuls+="".concat(r.title,": ").concat(Math.ceil((r.outs-8)/8))+"\n"}m.sbuls+="\n"}}(o);var t="======== OVERALL PLAN ======== \n\n"+m.portals+m.links+m.keys+m.sbuls;m.teams&&(t+="\n\n======== TEAMS PLAN ======== \n\n"+m.teams);var e=document.createElement("textarea");e.value=t,e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{if(document.execCommand("copy")){var n=document.createElement("div");n.innerHTML="Plan copied to clipboard",document.body.appendChild(n),n.style.position="fixed",n.style.display="block",n.style.left="50%",n.style.top="50%",n.style.transform="translate(-50%, -50%)",n.style.zIndex=100500,n.style.padding="4px",n.style.background="#fff",n.style.color="#000",setTimeout((function(){document.body.removeChild(n)}),1e3)}}catch(t){}document.body.removeChild(e)};var et=function(){if(o)for(var t=o.portalsList.length-1;t>=0;t--){var e=o.portalsList[t];if(!e.options.data.title){var n=window.portals[e.options.guid];n&&n.options&&n.options.data&&n.options.data.title&&(e.options.data.title=n.options.data.title)}}if(x.length)for(var r=x.length-1;r>=0;r--){var i=x[r],s=window.portals[i.guid];s&&s.options&&s.options.data&&s.options.data.title&&($("#".concat(i.id)).html(s.options.data.title),x.splice(r,1))}},nt=function(t){for(var e=[],n=0;n<t.length;n++)e.push({guid:t[n].guid,name:encodeURIComponent(t[n].name),location:t[n].location});return e},rt=function(){var t=window.map.getCenter(),e=null;return y&&(e={guid:y.guid,name:encodeURIComponent(y.name),location:y.location}),{center:{lat:t.lat,lng:t.lng},zoom:window.map.getZoom(),selectedPortals:nt(l),blackList:nt(d),scheme:o?o.getDataForSave():null,centerPortal:e}},it=function(){window.localStorage.setItem(a,JSON.stringify(rt()))},ot=function(t){if(t){if(t.selectedPortals&&t.selectedPortals.length){for(var e=[],n=0;n<t.selectedPortals.length;n++){var r=t.selectedPortals[n];r.guid&&(r.name=decodeURIComponent(r.name),e.push(r))}e.length&&(l=e,u=1,O())}if(t.blackList&&t.blackList.length){for(var i=[],s=0;s<t.blackList.length;s++){var a=t.blackList[s];a.guid&&(a.name=decodeURIComponent(a.name),i.push(a))}i.length&&(d=i,T())}t.centerPortal?(y=t.centerPortal).name=decodeURIComponent(y.name):y=null,R(),tt(),t.scheme&&(u=3,o=HomogeneousPluginUtils.getSchemeFromData(t.scheme),I(o))}};b.export=function(){download(HomogeneousPluginUtils.stringify(rt()),"homogeneous-field.json")},b.import=function(){$("#homogeneousFieldImportInput").click()},b.doImport=function(){var t=$("#homogeneousFieldImportInput").get(0).files[0],e=new FileReader;e.readAsText(t,"utf8"),e.onload=function(){try{b.reset();var t=JSON.parse(e.result);t&&t.center&&(window.map.setView(t.center,t.zoom||15),window.localStorage.setItem(a,JSON.stringify(t))),ot(t)}catch(t){console.log("Import error",t)}$("#homogeneousFieldImportInput").val("")},e.onerror=function(){$("#homogeneousFieldImportInput").val("")}},b.importBookmarks=function(){try{var t=JSON.parse(window.localStorage.getItem("plugin-bookmarks"));if(t.portals&&t.portals.idOthers&&t.portals.idOthers.bkmrk){var e=t.portals.idOthers.bkmrk,n=Object.keys(e);if(!n.length)return void alert("Bookmarks is empty");d=[];for(var r=0;r<n.length;r++){var i=e[n[r]],o=i.latlng.split(",");d.push({guid:i.guid,name:i.label,location:{lat:Number(o[0]),lng:Number(o[1])}})}it(),T(),tt()}else alert("Unable to import bookmarks")}catch(t){alert("Unable to import bookmarks")}},b.updateAutoScroll=function(){st()},b.selectPortalOnClick=function(t,e){if(t&&t.ctrlKey){window.selectPortal(e),window.renderPortalDetails(e);var n=window.portals[e];return n&&window.map.setView(n._latlng,window.map.getZoom()),t.stopPropagation(),!1}};var st=function(){var t={autoScrollDisabled:!$("#homogeneousFieldAutoScroll").prop("checked")};window.localStorage.setItem("iitc-plugin-homogeneous-field-options",JSON.stringify(t))};function at(){$.getScript("https://cdnjs.cloudflare.com/ajax/libs/downloadjs/1.4.8/download.min.js"),$("<style>").prop("type","text/css").html(HomogeneousPluginUtils.css).appendTo("head"),$("body").append(HomogeneousPluginUtils.ui),$("#homogeneousFieldBox").draggable({handle:".handle",containment:"window"}),$("#toolbox").append('<a onclick="window.plugin.homogeneousField.toggleBox();return false;">Homogeneous field</a>'),window.addHook("portalSelected",b.handlePortalSelect);var t=new L.LayerGroup;window.addLayerGroup("Homogeneous field",t,!0),(e=new L.LayerGroup).addTo(t),(r=new L.LayerGroup).addTo(t),(i=new L.LayerGroup).addTo(t),centerLayer=new L.LayerGroup,centerLayer.addTo(t),n=new L.LayerGroup,window.addLayerGroup("Homogeneous field keys",n,!0),s=new L.Popup({offset:L.point([1,-16])}),window.plugin.drawTools||$("#homogeneousFieldExportDrawTools").hide(),document.addEventListener("keydown",M,!1),function(){try{ot(JSON.parse(window.localStorage.getItem(a)))}catch(t){}}(),function(){$("#homogeneousFieldAutoScroll").prop("checked",!0);var t=window.localStorage.getItem("iitc-plugin-homogeneous-field-options");try{t=JSON.parse(t),$("#homogeneousFieldAutoScroll").prop("checked",!t.autoScrollDisabled)}catch(t){}}(),tt(),setInterval(et,1e3)}window.plugin.homogeneousField=b,at.info=t,window.bootPlugins||(window.bootPlugins=[]),window.bootPlugins.push(at),window.iitcLoaded&&at()}+")("+JSON.stringify(ye)+")");de.appendChild(ve),(document.body||document.head||document.documentElement).appendChild(de)}]);