EOX GitLab Instance

Skip to content
Snippets Groups Projects
ed6090683ac14375de89.worker.js 539 KiB
Newer Older
Lubomir Dolezal's avatar
Lubomir Dolezal committed
/*!
 * PRISM version: 1.1.0-rc.26
 * eoxc version: 1.1.0
 */
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(t){"use strict";function e(e,n){return self.services[e]||(n?self.services[e]=t.resolve((0,s.deserialize)(n)):self.services[e]=(0,s.discover)(e)),self.services[e]}function r(t,n,r,i,o,s,a,c,l,p){var h=o.maxCount,f=o.totalResults,d=o.itemsPerPage;return e(t,a).then(function(t){var e=(0,u.convertFilters)(r,i,o,s,t),a=t.getPaginator(e,{type:s,method:n,baseOffset:o.startIndex,maxUrlLength:c,dropEmptyParameters:l,parseOptions:p,totalResults:f,preferredItemsPerPage:d});return a.searchFirstRecords(h)})}function i(){self.search&&(self.search.cancel(),self.search=null),self.emitter&&(self.emitter.emit("cancel"),self.emitter=null)}var o=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();n(95),n(96);var s=n(61),a=n(147),u=n(52);t.config({cancellation:!0}),(0,s.config)({useXHR:!0}),self.DOMParser=a.DOMParser,self.services={},self.promises={},self.onmessage=function(t){var e=t.data,n=o(e,2),s=n[0],a=n[1];switch(s){case"searchAll":var c=a.url,l=a.method,p=a.filterParams,h=a.mapParams,f=a.options,d=a.format,g=a.description,y=a.maxUrlLength,_=a.dropEmptyParameters,m=a.parseOptions,v=a.switchMultiPolygonCoordinates;self.search=r(c,l,p,h,f,d,g,y,_,m),self.search.then(function(t){self.emitter=t,t.on("page",function(t){return self.postMessage(["progress",Object.assign(t,{records:(0,u.prepareRecords)(t.records,v)})])}).on("success",function(t){return self.postMessage(["success",t])}).on("error",function(t){return self.postMessage(["error",t.toString()])})},function(t){return self.postMessage(["error",t.toString()])});break;case"cancel":i();break;case"terminate":i(),self.close()}}}).call(e,n(4))},function(t,e,n){(function(e,r,i){"use strict";function o(){try{var t=R;return R=null,t.apply(this,arguments)}catch(t){return T.e=t,T}}function s(t){return R=t,o}function a(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function u(t){return"function"==typeof t||"object"==typeof t&&null!==t}function c(t){return a(t)?new Error(m(t)):t}function l(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;n<r;++n)i[n]=t[n];return i[n]=e,i}function p(t,e,n){if(!O.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function h(t,e,n){if(a(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return O.defineProperty(t,e,r),t}function f(t){throw t}function d(t){try{if("function"==typeof t){var e=O.names(t.prototype),n=O.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=M.test(t+"")&&O.names(t).length>0;if(n||r||i)return!0}return!1}catch(t){return!1}}function g(t){function e(){}function n(){return typeof r.foo}e.prototype=t;var r=new e;return n(),n(),t}function y(t){return F.test(t)}function _(t,e,n){for(var r=new Array(t),i=0;i<t;++i)r[i]=e+i+n;return r}function m(t){try{return t+""}catch(t){return"[no string representation]"}}function v(t){return t instanceof Error||null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function b(t){try{h(t,"isOperational",!0)}catch(t){}}function E(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0)}function x(t){return v(t)&&O.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function I(t,e,n){for(var r=O.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{O.defineProperty(e,o,O.getDescriptor(t,o))}catch(t){}}}function N(t){return B?r.env[t]:void 0}function C(){if("function"==typeof i)try{var t=new i(function(){});if("[object Promise]"==={}.toString.call(t))return i}catch(t){}}function S(t,e){return t.bind(e)}var O=n(5),P="undefined"==typeof navigator,T={e:{}},R,L="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof e?e:void 0!==this?this:null,A=function(t,e){function n(){this.constructor=t,this.constructor$=e;for(var n in e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}var r={}.hasOwnProperty;return n.prototype=e.prototype,t.prototype=new n,t.prototype},D=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(O.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=n(t)}catch(t){return r}for(var s=0;s<o.length;++s){var a=o[s];if(!i[a]){i[a]=!0;var u=Object.getOwnPropertyDescriptor(t,a);null!=u&&null==u.get&&null==u.set&&r.push(a)}}t=O.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),M=/this\s*\.\s*\S+\s*=/,F=/^[a-z$_][a-z$_0-9]*$/i,k=function(){return"stack"in new Error?function(t){return x(t)?t:new Error(m(t))}:function(t){if(x(t))return t;try{throw new Error(m(t))}catch(t){return t}}}(),j=function(t){return O.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var G="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);return n};j=function(t){return O.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?G(t):null}}var U="undefined"!=typeof r&&"[object process]"===w(r).toLowerCase(),B="undefined"!=typeof r&&"undefined"!=typeof r.env,q={isClass:d,isIdentifier:y,inheritedDataKeys:D,getDataPropertyOrDefault:p,thrower:f,isArray:O.isArray,asArray:j,notEnumerableProp:h,isPrimitive:a,isObject:u,isError:v,canEvaluate:P,errorObj:T,tryCatch:s,inherits:A,withAppended:l,maybeWrapAsError:c,toFastProperties:g,filledRange:_,toString:m,canAttachTrace:x,ensureErrorObject:k,originatesFromRejection:E,markAsOriginatingFromRejection:b,classString:w,copyDescriptors:I,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:U,hasEnvVariables:B,env:N,global:L,getNativePromise:C,domainBind:S};q.isRecentNode=q.isNode&&function(){var t;return r.versions&&r.versions.node?t=r.versions.node.split(".").map(Number):r.version&&(t=r.version.split(".").map(Number)),0===t[0]&&t[1]>10||t[0]>0}(),q.isNode&&q.toFastProperties(r);try{throw new Error}catch(t){q.lastLineError=t}t.exports=q}).call(e,function(){return this}(),n(9),n(4))},function(t,e,n){"use strict";function r(t){for(var e=t.indexOf("?")===-1?t:t.substring(t.indexOf("?")),n=e.split("&"),r={},i=0;i<n.length;i++){var o=n[i].split("=");r[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return r}function i(t){if("undefined"!=typeof DOMParser)return(new DOMParser).parseFromString(t,"text/xml");if("undefined"!=typeof ActiveXObject){var e=new ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e}throw new Error("Could not parse XML document.")}function o(t){return t.children?Array.from(t.children):Array.from(t.childNodes).filter(function(t){return 1===t.nodeType})}function s(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:I;if(!t)return[];var i=r[e]||e,s=o(t);return n&&i?s.filter(function(t){return t.localName===n&&t.namespaceURI===i}):n?s.filter(function(t){return t.localName===n}):s}function a(t,e,n,r){if(!e&&!n&&t.firstElementChild)return t.firstElementChild;var i=s(t,e,n,r);return i.length?i[0]:null}function u(t,e,n,r){var i=a(t,e,n,r);return i?i.textContent:null}function c(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:I,o=i[e]||e;return t.hasAttributeNS(o,n)?t.getAttributeNS(o,n):r}function l(t){return t.indexOf(":")!==-1?t.split(":"):[null,t]}function p(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=e.split("/").filter(function(t){return t.length}),o=n?t:[t],u=0;u<i.length;++u){var p=i[u];if(n){if("text()"===p)return o.textContent;if(p.indexOf("@")!==-1){var h=p.split("@"),f=w(h,2),d=f[0],g=f[1],y=l(d),_=w(y,2),m=_[0],v=_[1],b=l(g),E=w(b,2),I=E[0],N=E[1];return o=a(o,m,v,r),o?c(o,I,N,void 0,r):null}var C=l(p),S=w(C,2),O=S[0],P=S[1];if(o=a(o,O,P,r),!o)return null}else{if("text()"===p)return o.map(function(t){return t.textContent});if(p.indexOf("@")!==-1){var T=function(){var t=p.split("@"),e=w(t,2),n=e[0],i=e[1],a=l(n),u=w(a,2),h=u[0],f=u[1],d=l(i),g=w(d,2),y=g[0],_=g[1];return{v:o.map(function(t){return s(t,h,f,r)}).reduce(function(t,e){return t.concat(e)},[]).map(function(t){return c(t,y,_,void 0,r)})}}();if("object"===("undefined"==typeof T?"undefined":x(T)))return T.v}else!function(){var t=l(p),e=w(t,2),n=e[0],i=e[1];o=o.map(function(t){return s(t,n,i,r)}).reduce(function(t,e){return t.concat(e)},[])}()}}return o}function h(t,e){var n=/^xmlns:(.*)$/;if(e.namespaceURI&&e.namespaceURI===t&&e.lookupNamespaceURI(e.prefix)===t)return e.prefix;if(e.attributes&&e.attributes.length)for(var r=0;r<e.attributes.length;r++){var i=e.attributes[r];n.lastIndex=0;var o=i.localName||i.name.substr(i.name.indexOf(":")+1);if(o.indexOf(":")!==-1&&(o=o.substr(i.name.indexOf(":")+1)),n.test(i.name)&&i.value===t)return o}return e.parentNode?h(t,e.parentNode):null}function f(t,e){if(t.lookupPrefix)return t.lookupPrefix(e);if(null===e||""===e)return null;switch(t.nodeType){case 1:return h(e,t);case 9:return h(e,t.documentElement);case 6:case 12:case 11:case 10:return null;case 2:return t.ownerElement?h(e,t.ownerElement):null;default:return t.parentNode?h(e,t.parentNode):null}}function d(){return fetch.apply(void 0,arguments).then(function(t){if(t.status>=400)throw new Error("Bad response from server");return t})}function g(t){return"undefined"==typeof t||null===t}function y(t){function e(t){return"("+t+")"}function n(t){return t.join(" ")}function r(t){return t.map(n).join(", ")}function i(t){return t.map(r).map(e).join(", ")}function o(t){return t.map(i).map(e).join(", ")}switch("Feature"===t.type&&(t=t.geometry),t.type){case"Point":return"POINT("+n(t.coordinates)+")";case"LineString":return"LINESTRING("+r(t.coordinates)+")";case"Polygon":return"POLYGON("+i(t.coordinates)+")";case"MultiPoint":return"MULTIPOINT("+r(t.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON("+o(t.coordinates)+")";case"MultiLineString":return"MULTILINESTRING("+i(t.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION("+t.geometries.map(y).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}}function _(t,e){return new Request(t,e)}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new XMLHttpRequest;return n.open(e.method||"GET",t),e.headers&&Object.keys(e.headers).forEach(function(t){n.setRequestHeader(t,e.headers[t])}),n.send(e.body?e.body:null),n}function v(t,e,n){if(Array.prototype.find)return t.find(e,n);for(var r=0;r<t.length;++r){var i=t[r];if(e(i,r,t))return i}}function b(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(Object.assign)return Object.assign.apply(Object,[t].concat(n));for(var i=0;i<n.length;++i){var o=n[i];if(o)for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s])}return t}var E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Object.defineProperty(e,"__esModule",{value:!0}),e.namespaces=void 0;var x="function"==typeof Symbol&&"symbol"===E(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":E(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":E(t)},w=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.parseURLQuery=r,e.parseXml=i,e.getElements=s,e.getFirstElement=a,e.getText=u,e.getAttributeNS=c,e.simplePath=p,e.lookupPrefix=f,e.fetchAndCheck=d,e.isNullOrUndefined=g,e.toWKT=y,e.createRequest=_,e.createXHR=m,e.find=v,e.assign=b,n(45);var I=e.namespaces={os:"http://a9.com/-/spec/opensearch/1.1/",parameters:"http://a9.com/-/spec/opensearch/extensions/parameters/1.0/",atom:"http://www.w3.org/2005/Atom",georss:"http://www.georss.org/georss",dc:"http://purl.org/dc/elements/1.1/",media:"http://search.yahoo.com/mrss/",opt:"http://www.opengis.net/opt/2.1",om:"http://www.opengis.net/om/2.0",eop:"http://www.opengis.net/eop/2.0"}},function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return l(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=n(5),u=a.freeze,c=n(1),l=c.inherits,p=c.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),d=r("TimeoutError","timeout error"),g=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(t){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),_=0;_<y.length;++_)"function"==typeof Array.prototype[y[_]]&&(g.prototype[y[_]]=Array.prototype[y[_]]);a.defineProperty(g.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),g.prototype.isOperational=!0;var m=0;g.prototype.toString=function(){var t=Array(4*m+1).join(" "),e="\n"+t+"AggregateError of:\n";m++,t=Array(4*m+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join("\n"),e+=r+"\n"}return m--,e},l(i,Error);var v=Error.__BluebirdErrorTypes__;v||(v=u({CancellationError:f,TimeoutError:d,OperationalError:i,RejectionError:i,AggregateError:g}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:v,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:v.CancellationError,OperationalError:v.OperationalError,TimeoutError:v.TimeoutError,AggregateError:v.AggregateError,Warning:h}},function(t,e,n){(function(e){"use strict";function r(){try{e===o&&(e=i)}catch(t){}return o}var i;"undefined"!=typeof e&&(i=e);var o=n(81)();o.noConflict=r,t.exports=o}).call(e,n(4))},function(t,e){var n=function(){"use strict";return void 0===this}();if(n)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var r={}.hasOwnProperty,i={}.toString,o={}.constructor.prototype,s=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e},a=function(t,e){return{value:t[e]}},u=function(t,e,n){return t[e]=n.value,t},c=function(t){return t},l=function(t){try{return Object(t).constructor.prototype}catch(t){return o}},p=function(t){try{return"[object Array]"===i.call(t)}catch(t){return!1}};t.exports={isArray:p,keys:s,names:s,defineProperty:u,getDescriptor:a,freeze:c,getPrototypeOf:l,isES5:n,propertyIsWritable:function(){return!0}}}},function(t,e,n){var r=n(24)("wks"),i=n(27),o=n(8).Symbol,s="function"==typeof o,a=t.exports=function(t){return r[t]||(r[t]=s&&o[t]||(s?o:i)("Symbol."+t))};a.store=r},function(t,e){var n=t.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},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){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function s(){g&&f&&(g=!1,f.length?d=f.concat(d):y=-1,d.length&&a())}function a(){if(!g){var t=i(s);g=!0;for(var e=d.length;e;){for(f=d,d=[];++y<e;)f&&f[y].run();y=-1,e=d.length}f=null,g=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var l,p,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}}();var f,d=[],g=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new u(t,e)),1!==d.length||g||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e,n){t.exports=!n(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){(function(t){"use strict";function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!t)return r;for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r}Object.defineProperty(e,"__esModule",{value:!0}),e.config=n;var r={useXHR:!1,Promise:t}}).call(e,n(4))},function(t,e,n){var r=n(20);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(15),i=n(22);t.exports=n(10)?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(12),i=n(103),o=n(117),s=Object.defineProperty;e.f=n(10)?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){"use strict";function r(){return Object.keys(l)}function i(t){return l[t]}function o(t,e){l[t]=e}Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedTypes=r,e.getFormat=i,e.registerFormat=o;var s=n(57),a=n(59),u=n(58),c=n(60),l={};o("application/atom+xml",new s.AtomFormat),o("application/rss+xml",new a.RSSFormat),o("application/json",new u.GeoJSONFormat),o("application/vnd.geo+json",new u.GeoJSONFormat),o("application/x-suggestions+json",new c.SuggestionsJSONFormat)},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,n){var r=n(8),i=n(7),o=n(14),s=n(41),a=n(35),u="prototype",c=function(t,e,n){var l,p,h,f,d=t&c.F,g=t&c.G,y=t&c.S,_=t&c.P,m=t&c.B,v=g?r:y?r[e]||(r[e]={}):(r[e]||{})[u],b=g?i:i[e]||(i[e]={}),E=b[u]||(b[u]={});g&&(n=e);for(l in n)p=!d&&v&&void 0!==v[l],h=(p?v:n)[l],f=m&&p?a(h,r):_&&"function"==typeof h?a(Function.call,h):h,v&&s(v,l,h,t&c.U),b[l]!=h&&o(b,l,f),_&&E[l]!=h&&(E[l]=h)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},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){t.exports={}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(24)("keys"),i=n(27);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(7),i=n(8),o="__core-js_shared__",s=i[o]||(i[o]={});(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(39)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},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){var r=n(17);t.exports=function(t){return Object(r(t))}},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){"use strict";var r=n(123)();t.exports=function(t){return t!==r&&null!==t}},function(t,e){"use strict";function n(t,e,n){if(n=n||{},!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&&C(r),i&&S(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function r(t,e,n){if(n=n||{},!N(n))throw new Error("options is invalid");var r=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");r&&C(r);var o;switch(t){case"Point":o=i(e).geometry;break;case"LineString":o=u(e).geometry;break;case"Polygon":o=s(e).geometry;break;case"MultiPoint":o=h(e).geometry;break;case"MultiLineString":o=p(e).geometry;break;case"MultiPolygon":o=f(e).geometry;break;default:throw new Error(t+" is invalid")}return r&&(o.bbox=r),o}function i(t,e,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(!I(t[0])||!I(t[1]))throw new Error("coordinates must contain numbers");return n({type:"Point",coordinates:t},e,r)}function o(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map(function(t){return i(t,e)}),n)}function s(t,e,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&&!I(o[0][0])||!I(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 n({type:"Polygon",coordinates:t},e,r)}function a(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map(function(t){return s(t,e)}),n)}function u(t,e,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(!I(t[0][1])||!I(t[0][1]))throw new Error("coordinates must contain numbers");return n({type:"LineString",coordinates:t},e,r)}function c(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return l(t.map(function(t){return u(t,e)}),n)}function l(t,e){if(e=e||{},!N(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&&C(n),r&&S(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function p(t,e,r){if(!t)throw new Error("coordinates is required");return n({type:"MultiLineString",coordinates:t},e,r)}function h(t,e,r){if(!t)throw new Error("coordinates is required");return n({type:"MultiPoint",coordinates:t},e,r)}function f(t,e,r){if(!t)throw new Error("coordinates is required");return n({type:"MultiPolygon",coordinates:t},e,r)}function d(t,e,r){if(!t)throw new Error("geometries is required");if(!Array.isArray(t))throw new Error("geometries must be an Array");return n({type:"GeometryCollection",geometries:t},e,r)}function g(t,e){if(void 0===t||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 y(t,e){if(void 0===t||null===t)throw new Error("radians is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=F[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t*n}function _(t,e){if(void 0===t||null===t)throw new Error("distance is required");if(e&&"string"!=typeof e)throw new Error("units must be a string");var n=F[e||"kilometers"];if(!n)throw new Error(e+" units is invalid");return t/n}function m(t,e){return b(_(t,e))}function v(t){if(null===t||void 0===t)throw new Error("bearing is required");var e=t%360;return e<0&&(e+=360),e}function b(t){if(null===t||void 0===t)throw new Error("radians is required");var e=t%(2*Math.PI);return 180*e/Math.PI}function E(t){if(null===t||void 0===t)throw new Error("degrees is required");var e=t%360;return e*Math.PI/180}function x(t,e,n){if(null===t||void 0===t)throw new Error("length is required");if(!(t>=0))throw new Error("length must be a positive number");return y(_(t,e),n||"kilometers")}function w(t,e,n){if(null===t||void 0===t)throw new Error("area is required");if(!(t>=0))throw new Error("area must be a positive number");var r=j[e||"meters"];if(!r)throw new Error("invalid original units");var i=j[n||"kilometers"];if(!i)throw new Error("invalid final units");return t/r*i}function I(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function N(t){return!!t&&t.constructor===Object}function C(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(!I(t))throw new Error("bbox must only contain numbers")})}function S(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}function O(){throw new Error("method has been renamed to `radiansToDegrees`")}function P(){throw new Error("method has been renamed to `degreesToRadians`")}function T(){throw new Error("method has been renamed to `lengthToDegrees`")}function R(){throw new Error("method has been renamed to `lengthToRadians`")}function L(){throw new Error("method has been renamed to `radiansToLength`")}function A(){throw new Error("method has been renamed to `bearingToAzimuth`")}function D(){throw new Error("method has been renamed to `convertLength`")}Object.defineProperty(e,"__esModule",{value:!0});var M=6371008.8,F={meters:M,metres:M,millimeters:1e3*M,millimetres:1e3*M,centimeters:100*M,centimetres:100*M,kilometers:M/1e3,kilometres:M/1e3,miles:M/1609.344,nauticalmiles:M/1852,inches:39.37*M,yards:M/1.0936,feet:3.28084*M,radians:1,degrees:M/111325},k={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/M,degrees:1/111325},j={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:3.86e-7,yards:1.195990046,feet:10.763910417,inches:1550.003100006};e.earthRadius=M,e.factors=F,e.unitsFactors=k,e.areaFactors=j,e.feature=n,e.geometry=r,e.point=i,e.points=o,e.polygon=s,e.polygons=a,e.lineString=u,e.lineStrings=c,e.featureCollection=l,e.multiLineString=p,e.multiPoint=h,e.multiPolygon=f,e.geometryCollection=d,e.round=g,e.radiansToLength=y,e.lengthToRadians=_,e.lengthToDegrees=m,e.bearingToAzimuth=v,e.radiansToDegrees=b,e.degreesToRadians=E,e.convertLength=x,e.convertArea=w,e.isNumber=I,e.isObject=N,e.validateBBox=C,e.validateId=S,e.radians2degrees=O,e.degrees2radians=P,e.distanceToDegrees=T,e.distanceToRadians=R,e.radiansToDistance=L,e.bearingToAngle=A,e.convertDistance=D},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e.push([i,r])}return e}function s(t){var e=t.trim().split(/\s+/).map(parseFloat);return o(e)}function a(t){return o((0,d.getText)(t,t.namespaceURI,"posList").trim().split(/\s+/).map(parseFloat))}function u(t,e){var n=(0,d.getFirstElement)(t,e,"exterior"),r=(0,d.getElements)(t,e,"interior"),o=a((0,d.getFirstElement)(n,e,"LinearRing"),e),s=r.map(function(t){return a((0,d.getFirstElement)(t,e,"LinearRing"),e)});return[o].concat(i(s))}function c(t,e){var n=(0,d.getText)(t,e,"lowerCorner").trim().split(/\s+/).map(parseFloat),r=(0,d.getText)(t,e,"upperCorner").trim().split(/\s+/).map(parseFloat),i=[[[n[1],n[0]],[r[1],n[0]],[r[1],r[0]],[n[1],r[0]],[n[1],n[0]]]];return i}function l(t){switch(t.localName){case"Point":var e=(0,d.getText)(t,t.namespaceURI,"pos").trim().split(/\s+/).map(parseFloat);return{type:"Point",coordinates:[e[1],e[0]]};case"LineString":var n=a(t,t.namespaceURI);return{type:"LineString",coordinates:n};case"Polygon":var r=u(t,t.namespaceURI);return{type:"Polygon",coordinates:r};case"Envelope":var i=c(t,t.namespaceURI);return{type:"Polygon",coordinates:i};case"MultiPolygon":var o=(0,d.getElements)(t,t.namespaceURI,"polygonMember").map(function(t){return(0,d.getFirstElement)(t,t.namespaceURI,"Polygon")}),s=o.map(function(e){return u(e,t.namespaceURI)});return{type:"MultiPolygon",coordinates:s};case"MultiSurface":var p=(0,d.getElements)(t,t.namespaceURI,"surfaceMember").map(function(t){return(0,d.getFirstElement)(t,t.namespaceURI,"Polygon")}),h=(0,d.getFirstElement)(t,t.namespaceURI,"surfaceMembers");h&&(p=p.concat((0,d.getElements)(h,h.namespaceURI,"Polygon")));var f=p.map(function(e){return u(e,t.namespaceURI)});return{type:"MultiPolygon",coordinates:f};case"geometryMember":return l((0,d.getFirstElement)(t))}return null}function p(t){for(var e=null,n=null,r=null,i=null,o=0;o<t.length;++o){var s=f(t[o],2),a=s[0],u=s[1];e=null===e||a<e?a:e,n=null===n||u<n?u:n,r=null===r||a>r?a:r,i=null===i||u>i?u:i}return[e,n,r,i]}Object.defineProperty(e,"__esModule",{value:!0}),e.BaseFeedFormat=void 0;var h=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),f=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance");
}}(),d=n(2);e.BaseFeedFormat=function(){function t(){r(this,t)}return h(t,[{key:"parseGeometry",value:function(t){var e=(0,d.getFirstElement)(t,"georss","where"),n=(0,d.getText)(t,"georss","point"),r=(0,d.getText)(t,"georss","line"),i=(0,d.getText)(t,"georss","polygon");if(e){var o=(0,d.getFirstElement)(e);if(o)return l(o)}else{if(n)return{type:"Point",coordinates:s(n)[0]};if(r)return{type:"LineString",coordinates:s(r)};if(i)return{type:"Polygon",coordinates:[s(i)]}}return null}},{key:"parseBox",value:function(t){var e=(0,d.getText)(t,"georss","box");if(e){var n=e.split(/\s+/).map(parseFloat);return[n[1],n[0],n[3],n[2]]}return null}},{key:"getBoxFromGeometry",value:function(t){var e=t.coordinates;switch(t.type){case"Point":return[e[0],e[1],e[0],e[1]];case"LineString":return p(e);case"Polygon":return p(e[0]);case"MultiPolygon":for(var n=e.map(function(t){return p(t[0])}),r=n[0],i=1;i<n.length;++i){var o=n[i];r[0]=Math.min(r[0],o[0]),r[1]=Math.min(r[1],o[1]),r[2]=Math.max(r[2],o[2]),r[3]=Math.max(r[3],o[3])}return r;default:return null}}},{key:"parseDate",value:function(t){var e=(0,d.getText)(t,"dc","date");if(e){var n=e.split("/");if(1===n.length)return new Date(e);if(n.length>=1)return[new Date(n[0]),new Date(n[1])]}return null}},{key:"parseLinks",value:function(t){return(0,d.getElements)(t,"atom","link").map(function(t){var e={href:t.getAttribute("href")},n=t.getAttribute("rel"),r=t.getAttribute("type"),i=t.getAttribute("title");return n&&(e.rel=n),r&&(e.type=r),i&&(e.title=i),e})}},{key:"parseMedia",value:function(t){var e=(0,d.getElements)(t,"media","content"),n=(0,d.getElements)(t,"media","group"),r=n.map(function(t){return(0,d.getElements)(t,"media","content")}).reduce(function(t,e){return t.concat(e)},[]),i=e.concat(r);return i.map(function(t){var e=(0,d.getFirstElement)(t,"media","category");return{url:t.getAttribute("url"),category:e?e.textContent:void 0,scheme:e?e.getAttribute("scheme"):void 0}})}},{key:"parseEOP",value:function(t){var e=(0,d.getFirstElement)(t,null,"EarthObservation");if(e){var n=(0,d.simplePath)(e,"om:procedure/EarthObservationEquipment",!0);return{productType:(0,d.simplePath)(e,"metaDataProperty/EarthObservationMetaData/productType/text()",!0),processingLevel:(0,d.simplePath)(e,"metaDataProperty/EarthObservationMetaData/processing/ProcessingInformation/processingLevel/text()",!0),platformShortName:(0,d.simplePath)(n,"platform/Platform/shortName/text()",!0),platformSerialIdentifier:(0,d.simplePath)(n,"platform/Platform/serialIdentifier/text()",!0),instrumentShortName:(0,d.simplePath)(n,"instrument/Instrument/shortName/text()",!0),sensorType:(0,d.simplePath)(n,"sensor/Sensor/sensorType/text()",!0),resolution:(0,d.simplePath)(n,"sensor/Sensor/resolution/text()",!0)+(0,d.simplePath)(n,"sensor/Sensor/resolution@uom",!0),orbitNumber:(0,d.simplePath)(n,"acquisitionParameters/Acquisition/orbitNumber/text()",!0),cloudCoverPercentage:(0,d.simplePath)(e,"om:result/opt:EarthObservationResult/opt:cloudCoverPercentage/text()",!0)}}return null}},{key:"parseS3Path",value:function(t){return(0,d.getText)(t,null,"s3Path")}},{key:"parseExtraFields",value:function(t,e,n,r){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=e[i],s=void 0,a=!0;if(Array.isArray(o)){var u=f(o,2);s=u[0],a=u[1]}else s=o;for(var c=i.split("."),l=r,p=0;p<c.length-1;++p){var h=c[p];l[h]||(l[h]={}),l=l[h]}l[c[c.length-1]]=(0,d.simplePath)(t,s,a,n)}}}]),t}()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e,n,r){Object.keys(e).forEach(function(e){if(!Object.prototype.hasOwnProperty.call(t._parametersByType,e)&&!Object.prototype.hasOwnProperty.call(t._parametersByName,e))throw new Error("Invalid parameter '"+e+"'.")});var i=t.getMissingMandatoryParameters(e).map(function(t){return t.type});if(i.length)throw new Error("Missing mandatory parameters: "+i.join(", "));var o=t.serializeValues(e);if("GET"===t.method){for(var a=t.url,c=0;c<o.length;++c){var l=s(o[c],3),p=l[1],h=l[2];a=a.replace(new RegExp("{"+p+"[?]?}"),h)}if(n){var f=(0,u.default)(a,!1),d=f.query.split("&").map(function(t){return t.split("=")}).filter(function(t){return""!==t[1]}).map(function(t){return t.join("=")}).join("&");f.set("query",d),a=f.toString()}return{method:t.method,url:a,headers:r}}var g=t.enctype||"application/x-www-form-urlencoded",y=null;if("application/x-www-form-urlencoded"===g)y=o.map(function(t){var e=s(t,3),n=e[0],r=e[2];return encodeURIComponent(n)+"="+encodeURIComponent(r)}).join("&");else{if("multipart/form-data"!==g)throw new Error("Unsupported enctype '"+g+"'.");y=new FormData,o.forEach(function(t){var e=s(t,3),n=e[0],r=e[2];return y.append(n,r)})}return{method:t.method,url:t.url,headers:{"Content-Type":g},body:y}}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.type,o=n.raw,a=n.maxUrlLength,u=n.dropEmptyParameters,f=n.parseOptions,d=n.headers,g=i(t,e,u,d),y=(0,h.config)(),_=y.useXHR,m=y.Promise;if("undefined"!=typeof a&&g.url.length>a)return m.reject(new Error("Search URL too long: "+g.url.length+", maximum: "+a));var v=null;if(_)v=new m(function(t,e,n){var r=(0,l.createXHR)(g.url,g);r.onload=function(){o&&t(r),t([r.responseText,r.status])},r.onerror=function(){e(new TypeError("Failed to fetch"))},n&&"function"==typeof n&&n(function(){r.abort()})});else{if(v=fetch((0,l.createRequest)(g.url,g)),o)return v;v=v.then(function(t){return t.text().then(function(e){return[e,t.status]})})}return v.then(function(e){var n=s(e,2),i=n[0],o=n[1];if(o>=400){var a=(0,p.getErrorFromXml)(i);throw a||new Error(i)}var u=(0,c.getFormat)(r||t.type);if(!u)throw new Error("Could not parse response of type '"+r+"'.");return u.parse(i,f)})}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.createBaseRequest=i,e.search=o;var a=n(47),u=r(a),c=n(16),l=n(2),p=n(56),h=n(11)},function(t,e,n){"use strict";t.exports=function(t){function e(e,n,a){return function(u){var c=a._boundValue();t:for(var l=0;l<e.length;++l){var p=e[l];if(p===Error||null!=p&&p.prototype instanceof Error){if(u instanceof p)return o(n).call(c,u)}else if("function"==typeof p){var h=o(p).call(c,u);if(h===s)return h;if(h)return o(n).call(c,u)}else if(r.isObject(u)){for(var f=i(p),d=0;d<f.length;++d){var g=f[d];if(p[g]!=u[g])continue t}return o(n).call(c,u)}}return t}}var r=n(1),i=n(5).keys,o=r.tryCatch,s=r.errorObj;return e}},function(t,e,n){"use strict";function r(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=l.keys(t),i=0;i<n.length;++i){var o=n[i];p.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function o(t,e){return function(n,r){if(null!==t){if(n){var o=i(a(n));t._attachExtraTrace(o),t._reject(o)}else if(e){for(var s=arguments.length,u=new Array(Math.max(s-1,0)),c=1;c<s;++c)u[c-1]=arguments[c];t._fulfill(u)}else t._fulfill(r);t=null}}}var s=n(1),a=s.maybeWrapAsError,u=n(3),c=u.OperationalError,l=n(5),p=/^(?:name|message|stack|cause)$/;t.exports=o},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(97);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,n){var r=n(20),i=n(8).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(34);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){t.exports=!1},function(t,e,n){var r=n(114),i=n(37);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(8),i=n(14),o=n(13),s=n(27)("src"),a=n(101),u="toString",c=(""+a).split(u);n(7).inspectSource=function(t){return a.call(t)},(t.exports=function(t,e,n,a){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,s)||i(n,s,t[e]?""+t[e]:c.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,u,function(){return"function"==typeof this&&this[s]||a.call(this)})},function(t,e,n){var r=n(15).f,i=n(13),o=n(6)("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(38),i=n(17);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(25),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){n(146),t.exports=self.fetch.bind(self)},function(t,e){"use strict";var n=void 0;t.exports=function(t){return t!==n&&null!==t}},function(t,e,n){(function(e){"use strict";function r(t){return(t?t:"").toString().replace(g,"")}function i(t){var n;n="undefined"!=typeof window?window:"undefined"!=typeof e?e:"undefined"!=typeof self?self:{};var r=n.location||{};t=t||r;var i,o={},s=typeof t;if("blob:"===t.protocol)o=new a(unescape(t.pathname),{});else if("string"===s){o=new a(t,{});for(i in _)delete o[i]}else if("object"===s){for(i in t)i in _||(o[i]=t[i]);void 0===o.slashes&&(o.slashes=h.test(t.href))}return o}function o(t){t=r(t);var e=f.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],rest:e[3]}}function s(t,e){if(""===t)return e;for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,i=n[r-1],o=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(o=!0),n.splice(r,1),s--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}function a(t,e,n){if(t=r(t),!(this instanceof a))return new a(t,e,n);var u,c,h,f,d,g,_=y.slice(),m=typeof e,v=this,b=0;for("object"!==m&&"string"!==m&&(n=e,e=null),n&&"function"!=typeof n&&(n=p.parse),e=i(e),c=o(t||""),u=!c.protocol&&!c.slashes,v.slashes=c.slashes||u&&e.slashes,v.protocol=c.protocol||e.protocol||"",t=c.rest,c.slashes||(_[3]=[/(.*)/,"pathname"]);b<_.length;b++)f=_[b],"function"!=typeof f?(h=f[0],g=f[1],h!==h?v[g]=t:"string"==typeof h?~(d=t.indexOf(h))&&("number"==typeof f[2]?(v[g]=t.slice(0,d),t=t.slice(d+f[2])):(v[g]=t.slice(d),t=t.slice(0,d))):(d=h.exec(t))&&(v[g]=d[1],t=t.slice(0,d.index)),v[g]=v[g]||(u&&f[3]?e[g]||"":""),f[4]&&(v[g]=v[g].toLowerCase())):t=f(t);n&&(v.query=n(v.query)),u&&e.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==e.pathname)&&(v.pathname=s(v.pathname,e.pathname)),l(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(f=v.auth.split(":"),v.username=f[0]||"",v.password=f[1]||""),v.origin=v.protocol&&v.host&&"file:"!==v.protocol?v.protocol+"//"+v.host:"null",v.href=v.toString()}function u(t,e,n){var r=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(n||p.parse)(e)),r[t]=e;break;case"port":r[t]=e,l(e,r.protocol)?e&&(r.host=r.hostname+":"+e):(r.host=r.hostname,r[t]="");break;case"hostname":r[t]=e,r.port&&(e+=":"+r.port),r.host=e;break;case"host":r[t]=e,/:\d+$/.test(e)?(e=e.split(":"),r.port=e.pop(),r.hostname=e.join(":")):(r.hostname=e,r.port="");break;case"protocol":r.protocol=e.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(e){var i="pathname"===t?"/":"#";r[t]=e.charAt(0)!==i?i+e:e}else r[t]=e;break;default:r[t]=e}for(var o=0;o<y.length;o++){var s=y[o];s[4]&&(r[s[1]]=r[s[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}function c(t){t&&"function"==typeof t||(t=p.stringify);var e,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,e="object"==typeof n.query?t(n.query):n.query,e&&(i+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(i+=n.hash),i}var l=n(138),p=n(137),h=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,d="[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]",g=new RegExp("^"+d+"+"),y=[["#","hash"],["?","query"],function(t){return t.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],_={hash:1,query:1};a.prototype={set:u,toString:c},a.extractProtocol=o,a.location=i,a.trimLeft=r,a.qs=p,t.exports=a}).call(e,function(){return this}())},function(t,e){function n(t,e){for(var n in t)e[n]=t[n]}function r(t,e){function r(){}var i=t.prototype;if(Object.create){var o=Object.create(e.prototype);i.__proto__=o}i instanceof e||(r.prototype=e.prototype,r=new r,n(i,r),t.prototype=i=r),i.constructor!=t&&("function"!=typeof t&&console.error("unknow Class:"+t),i.constructor=t)}function i(t,e){if(e instanceof Error)var n=e;else n=this,Error.call(this,it[t]),this.message=it[t],Error.captureStackTrace&&Error.captureStackTrace(this,i);return n.code=t,e&&(this.message=this.message+": "+e),n}function o(){}function s(t,e){this._node=t,this._refresh=e,a(this)}function a(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!=e){var r=t._refresh(t._node);B(t,"length",r.length),n(r,t),t._inc=e}}function u(){}function c(t,e){for(var n=t.length;n--;)if(t[n]===e)return n}function l(t,e,n,r){if(r?e[c(e,r)]=n:e[e.length++]=n,t){n.ownerElement=t;var i=t.ownerDocument;i&&(r&&m(i,t,r),_(i,t,n))}}function p(t,e,n){var r=c(e,n);if(!(r>=0))throw i(st,new Error(t.tagName+"@"+n));for(var o=e.length-1;r<o;)e[r]=e[++r];if(e.length=o,t){var s=t.ownerDocument;s&&(m(s,t,n),n.ownerElement=null)}}function h(t){if(this._features={},t)for(var e in t)this._features=t[e]}function f(){}function d(t){return"<"==t&&"&lt;"||">"==t&&"&gt;"||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function g(t,e){if(e(t))return!0;if(t=t.firstChild)do if(g(t,e))return!0;while(t=t.nextSibling)}function y(){}function _(t,e,n){t&&t._inc++;var r=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==r&&(e._nsMap[n.prefix?n.localName:""]=n.value)}function m(t,e,n,r){t&&t._inc++;var i=n.namespaceURI;"http://www.w3.org/2000/xmlns/"==i&&delete e._nsMap[n.prefix?n.localName:""]}function v(t,e,n){if(t&&t._inc){t._inc++;var r=e.childNodes;if(n)r[r.length++]=n;else{for(var i=e.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function b(t,e){var n=e.previousSibling,r=e.nextSibling;return n?n.nextSibling=r:t.firstChild=r,r?r.previousSibling=n:t.lastChild=n,v(t.ownerDocument,t),e}function E(t,e,n){var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===et){var i=e.firstChild;if(null==i)return e;var o=e.lastChild}else i=o=e;var s=n?n.previousSibling:t.lastChild;i.previousSibling=s,o.nextSibling=n,s?s.nextSibling=i:t.firstChild=i,null==n?t.lastChild=o:n.previousSibling=o;do i.parentNode=t;while(i!==o&&(i=i.nextSibling));return v(t.ownerDocument||t,t),e.nodeType==et&&(e.firstChild=e.lastChild=null),e}function x(t,e){var n=e.parentNode;if(n){var r=t.lastChild;n.removeChild(e);var r=t.lastChild}var r=t.lastChild;return e.parentNode=t,e.previousSibling=r,e.nextSibling=null,r?r.nextSibling=e:t.firstChild=e,t.lastChild=e,v(t.ownerDocument,t,e),e}function w(){this._nsMap={}}function I(){}function N(){}function C(){}function S(){}function O(){}function P(){}function T(){}function R(){}function L(){}function A(){}function D(){}function M(){}function F(t,e){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,o=r.namespaceURI;if(o&&null==i){var i=r.lookupPrefix(o);if(null==i)var s=[{namespace:o,prefix:null}]}return j(this,n,t,e,s),n.join("")}function k(t,e,n){var r=t.prefix||"",i=t.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=n.length;o--;){var s=n[o];if(s.prefix==r)return s.namespace!=i}return!0}function j(t,e,n,r,i){if(r){if(t=r(t),!t)return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case X:i||(i=[]);var o=(i.length,t.attributes),s=o.length,a=t.firstChild,u=t.tagName;n=V===t.namespaceURI||n,e.push("<",u);for(var c=0;c<s;c++){var l=o.item(c);"xmlns"==l.prefix?i.push({prefix:l.localName,namespace:l.value}):"xmlns"==l.nodeName&&i.push({prefix:"",namespace:l.value})}for(var c=0;c<s;c++){var l=o.item(c);if(k(l,n,i)){var p=l.prefix||"",h=l.namespaceURI,f=p?" xmlns:"+p:" xmlns";e.push(f,'="',h,'"'),i.push({prefix:p,namespace:h})}j(l,e,n,r,i)}if(k(t,n,i)){var p=t.prefix||"",h=t.namespaceURI,f=p?" xmlns:"+p:" xmlns";e.push(f,'="',h,'"'),i.push({prefix:p,namespace:h})}if(a||n&&!/^(?:meta|link|img|br|hr|input)$/i.test(u)){if(e.push(">"),n&&/^script$/i.test(u))for(;a;)a.data?e.push(a.data):j(a,e,n,r,i),a=a.nextSibling;else for(;a;)j(a,e,n,r,i),a=a.nextSibling;e.push("</",u,">")}else e.push("/>");return;case Z:case et:for(var a=t.firstChild;a;)j(a,e,n,r,i),a=a.nextSibling;return;case Y:return e.push(" ",t.name,'="',t.value.replace(/[<&"]/g,d),'"');case H:return e.push(t.data.replace(/[<&]/g,d));case W:return e.push("<![CDATA[",t.data,"]]>");case J:return e.push("<!--",t.data,"-->");case tt:var g=t.publicId,y=t.systemId;if(e.push("<!DOCTYPE ",t.name),g)e.push(' PUBLIC "',g),y&&"."!=y&&e.push('" "',y),e.push('">');else if(y&&"."!=y)e.push(' SYSTEM "',y,'">');else{var _=t.internalSubset;_&&e.push(" [",_,"]"),e.push(">")}return;case K:return e.push("<?",t.target," ",t.data,"?>");case $:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function G(t,e,n){var r;switch(e.nodeType){case X:r=e.cloneNode(!1),r.ownerDocument=t;case et:break;case Y:n=!0}if(r||(r=e.cloneNode(!1)),r.ownerDocument=t,r.parentNode=null,n)for(var i=e.firstChild;i;)r.appendChild(G(t,i,n)),i=i.nextSibling;return r}function U(t,e,n){var r=new e.constructor;for(var i in e){var s=e[i];"object"!=typeof s&&s!=r[i]&&(r[i]=s)}switch(e.childNodes&&(r.childNodes=new o),r.ownerDocument=t,r.nodeType){case X:var a=e.attributes,c=r.attributes=new u,l=a.length;c._ownerElement=r;for(var p=0;p<l;p++)r.setAttributeNode(U(t,a.item(p),!0));break;case Y:n=!0}if(n)for(var h=e.firstChild;h;)r.appendChild(U(t,h,n)),h=h.nextSibling;return r}function B(t,e,n){t[e]=n}function q(t){switch(t.nodeType){case X:case et:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(q(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}var V="http://www.w3.org/1999/xhtml",z={},X=z.ELEMENT_NODE=1,Y=z.ATTRIBUTE_NODE=2,H=z.TEXT_NODE=3,W=z.CDATA_SECTION_NODE=4,$=z.ENTITY_REFERENCE_NODE=5,Q=z.ENTITY_NODE=6,K=z.PROCESSING_INSTRUCTION_NODE=7,J=z.COMMENT_NODE=8,Z=z.DOCUMENT_NODE=9,tt=z.DOCUMENT_TYPE_NODE=10,et=z.DOCUMENT_FRAGMENT_NODE=11,nt=z.NOTATION_NODE=12,rt={},it={},ot=(rt.INDEX_SIZE_ERR=(it[1]="Index size error",1),rt.DOMSTRING_SIZE_ERR=(it[2]="DOMString size error",2),rt.HIERARCHY_REQUEST_ERR=(it[3]="Hierarchy request error",3)),st=(rt.WRONG_DOCUMENT_ERR=(it[4]="Wrong document",4),rt.INVALID_CHARACTER_ERR=(it[5]="Invalid character",5),rt.NO_DATA_ALLOWED_ERR=(it[6]="No data allowed",6),rt.NO_MODIFICATION_ALLOWED_ERR=(it[7]="No modification allowed",7),rt.NOT_FOUND_ERR=(it[8]="Not found",8)),at=(rt.NOT_SUPPORTED_ERR=(it[9]="Not supported",9),rt.INUSE_ATTRIBUTE_ERR=(it[10]="Attribute in use",10));rt.INVALID_STATE_ERR=(it[11]="Invalid state",11),rt.SYNTAX_ERR=(it[12]="Syntax error",12),rt.INVALID_MODIFICATION_ERR=(it[13]="Invalid modification",13),rt.NAMESPACE_ERR=(it[14]="Invalid namespace",14),rt.INVALID_ACCESS_ERR=(it[15]="Invalid access",15);i.prototype=Error.prototype,n(rt,i),o.prototype={length:0,item:function(t){return this[t]||null},toString:function(t,e){for(var n=[],r=0;r<this.length;r++)j(this[r],n,t,e);return n.join("")}},s.prototype.item=function(t){return a(this),this[t]},r(s,o),u.prototype={length:0,item:o.prototype.item,getNamedItem:function(t){for(var e=this.length;e--;){var n=this[e];if(n.nodeName==t)return n}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement)throw new i(at);var n=this.getNamedItem(t.nodeName);return l(this._ownerElement,this,t,n),n},setNamedItemNS:function(t){var e,n=t.ownerElement;if(n&&n!=this._ownerElement)throw new i(at);return e=this.getNamedItemNS(t.namespaceURI,t.localName),l(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return p(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var n=this.getNamedItemNS(t,e);return p(this._ownerElement,this,n),n},getNamedItemNS:function(t,e){for(var n=this.length;n--;){var r=this[n];if(r.localName==e&&r.namespaceURI==t)return r}return null}},h.prototype={hasFeature:function(t,e){var n=this._features[t.toLowerCase()];return!(!n||e&&!(e in n))},createDocument:function(t,e,n){var r=new y;if(r.implementation=this,r.childNodes=new o,r.doctype=n,n&&r.appendChild(n),e){var i=r.createElementNS(t,e);r.appendChild(i)}return r},createDocumentType:function(t,e,n){var r=new P;return r.name=t,r.nodeName=t,r.publicId=e,r.systemId=n,r}},f.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(t,e){return E(this,t,e)},replaceChild:function(t,e){this.insertBefore(t,e),e&&this.removeChild(e)},removeChild:function(t){return b(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return U(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==H&&t.nodeType==H?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;e;){var n=e._nsMap;if(n)for(var r in n)if(n[r]==t)return r;e=e.nodeType==Y?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var n=e._nsMap;if(n&&t in n)return n[t];e=e.nodeType==Y?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return null==e}},n(z,f),n(z,f.prototype),y.prototype={nodeName:"#document",nodeType:Z,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==et){for(var n=t.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,e),n=r}return t}return null==this.documentElement&&t.nodeType==X&&(this.documentElement=t),E(this,t,e),t.ownerDocument=this,t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),b(this,t)},importNode:function(t,e){return G(this,t,e)},getElementById:function(t){var e=null;return g(this.documentElement,function(n){if(n.nodeType==X&&n.getAttribute("id")==t)return e=n,!0}),e},createElement:function(t){var e=new w;e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.childNodes=new o;var n=e.attributes=new u;return n._ownerElement=e,e},createDocumentFragment:function(){var t=new A;return t.ownerDocument=this,t.childNodes=new o,t},createTextNode:function(t){var e=new C;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new S;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new O;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var n=new D;return n.ownerDocument=this,n.tagName=n.target=t,n.nodeValue=n.data=e,n},createAttribute:function(t){var e=new I;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new L;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var n=new w,r=e.split(":"),i=n.attributes=new u;return n.childNodes=new o,n.ownerDocument=this,n.nodeName=e,n.tagName=e,n.namespaceURI=t,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,i._ownerElement=n,n},createAttributeNS:function(t,e){var n=new I,r=e.split(":");return n.ownerDocument=this,n.nodeName=e,n.name=e,n.namespaceURI=t,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=e,n}},r(y,f),w.prototype={nodeType:X,hasAttribute:function(t){return null!=this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var n=this.ownerDocument.createAttribute(t);n.value=n.nodeValue=""+e,this.setAttributeNode(n)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===et?this.insertBefore(t,null):x(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);n&&this.removeAttributeNode(n)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var n=this.getAttributeNodeNS(t,e);return n&&n.value||""},setAttributeNS:function(t,e,n){var r=this.ownerDocument.createAttributeNS(t,e);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new s(this,function(e){var n=[];return g(e,function(r){r===e||r.nodeType!=X||"*"!==t&&r.tagName!=t||n.push(r)}),n})},getElementsByTagNameNS:function(t,e){return new s(this,function(n){var r=[];return g(n,function(i){i===n||i.nodeType!==X||"*"!==t&&i.namespaceURI!==t||"*"!==e&&i.localName!=e||r.push(i)}),r})}},y.prototype.getElementsByTagName=w.prototype.getElementsByTagName,y.prototype.getElementsByTagNameNS=w.prototype.getElementsByTagNameNS,r(w,f),I.prototype.nodeType=Y,r(I,f),N.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(it[ot])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,n){var r=this.data.substring(0,t),i=this.data.substring(t+e);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},r(N,f),C.prototype={nodeName:"#text",nodeType:H,splitText:function(t){var e=this.data,n=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(C,N),S.prototype={nodeName:"#comment",nodeType:J},r(S,N),O.prototype={nodeName:"#cdata-section",nodeType:W},r(O,N),P.prototype.nodeType=tt,r(P,f),T.prototype.nodeType=nt,r(T,f),R.prototype.nodeType=Q,r(R,f),L.prototype.nodeType=$,r(L,f),A.prototype.nodeName="#document-fragment",A.prototype.nodeType=et,r(A,f),D.prototype.nodeType=K,r(D,f),M.prototype.serializeToString=function(t,e,n){return F.call(t,e,n)},f.prototype.toString=F;try{Object.defineProperty&&(Object.defineProperty(s.prototype,"length",{get:function(){return a(this),this.$$length}}),Object.defineProperty(f.prototype,"textContent",{get:function(){return q(this)},set:function(t){switch(this.nodeType){case X:case et:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),B=function(t,e,n){t["$$"+e]=n})}catch(t){}e.DOMImplementation=h,e.XMLSerializer=M},function(t,e,n){"use strict";function r(t){var e=[1/0,1/0,-(1/0),-(1/0)];return i.coordEach(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}var i=n(50);t.exports=r,t.exports.default=r},function(t,e,n){"use strict";function r(t,e,n){if(null!==t)for(var i,o,s,a,u,c,l,p,h=0,f=0,d=t.type,g="FeatureCollection"===d,y="Feature"===d,_=g?t.features.length:1,m=0;m<_;m++){l=g?t.features[m].geometry:y?t.geometry:t,p=!!l&&"GeometryCollection"===l.type,u=p?l.geometries.length:1;for(var v=0;v<u;v++){var b=0,E=0;if(a=p?l.geometries[v]:l,null!==a){c=a.coordinates;var x=a.type;switch(h=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(e(c,f,m,b,E)===!1)return!1;f++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(e(c[i],f,m,b,E)===!1)return!1;f++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(o=0;o<c[i].length-h;o++){if(e(c[i][o],f,m,b,E)===!1)return!1;f++}"MultiLineString"===x&&b++,"Polygon"===x&&E++}"Polygon"===x&&b++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for("MultiPolygon"===x&&(E=0),o=0;o<c[i].length;o++){for(s=0;s<c[i][o].length-h;s++){if(e(c[i][o][s],f,m,b,E)===!1)return!1;f++}E++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(r(a.geometries[i],e,n)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function i(t,e,n,i){var o=n;return r(t,function(t,r,i,s,a){o=0===r&&void 0===n?t:e(o,t,r,i,s,a)},i),o}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&e(t.features[n].properties,n)!==!1;n++);break;case"Feature":e(t.properties,0)}}function s(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 a(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&e(t.features[n],n)!==!1;n++);}function u(t,e,n){var r=n;return a(t,function(t,i){r=0===i&&void 0===n?t:e(r,t,i)}),r}function c(t){var e=[];return r(t,function(t){e.push(t)}),e}function l(t,e){var n,r,i,o,s,a,u,c,l,p,h=0,f="FeatureCollection"===t.type,d="Feature"===t.type,g=f?t.features.length:1;for(n=0;n<g;n++){for(a=f?t.features[n].geometry:d?t.geometry:t,c=f?t.features[n].properties:d?t.properties:{},l=f?t.features[n].bbox:d?t.bbox:void 0,p=f?t.features[n].id:d?t.id:void 0,u=!!a&&"GeometryCollection"===a.type,s=u?a.geometries.length:1,i=0;i<s;i++)if(o=u?a.geometries[i]:a,null!==o)switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(e(o,h,c,l,p)===!1)return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(e(o.geometries[r],h,c,l,p)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}else if(e(null,h,c,l,p)===!1)return!1;h++}}function p(t,e,n){var r=n;return l(t,function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)}),r}function h(t,e){l(t,function(t,n,r,i,o){var s=null===t?null:t.type;switch(s){case null:case"Point":case"LineString":case"Polygon":if(e(b.feature(t,r,{bbox:i,id:o}),n,0)===!1)return!1;return}var a;switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var u=0;u<t.coordinates.length;u++){var c=t.coordinates[u],l={type:a,coordinates:c};if(e(b.feature(l,r),n,u)===!1)return!1}})}function f(t,e,n){var r=n;return h(t,function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)}),r}function d(t,e){h(t,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var a;return r(t,function(r,s,u,c,l){if(void 0===a)return void(a=r);var p=b.lineString([a,r],t.properties);return e(p,n,i,l,o)!==!1&&(o++,void(a=r))})!==!1&&void 0}}})}function g(t,e,n){var r=n,i=!1;return d(t,function(t,o,s,a,u){r=i===!1&&void 0===n?t:e(r,t,o,s,a,u),i=!0}),r}function y(t,e){if(!t)throw new Error("geojson is required");
h(t,function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(e(t,n,r,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(e(b.lineString(o[s],t.properties),n,r,s)===!1)return!1}}})}function _(t,e,n){var r=n;return y(t,function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)}),r}function m(t,e){if(e=e||{},!b.isObject(e))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=u.length+s-1),b.lineString([u[s],u[s+1]],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),b.lineString([u[o][s],u[o][s+1]],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s-1),b.lineString([u[i][s],u[i][s+1]],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s-1),b.lineString([u[i][o][s],u[i][o][s+1]],a,e)}throw new Error("geojson is invalid")}function v(t,e){if(e=e||{},!b.isObject(e))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":return b.point(u,a,e);case"MultiPoint":return i<0&&(i=u.length+i),b.point(u[i],a,e);case"LineString":return s<0&&(s=u.length+s),b.point(u[s],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),b.point(u[o][s],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s),b.point(u[i][s],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s),b.point(u[i][o][s],a,e)}throw new Error("geojson is invalid")}Object.defineProperty(e,"__esModule",{value:!0});var b=n(29);e.coordEach=r,e.coordReduce=i,e.propEach=o,e.propReduce=s,e.featureEach=a,e.featureReduce=u,e.coordAll=c,e.geomEach=l,e.geomReduce=p,e.flattenEach=h,e.flattenReduce=f,e.segmentEach=d,e.segmentReduce=g,e.lineEach=y,e.lineReduce=_,e.findSegment=m,e.findPoint=v},function(t,e,n){"use strict";function r(){for(var t=new i.GeoJSONReader,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=i.UnionOp.union(e,t.read(JSON.stringify(arguments[n].geometry)));var r=new i.GeoJSONWriter;return e=r.write(e),{type:"Feature",geometry:e,properties:arguments[0].properties}}var i=n(141);t.exports=r,t.exports.default=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t){var e=[].concat(i(t));e[1]=Math.max(e[1],-90),e[3]=Math.min(e[3],90);for(var n=0;n<=2;n+=2){for(;e[n]>180;)e[n]-=360;for(;e[n]<-180;)e[n]+=360}return e}function s(t,e){return t.map(function(t){var n=!1;if(t.geometry&&"Polygon"===t.geometry.type)for(var r=0;r<t.geometry.coordinates.length;++r)for(var o=t.geometry.coordinates[r],s=null,a=0;a<o.length;++a){var u=o[a];s&&(u[0]-s[0]<-180&&(u[0]+=360,n=!0),u[0]-s[0]>180&&(u[0]-=360,n=!0)),s=u}else if(e&&t.geometry&&"MultiPolygon"===t.geometry.type){for(var p=0;p<t.geometry.coordinates.length;++p)for(var f=0;f<t.geometry.coordinates[p].length;++f)for(var d=t.geometry.coordinates[p][f],g=0;g<d.length;++g)d[g].reverse();if(2===t.geometry.coordinates.length){n=!0;var y=t.geometry.coordinates[1][0],_=t.geometry.coordinates[0][0],m=Array.from(y,function(t){return t[1]}),v=Array.from(_,function(t){return t[1]}),b=Math.abs(Math.min.apply(Math,i(m))+85.05115)<1e-8||Math.abs(Math.min.apply(Math,i(v))+85.05115)<1e-8||Math.abs(Math.max.apply(Math,i(m))-85.05115)<1e-8||Math.abs(Math.max.apply(Math,i(v))-85.05115)<1e-8;if(!b){n=!0;var E=Array.from(y,function(t){return t[0]}),x=Array.from(_,function(t){return t[0]});if(Math.abs(Math.min.apply(Math,i(E))+180)<1e-8&&Math.abs(Math.max.apply(Math,i(x))-180)<1e-8)for(var w=0;w<y.length;++w)y[w][0]+=360;else if(Math.abs(Math.min.apply(Math,i(x))+180)<1e-8&&Math.abs(Math.max.apply(Math,i(E))-180)<1e-8)for(var I=0;I<_.length;++I)_[I][0]+=360;var N=(0,l.polygon)(t.geometry.coordinates[0]),C=(0,l.polygon)(t.geometry.coordinates[1]),S=(0,c.default)(N,C);t.geometry=S.geometry}}}return t.bbox&&!n||(t.bbox=(0,h.default)(t.geometry)),t})}function a(t,e,n,r,i){var s=i.getDescription(),a=s.getUrl(null,r||null),u={},c=t.time||e.extendedTime||e.time;if(c&&(Array.isArray(c)?(u["time:start"]=c[0],u["time:end"]=c[1]):(u["time:start"]=c,u["time:end"]=c)),e){var l=e.area;if(l){if(Array.isArray(l))u["geo:box"]=o(l);else if(l.geometry){var p=l.geometry;"Point"===p.type&&a.hasParameter("geo:lon")&&a.hasParameter("geo:lat")?(u["geo:lon"]=p.coordinates[0],u["geo:lat"]=p.coordinates[1],a.hasParameter("geo:radius")&&(u["geo:radius"]=0)):u["geo:geometry"]=p}}else e&&e.bbox&&(u["geo:box"]=o(e.bbox))}return n.hasOwnProperty("itemsPerPage")&&a.hasParameter("count")&&(u.count=n.itemsPerPage),n.hasOwnProperty("page")&&(a.hasParameter("startIndex")&&n.hasOwnProperty("itemsPerPage")?u.startIndex=n.page*n.itemsPerPage+a.indexOffset:a.hasParameter("startPage")&&(u.startPage=n.page+a.pageOffset)),Object.keys(t).forEach(function(e){a.hasParameter(e)&&(u[e]=t[e])}),u}Object.defineProperty(e,"__esModule",{value:!0}),e.prepareRecords=s,e.convertFilters=a;var u=n(51),c=r(u),l=n(29),p=n(49),h=r(p)},function(t,e){"use strict";t.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},function(t,e,n){"use strict";var r=n(25),i=Math.max,o=Math.min;t.exports=function(t,e){return t=r(t),t<0?i(t+e,0):o(t,e)}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSearchDescription=void 0;var i=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(65),s=n(2);e.OpenSearchDescription=function(){function t(e){r(this,t),this.shortName=e.shortName,this.description=e.description,this.tags=e.tags,this.contact=e.contact,this.urls=e.urls,this.longName=e.longName,this.images=e.images,this.queries=e.queries,this.developer=e.developer,this.attribution=e.attribution,this.syndicationRight=e.syndicationRight,this.adultContent=e.adultContent,this.language=e.language,this.outputEncoding=e.outputEncoding,this.inputEncoding=e.inputEncoding}return i(t,[{key:"getUrl",value:function(){var t=this.getUrls.apply(this,arguments);return t.length?t[0]:null}},{key:"getUrls",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.urls.filter(function(t){return(0,s.find)(t.relations,function(t){return"results"===t})});return e&&(r=r.filter(function(t){return Array.isArray(e)?e.indexOf(t.type)>-1:t.type===e})),n&&(r=r.filter(function(t){return Array.isArray(n)?n.indexOf(t.method)>-1:t.method===n})),t?r.filter(function(e){return e.isCompatible(t)}):r}},{key:"serialize",value:function(){return{shortName:this.shortName,description:this.description,tags:this.tags,contact:this.contact,urls:this.urls.map(function(t){return t.serialize()}),longName:this.longName,images:this.images,queries:this.queries,developer:this.developer,attribution:this.attribution,syndicationRight:this.syndicationRight,adultContent:this.adultContent,language:this.language,outputEncoding:this.outputEncoding,inputEncoding:this.inputEncoding}}}],[{key:"fromXml",value:function(e){var n=(0,s.parseXml)(e).documentElement,r={shortName:(0,s.getText)(n,"os","ShortName"),description:(0,s.getText)(n,"os","Description"),tags:(0,s.getText)(n,"os","Tags"),contact:(0,s.getText)(n,"os","Contact"),urls:(0,s.getElements)(n,"os","Url").map(function(t){return o.OpenSearchUrl.fromNode(t)}),longName:(0,s.getText)(n,"os","LongName"),images:(0,s.getElements)(n,"os","Image").map(function(t){return{height:parseInt(t.getAttribute("height"),10),width:parseInt(t.getAttribute("width"),10),type:t.getAttribute("type"),url:t.textContent}}),queries:(0,s.getElements)(n,"os","Query").map(function(t){for(var e={role:t.getAttribute("role")},n=0;n<t.attributes.length;++n){var r=t.attributes[n];e[r.name]=r.value}return e}),developer:(0,s.getText)(n,"os","Developer"),attribution:(0,s.getText)(n,"os","Attribution"),syndicationRight:(0,s.getText)(n,"os","SyndicationRight"),adultContent:(0,s.getText)(n,"os","AdultContent"),language:(0,s.getText)(n,"os","Language"),outputEncoding:(0,s.getText)(n,"os","OutputEncoding"),inputEncoding:(0,s.getText)(n,"os","InputEncoding")};return new t(r)}},{key:"deserialize",value:function(e){return new t((0,s.assign)({},e,{urls:e.urls.map(function(t){return o.OpenSearchUrl.deserialize(t)})}))}}]),t}()},function(t,e,n){"use strict";function r(t){try{var e=(0,i.parseXml)(t).documentElement,n=(0,i.getFirstElement)(e,e.namespaceURI,"Exception");if(!n)return null;var r=((0,i.getText)(n,n.namespaceURI,"ExceptionText")||"").trim(),o=n.getAttribute("exceptionCode");return new Error(r.length?r:o)}catch(t){return null}}Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorFromXml=r;var i=n(2)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":s(e))&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":s(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Object.defineProperty(e,"__esModule",{value:!0}),e.AtomFormat=void 0;var a=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(2),c=n(30);e.AtomFormat=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),a(e,[{key:"parse",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.extraFields,i=void 0===r?void 0:r,o=n.namespaces,s=void 0===o?void 0:o,a=(0,u.parseXml)(t).documentElement,c=(0,u.getElements)(a,"atom","entry").map(function(t){var n={id:(0,u.getText)(t,"dc","identifier")||(0,u.getText)(t,"atom","id"),properties:{title:(0,u.getText)(t,"atom","title"),updated:new Date((0,u.getText)(t,"atom","updated")),content:(0,u.getText)(t,"atom","content"),summary:(0,u.getText)(t,"atom","summary"),links:e.parseLinks(t),media:e.parseMedia(t)}},r=e.parseBox(t);r&&(n.bbox=r);var o=e.parseGeometry(t);o&&(n.geometry=o,n.bbox||(n.bbox=e.getBoxFromGeometry(o)));var a=e.parseDate(t);a&&(n.properties.time=a);var c=e.parseEOP(t);c&&(n.properties.eop=c);var l=e.parseS3Path(t);return l&&(n.properties.s3Path=l),i&&e.parseExtraFields(t,i,s,n),n});return{totalResults:parseInt((0,u.getText)(a,"os","totalResults"),10),startIndex:parseInt((0,u.getText)(a,"os","startIndex"),10),itemsPerPage:parseInt((0,u.getText)(a,"os","itemsPerPage"),10),query:{},links:this.parseLinks(a),records:c}}}]),e}(c.BaseFeedFormat)},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.GeoJSONFormat=void 0;var i=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=n(2);e.GeoJSONFormat=function(){function t(){r(this,t)}return i(t,[{key:"parse",value:function(t){var e=JSON.parse(t),n=e.features.map(function(t){return!Object.prototype.hasOwnProperty.call(t,"id")&&Object.prototype.hasOwnProperty.call(t.properties,"id")?(0,o.assign)({id:t.properties.id},t):t});return{records:n}}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":s(e))&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":s(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Object.defineProperty(e,"__esModule",{value:!0}),e.RSSFormat=void 0;var a=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=n(2),c=n(30);e.RSSFormat=function(t){function e(){return r(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return o(e,t),a(e,[{key:"parse",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.extraFields,i=void 0===r?void 0:r,o=n.namespaces,s=void 0===o?void 0:o,a=(0,u.parseXml)(t).documentElement,c=(0,u.getFirstElement)(a,null,"channel"),l=(0,u.getElements)(c,null,"item").map(function(t){var n={id:(0,u.getText)(t,"dc","identifier")||(0,u.getText)(t,null,"guid"),properties:{title:(0,u.getText)(t,null,"title"),content:(0,u.getText)(t,null,"description"),summary:(0,u.getText)(t,null,"description"),links:e.parseLinks(t),media:e.parseMedia(t)}},r=e.parseBox(t);r&&(n.bbox=r);var o=e.parseGeometry(t);o&&(n.geometry=o,n.bbox||(n.bbox=e.getBoxFromGeometry(o)));var a=e.parseDate(t);a&&(n.properties.time=a);var c=e.parseEOP(t);c&&(n.properties.eop=c);var l=e.parseS3Path(t);return l&&(n.properties.s3Path=l),i&&e.parseExtraFields(t,i,s,n),n});return{totalResults:parseInt((0,u.getText)(c,"os","totalResults"),10),startIndex:parseInt((0,u.getText)(c,"os","startIndex"),10),itemsPerPage:parseInt((0,u.getText)(c,"os","itemsPerPage"),10),query:{},links:this.parseLinks(a),records:l}}}]),e}(c.BaseFeedFormat)},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw o}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();e.SuggestionsJSONFormat=function(){function t(){n(this,t)}return i(t,[{key:"parse",value:function(t){var e=JSON.parse(t),n=r(e,4),i=n[1],o=n[2],s=n[3];return i.map(function(t,e){return{completion:t,description:o&&o[e],url:s&&s[e]}})}}]),t}()},function(t,e,n){"use strict";function r(t){return s.OpenSearchService.discover(t)}function i(t){return s.OpenSearchService.fromXml(t)}function o(t){return s.OpenSearchService.deserialize(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.registerFormat=e.config=void 0,e.discover=r,e.fromXml=i,e.deserialize=o;var s=n(64),a=n(11),u=n(16);e.config=a.config,e.registerFormat=u.registerFormat},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":l(e))&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":l(e)));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){return t&&"function"==typeof t.cancel&&!t.isCancelled()}function c(t){var e=t[0],n=t.reduce(function(t,e){return t.concat(e.records)},[]);return{totalResults:e.totalResults,startIndex:e.startIndex,itemsPerPage:e.itemsPerPage,records:n}}var 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};Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSearchPaginator=e.PagedSearchProgressEmitter=void 0;var p=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),h=n(136),f=r(h),d=n(31),g=n(2),y=n(11),_=function(t){function e(){return o(this,e),s(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return a(e,t),e}(f.default);e.PagedSearchProgressEmitter=_;e.OpenSearchPaginator=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,e);var s=r.useCache,a=void 0===s||s,u=r.preferredItemsPerPage,c=void 0===u?void 0:u,l=r.preferStartIndex,p=void 0===l||l,h=r.baseOffset,f=void 0===h?0:h,d=r.totalResults,g=void 0===d?void 0:d,y=i(r,["useCache","preferredItemsPerPage","preferStartIndex","baseOffset","totalResults"]);this._url=t,this._parameters=n,this._cache=a?{}:null,this._preferredItemsPerPage=c,this._preferStartIndex=p,this._baseOffset=f,this._totalResults=g,this._searchOptions=y}return p(e,[{key:"fetchPage",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=(0,g.assign)({},this._parameters),i=this.getActualPageSize();return i&&n?r.count=Math.min(n,i):i?r.count=i:n&&(r.count=n),this._preferStartIndex?"undefined"==typeof i?r.startIndex=this._baseOffset+this._url.indexOffset:r.startIndex=this._baseOffset+i*e+this._url.indexOffset:r.startPage=e+this._url.pageOffset,(0,d.search)(this._url,r,this._searchOptions).then(function(e){return t._totalResults=e.totalResults,!t._serverItemsPerPage&&e.itemsPerPage&&(t._serverItemsPerPage=e.itemsPerPage),e})}},{key:"fetchAllPages",value:function(){var t=this;return this.fetchPage().then(function(e){for(var n=t.getPageCount(),r=[e],i=1;i<n;++i)r.push(t.fetchPage(i));var o=(0,y.config)(),s=o.Promise;return s.all(r)})}},{key:"fetchAllRecords",value:function(){return this.fetchAllPages().then(function(t){var e=t[0],n=t.reduce(function(t,e){return t.concat(e.records)},[]);return{totalResults:e.totalResults,startIndex:e.startIndex,itemsPerPage:e.itemsPerPage,records:n}})}},{key:"fetchFirstRecords",value:function(e){var n=this;return this.fetchPage(0,e).then(function(r){if(r.totalResults<=r.itemsPerPage)return r;for(var i=[r],o=Math.min(e,r.totalResults-r.startIndex+n._url.indexOffset),s=r.itemsPerPage?Math.ceil(o/r.itemsPerPage):1,a=1;a<s;++a){var u=r.itemsPerPage;r.itemsPerPage*(a+1)>o&&(u=o-r.itemsPerPage*a),i.push(n.fetchPage(a,u))}return t.all(i).then(function(t){return c(t)})})}},{key:"searchFirstRecords",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=new _,o=null,s=null;this._preferredItemsPerPage&&this._totalResults&&"undefined"!=typeof n&&0!==n?(o=t.resolve({itemsPerPage:this._preferredItemsPerPage,records:[],totalResults:this._totalResults,startIndex:this._baseOffset}),s=0):(o=this.fetchPage(0,n),s=1);var a=[o];i.on("cancel",function(){a.forEach(function(t){u(t)&&t.cancel()})});var l=!1,p=function(t){return l=!0,i.emit("error",t),t};return o.catch(p).then(function(o){if(l)throw o;var u=[];1===s&&u.push(t.resolve(o));for(var h=n?Math.min(n,o.totalResults-o.startIndex+e._url.indexOffset):o.totalResults,f=o.itemsPerPage?Math.ceil(h/o.itemsPerPage):1,d=s;d<f;++d){var g=o.itemsPerPage;o.itemsPerPage*(d+1)>h&&(g=h-o.itemsPerPage*d),u.push(e.fetchPage(d,g))}a=u;var y=Array(a.length);r?!function(){var t=0,e=Array.from(a),n=function n(r){if(!l){y[t]=r,t+=1,i.emit("page",r);var o=e.shift();o?o.then(n,p):i.emit("success",c(y))}};e.shift().then(n,p)}():!function(){var t=0;a.forEach(function(e,n){e.then(function(e){l||(t+=1,y[n]=e,t===a.length&&i.emit("success",c(y)))},p)})}()}),i}},{key:"getActualPageSize",value:function(){if(this._preferredItemsPerPage&&this._serverItemsPerPage)return Math.min(this._preferredItemsPerPage,this._serverItemsPerPage);if(this._serverItemsPerPage)return this._serverItemsPerPage;if(this._preferredItemsPerPage)return this._preferredItemsPerPage;var t=this._url.getParameter("count");if(t){if("undefined"!=typeof t.maxExclusive)return t.maxExclusive-1;if(t.maxInclusive)return t.maxInclusive}}},{key:"getPageCount",value:function(){var t=this.getActualPageSize();if(!this._totalResults)return this._totalResults;if(t)return Math.ceil(this._totalResults/t)}}]),e}()}).call(e,n(4))},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){var e=p.exec(t);return e?e[1]:null}function o(t){return"?"!==p.exec(t)[2]}function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=e?new RegExp(e):null;if(t instanceof Date){var r=t.toISOString(),i=r;return!n||n.test(i)?i:(i=r.split(".")[0]+"Z",!n||n.test(i)?i:(i=r.slice(0,-1),!n||n.test(i)?i:(i=r.split(".")[0],!n||n.test(i)?i:r)))}return t}function a(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=function(t){return s(t,n)};if("string"==typeof t)return t;if("number"==typeof t)return t.toString();if(e&&t instanceof Date)return r(t);if(Array.isArray(t))return e?"{"+t.map(r).join(",")+"}":"{"+t.join(",")+"}";var i=null,o=null;return Object.prototype.hasOwnProperty.call(t,"min")?i="["+(e?r(t.min):t.min):Object.prototype.hasOwnProperty.call(t,"minExclusive")&&(i="]"+(e?r(t.minExclusive):t.minExclusive)),Object.prototype.hasOwnProperty.call(t,"max")?o=(e?r(t.max):t.max)+"]":Object.prototype.hasOwnProperty.call(t,"maxExclusive")&&(o=(e?r(t.maxExclusive):t.maxExclusive)+"["),null!==i&&null!==o?i+","+o:null!==i?i:o}function u(t,e,n){switch(e){case"time:start":case"time:end":return s(t,n);case"geo:box":if(Array.isArray(t))return t.join(",");break;case"geo:geometry":return(0,l.toWKT)(t);case"eo:orbitNumber":case"eo:track":case"eo:frame":case"eo:cloudCover":case"eo:snowCover":case"eo:startTimeFromAscendingNode":case"eo:completionTimeFromAscendingNode":case"eo:illuminationAzimuthAngle":case"eo:illuminationZenithAngle":case"eo:illuminationElevationAngle":case"eo:minimumIncidenceAngle":case"eo:maximumIncidenceAngle":case"eo:dopplerFrequency":case"eo:incidenceAngleVariation":return a(t,!1,n);case"eo:availabilityTime":case"eo:creationDate":case"eo:modificationDate":case"eo:processingDate":return a(t,!0,n)}return t}Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSearchParameter=void 0;var c=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=n(2),p=/{([a-zA-Z:]+)([?]?)}/,h=/{([a-zA-Z:]+)([?]?)}/g;e.OpenSearchParameter=function(){function t(e,n,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:void 0,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:void 0;r(this,t),this._type=e,this._name=n,this._mandatory=i,this._options=o,this._minExclusive=s,this._maxExclusive=a,this._minInclusive=u,this._maxInclusive=c,this._pattern=l}return c(t,[{key:"combined",value:function(e){return new t(this.type,this.name,(0,l.isNullOrUndefined)(this.mandatory)?e.mandatory:this.mandatory,(0,l.isNullOrUndefined)(this.options)?e.options:this.options,(0,l.isNullOrUndefined)(this.minExclusive)?e.minExclusive:this.minExclusive,(0,l.isNullOrUndefined)(this.maxExclusive)?e.maxExclusive:this.maxExclusive,(0,l.isNullOrUndefined)(this.minInclusive)?e.minInclusive:this.minInclusive,(0,l.isNullOrUndefined)(this.maxInclusive)?e.maxInclusive:this.maxInclusive,(0,l.isNullOrUndefined)(this.pattern)?e.pattern:this.pattern)}},{key:"serializeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=this.type;return this.isMulti&&e?Array.isArray(t)?u(t[this.types.indexOf(e)],e,this.pattern):Object.prototype.hasOwnProperty.call(t,e)?u(t[e],e,this.pattern):u(t,e,this.pattern):u(t,n,this.pattern)}},{key:"serialize",value:function(){var t={type:this._type,name:this._name,mandatory:this._mandatory,options:this._options,pattern:this._pattern};return"undefined"!=typeof this._minExclusive&&(t.minExclusive=this._minExclusive),"undefined"!=typeof this._maxExclusive&&(t.maxExclusive=this._maxExclusive),"undefined"!=typeof this._minInclusive&&(t.minInclusive=this._minInclusive),"undefined"!=typeof this._maxInclusive&&(t.maxInclusive=this._maxInclusive),t}},{key:"type",get:function(){return this._type}},{key:"name",get:function(){return this._name}},{key:"mandatory",get:function(){return this._mandatory}},{key:"options",get:function(){return this._options}},{key:"minExclusive",get:function(){return this._minExclusive}},{key:"maxExclusive",get:function(){return this._maxExclusive}},{key:"minInclusive",get:function(){return this._minInclusive}},{key:"maxInclusive",get:function(){return this._maxInclusive}},{key:"pattern",get:function(){return this._pattern}},{key:"isMulti",get:function(){return Array.isArray(this.type)}}],[{key:"fromNode",value:function(e){var n=i(e.getAttribute("value")),r=e.getAttribute("name"),o=e.hasAttribute("minimum")?"0"!==e.getAttribute("minimum"):void 0,s=e.hasAttribute("minExclusive")?parseInt(e.getAttribute("minExclusive"),10):void 0,a=e.hasAttribute("maxExclusive")?parseInt(e.getAttribute("maxExclusive"),10):void 0,u=e.hasAttribute("minInclusive")?parseInt(e.getAttribute("minInclusive"),10):void 0,c=e.hasAttribute("maxInclusive")?parseInt(e.getAttribute("maxInclusive"),10):void 0,p=e.hasAttribute("pattern")?e.getAttribute("pattern"):void 0,h=(0,l.getElements)(e,"parameters","Option"),f=void 0;return h.length&&(f=h.map(function(t){return{label:t.getAttribute("label"),value:t.getAttribute("value")}})),new t(n,r,o,f,s,a,u,c,p)}},{key:"fromKeyValuePair",value:function(e,n){var r=i(n);if(r){var s=n.match(h);if(s.length>1){var a=s.map(i),u=s.map(o).reduce(function(t,e){return t||e},!1);return new t(a,e,u)}return new t(r,e,o(n))}return null}},{key:"deserialize",value:function(e){return new t(e.type,e.name,e.mandatory,e.options,e.minExclusive,e.maxExclusive,e.minInclusive,e.maxInclusive,e.pattern)}}]),t}()},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSearchService=void 0;var i=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();n(45);var o=n(55),s=n(62),a=n(31),u=n(16),c=n(2),l=n(11);e.OpenSearchService=function(){function t(e){r(this,t),this.descriptionDocument=e}return i(t,[{key:"getDescription",value:function(){return this.descriptionDocument}},{key:"getUrl",value:function(t,e,n){var r=this.descriptionDocument.getUrl(t,e,n);if(!r){var i=this.descriptionDocument.getUrls(null,e,n);if(1===i.length){var o=i[0].getMissingMandatoryParameters(t).map(function(t){return'"'+t.type+'"'}),s=i[0].getUnsupportedParameterKeys(t).map(function(t){return'"'+t+'"'}),a=[];throw o.length&&a.push("missing parameters: "+o.join(", ")),s.length&&a.push("unsupported parameters keys: "+s.join(", ")),new Error("No matching URL found, "+a.join(" and "))}throw new Error("No URL found for type '"+e+"' and the given parameters.")}return r}},{key:"createSearchRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=null;if(e)r=this.getUrl(t,e,n);else{for(var i=(0,u.getSupportedTypes)(),o=0;o<i.length&&(r=this.descriptionDocument.getUrl(t,i[o],n),!r||!r.isCompatible(t));++o);if(!r)throw new Error("No compatible URL found.")}return(0,a.createBaseRequest)(r,t)}},{key:"search",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.type,r=void 0===n?null:n,i=e.method,o=void 0===i?null:i,s=null;if(r)s=this.getUrl(t,r,o);else{for(var c=(0,u.getSupportedTypes)(),l=0;l<c.length&&(s=this.descriptionDocument.getUrl(t,c[l],o),!s||!s.isCompatible(t));++l);if(!s)throw new Error("No compatible URL found.")}return(0,a.search)(s,t,e)}},{key:"getSuggestions",value:function(t){
var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r="application/x-suggestions+json",i=void 0;try{i=this.getUrl(t,r,e)}catch(t){var o=(0,l.config)(),s=o.Promise;return s.reject(new Error("No suggestion URL found."))}return(0,a.search)(i,t,r,!1,n)}},{key:"getPaginator",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.type,r=void 0===n?null:n,i=e.method,o=void 0===i?null:i;return new s.OpenSearchPaginator(this.getUrl(t,r,o),t,e)}},{key:"serialize",value:function(){return{description:this.descriptionDocument.serialize()}}}],[{key:"discover",value:function(e){var n=(0,l.config)(),r=n.useXHR,i=n.Promise;return r?new i(function(n,r,i){var o=(0,c.createXHR)(e);o.onload=function(){try{n(t.fromXml(o.responseText))}catch(t){r(t)}},o.onerror=function(){r(new TypeError("Failed to fetch"))},i&&"function"==typeof i&&i(function(){o.abort()})}):(0,c.fetchAndCheck)(e).then(function(t){return t.text()}).then(function(e){return t.fromXml(e)})}},{key:"fromXml",value:function(e){return new t(o.OpenSearchDescription.fromXml(e))}},{key:"deserialize",value:function(e){return new t(o.OpenSearchDescription.deserialize(e.description))}}]),t}()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(Object.prototype.hasOwnProperty.call(t,e.name))return!1;if(e.isMulti){for(var n=e.type,r=0;r<n.length;++r){var i=n[r];if(Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}return!Object.prototype.hasOwnProperty.call(t,e.type)}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSearchUrl=void 0;var a="function"==typeof Symbol&&"symbol"===s(Symbol.iterator)?function(t){return"undefined"==typeof t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":"undefined"==typeof t?"undefined":s(t)},u=function(){function t(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)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=n(47),l=r(c),p=n(2),h=n(63);e.OpenSearchUrl=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"GET",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"application/x-www-form-urlencoded",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=this,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:["results"];i(this,t),this._type=e,this._url=n,this._method=o,this._enctype=s,this._indexOffset=a,this._pageOffset=c,this._relations=l,this._parameters=r,this._parametersByName={},this._parametersByType={},this._multiParameters={},r.forEach(function(t){var e=t.type;if(Array.isArray(e))for(var n=0;n<e.length;++n)u._parametersByType[e[n]]=t;else u._parametersByType[e]=t;u._parametersByName[t.name]=t})}return u(t,[{key:"hasParameter",value:function(t){return Object.prototype.hasOwnProperty.call(this._parametersByType,t)}},{key:"getParameter",value:function(t){return this._parametersByType[t]}},{key:"isCompatible",value:function(t){var e=this,n=!0;return Object.keys(t).forEach(function(t){Object.prototype.hasOwnProperty.call(e._parametersByType,t)||Object.prototype.hasOwnProperty.call(e._parametersByName,t)||(n=!1)}),!!n&&!this.getMissingMandatoryParameters(t).length}},{key:"getMissingMandatoryParameters",value:function(t){return this.parameters.filter(function(t){return t.mandatory}).filter(function(e){return o(t,e)})}},{key:"getMissingOptionalParameters",value:function(t){return this.parameters.filter(function(t){return!t.mandatory}).filter(function(e){return o(t,e)})}},{key:"getUnsupportedParameterKeys",value:function(t){var e=this;return Object.keys(t).filter(function(t){return!Object.prototype.hasOwnProperty.call(e._parametersByType,t)&&!Object.prototype.hasOwnProperty.call(e._parametersByName,t)})}},{key:"serializeValues",value:function(t){var e=this;Object.keys(t).forEach(function(t){if(!Object.prototype.hasOwnProperty.call(e._parametersByType,t)&&!Object.prototype.hasOwnProperty.call(e._parametersByName,t))throw new Error("Invalid parameter '"+t+"'.")});var n=this.getMissingMandatoryParameters(t).map(function(t){return t.type});if(n.length)throw new Error("Missing mandatory parameters: "+n.join(", "));for(var r=[],i=this.parameters,o=0;o<i.length;++o){var s=i[o];if(s.isMulti)for(var u=s.type,c=0;c<u.length;++c){var l=u[c],p=void 0;p=Array.isArray(t[s.name])||"object"===a(t[s.name])?s.serializeValue(t[s.name],l):s.serializeValue(t,l),r.push([s.name,l,p])}else{var h=void 0;h=Object.prototype.hasOwnProperty.call(t,s.name)?s.serializeValue(t[s.name]):Object.prototype.hasOwnProperty.call(t,s.type)?s.serializeValue(t[s.type]):"",r.push([s.name,s.type,h])}}return r}},{key:"serialize",value:function(){return{type:this._type,url:this._url,method:this._method,enctype:this._enctype,indexOffset:this._indexOffset,pageOffset:this._pageOffset,relations:this._relations,parameters:this._parameters.map(function(t){return t.serialize()})}}},{key:"type",get:function(){return this._type}},{key:"url",get:function(){return this._url}},{key:"method",get:function(){return this._method}},{key:"enctype",get:function(){return this._enctype}},{key:"indexOffset",get:function(){return this._indexOffset}},{key:"pageOffset",get:function(){return this._pageOffset}},{key:"relations",get:function(){return this._relations}},{key:"parameters",get:function(){return this._parameters}}],[{key:"fromNode",value:function(e){var n=(0,p.getElements)(e,"parameters","Parameter"),r=(0,p.getAttributeNS)(e,"parameters","method"),i=(0,p.getAttributeNS)(e,"parameters","enctype"),o=e.hasAttribute("indexOffset")?parseInt(e.getAttribute("indexOffset"),10):1,s=e.hasAttribute("pageOffset")?parseInt(e.getAttribute("pageOffset"),10):1,a=e.getAttribute("rel"),u=a&&""!==a?a.split(" "):void 0,c=(0,l.default)(e.getAttribute("template"),!0),f=Object.keys(c.query).map(function(t){return h.OpenSearchParameter.fromKeyValuePair(t,c.query[t])}).filter(function(t){return t}),d=n.map(h.OpenSearchParameter.fromNode),g=d.filter(function(t){return!(0,p.find)(f,function(e){return t.name===e.name})}).map(function(t){return t._mandatory="undefined"==typeof t.mandatory||t.mandatory,t}),y=f.map(function(t){var e=(0,p.find)(d,function(e){return t.name===e.name});return e?t.combined(e):t}).concat(g);return new t(e.getAttribute("type"),e.getAttribute("template"),y,r,i,o,s,u)}},{key:"fromTemplateUrl",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/x-www-form-urlencoded",o=(0,l.default)(n,!0),s=Object.keys(o.query).map(function(t){return h.OpenSearchParameter.fromKeyValuePair(t,o.query[t])}).filter(function(t){return t});return new t(e,n,s,r,i)}},{key:"deserialize",value:function(e){return new t(e.type,e.url,e.parameters.map(function(t){return h.OpenSearchParameter.deserialize(t)}),e.method,e.enctype,e.indexOffset,e.pageOffset,e.relations)}}]),t}()},function(t,e){"use strict";t.exports=function(t){function e(t){var e=new n(t),r=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),r}var n=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},function(t,e,n){(function(e){"use strict";function r(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new p(16),this._normalQueue=new p(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=l}function i(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function o(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function s(t){this._normalQueue._pushOne(t),this._queueTick()}function a(t){for(;t.length()>0;)u(t)}function u(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var n=t.shift(),r=t.shift();e.call(n,r)}}var c;try{throw new Error}catch(t){c=t}var l=n(88),p=n(85),h=n(1);r.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){h.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,n){n?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")}},h.hasDevTools?(r.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?i.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},r.prototype.invoke=function(t,e,n){this._trampolineEnabled?o.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=s),r.prototype._drainQueues=function(){a(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,a(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},t.exports=r,t.exports.firstLineError=c}).call(e,n(9))},function(t,e){"use strict";t.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var c=n(o),l=new t(e);l._propagateFrom(this,1);var p=this._target();if(l._setBoundTo(c),c instanceof t){var h={promiseRejectionQueued:!1,promise:l,target:p,bindingPromise:c};p._then(e,s,void 0,l,h),c._then(a,u,void 0,l,h),l._setOnCancel(c)}else l._resolveCallback(p);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=this._bitField&-2097153},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}t.exports=function(t){function e(e,n){var r;if(null!=e&&(r=e[n]),"function"!=typeof r){var i="Object "+l.classString(e)+" has no method '"+l.toString(n)+"'";throw new t.TypeError(i)}return r}function r(t){var n=this.pop(),r=e(t,n);return r.apply(t,this)}function s(t){return t[this]}function a(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}var u,c,l=n(1),p=l.canEvaluate,h=l.isIdentifier,f=function(t){return new Function("ensureMethod","                                    \n\t        return function(obj) {                                               \n\t            'use strict'                                                     \n\t            var len = this.length;                                           \n\t            ensureMethod(obj, 'methodName');                                 \n\t            switch(len) {                                                    \n\t                case 1: return obj.methodName(this[0]);                      \n\t                case 2: return obj.methodName(this[0], this[1]);             \n\t                case 3: return obj.methodName(this[0], this[1], this[2]);    \n\t                case 0: return obj.methodName();                             \n\t                default:                                                     \n\t                    return obj.methodName.apply(obj, this);                  \n\t            }                                                                \n\t        };                                                                   \n\t        ".replace(/methodName/g,t))(e)},d=function(t){return new Function("obj","                                             \n\t        'use strict';                                                        \n\t        return obj.propertyName;                                             \n\t        ".replace("propertyName",t))},g=function(t,e,n){var r=n[t];if("function"!=typeof r){if(!h(t))return null;if(r=e(t),n[t]=r,n[" size"]++,n[" size"]>512){for(var i=Object.keys(n),o=0;o<256;++o)delete n[i[o]];n[" size"]=i.length-256}}return r};u=function(t){return g(t,f,i)},c=function(t){return g(t,d,o)},t.prototype.call=function(t){for(var e=arguments.length,n=new Array(Math.max(e-1,0)),i=1;i<e;++i)n[i-1]=arguments[i];if(p){var o=u(t);if(null!==o)return this._then(o,void 0,void 0,n,void 0)}return n.push(t),this._then(r,void 0,void 0,n,void 0)},t.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=a;else if(p){var r=c(t);e=null!==r?r:s}else e=s;return this._then(e,void 0,void 0,t,void 0)}}},function(t,e,n){"use strict";t.exports=function(t,e,r,i){var o=n(1),s=o.tryCatch,a=o.errorObj,u=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);else if(void 0!==t)if("function"==typeof t){if(!e){var r=s(t).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),u.throwLater(r.e))}}else t._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,t)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},function(t,e){"use strict";t.exports=function(t){function e(){this._trace=new e.CapturedTrace(r())}function n(){if(i)return new e}function r(){var t=o.length-1;if(t>=0)return o[t]}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,u=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=u,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},function(t,e,n){(function(e){"use strict";t.exports=function(t,r){function i(t,e){return{promise:e}}function o(){return!1}function s(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+U.toString(t));r._attachCancellationCallback(t)})}catch(t){return t}}function a(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?U.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function u(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function p(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function f(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function d(){this._trace=new A(this._peekContext())}function g(t,e){if(q(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=N(t);U.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),U.notEnumerableProp(t,"__stackCleaned__",!0)}}}function y(){this._trace=void 0}function _(t,e,n,r,i){if(void 0===t&&null!==e&&J){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),u=w(a),c=u.length-1;c>=0;--c){var l=u[c];if(!z.test(l)){var p=l.match(X);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(u.length>0)for(var h=u[0],c=0;c<a.length;++c)if(a[c]===h){c>0&&(s="\n"+a[c-1]);break}}var f="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(f,!0,e)}}function m(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),v(n)}function v(e,n,r){if(ut.warnings){var i,o=new G(e);if(n)r._attachExtraTrace(o);else if(ut.longStackTraces&&(i=t._peekContext()))i.attachExtraTrace(o);else{var s=N(o);o.stack=s.message+"\n"+s.stack.join("\n")}rt("warning",o)||C(o,"",!0)}}function b(t,e){for(var n=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");return n<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n")}function E(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function x(t){for(var e=t[0],n=1;n<t.length;++n){for(var r=t[n],i=e.length-1,o=e[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=r[a];if(e[i]!==u)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],i="    (No stack trace)"===r||Y.test(r),o=i&&ot(r);i&&!o&&(W&&" "!==r.charAt(0)&&(r="    "+r),e.push(r))}return e}function I(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var r=e[n];if("    (No stack trace)"===r||Y.test(r))break}return n>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function N(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?I(t):["    (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}function C(t,e,n){if("undefined"!=typeof console){var r;if(U.isObject(t)){var i=t.stack;r=e+H(i,t)}else r=e+String(t);"function"==typeof F?F(r,n):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}}function S(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(t){j.throwLater(t)}"unhandledRejection"===t?rt(t,n,r)||i||C(n,"Unhandled rejection "):rt(t,r)}function O(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():U.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+P(e)+">, no stack trace)"}function P(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function T(){return"function"==typeof at}function R(t){var e=t.match(st);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function L(t,e){if(T()){for(var n,r,i=(t.stack||"").split("\n"),o=(e.stack||"").split("\n"),s=-1,a=-1,u=0;u<i.length;++u){var c=R(i[u]);if(c){n=c.fileName,s=c.line;break}}for(var u=0;u<o.length;++u){var c=R(o[u]);if(c){r=c.fileName,a=c.line;break}}s<0||a<0||!n||!r||n!==r||s>=a||(ot=function(t){if(V.test(t))return!0;var e=R(t);return!!(e&&e.fileName===n&&s<=e.line&&e.line<=a)})}}function A(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);at(this,A),e>32&&this.uncycle()}var D,M,F,k=t._getDomain,j=t._async,G=n(3).Warning,U=n(1),B=n(5),q=U.canAttachTrace,V=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,z=/\((?:timers\.js):\d+:\d+\)/,X=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,Y=null,H=null,W=!1,$=!(0==U.env("BLUEBIRD_DEBUG")||!U.env("BLUEBIRD_DEBUG")&&"development"!==U.env("NODE_ENV")),Q=!(0==U.env("BLUEBIRD_WARNINGS")||!$&&!U.env("BLUEBIRD_WARNINGS")),K=!(0==U.env("BLUEBIRD_LONG_STACK_TRACES")||!$&&!U.env("BLUEBIRD_LONG_STACK_TRACES")),J=0!=U.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(Q||!!U.env("BLUEBIRD_W_FORGOTTEN_RETURN"));t.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=t._bitField&-1048577|524288},t.prototype._ensurePossibleRejectionHandled=function(){if(0===(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},t.prototype._notifyUnhandledRejectionIsHandled=function(){S("rejectionHandled",D,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),S("unhandledRejection",M,t,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(t,e,n){return v(t,e,n||this)},t.onPossiblyUnhandledRejection=function(t){var e=k();M="function"==typeof t?null===e?t:U.domainBind(e,t):void 0},t.onUnhandledRejectionHandled=function(t){var e=k();D="function"==typeof t?null===e?t:U.domainBind(e,t):void 0};var Z=function(){};t.longStackTraces=function(){if(j.haveItemsQueued()&&!ut.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");if(!ut.longStackTraces&&T()){var e=t.prototype._captureStackTrace,n=t.prototype._attachExtraTrace,i=t.prototype._dereferenceTrace;ut.longStackTraces=!0,Z=function(){if(j.haveItemsQueued()&&!ut.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=n,t.prototype._dereferenceTrace=i,r.deactivateLongStackTraces(),j.enableTrampoline(),ut.longStackTraces=!1},t.prototype._captureStackTrace=d,t.prototype._attachExtraTrace=g,t.prototype._dereferenceTrace=y,r.activateLongStackTraces(),j.disableTrampolineIfNecessary()}},t.hasLongStackTraces=function(){return ut.longStackTraces&&T()};var tt=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return U.global.dispatchEvent(t),function(t,e){var n={detail:e,cancelable:!0};B.defineProperty(n,"promise",{value:e.promise}),B.defineProperty(n,"reason",{value:e.reason});var r=new CustomEvent(t.toLowerCase(),n);return!U.global.dispatchEvent(r)}}if("function"==typeof Event){var t=new Event("CustomEvent");return U.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,B.defineProperty(n,"promise",{value:e.promise}),B.defineProperty(n,"reason",{value:e.reason}),!U.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),U.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!U.global.dispatchEvent(n)}}catch(t){}return function(){return!1}}(),et=function(){return U.isNode?function(){return e.emit.apply(e,arguments)}:U.global?function(t){var e="on"+t.toLowerCase(),n=U.global[e];return!!n&&(n.apply(U.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),nt={promiseCreated:i,promiseFulfilled:i,promiseRejected:i,promiseResolved:i,promiseCancelled:i,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:i},rt=function(t){var e=!1;try{e=et.apply(null,arguments)}catch(t){j.throwLater(t),e=!0}var n=!1;try{n=tt(t,nt[t].apply(null,arguments))}catch(t){j.throwLater(t),n=!0}return n||e};t.config=function(e){if(e=Object(e),"longStackTraces"in e&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&Z()),"warnings"in e){var n=e.warnings;ut.warnings=!!n,J=ut.warnings,U.isObject(n)&&"wForgottenReturn"in n&&(J=!!n.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!ut.cancellation){if(j.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=l,t.prototype._propagateFrom=p,t.prototype._onCancel=u,t.prototype._setOnCancel=c,t.prototype._attachCancellationCallback=a,t.prototype._execute=s,it=p,ut.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!ut.monitoring?(ut.monitoring=!0,t.prototype._fireEvent=rt):!e.monitoring&&ut.monitoring&&(ut.monitoring=!1,t.prototype._fireEvent=o)),t},t.prototype._fireEvent=o,t.prototype._execute=function(t,e,n){try{t(e,n)}catch(t){return t}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(t){},t.prototype._attachCancellationCallback=function(t){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._dereferenceTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(t,e){};var it=h,ot=function(){return!1},st=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;U.inherits(A,Error),r.CapturedTrace=A,A.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;r<t;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var u=r>0?e[r-1]:this;a<t-1?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=r-2;l>=0;--l)e[l]._length=c,c++;return}}}},A.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=N(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;x(r),E(r),U.notEnumerableProp(t,"stack",b(n,r)),U.notEnumerableProp(t,"__stackCleaned__",!0)}};var at=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():O(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,Y=t,H=e;var n=Error.captureStackTrace;return ot=function(t){return V.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return Y=/@/,H=e,W=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(t){i="stack"in t}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(H=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?O(e):e.toString()},null):(Y=t,H=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(F=function(t){console.warn(t)},U.isNode&&e.stderr.isTTY?F=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:U.isNode||"string"!=typeof(new Error).stack||(F=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ut={warnings:Q,longStackTraces:!1,cancellation:!1,monitoring:!1};return K&&t.longStackTraces(),{longStackTraces:function(){return ut.longStackTraces},warnings:function(){return ut.warnings},cancellation:function(){return ut.cancellation},monitoring:function(){return ut.monitoring},propagateFromFunction:function(){return it},boundValueFunction:function(){return f},checkForgottenReturns:_,setBounds:L,warn:v,deprecated:m,CapturedTrace:A,fireDomEvent:tt,fireGlobalEvent:et}}}).call(e,n(9))},function(t,e){"use strict";t.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},function(t,e){"use strict";t.exports=function(t,e){var n=t.map;t.prototype.filter=function(t,r){return n(this,t,r,e)},t.filter=function(t,r,i){return n(t,r,i,e)}}},function(t,e,n){"use strict";t.exports=function(t,e,r){function i(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}function o(t){this.finallyHandler=t}function s(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function a(){return c.call(this,this.promise._target()._settledValue())}function u(t){if(!s(this,t))return h.e=t,h}function c(n){var i=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(i._boundValue()):c.call(i._boundValue(),n);if(l===r)return l;if(void 0!==l){i._setReturnedNonUndefined();var f=e(l,i);if(f instanceof t){if(null!=this.cancelPromise){if(f._isCancelled()){var d=new p("late cancellation observer");return i._attachExtraTrace(d),h.e=d,h}f.isPending()&&f._attachCancellationCallback(new o(this));
}return f._then(a,u,void 0,this,void 0)}}}return i.isRejected()?(s(this),h.e=n,h):(s(this),n)}var l=n(1),p=t.CancellationError,h=l.errorObj,f=n(32)(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){s(this.finallyHandler)},t.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new i(this,e,t),void 0)},t.prototype.lastly=t.prototype.finally=function(t){return this._passThrough(t,0,c,c)},t.prototype.tap=function(t){return this._passThrough(t,1,c)},t.prototype.tapCatch=function(e){var n=arguments.length;if(1===n)return this._passThrough(e,1,void 0,c);var r,i=new Array(n-1),o=0;for(r=0;r<n-1;++r){var s=arguments[r];if(!l.isObject(s))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+l.classString(s)));i[o++]=s}i.length=o;var a=arguments[r];return this._passThrough(f(i,a,this),1,void 0,c)},i}},function(t,e,n){"use strict";t.exports=function(t,e,r,i,o,s){function a(e,n,r){for(var o=0;o<n.length;++o){r._pushContext();var s=f(n[o])(e);if(r._popContext(),s===h){r._pushContext();var a=t.reject(h.e);return r._popContext(),a}var u=i(s,r);if(u instanceof t)return u}return null}function u(e,n,i,o){if(s.cancellation()){var a=new t(r),u=this._finallyPromise=new t(r);this._promise=a.lastly(function(){return u}),a._captureStackTrace(),a._setOnCancel(this)}else{var c=this._promise=new t(r);c._captureStackTrace()}this._stack=o,this._generatorFunction=e,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(d):d,this._yieldedPromise=null,this._cancellationPhase=!1}var c=n(3),l=c.TypeError,p=n(1),h=p.errorObj,f=p.tryCatch,d=[];p.inherits(u,o),u.prototype._isResolved=function(){return null===this._promise},u.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},u.prototype._promiseCancelled=function(){if(!this._isResolved()){var e,n="undefined"!=typeof this._generator.return;if(n)this._promise._pushContext(),e=f(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=f(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},u.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=f(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},u.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=f(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},u.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},u.prototype.promise=function(){return this._promise},u.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},u.prototype._continue=function(e){var n=this._promise;if(e===h)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(e.e,!1);var r=e.value;if(e.done===!0)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var o=i(r,this._promise);if(!(o instanceof t)&&(o=a(o,this._yieldHandlers,this._promise),null===o))return void this._promiseRejected(new l("A value %s was yielded that could not be treated as a promise\n\n    See http://goo.gl/MqrFmX\n\n".replace("%s",String(r))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o=o._target();var s=o._bitField;0===(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&s)?t._async.invoke(this._promiseFulfilled,this,o._value()):0!==(16777216&s)?t._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled()},t.coroutine=function(t,e){if("function"!=typeof t)throw new l("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var n=Object(e).yieldHandler,r=u,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new r(void 0,void 0,n,i),s=o.promise();return o._generator=e,o._promiseFulfilled(void 0),s}},t.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new l("expecting a function but got "+p.classString(t));d.push(t)},t.spawn=function(n){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof n)return e("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var r=new u(n,this),i=r.promise();return r._run(t.spawn),i}}},function(t,e,n){"use strict";t.exports=function(t,e,r,i,o,s){var a,u=n(1),c=u.canEvaluate,l=u.tryCatch,p=u.errorObj;if(c){for(var h=function(t){return new Function("value","holder","                             \n\t            'use strict';                                                    \n\t            holder.pIndex = value;                                           \n\t            holder.checkFulfillment(this);                                   \n\t            ".replace(/Index/g,t))},f=function(t){return new Function("promise","holder","                           \n\t            'use strict';                                                    \n\t            holder.pIndex = promise;                                         \n\t            ".replace(/Index/g,t))},d=function(e){for(var n=new Array(e),r=0;r<n.length;++r)n[r]="this.p"+(r+1);var i=n.join(" = ")+" = null;",s="var promise;\n"+n.map(function(t){return"                                                         \n\t                promise = "+t+";                                      \n\t                if (promise instanceof Promise) {                            \n\t                    promise.cancel();                                        \n\t                }                                                            \n\t            "}).join("\n"),a=n.join(", "),u="Holder$"+e,c="return function(tryCatch, errorObj, Promise, async) {    \n\t            'use strict';                                                    \n\t            function [TheName](fn) {                                         \n\t                [TheProperties]                                              \n\t                this.fn = fn;                                                \n\t                this.asyncNeeded = true;                                     \n\t                this.now = 0;                                                \n\t            }                                                                \n\t                                                                             \n\t            [TheName].prototype._callFunction = function(promise) {          \n\t                promise._pushContext();                                      \n\t                var ret = tryCatch(this.fn)([ThePassedArguments]);           \n\t                promise._popContext();                                       \n\t                if (ret === errorObj) {                                      \n\t                    promise._rejectCallback(ret.e, false);                   \n\t                } else {                                                     \n\t                    promise._resolveCallback(ret);                           \n\t                }                                                            \n\t            };                                                               \n\t                                                                             \n\t            [TheName].prototype.checkFulfillment = function(promise) {       \n\t                var now = ++this.now;                                        \n\t                if (now === [TheTotal]) {                                    \n\t                    if (this.asyncNeeded) {                                  \n\t                        async.invoke(this._callFunction, this, promise);     \n\t                    } else {                                                 \n\t                        this._callFunction(promise);                         \n\t                    }                                                        \n\t                                                                             \n\t                }                                                            \n\t            };                                                               \n\t                                                                             \n\t            [TheName].prototype._resultCancelled = function() {              \n\t                [CancellationCode]                                           \n\t            };                                                               \n\t                                                                             \n\t            return [TheName];                                                \n\t        }(tryCatch, errorObj, Promise, async);                               \n\t        ";return c=c.replace(/\[TheName\]/g,u).replace(/\[TheTotal\]/g,e).replace(/\[ThePassedArguments\]/g,a).replace(/\[TheProperties\]/g,i).replace(/\[CancellationCode\]/g,s),new Function("tryCatch","errorObj","Promise","async",c)(l,p,t,o)},g=[],y=[],_=[],m=0;m<8;++m)g.push(d(m+1)),y.push(h(m+1)),_.push(f(m+1));a=function(t){this._reject(t)}}t.join=function(){var n,o=arguments.length-1;if(o>0&&"function"==typeof arguments[o]&&(n=arguments[o],o<=8&&c)){var l=new t(i);l._captureStackTrace();for(var p=g[o-1],h=new p(n),f=y,d=0;d<o;++d){var m=r(arguments[d],l);if(m instanceof t){m=m._target();var v=m._bitField;0===(50397184&v)?(m._then(f[d],a,void 0,l,h),_[d](m,h),h.asyncNeeded=!1):0!==(33554432&v)?f[d].call(l,m._value(),h):0!==(16777216&v)?l._reject(m._reason()):l._cancel()}else f[d].call(l,m,h)}if(!l._isFateSealed()){if(h.asyncNeeded){var b=s();null!==b&&(h.fn=u.domainBind(b,h.fn))}l._setAsyncGuaranteed(),l._setOnCancel(h)}return l}for(var E=arguments.length,x=new Array(E),w=0;w<E;++w)x[w]=arguments[w];n&&x.pop();var l=new e(x).promise();return void 0!==n?l.spread(n):l}}},function(t,e,n){"use strict";t.exports=function(t,e,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:l.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function u(e,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+l.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return t.reject(new TypeError("options argument must be an object but it is "+l.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(e,n,s,o).promise()}var c=t._getDomain,l=n(1),p=l.tryCatch,h=l.errorObj,f=t._async;l.inherits(a,e),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(e,n){var r=this._values,o=this.length(),a=this._preservedValues,u=this._limit;if(n<0){if(n=n*-1-1,r[n]=e,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return r[n]=e,this._queue.push(n),!1;null!==a&&(a[n]=e);var c=this._promise,l=this._callback,f=c._boundValue();c._pushContext();var d=p(l).call(f,e,n,o),g=c._popContext();if(s.checkForgottenReturns(d,g,null!==a?"Promise.filter":"Promise.map",c),d===h)return this._reject(d.e),!0;var y=i(d,this._promise);if(y instanceof t){y=y._target();var _=y._bitField;if(0===(50397184&_))return u>=1&&this._inFlight++,r[n]=y,y._proxy(this,(n+1)*-1),!1;if(0===(33554432&_))return 0!==(16777216&_)?(this._reject(y._reason()),!0):(this._cancel(),!0);d=y._value()}r[n]=d}var m=++this._totalResolved;return m>=o&&(null!==a?this._filter(r,a):this._resolve(r),!0)},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(t,e){for(var n=e.length,r=new Array(n),i=0,o=0;o<n;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(t,e){return u(this,t,e,null)},t.map=function(t,e,n,r){return u(t,e,n,r)}}},function(t,e,n){"use strict";t.exports=function(t,e,r,i,o){var s=n(1),a=s.tryCatch;t.method=function(n){if("function"!=typeof n)throw new t.TypeError("expecting a function but got "+s.classString(n));return function(){var r=new t(e);r._captureStackTrace(),r._pushContext();var i=a(n).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},t.attempt=t.try=function(n){if("function"!=typeof n)return i("expecting a function but got "+s.classString(n));var r=new t(e);r._captureStackTrace(),r._pushContext();var u;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];u=s.isArray(c)?a(n).apply(l,c):a(n).call(l,c)}else u=a(n)();var p=r._popContext();return o.checkForgottenReturns(u,p,"Promise.try",r),r._resolveFromSyncValue(u),r},t.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},function(t,e,n){"use strict";t.exports=function(t){function e(t,e){var n=this;if(!o.isArray(t))return r.call(n,t,e);var i=a(e).apply(n._boundValue(),[null].concat(t));i===u&&s.throwLater(i.e)}function r(t,e){var n=this,r=n._boundValue(),i=void 0===t?a(e).call(r,null):a(e).call(r,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var n=this;if(!t){var r=new Error(t+"");r.cause=t,t=r}var i=a(e).call(n._boundValue(),t);i===u&&s.throwLater(i.e)}var o=n(1),s=t._async,a=o.tryCatch,u=o.errorObj;t.prototype.asCallback=t.prototype.nodeify=function(t,n){if("function"==typeof t){var o=r;void 0!==n&&Object(n).spread&&(o=e),this._then(o,i,void 0,this,t)}return this}}},function(t,e,n){(function(e,r){"use strict";t.exports=function(){function e(){}function i(t,e){if(null==t||t.constructor!==o)throw new v("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n");if("function"!=typeof e)throw new v("expecting a function but got "+d.classString(e))}function o(t){t!==E&&i(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function s(t){this.promise._resolveCallback(t)}function a(t){this.promise._rejectCallback(t,!1)}function u(t){var e=new o(E);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}var c,l=function(){return new v("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n")},p=function(){return new o.PromiseInspection(this._target())},h=function(t){return o.reject(new v(t))},f={},d=n(1);c=d.isNode?function(){var t=r.domain;return void 0===t&&(t=null),t}:function(){return null},d.notEnumerableProp(o,"_getDomain",c);var g=n(5),y=n(67),_=new y;g.defineProperty(o,"_async",{value:_});var m=n(3),v=o.TypeError=m.TypeError;o.RangeError=m.RangeError;var b=o.CancellationError=m.CancellationError;o.TimeoutError=m.TimeoutError,o.OperationalError=m.OperationalError,o.RejectionError=m.OperationalError,o.AggregateError=m.AggregateError;var E=function(){},x={},w={},I=n(92)(o,E),N=n(82)(o,E,I,h,e),C=n(71)(o),S=C.create,O=n(72)(o,C),P=(O.CapturedTrace,n(75)(o,I,w)),T=n(32)(w),R=n(33),L=d.errorObj,A=d.tryCatch;return o.prototype.toString=function(){return"[object Promise]"},o.prototype.caught=o.prototype.catch=function(t){var e=arguments.length;if(e>1){var n,r=new Array(e-1),i=0;for(n=0;n<e-1;++n){var o=arguments[n];if(!d.isObject(o))return h("Catch statement predicate: expecting an object but got "+d.classString(o));r[i++]=o}if(r.length=i,t=arguments[n],"function"!=typeof t)throw new v("The last argument to .catch() must be a function, got "+d.toString(t));return this.then(void 0,T(r,t,this))}return this.then(void 0,t)},o.prototype.reflect=function(){return this._then(p,p,void 0,this,void 0)},o.prototype.then=function(t,e){if(O.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+d.classString(t);arguments.length>1&&(n+=", "+d.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},o.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},o.prototype.spread=function(t){return"function"!=typeof t?h("expecting a function but got "+d.classString(t)):this.all()._then(t,void 0,void 0,x,void 0)},o.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new N(this).promise()},o.prototype.error=function(t){return this.caught(d.originatesFromRejection,t)},o.getNewLibraryCopy=t.exports,o.is=function(t){return t instanceof o},o.fromNode=o.fromCallback=function(t){var e=new o(E);e._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=A(t)(R(e,n));return r===L&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},o.all=function(t){return new N(t).promise()},o.cast=function(t){var e=I(t);return e instanceof o||(e=new o(E),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(t){var e=new o(E);return e._captureStackTrace(),e._rejectCallback(t,!0),e},o.setScheduler=function(t){if("function"!=typeof t)throw new v("expecting a function but got "+d.classString(t));return _.setScheduler(t)},o.prototype._then=function(t,e,n,r,i){var s=void 0!==i,a=s?i:new o(E),u=this._target(),l=u._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var p=c();if(0!==(50397184&l)){var h,f,g=u._settlePromiseCtx;0!==(33554432&l)?(f=u._rejectionHandler0,h=t):0!==(16777216&l)?(f=u._fulfillmentHandler0,h=e,u._unsetRejectionIsUnhandled()):(g=u._settlePromiseLateCancellationObserver,f=new b("late cancellation observer"),u._attachExtraTrace(f),h=e),_.invoke(g,u,{handler:null===p?h:"function"==typeof h&&d.domainBind(p,h),promise:a,receiver:r,value:f})}else u._addCallbacks(t,e,a,r,p);return a},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},o.prototype._setLength=function(t){this._bitField=this._bitField&-65536|65535&t},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){_.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==f)return void 0===e&&this._isBound()?this._boundValue():e},o.prototype._promiseAt=function(t){return this[4*t-4+2]},o.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},o.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=f),this._addCallbacks(e,n,r,i,null)},o.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=f),this._addCallbacks(n,r,i,o,null)},o.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:d.domainBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:d.domainBind(i,e))}return this._setLength(o+1),o},o.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},o.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=I(t,this);if(!(n instanceof o))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var i=r._bitField;if(0===(50397184&i)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;a<s;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&i))this._fulfill(r._value());else if(0!==(16777216&i))this._reject(r._reason());else{var u=new b("late cancellation observer");r._attachExtraTrace(u),this._reject(u)}}},o.prototype._rejectCallback=function(t,e,n){var r=d.ensureErrorObject(t),i=r===t;if(!i&&!n&&O.warnings()){var o="a promise was rejected with a non-error: "+d.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,!!e&&i),this._reject(t)},o.prototype._resolveFromExecutor=function(t){if(t!==E){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},o.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===x?n&&"number"==typeof n.length?o=A(t).apply(this._boundValue(),n):(o=L,o.e=new v("cannot .spread() a non-array: "+d.classString(n))):o=A(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===w?r._reject(n):o===L?r._rejectCallback(o.e,!1):(O.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},o.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},o.prototype._followee=function(){return this._rejectionHandler0},o.prototype._setFollowee=function(t){this._rejectionHandler0=t},o.prototype._settlePromise=function(t,n,r,i){var s=t instanceof o,a=this._bitField,u=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof P&&r.isFinallyHandler()?(r.cancelPromise=t,A(n).call(r,i)===L&&t._reject(L.e)):n===p?t._fulfill(p.call(r)):r instanceof e?r._promiseCancelled(t):s||t instanceof N?t._cancel():r.cancel()):"function"==typeof n?s?(u&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(n,r,i,t)):n.call(r,i,t):r instanceof e?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(i,t):r._promiseRejected(i,t)):s&&(u&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(i):t._reject(i))},o.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,i=t.value;"function"==typeof e?n instanceof o?this._settlePromiseFromHandler(e,r,i,n):e.call(r,i,n):n instanceof o&&n._reject(i)},o.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},o.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},o.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},o.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():_.settlePromises(this),this._dereferenceTrace())}},o.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?_.fatalError(t,d.isNode):void((65535&e)>0?_.settlePromises(this):this._ensurePossibleRejectionHandled())},o.prototype._fulfillPromises=function(t,e){for(var n=1;n<t;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},o.prototype._rejectPromises=function(t,e){for(var n=1;n<t;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},o.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&g.defineProperty(o.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),o.defer=o.pending=function(){O.deprecated("Promise.defer","new Promise");var t=new o(E);return{promise:t,resolve:s,reject:a}},d.notEnumerableProp(o,"_makeSelfResolutionError",l),n(79)(o,E,I,h,O),n(68)(o,E,I,O),n(70)(o,N,h,O),n(53)(o),n(91)(o),n(77)(o,N,I,E,_,c),o.Promise=o,o.version="3.5.5",n(69)(o),n(76)(o,h,E,I,e,O),n(78)(o,N,h,I,E,O),n(80)(o),n(83)(o,E),n(84)(o,N,I,h),n(86)(o,E,I,h),n(87)(o,N,h,I,E,O),n(89)(o,N,O),n(90)(o,N,h),n(93)(o,E,O),n(94)(o,h,I,S,E,O),n(66)(o),n(73)(o,E),n(74)(o,E),d.toFastProperties(o),d.toFastProperties(o.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new o(E)),O.setBounds(y.firstLineError,d.lastLineError),o}}).call(e,n(4),n(9))},function(t,e,n){"use strict";t.exports=function(t,e,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function a(n){var r=this._promise=new t(e);n instanceof t&&r._propagateFrom(n,3),r._setOnCancel(this),this._values=n,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=n(1);u.isArray;return u.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function e(n,o){var a=r(this._values,this._promise);if(a instanceof t){a=a._target();var c=a._bitField;if(this._values=a,0===(50397184&c))return this._promise._setAsyncGuaranteed(),a._then(e,this._reject,void 0,this,o);if(0===(33554432&c))return 0!==(16777216&c)?this._reject(a._reason()):this._cancel();a=a._value()}if(a=u.asArray(a),null===a){var l=i("expecting an array or an iterable object but got "+u.classString(a)).reason();return void this._promise._rejectCallback(l,!1)}return 0===a.length?void(o===-5?this._resolveEmptyArray():this._resolve(s(o))):void this._iterate(a)},a.prototype._iterate=function(e){var n=this.getActualLength(e.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;a<n;++a){var u=r(e[a],i);u instanceof t?(u=u._target(),s=u._bitField):s=null,o?null!==s&&u.suppressUnhandledRejections():null!==s?0===(50397184&s)?(u._proxy(this,a),this._values[a]=u):o=0!==(33554432&s)?this._promiseFulfilled(u._value(),a):0!==(16777216&s)?this._promiseRejected(u._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(u,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n<e.length;++n)e[n]instanceof t&&e[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){return t},a}},function(t,e,n){"use strict";t.exports=function(t,e){function r(t){return!x.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(t){return!1}}function o(t,e,n){var r=f.getDataPropertyOrDefault(t,e+n,b);return!!r&&i(r)}function s(t,e,n){for(var r=0;r<t.length;r+=2){var i=t[r];if(n.test(i))for(var o=i.replace(n,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new m("Cannot promisify an API that has normal methods with '%s'-suffix\n\n    See http://goo.gl/MqrFmX\n".replace("%s",e))}}function a(t,e,n,r){for(var a=f.inheritedDataKeys(t),u=[],c=0;c<a.length;++c){var l=a[c],p=t[l],h=r===w||w(l,p,t);"function"!=typeof p||i(p)||o(t,l,e)||!r(l,p,t,h)||u.push(l,p)}return s(u,e,n),u}function u(n,r,i,o,s,a){function u(){var i=r;r===h&&(i=this);var o=new t(e);o._captureStackTrace();var s="string"==typeof l&&this!==c?this[l]:n,u=d(o,a);try{s.apply(i,g(arguments,u))}catch(t){o._rejectCallback(y(t),!0,!0)}return o._isFateSealed()||o._setAsyncGuaranteed(),o}var c=function(){return this}(),l=n;return"string"==typeof l&&(n=o),f.notEnumerableProp(u,"__isPromisified__",!0),u}function c(t,e,n,r,i){for(var o=new RegExp(I(e)+"$"),s=a(t,e,o,n),u=0,c=s.length;u<c;u+=2){var l=s[u],p=s[u+1],d=l+e;if(r===P)t[d]=P(l,h,l,p,e,i);else{var g=r(p,function(){return P(l,h,l,p,e,i)});f.notEnumerableProp(g,"__isPromisified__",!0),t[d]=g}}return f.toFastProperties(t),t}function l(t,e,n){return P(t,e,void 0,t,null,n)}var p,h={},f=n(1),d=n(33),g=f.withAppended,y=f.maybeWrapAsError,_=f.canEvaluate,m=n(3).TypeError,v="Async",b={__isPromisified__:!0},E=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],x=new RegExp("^(?:"+E.join("|")+")$"),w=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},I=function(t){return t.replace(/([$])/,"\\$")},N=function(t){for(var e=[t],n=Math.max(0,t-1-3),r=t-1;r>=n;--r)e.push(r);for(var r=t+1;r<=3;++r)e.push(r);return e},C=function(t){return f.filledRange(t,"_arg","")},S=function(t){return f.filledRange(Math.max(t,3),"_arg","")},O=function(t){return"number"==typeof t.length?Math.max(Math.min(t.length,1024),0):0};p=function(n,r,i,o,s,a){function u(t){var e,n=C(t).join(", "),i=t>0?", ":"";return e=_?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===r?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n",
e.replace("{{args}}",n).replace(", ",i)}function c(){for(var t="",e=0;e<p.length;++e)t+="case "+p[e]+":"+u(p[e]);return t+="                                                             \n\t        default:                                                             \n\t            var args = new Array(len + 1);                                   \n\t            var i = 0;                                                       \n\t            for (var i = 0; i < len; ++i) {                                  \n\t               args[i] = arguments[i];                                       \n\t            }                                                                \n\t            args[i] = nodeback;                                              \n\t            [CodeForCall]                                                    \n\t            break;                                                           \n\t        ".replace("[CodeForCall]",_?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}var l=Math.max(0,O(o)-1),p=N(l),_="string"==typeof n||r===h,m="string"==typeof n?"this != null ? this['"+n+"'] : fn":"fn",v="'use strict';                                                \n\t        var ret = function (Parameters) {                                    \n\t            'use strict';                                                    \n\t            var len = arguments.length;                                      \n\t            var promise = new Promise(INTERNAL);                             \n\t            promise._captureStackTrace();                                    \n\t            var nodeback = nodebackForPromise(promise, "+a+");   \n\t            var ret;                                                         \n\t            var callback = tryCatch([GetFunctionCode]);                      \n\t            switch(len) {                                                    \n\t                [CodeForSwitchCase]                                          \n\t            }                                                                \n\t            if (ret === errorObj) {                                          \n\t                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\t            }                                                                \n\t            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \n\t            return promise;                                                  \n\t        };                                                                   \n\t        notEnumerableProp(ret, '__isPromisified__', true);                   \n\t        return ret;                                                          \n\t    ".replace("[CodeForSwitchCase]",c()).replace("[GetFunctionCode]",m);return v=v.replace("Parameters",S(l)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",v)(t,o,r,g,y,d,f.tryCatch,f.errorObj,f.notEnumerableProp,e)};var P=_?p:u;t.promisify=function(t,e){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=l(t,n,o);return f.copyDescriptors(t,s,r),s},t.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new m("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=v);var i=e.filter;"function"!=typeof i&&(i=w);var o=e.promisifier;if("function"!=typeof o&&(o=P),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;a<s.length;++a){var u=t[s[a]];"constructor"!==s[a]&&f.isClass(u)&&(c(u.prototype,r,i,o,n),c(u,r,i,o,n))}return c(t,r,i,o,n)}}},function(t,e,n){"use strict";t.exports=function(t,e,r,i){function o(t){var e,n=!1;if(void 0!==a&&t instanceof a)e=p(t),n=!0;else{var r=l.keys(t),i=r.length;e=new Array(2*i);for(var o=0;o<i;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,n?-6:-3)}function s(e){var n,s=r(e);return c(s)?(n=s instanceof t?s._then(t.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof t&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n")}var a,u=n(1),c=u.isObject,l=n(5);"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;r<n;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};u.inherits(o,e),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();o<s;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},t.prototype.props=function(){return s(this)},t.props=function(t){return s(t)}}},function(t,e){"use strict";function n(t,e,n,r,i){for(var o=0;o<i;++o)n[o+r]=t[o+e],t[o+e]=void 0}function r(t){this._capacity=t,this._length=0,this._front=0}r.prototype._willBeOverCapacity=function(t){return this._capacity<t},r.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var n=this._front+e&this._capacity-1;this[n]=t,this._length=e+1},r.prototype.push=function(t,e,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},r.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},r.prototype.length=function(){return this._length},r.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},r.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var r=this._front,i=this._length,o=r+i&e-1;n(this,0,this,e,o)},t.exports=r},function(t,e,n){"use strict";t.exports=function(t,e,r,i){function o(n,o){var u=r(n);if(u instanceof t)return a(u);if(n=s.asArray(n),null===n)return i("expecting an array or an iterable object but got "+s.classString(n));var c=new t(e);void 0!==o&&c._propagateFrom(o,3);for(var l=c._fulfill,p=c._reject,h=0,f=n.length;h<f;++h){var d=n[h];(void 0!==d||h in n)&&t.cast(d)._then(l,p,void 0,c,null)}return c}var s=n(1),a=function(t){return t.then(function(e){return o(e,t)})};t.race=function(t){return o(t,void 0)},t.prototype.race=function(){return o(this,void 0)}}},function(t,e,n){"use strict";t.exports=function(t,e,r,i,o,s){function a(e,n,r,i){this.constructor$(e);var s=h();this._fn=null===s?n:f.domainBind(s,n),void 0!==r&&(r=t.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function u(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function c(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function l(e){this.accum=e,this.array._gotAccum(e);var n=i(this.value,this.array._promise);return n instanceof t?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(e){var n=this.array,r=n._promise,i=d(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),e,this.index,this.length):i.call(r._boundValue(),this.accum,e,this.index,this.length),o instanceof t&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=t._getDomain,f=n(1),d=f.tryCatch;f.inherits(a,e),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(e){return e===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel()))},a.prototype._iterate=function(e){this._values=e;var n,r,i=e.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=t.resolve(e[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;r<i;++r){var o={accum:null,value:e[r],index:r,length:i,array:this};n=n._then(l,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(u,u,void 0,n,this)},t.prototype.reduce=function(t,e){return c(this,t,e,null)},t.reduce=function(t,e,n,r){return c(t,e,n,r)}}},function(t,e,n){(function(e,r,i){"use strict";var o,s=n(1),a=function(){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")},u=s.getNativePromise();if(s.isNode&&"undefined"==typeof MutationObserver){var c=e.setImmediate,l=r.nextTick;o=s.isRecentNode?function(t){c.call(e,t)}:function(t){l.call(r,t)}}else if("function"==typeof u&&"function"==typeof u.resolve){var p=u.resolve();o=function(t){p.then(t)}}else o="undefined"!=typeof MutationObserver&&("undefined"==typeof window||!window.navigator||!window.navigator.standalone&&!window.cordova)&&"classList"in document.documentElement?function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}():"undefined"!=typeof i?function(t){i(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:a;t.exports=o}).call(e,function(){return this}(),n(9),n(140).setImmediate)},function(t,e,n){"use strict";t.exports=function(t,e,r){function i(t){this.constructor$(t)}var o=t.PromiseInspection,s=n(1);s.inherits(i,e),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},t.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},t.prototype.settle=function(){return t.settle(this)}}},function(t,e,n){"use strict";t.exports=function(t,e,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||e<0)return r("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=n(1),a=n(3).RangeError,u=n(3).AggregateError,c=s.isArray,l={};s.inherits(i,e),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new u,e=this.length();e<this._values.length;++e)this._values[e]!==l&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(t,e){return o(t,e)},t.prototype.some=function(t){return o(this,t)},t._SomePromiseArray=i}},function(t,e){"use strict";t.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},function(t,e,n){"use strict";t.exports=function(t,e){function r(n,r){if(l(n)){if(n instanceof t)return n;var i=o(n);if(i===c){r&&r._pushContext();var u=t.reject(i.e);return r&&r._popContext(),u}if("function"==typeof i){if(s(n)){var u=new t(e);return n._then(u._fulfill,u._reject,void 0,u,null),u}return a(n,i,r)}}return n}function i(t){return t.then}function o(t){try{return i(t)}catch(t){return c.e=t,c}}function s(t){try{return p.call(t,"_promise0")}catch(t){return!1}}function a(n,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new t(e),l=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=u.tryCatch(r).call(n,o,s);return p=!1,a&&h===c&&(a._rejectCallback(h.e,!0,!0),a=null),l}var u=n(1),c=u.errorObj,l=u.isObject,p={}.hasOwnProperty;return r}},function(t,e,n){"use strict";t.exports=function(t,e,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=n(1),u=t.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(t){return l(+this).thenReturn(t)},l=t.delay=function(n,o){var s,a;return void 0!==o?(s=t.resolve(o)._then(c,null,null,n,void 0),r.cancellation()&&o instanceof t&&s._setOnCancel(o)):(s=new t(e),a=setTimeout(function(){s._fulfill()},+n),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};t.prototype.delay=function(t){return l(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new u("operation timed out"):new u(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};t.prototype.timeout=function(t,e){t=+t;var n,a,u=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,u,void 0),n._setOnCancel(u)):n=this._then(o,s,void 0,u,void 0),n}}},function(t,e,n){"use strict";t.exports=function(t,e,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function u(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function c(e,n){function i(){if(s>=c)return l._fulfill();var o=u(e[s++]);if(o instanceof t&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),e.promise)}catch(t){return a(t)}if(o instanceof t)return o._then(i,a,null,null,null)}i()}var s=0,c=e.length,l=new t(o);return i(),l}function l(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return l.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var d=n(1),g=n(3).TypeError,y=n(1).inherits,_=d.errorObj,m=d.tryCatch,v={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():v},l.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==v?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},y(p,l),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var e=this.length,n=0;n<e;++n){var r=this[n];r instanceof t&&r.cancel()}},t.using=function(){var n=arguments.length;if(n<2)return e("you must pass at least 2 arguments to Promise.using");var i=arguments[n-1];if("function"!=typeof i)return e("expecting a function but got "+d.classString(i));var o,a=!0;2===n&&Array.isArray(arguments[0])?(o=arguments[0],n=o.length,a=!1):(o=arguments,n--);for(var u=new f(n),p=0;p<n;++p){var g=o[p];if(l.isDisposer(g)){var y=g;g=g.promise(),g._setDisposable(y)}else{var v=r(g);v instanceof t&&(g=v._then(h,null,null,{resources:u,index:p},void 0))}u[p]=g}for(var b=new Array(u.length),p=0;p<b.length;++p)b[p]=t.resolve(u[p]).reflect();var E=t.all(b).then(function(t){for(var e=0;e<t.length;++e){var n=t[e];if(n.isRejected())return _.e=n.error(),_;if(!n.isFulfilled())return void E.cancel();t[e]=n.value()}x._pushContext(),i=m(i);var r=a?i.apply(void 0,t):i(t),o=x._popContext();return s.checkForgottenReturns(r,o,"Promise.using",x),r}),x=E.lastly(function(){var e=new t.PromiseInspection(E);return c(u,e)});return u.promise=x,x._setOnCancel(u),x},t.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},t.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new g}}},function(t,e,n){n(121),n(119),t.exports=n(7).Array.from},function(t,e,n){n(120),t.exports=n(7).Object.assign},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(43),i=n(44),o=n(54);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!=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,n){var r=n(34),i=n(6)("toStringTag"),o="Arguments"==r(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){"use strict";var r=n(15),i=n(22);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){t.exports=n(24)("native-function-to-string",Function.toString)},function(t,e,n){var r=n(8).document;t.exports=r&&r.documentElement},function(t,e,n){t.exports=!n(10)&&!n(19)(function(){return 7!=Object.defineProperty(n(36)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(21),i=n(6)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(12);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){"use strict";var r=n(110),i=n(22),o=n(42),s={};n(14)(s,n(6)("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){"use strict";var r=n(39),i=n(18),o=n(41),s=n(14),a=n(21),u=n(106),c=n(42),l=n(113),p=n(6)("iterator"),h=!([].keys&&"next"in[].keys()),f="@@iterator",d="keys",g="values",y=function(){return this};t.exports=function(t,e,n,_,m,v,b){u(n,e,_);var E,x,w,I=function(t){if(!h&&t in O)return O[t];switch(t){case d:return function(){return new n(this,t)};case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}},N=e+" Iterator",C=m==g,S=!1,O=t.prototype,P=O[p]||O[f]||m&&O[m],T=P||I(m),R=m?C?I("entries"):T:void 0,L="Array"==e?O.entries||P:P;if(L&&(w=l(L.call(new t)),w!==Object.prototype&&w.next&&(c(w,N,!0),r||"function"==typeof w[p]||s(w,p,y))),C&&P&&P.name!==g&&(S=!0,T=function(){return P.call(this)}),r&&!b||!h&&!S&&O[p]||s(O,p,T),a[e]=T,a[N]=y,m)if(E={values:C?T:I(g),keys:v?T:I(d),entries:R},b)for(x in E)x in O||o(O,x,E[x]);else i(i.P+i.F*(h||S),e,E);return E}},function(t,e,n){var r=n(6)("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(10),i=n(40),o=n(112),s=n(115),a=n(26),u=n(38),c=Object.assign;t.exports=!c||n(19)(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,p=o.f,h=s.f;c>l;)for(var f,d=u(arguments[l++]),g=p?i(d).concat(p(d)):i(d),y=g.length,_=0;y>_;)f=g[_++],r&&!h.call(d,f)||(n[f]=d[f]);return n}:c},function(t,e,n){var r=n(12),i=n(111),o=n(37),s=n(23)("IE_PROTO"),a=function(){},u="prototype",c=function(){var t,e=n(36)("iframe"),r=o.length,i="<",s=">";for(e.style.display="none",n(102).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(i+"script"+s+"document.F=Object"+i+"/script"+s),t.close(),c=t.F;r--;)delete c[u][o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[u]=r(t),n=new a,a[u]=null,n[s]=t):n=c(),void 0===e?n:i(n,e)}},function(t,e,n){var r=n(15),i=n(12),o=n(40);t.exports=n(10)?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){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(13),i=n(26),o=n(23)("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,n){var r=n(13),i=n(43),o=n(98)(!1),s=n(23)("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){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(25),i=n(17);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),o<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):(o-55296<<10)+(s-56320)+65536)}}},function(t,e,n){var r=n(20);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,n){var r=n(99),i=n(6)("iterator"),o=n(21);t.exports=n(7).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){"use strict";var r=n(35),i=n(18),o=n(26),s=n(105),a=n(104),u=n(44),c=n(100),l=n(118);i(i.S+i.F*!n(108)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,i,p,h=o(t),f="function"==typeof this?this:Array,d=arguments.length,g=d>1?arguments[1]:void 0,y=void 0!==g,_=0,m=l(h);if(y&&(g=r(g,d>2?arguments[2]:void 0,2)),void 0==m||f==Array&&a(m))for(e=u(h.length),n=new f(e);e>_;_++)c(n,_,y?g(h[_],_):h[_]);else for(p=m.call(h),n=new f;!(i=p.next()).done;_++)c(n,_,y?s(p,g,[i.value,_],!0):i.value);return n.length=_,n}})},function(t,e,n){var r=n(18);r(r.S+r.F,"Object",{assign:n(109)})},function(t,e,n){"use strict";var r=n(116)(!0);n(107)(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(46),i=n(144),o=n(124),s=n(130),a=n(133),u=t.exports=function(t,e){var n,i,u,c,l;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=a.call(t,"c"),i=a.call(t,"e"),u=a.call(t,"w")):(n=u=!0,i=!1),l={value:e,configurable:n,enumerable:i,writable:u},c?o(s(c),l):l};u.gs=function(t,e,n){var u,c,l,p;return"string"!=typeof t?(l=n,n=e,e=t,t=null):l=arguments[3],r(e)?i(e)?r(n)?i(n)||(l=n,n=void 0):n=void 0:(l=e,e=n=void 0):e=void 0,r(t)?(u=a.call(t,"c"),c=a.call(t,"e")):(u=!0,c=!1),p={get:e,set:n,configurable:u,enumerable:c},l?o(s(l),p):p}},function(t,e){"use strict";t.exports=function(){}},function(t,e,n){"use strict";t.exports=n(125)()?Object.assign:n(126)},function(t,e){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var r=n(127),i=n(132),o=Math.max;t.exports=function(t,e){var n,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},s=1;s<u;++s)e=arguments[s],r(e).forEach(a);if(void 0!==n)throw n;return t}},function(t,e,n){"use strict";t.exports=n(128)()?Object.keys:n(129)},function(t,e){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(28),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t,e,n){"use strict";var r=n(28),i=Array.prototype.forEach,o=Object.create,s=function(t,e){var n;for(n in t)e[n]=t[n]};t.exports=function(t){var e=o(null);return i.call(arguments,function(t){r(t)&&s(Object(t),e)}),e}},function(t,e){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){"use strict";var r=n(28);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";t.exports=n(134)()?String.prototype.contains:n(135)},function(t,e){"use strict";var n="razdwatrzy";t.exports=function(){return"function"==typeof n.contains&&(n.contains("dwa")===!0&&n.contains("foo")===!1)}},function(t,e){"use strict";var n=String.prototype.indexOf;t.exports=function(t){return n.call(this,t,arguments[1])>-1}},function(t,e,n){"use strict";var r,i,o,s,a,u,c,l=n(122),p=n(131),h=Function.prototype.apply,f=Function.prototype.call,d=Object.create,g=Object.defineProperty,y=Object.defineProperties,_=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var n;return p(e),_.call(this,"__ee__")?n=this.__ee__:(n=m.value=d(null),g(this,"__ee__",m),m.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},i=function(t,e){var n,i;return p(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},o=function(t,e){var n,r,i,o;if(p(e),!_.call(this,"__ee__"))return this;if(n=this.__ee__,!n[t])return this;if(r=n[t],"object"==typeof r)for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},s=function(t){var e,n,r,i,o;if(_.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)h.call(r,this,o)}else switch(arguments.length){case 1:f.call(i,this);break;case 2:f.call(i,this,arguments[1]);break;case 3:f.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];h.call(i,this,o)}},a={on:r,once:i,off:o,emit:s},u={on:l(r),once:l(i),off:l(o),emit:l(s)},c=y({},u),t.exports=e=function(t){return null==t?d(c):y(Object(t),u)},e.methods=a},function(t,e){"use strict";function n(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function r(t){for(var e,r=/([^=?&]+)=?([^&]*)/g,i={};e=r.exec(t);){var o=n(e[1]),s=n(e[2]);null===o||null===s||o in i||(i[o]=s)}return i}function i(t,e){e=e||"";var n,r,i=[];"string"!=typeof e&&(e="?");for(r in t)if(s.call(t,r)){if(n=t[r],n||null!==n&&n!==o&&!isNaN(n)||(n=""),r=encodeURIComponent(r),n=encodeURIComponent(n),null===r||null===n)continue;i.push(r+"="+n)}return i.length?e+i.join("&"):""}var o,s=Object.prototype.hasOwnProperty;e.stringify=i,e.parse=r},function(t,e){"use strict";t.exports=function(t,e){if(e=e.split(":")[0],t=+t,!t)return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},function(t,e,n){(function(t,e){!function(t,n){"use strict";function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return g[d]=r,f(d),d++}function i(t){delete g[t]}function o(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}function s(t){if(y)setTimeout(s,0,t);else{var e=g[t];if(e){y=!0;try{o(e)}finally{i(t),y=!1}}}}function a(){f=function(t){e.nextTick(function(){s(t)})}}function u(){if(t.postMessage&&!t.importScripts){
var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}function c(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&s(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),f=function(n){t.postMessage(e+n,"*")}}function l(){var t=new MessageChannel;t.port1.onmessage=function(t){var e=t.data;s(e)},f=function(e){t.port2.postMessage(e)}}function p(){var t=_.documentElement;f=function(e){var n=_.createElement("script");n.onreadystatechange=function(){s(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}function h(){f=function(t){setTimeout(s,0,t)}}if(!t.setImmediate){var f,d=1,g={},y=!1,_=t.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(t);m=m&&m.setTimeout?m:t,"[object process]"==={}.toString.call(t.process)?a():u()?c():t.MessageChannel?l():_&&"onreadystatechange"in _.createElement("script")?p():h(),m.setImmediate=r,m.clearImmediate=i}}("undefined"==typeof self?"undefined"==typeof t?this:t:self)}).call(e,function(){return this}(),n(9))},function(t,e,n){(function(t){function r(t,e){this._id=t,this._clearFn=e}var i="undefined"!=typeof t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(139),e.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(e,function(){return this}())},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?Dt:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function c(t){return null===t?null:t.left}function l(t){return null===t?null:t.right}function p(){this.root_=null,this.size_=0}function h(){}function f(){this.array_=[],arguments[0]instanceof bt&&this.addAll(arguments[0])}function d(){}function g(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(void 0===this||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: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 _=function(){};_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var m=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",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),v=function(){},b={MAX_VALUE:{configurable:!0}};v.isNaN=function(t){return Number.isNaN(t)},v.doubleToLongBits=function(t){return t},v.longBitsToDouble=function(t){return t},v.isInfinite=function(t){return!Number.isFinite(t)},b.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(v,b);var E=function(){},x=function(){},w=function(){},I=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])},N={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};I.prototype.setOrdinate=function(t,e){switch(t){case I.X:this.x=e;break;case I.Y:this.y=e;break;case I.Z:this.z=e;break;default:throw new m("Invalid ordinate index: "+t)}},I.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!!_.equalsWithTolerance(this.x,e.x,n)&&!!_.equalsWithTolerance(this.y,e.y,n)}},I.prototype.getOrdinate=function(t){switch(t){case I.X:return this.x;case I.Y:return this.y;case I.Z:return this.z}throw new m("Invalid ordinate index: "+t)},I.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||v.isNaN(this.z))&&v.isNaN(t.z)},I.prototype.equals=function(t){return t instanceof I&&this.equals2D(t)},I.prototype.equalInZ=function(t,e){return _.equalsWithTolerance(this.z,t.z,e)},I.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},I.prototype.clone=function(){},I.prototype.copy=function(){return new I(this)},I.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},I.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)},I.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},I.prototype.hashCode=function(){var t=17;return t=37*t+I.hashCode(this.x),t=37*t+I.hashCode(this.y)},I.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},I.prototype.interfaces_=function(){return[E,x,e]},I.prototype.getClass=function(){return I},I.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=v.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},N.DimensionalComparator.get=function(){return C},N.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},N.NULL_ORDINATE.get=function(){return v.NaN},N.X.get=function(){return 0},N.Y.get=function(){return 1},N.Z.get=function(){return 2},Object.defineProperties(I,N);var C=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 m("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};C.prototype.compare=function(t,e){var n=t,r=e,i=C.compare(n.x,r.x);if(0!==i)return i;var o=C.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:C.compare(n.z,r.z)},C.prototype.interfaces_=function(){return[w]},C.prototype.getClass=function(){return C},C.compare=function(t,e){return t<e?-1:t>e?1:v.isNaN(t)?v.isNaN(e)?0:-1:v.isNaN(e)?1:0};var S=function(){};S.prototype.create=function(){},S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S};var O=function(){},P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.toLocationSymbol=function(t){switch(t){case O.EXTERIOR:return"e";case O.BOUNDARY:return"b";case O.INTERIOR:return"i";case O.NONE:return"-"}throw new m("Unknown location value: "+t)},P.INTERIOR.get=function(){return 0},P.BOUNDARY.get=function(){return 1},P.EXTERIOR.get=function(){return 2},P.NONE.get=function(){return-1},Object.defineProperties(O,P);var T=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},R=function(){},L={LOG_10:{configurable:!0}};R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.log10=function(t){var e=Math.log(t);return v.isInfinite(e)?e:v.isNaN(e)?e:e/R.LOG_10},R.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},R.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}},R.wrap=function(t,e){return t<0?e- -t%e:t%e},R.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}},R.average=function(t,e){return(t+e)/2},L.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(R,L);var A=function(t){this.str=t};A.prototype.append=function(t){this.str+=t},A.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},A.prototype.toString=function(t){return this.str};var D=function(t){this.value=t};D.prototype.intValue=function(){return this.value},D.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},D.isNaN=function(t){return Number.isNaN(t)};var M=function(){};M.isWhitespace=function(t){return t<=32&&t>=0||127===t},M.toUpperCase=function(t){return t.toUpperCase()};var F=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)}},k={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}};F.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},F.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=F.magnitude(n._hi),i=F.TEN.pow(r);(n=n.divide(i)).gt(F.TEN)?(n=n.divide(F.TEN),r+=1):n.lt(F.ONE)&&(n=n.multiply(F.TEN),r-=1);for(var o=r+1,s=new A,a=F.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,p=0;c>9?(l=!0,p="9"):p="0"+c,s.append(p),n=n.subtract(F.valueOf(c)).multiply(F.TEN),l&&n.selfAdd(F.TEN);var h=!0,f=F.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(h=!1),!h)break}return e[0]=r,s.toString()},F.prototype.sqr=function(){return this.multiply(this)},F.prototype.doubleValue=function(){return this._hi+this._lo},F.prototype.subtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},F.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},F.prototype.isZero=function(){return 0===this._hi&&0===this._lo},F.prototype.selfSubtract=function(){if(arguments[0]instanceof F){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)}},F.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},F.prototype.min=function(t){return this.le(t)?this:t},F.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof F){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,p=null;return u=this._hi/n,c=F.SPLIT*u,i=c-u,p=F.SPLIT*n,i=c-i,o=u-i,s=p-n,l=u*n,s=p-s,a=n-s,p=i*s-l+i*a+o*s+o*a,c=(this._hi-l-p+this._lo-u*r)/n,p=u+c,this._hi=p,this._lo=u-p+c,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){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=F.SPLIT*o)-(e=s-o)),u=e*(r=(u=F.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 F(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return v.isNaN(c)?F.createNaN():F.copy(this).selfDivide(c,0)}},F.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},F.prototype.pow=function(t){if(0===t)return F.valueOf(1);var e=new F(this),n=F.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},F.prototype.ceil=function(){if(this.isNaN())return F.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new F(t,e)},F.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},F.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},F.prototype.setValue=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},F.prototype.max=function(t){return this.ge(t)?this:t},F.prototype.sqrt=function(){if(this.isZero())return F.valueOf(0);if(this.isNegative())return F.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=F.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},F.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof F){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 i=this._hi+e,s=i-this._hi,o=i-s,o=e-s+(this._hi-o),a=o+this._lo,n=i+a,r=a+(i-n),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,p=null,h=null,f=null,d=null,g=null,y=null;f=this._hi+u,p=this._lo+c,d=f-(g=f-this._hi),h=p-(y=p-this._lo);var _=(l=f+(g=(d=u-g+(this._hi-d))+p))+(g=(h=c-y+(this._lo-h))+(g+(f-l))),m=g+(l-_);return this._hi=_,this._lo=m,this}},F.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof F){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=F.SPLIT*this._hi)-this._hi,c=F.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)),p=c+(i=u-l);return this._hi=l,this._lo=p,this}},F.prototype.selfSqr=function(){return this.selfMultiply(this)},F.prototype.floor=function(){if(this.isNaN())return F.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new F(t,e)},F.prototype.negate=function(){return this.isNaN()?this:new F(-this._hi,-this._lo)},F.prototype.clone=function(){},F.prototype.multiply=function(){if(arguments[0]instanceof F){var t=arguments[0];return t.isNaN()?F.createNaN():F.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return v.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return v.isNaN(this._hi)},F.prototype.intValue=function(){return Math.trunc(this._hi)},F.prototype.toString=function(){var t=F.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},F.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."+F.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+F.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},F.prototype.reciprocal=function(){var t=null,e=null,n=null,r=null,i=null,o=null,s=null,a=null;e=(i=1/this._hi)-(t=(o=F.SPLIT*i)-(t=o-i)),n=(a=F.SPLIT*this._hi)-this._hi;var u=i+(o=(1-(s=i*this._hi)-(a=t*(n=a-n)-s+t*(r=this._hi-n)+e*n+e*r)-i*this._lo)/this._hi);return new F(u,i-u+o)},F.prototype.toSciNotation=function(){if(this.isZero())return F.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=F.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},F.prototype.abs=function(){return this.isNaN()?F.NaN:this.isNegative()?this.negate():new F(this)},F.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},F.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},F.prototype.add=function(){if(arguments[0]instanceof F){var t=arguments[0];return F.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return F.copy(this).selfAdd(e)}},F.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 F){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}},F.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},F.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},F.prototype.trunc=function(){return this.isNaN()?F.NaN:this.isPositive()?this.floor():this.ceil()},F.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},F.prototype.interfaces_=function(){return[e,E,x]},F.prototype.getClass=function(){return F},F.sqr=function(t){return F.valueOf(t).selfMultiply(t)},F.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return F.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new F(e)}},F.sqrt=function(t){return F.valueOf(t).sqrt()},F.parse=function(t){for(var e=0,n=t.length;M.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 F,s=0,a=0,u=0;!(e>=n);){var c=t.charAt(e);if(e++,M.isDigit(c)){var l=c-"0";o.selfMultiply(F.TEN),o.selfAdd(l),s++}else{if("."!==c){if("e"===c||"E"===c){var p=t.substring(e);try{u=D.parseInt(p)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+p+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var h=o,f=s-a-u;if(0===f)h=o;else if(f>0){var d=F.TEN.pow(f);h=o.divide(d)}else if(f<0){var g=F.TEN.pow(-f);h=o.multiply(g)}return r?h.negate():h},F.createNaN=function(){return new F(v.NaN,v.NaN)},F.copy=function(t){return new F(t)},F.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},F.stringOfChar=function(t,e){for(var n=new A,r=0;r<e;r++)n.append(t);return n.toString()},k.PI.get=function(){return new F(3.141592653589793,1.2246467991473532e-16)},k.TWO_PI.get=function(){return new F(6.283185307179586,2.4492935982947064e-16)},k.PI_2.get=function(){return new F(1.5707963267948966,6.123233995736766e-17)},k.E.get=function(){return new F(2.718281828459045,1.4456468917292502e-16)},k.NaN.get=function(){return new F(v.NaN,v.NaN)},k.EPS.get=function(){return 1.23259516440783e-32},k.SPLIT.get=function(){return 134217729},k.MAX_PRINT_DIGITS.get=function(){return 32},k.TEN.get=function(){return F.valueOf(10)},k.ONE.get=function(){return F.valueOf(1)},k.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},k.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(F,k);var j=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};j.prototype.interfaces_=function(){return[]},j.prototype.getClass=function(){return j},j.orientationIndex=function(t,e,n){var r=j.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=F.valueOf(e.x).selfAdd(-t.x),o=F.valueOf(e.y).selfAdd(-t.y),s=F.valueOf(n.x).selfAdd(-e.x),a=F.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},j.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},j.intersection=function(t,e,n,r){var i=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(e.x).selfSubtract(t.x)),o=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),u=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),c=a.subtract(u).selfDivide(s).doubleValue(),l=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),p=F.valueOf(e.x).selfSubtract(t.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),h=F.valueOf(e.y).selfSubtract(t.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),f=p.subtract(h).selfDivide(s).doubleValue(),d=F.valueOf(n.y).selfAdd(F.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new I(l,d)},j.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 j.signum(s);r=i+o}else{if(!(i<0))return j.signum(s);if(o>=0)return j.signum(s);r=-i-o}var a=j.DP_SAFE_EPSILON*r;return s>=a||-s>=a?j.signum(s):2},j.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(j,G);var U=function(){},B={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};B.X.get=function(){return 0},B.Y.get=function(){return 1},B.Z.get=function(){return 2},B.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,n){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[x]},U.prototype.getClass=function(){return U},Object.defineProperties(U,B);var q=function(){},V=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}(q),z=function(){};z.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},z.getProperty=function(t){return{"line.separator":"\n"}[t]};var X=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 I&&arguments[1]instanceof I){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 p=arguments[0],h=arguments[1],f=arguments[2],d=arguments[3],g=p.y-h.y,y=h.x-p.x,_=p.x*h.y-h.x*p.y,m=f.y-d.y,v=d.x-f.x,b=f.x*d.y-d.x*f.y;this.x=y*b-v*_,this.y=m*_-g*b,this.w=g*v-m*y}};X.prototype.getY=function(){var t=this.y/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new V;return t},X.prototype.getX=function(){var t=this.x/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new V;return t},X.prototype.getCoordinate=function(){var t=new I;return t.x=this.getX(),t.y=this.getY(),t},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.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,p=(o*c-u*s)/l,h=(a*s-i*c)/l;if(v.isNaN(p)||v.isInfinite(p)||v.isNaN(h)||v.isInfinite(h))throw new V;return new I(p,h)};var Y=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 I){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)}},H={serialVersionUID:{configurable:!0}};Y.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Y.prototype.equals=function(t){if(!(t instanceof Y))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()},Y.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Y;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 Y(e,r,n,i)},Y.prototype.isNull=function(){return this._maxx<this._minx},Y.prototype.getMaxX=function(){return this._maxx},Y.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof Y){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}},Y.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Y){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 I){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)}},Y.prototype.getMinY=function(){return this._miny},Y.prototype.getMinX=function(){return this._minx},Y.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof Y){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))}},Y.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Y.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Y.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},Y.prototype.translate=function(t,e){return this.isNull()?null:void this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Y.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Y.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Y.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Y.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Y.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()}},Y.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Y){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof I){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)}},Y.prototype.centre=function(){return this.isNull()?null:new I((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Y.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Y){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)}},Y.prototype.getMaxY=function(){return this._maxy},Y.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)},Y.prototype.hashCode=function(){var t=17;return t=37*t+I.hashCode(this._minx),t=37*t+I.hashCode(this._maxx),t=37*t+I.hashCode(this._miny),t=37*t+I.hashCode(this._maxy)},Y.prototype.interfaces_=function(){return[E,e]},Y.prototype.getClass=function(){return Y},Y.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))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Y,H);var W={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*$/},$=function(t){this.geometryFactory=t||new _e};$.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=W.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=W.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],
K[n]&&(e=K[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},$.prototype.write=function(t){return this.extractGeometry(t)},$.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!Q[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+Q[e].apply(this,[t])+")"};var Q={coordinate:function(t){return t.x+" "+t.y},point:function(t){return Q.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+Q.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(Q.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(Q.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("("+Q.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+Q.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+Q.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("("+Q.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(",")}},K={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(W.spaces);return this.geometryFactory.createPoint(new I(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(W.trimParens,"$1"),r.push(K.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(W.spaces),r.push(new I(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(W.spaces),r.push(new I(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(W.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(K.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(W.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(W.trimParens,"$1"),n=K.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(W.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(K.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)}},J=function(t){this.parser=new $(t)};J.prototype.write=function(t){return this.parser.write(t)},J.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Z=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),tt=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}(Z),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t,e;if(1===arguments.length)t=arguments[0],et.isTrue(t,null);else if(2===arguments.length&&(t=arguments[0],e=arguments[1],!t))throw null===e?new tt:new tt(e)},et.equals=function(){var t,e,n;if(2===arguments.length)t=arguments[0],e=arguments[1],et.equals(t,e,null);else if(3===arguments.length&&(t=arguments[0],e=arguments[1],n=arguments[2],!e.equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=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 I,this._intPt[1]=new I,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new A;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.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)},nt.prototype.getIntersectionNum=function(){return this._result},nt.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)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.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}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return J.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+J.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.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 et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=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 Y(this._inputLines[0][0],this._inputLines[0][1]),n=new Y(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];return this._isProper=!1,Y.intersects(n,r,e)&&0===at.orientationIndex(n,r,e)&&0===at.orientationIndex(r,n,e)?(this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null):void(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=X.intersection(t,n,r,i)}catch(s){if(!(s instanceof V))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 I(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=j.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);z.out.println("DD in env = "+s+"  --------------------- "+o),i.distance(o)>1e-4&&z.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new I(t),o=new I(e),s=new I(n),a=new I(r),u=new I;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=Y.intersects(e,n,r),s=Y.intersects(e,n,i),a=Y.intersects(r,i,e),u=Y.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,p=n.x>r.x?n.x:r.x,h=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(a<p?a:p))/2,d=((s>l?s:l)+(u<h?u:h))/2;i.x=f,i.y=d,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,!Y.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=at.orientationIndex(e,n,r),s=at.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(r,i,e),u=at.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 I(r):0===s?this._intPt[0]=new I(i):0===a?this._intPt[0]=new I(e):0===u&&(this._intPt[0]=new I(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=at.distancePointLine(t,n,r),s=at.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=at.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=at.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.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 ot.signOfDet2x2(r,i,o,s)},ot.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(s=Math.floor(n/t),n-=s*t,(r-=s*e)<0)return-i;if(r>e)return i;if(t>n+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(s=Math.floor(t/n),t-=s*n,(e-=s*r)<0)return i;if(e>r)return-i;if(n>t+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 st=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};st.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=ot.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},st.prototype.isPointInPolygon=function(){return this.getLocation()!==O.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?O.BOUNDARY:this._crossingCount%2==1?O.INTERIOR:O.EXTERIOR},st.prototype.isOnSegment=function(){return this._isPointOnSegment},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.locatePointInRing=function(){if(arguments[0]instanceof I&&T(arguments[1],U)){for(var t=arguments[0],e=arguments[1],n=new st(t),r=new I,i=new I,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 I&&arguments[1]instanceof Array){for(var s=arguments[0],a=arguments[1],u=new st(s),c=1;c<a.length;c++){var l=a[c],p=a[c-1];if(u.countSegment(l,p),u.isOnSegment())return u.getLocation()}return u.getLocation()}};var at=function(){},ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return j.orientationIndex(t,e,n)},at.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(T(arguments[0],U)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new I,c=new I,l=new I;s.getCoordinate(0,c),s.getCoordinate(1,l);var p=c.x;l.x-=p;for(var h=0,f=1;f<a-1;f++)u.y=c.y,c.x=l.x,c.y=l.y,s.getCoordinate(f+1,l),l.x-=p,h+=c.x*(u.y-l.y);return h/2}},at.distanceLineLine=function(t,e,n,r){if(t.equals(e))return at.distancePointLine(t,n,r);if(n.equals(r))return at.distancePointLine(r,t,e);var i=!1;if(Y.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?R.min(at.distancePointLine(t,n,r),at.distancePointLine(e,n,r),at.distancePointLine(n,t,e),at.distancePointLine(r,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==O.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new I;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},at.isCCW=function(t){var e=t.length-1;if(e<3)throw new m("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=at.computeOrientation(u,n,c),p=!1;return p=0===l?u.x>c.x:l>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.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)},at.computeOrientation=function(t,e,n){return at.orientationIndex(t,e,n)},at.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new m("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=at.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)}},at.isOnLine=function(t,e){for(var n=new it,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},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return at.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return at.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return at.COLLINEAR},Object.defineProperties(at,ut);var ct=function(){};ct.prototype.filter=function(t){},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var lt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},pt={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}};lt.prototype.isGeometryCollection=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION},lt.prototype.getFactory=function(){return this._factory},lt.prototype.getGeometryN=function(t){return this},lt.prototype.getArea=function(){return 0},lt.prototype.isRectangle=function(){return!1},lt.prototype.equals=function(){if(arguments[0]instanceof lt){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof lt))return!1;var n=e;return this.equalsExact(n)}},lt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},lt.prototype.geometryChanged=function(){this.apply(lt.geometryChangedFilter)},lt.prototype.geometryChangedAction=function(){this._envelope=null},lt.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},lt.prototype.getLength=function(){return 0},lt.prototype.getNumGeometries=function(){return 1},lt.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)}},lt.prototype.getUserData=function(){return this._userData},lt.prototype.getSRID=function(){return this._SRID},lt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},lt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION)throw new m("This method does not support GeometryCollection arguments")},lt.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},lt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},lt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},lt.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Y(this._envelope)},lt.prototype.setSRID=function(t){this._SRID=t},lt.prototype.setUserData=function(t){this._userData=t},lt.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},lt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},lt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===lt.SORTINDEX_MULTIPOINT||this.getSortIndex()===lt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===lt.SORTINDEX_MULTIPOLYGON},lt.prototype.interfaces_=function(){return[x,E,e]},lt.prototype.getClass=function(){return lt},lt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},lt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},pt.serialVersionUID.get=function(){return 0x799ea46522854c00},pt.SORTINDEX_POINT.get=function(){return 0},pt.SORTINDEX_MULTIPOINT.get=function(){return 1},pt.SORTINDEX_LINESTRING.get=function(){return 2},pt.SORTINDEX_LINEARRING.get=function(){return 3},pt.SORTINDEX_MULTILINESTRING.get=function(){return 4},pt.SORTINDEX_POLYGON.get=function(){return 5},pt.SORTINDEX_MULTIPOLYGON.get=function(){return 6},pt.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},pt.geometryChangedFilter.get=function(){return ht},Object.defineProperties(lt,pt);var ht=function(){};ht.interfaces_=function(){return[ct]},ht.filter=function(t){t.geometryChangedAction()};var ft=function(){};ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft};var dt=function(){},gt={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}};dt.prototype.isInBoundary=function(t){},dt.prototype.interfaces_=function(){return[]},dt.prototype.getClass=function(){return dt},gt.Mod2BoundaryNodeRule.get=function(){return yt},gt.EndPointBoundaryNodeRule.get=function(){return _t},gt.MultiValentEndPointBoundaryNodeRule.get=function(){return mt},gt.MonoValentEndPointBoundaryNodeRule.get=function(){return vt},gt.MOD2_BOUNDARY_RULE.get=function(){return new yt},gt.ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},gt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},gt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},gt.OGC_SFS_BOUNDARY_RULE.get=function(){return dt.MOD2_BOUNDARY_RULE},Object.defineProperties(dt,gt);var yt=function(){};yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[dt]},yt.prototype.getClass=function(){return yt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>0},_t.prototype.interfaces_=function(){return[dt]},_t.prototype.getClass=function(){return _t};var mt=function(){};mt.prototype.isInBoundary=function(t){return t>1},mt.prototype.interfaces_=function(){return[dt]},mt.prototype.getClass=function(){return mt};var vt=function(){};vt.prototype.isInBoundary=function(t){return 1===t},vt.prototype.interfaces_=function(){return[dt]},vt.prototype.getClass=function(){return vt};var bt=function(){};bt.prototype.add=function(){},bt.prototype.addAll=function(){},bt.prototype.isEmpty=function(){},bt.prototype.iterator=function(){},bt.prototype.size=function(){},bt.prototype.toArray=function(){},bt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var Et=function(){};Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){};var xt=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}(bt);(r.prototype=new Error).name="NoSuchElementException";var wt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof bt&&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,bt]},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 It(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;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}(xt),It=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 r;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}(Et),Nt=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 I&&"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 I){var p=arguments[0],h=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(p>0&&this.get(p-1).equals2D(h))return null;if(p<f&&this.get(p).equals2D(h))return null}}t.prototype.add.call(this,p,h)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],y=arguments[2],_=arguments[3],m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(d[v],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new I(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(wt),Ct=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};St.ForwardComparator.get=function(){return Ot},St.BidirectionalComparator.get=function(){return Pt},St.coordArrayType.get=function(){return new Array(0).fill(null)},Ct.prototype.interfaces_=function(){return[]},Ct.prototype.getClass=function(){return Ct},Ct.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Ct.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Ct.indexOf(r,e)<0)return r}return null},Ct.scroll=function(t,e){var n=Ct.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);z.arraycopy(t,n,r,0,t.length-n),z.arraycopy(t,0,r,t.length-n,n),z.arraycopy(r,0,t,0,t.length)},Ct.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}},Ct.intersection=function(t,e){
for(var n=new Nt,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},Ct.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Ct.removeRepeatedPoints=function(t){return Ct.hasRepeatedPoints(t)?new Nt(t,!1).toCoordinateArray():t},Ct.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}},Ct.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},Ct.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 I(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 I(r[i+u])},Ct.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},Ct.envelope=function(t){for(var e=new Y,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Ct.toCoordinateArray=function(t){return t.toArray(Ct.coordArrayType)},Ct.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Ct.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Ct.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},Ct.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},Ct.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},Ct.extract=function(t,e,n){e=R.clamp(e,0,t.length);var r=(n=R.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(Ct,St);var Ot=function(){};Ot.prototype.compare=function(t,e){return Ct.compare(t,e)},Ot.prototype.interfaces_=function(){return[w]},Ot.prototype.getClass=function(){return Ot};var Pt=function(){};Pt.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=Ct.compare(n,r);return Ct.isEqualReversed(n,r)?0:i},Pt.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=Ct.increasingDirection(n),o=Ct.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},Pt.prototype.interfaces_=function(){return[w]},Pt.prototype.getClass=function(){return Pt};var Tt=function(){};Tt.prototype.get=function(){},Tt.prototype.put=function(){},Tt.prototype.size=function(){},Tt.prototype.values=function(){},Tt.prototype.entrySet=function(){};var Rt=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}(Tt);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new bt).contains=function(){};var Lt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof bt&&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 At(this)},e}(o),At=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 r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(Et),Dt=0;(p.prototype=new Rt).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},p.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Dt,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:Dt,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},p.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===c(a(a(t)))){var e=l(a(a(t)));1===s(e)?(u(a(t),Dt),u(e,Dt),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),Dt),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=c(a(a(t)));1===s(n)?(u(a(t),Dt),u(n,Dt),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),Dt),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=Dt},p.prototype.values=function(){var t=new wt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=p.successor(e));)t.add(e.value);return t},p.prototype.entrySet=function(){var t=new Lt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=p.successor(e));)t.add(e);return t},p.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}},p.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}},p.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},p.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},p.prototype.size=function(){return this.size_};var Mt=function(){};Mt.prototype.interfaces_=function(){return[]},Mt.prototype.getClass=function(){return Mt},h.prototype=new o,(f.prototype=new h).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},f.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},f.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},f.prototype.remove=function(t){throw new i},f.prototype.size=function(){return this.array_.length},f.prototype.isEmpty=function(){return 0===this.array_.length},f.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},f.prototype.iterator=function(){return new Ft(this)};var Ft=function(t){this.treeSet_=t,this.position_=0};Ft.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Ft.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ft.prototype.remove=function(){throw new i};var kt=function(){};kt.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])},kt.asList=function(t){for(var e=new wt,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var jt=function(){},Gt={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}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},jt.prototype.interfaces_=function(){return[]},jt.prototype.getClass=function(){return jt},jt.toDimensionSymbol=function(t){switch(t){case jt.FALSE:return jt.SYM_FALSE;case jt.TRUE:return jt.SYM_TRUE;case jt.DONTCARE:return jt.SYM_DONTCARE;case jt.P:return jt.SYM_P;case jt.L:return jt.SYM_L;case jt.A:return jt.SYM_A}throw new m("Unknown dimension value: "+t)},jt.toDimensionValue=function(t){switch(M.toUpperCase(t)){case jt.SYM_FALSE:return jt.FALSE;case jt.SYM_TRUE:return jt.TRUE;case jt.SYM_DONTCARE:return jt.DONTCARE;case jt.SYM_P:return jt.P;case jt.SYM_L:return jt.L;case jt.SYM_A:return jt.A}throw new m("Unknown dimension symbol: "+t)},Object.defineProperties(jt,Gt);var Ut=function(){};Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var Bt=function(){};Bt.prototype.filter=function(t,e){},Bt.prototype.isDone=function(){},Bt.prototype.isGeometryChanged=function(){},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt};var qt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new m("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 Y,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();kt.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=jt.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=jt.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 f(kt.asList(this._geometries)),n=new f(kt.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),p=c.compareToSameClass(l,i);if(0!==p)return p;u++}return u<s?1:u<a?-1:0}},e.prototype.apply=function(){if(T(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(T(arguments[0],Bt)){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(T(arguments[0],Ut)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(T(arguments[0],ct)){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),et.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}(lt),Vt=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 lt.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()?jt.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 zt(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[Mt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(qt),zt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=dt.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}};zt.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)},zt.prototype.getBoundary=function(){return this._geom instanceof $t?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},zt.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()])},zt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},zt.prototype.computeBoundaryCoordinates=function(t){var e=new wt;this._endpointMap=new p;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 Ct.toCoordinateArray(e)},zt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.getBoundary=function(){if(1===arguments.length){var t=arguments[0];return new zt(t).getBoundary()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new zt(e,n).getBoundary()}};var Xt=function(){this.count=null};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt};var Yt=function(){},Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Yt.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(){}(Yt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Yt.NEWLINE}catch(t){if(!(t instanceof d))throw t;et.shouldNeverReachHere()}return o}},Yt.split=function(t,e){for(var n=e.length,r=new wt,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},Yt.toString=function(){if(1===arguments.length){var t=arguments[0];return Yt.SIMPLE_ORDINATE_FORMAT.format(t)}},Yt.spaces=function(t){return Yt.chars(" ",t)},Ht.NEWLINE.get=function(){return z.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Yt,Ht);var Wt=function(){};Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.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))},Wt.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,U.X)===t.getOrdinate(e-1,U.X)&&t.getOrdinate(0,U.Y)===t.getOrdinate(e-1,U.Y)},Wt.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)||v.isNaN(s)&&v.isNaN(a)))return!1}return!0},Wt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Wt.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Wt.copy(e,i-1,r,o,1);return r},Wt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Wt.swap(t,r,e-r)},Wt.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)}},Wt.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Wt.copyCoord(t,e+o,n,r+o)},Wt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new A;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(Yt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Wt.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(n-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(n-1,U.Y)?e:Wt.createClosedRing(t,e,n+1)},Wt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wt.copy(e,0,r,0,i);for(var o=i;o<n;o++)Wt.copy(e,0,r,o,1);return r};var $t=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 Y:this._points.expandEnvelope(new Y)},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&&Wt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?jt.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 at.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Wt.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(T(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(T(arguments[0],Bt)){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 T(arguments[0],Ut)?arguments[0].filter(this):T(arguments[0],ct)&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new zt(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 m("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[Mt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(lt),Qt=function(){};Qt.prototype.interfaces_=function(){return[]},Qt.prototype.getClass=function(){return Qt};var Kt=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 Y;var t=new Y;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 jt.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(T(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(T(arguments[0],Bt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else T(arguments[0],Ut)?arguments[0].filter(this):T(arguments[0],ct)&&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([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(lt),Jt=function(){};Jt.prototype.interfaces_=function(){return[]},Jt.prototype.getClass=function(){return Jt};var Zt=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 m("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new m("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(at.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(at.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);kt.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);z.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Ct.minCoordinate(e.getCoordinates());Ct.scroll(r,i),z.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],at.isCCW(e.getCoordinates())===n&&Ct.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(),p=0;p<c&&p<l;){var h=this.getInteriorRingN(p),f=o.getInteriorRingN(p),d=h.compareToSameClass(f,i);if(0!==d)return d;p++}return p<c?1:p<l?-1:0}},e.prototype.apply=function(t){if(T(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(T(t,Bt)){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(T(t,Ut))t.filter(this);else if(T(t,ct)){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[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(lt),te=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 lt.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 jt.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[Qt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(qt),ee=function(t){function e(e,n){e instanceof I&&n instanceof _e&&(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 lt.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return jt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Wt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new m("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new m("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}($t),ne=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 lt.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 wt,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[Jt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(qt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof qt?this.editGeometryCollection(t,e):t instanceof Zt?this.editPolygon(t,e):t instanceof Kt?e.edit(t,this._factory):t instanceof $t?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new wt,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.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 wt,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([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return se},ie.CoordinateSequenceOperation.get=function(){return ae},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof $t?e.createLineString(n):t instanceof Kt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){};ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof $t?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var ue=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 I}else if(T(arguments[0],U)){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 I}},ce={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case U.X:this._coordinates[t].x=n;break;case U.Y:this._coordinates[t].y=n;break;case U.Z:this._coordinates[t].z=n;break;default:throw new m("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case U.X:return this._coordinates[t].x;case U.Y:return this._coordinates[t].y;case U.Z:return this._coordinates[t].z}return v.NaN},ue.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}},ue.prototype.getCoordinateCopy=function(t){return new I(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.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 ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.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 ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new A(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"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[U,e]},ue.prototype.getClass=function(){return ue},ce.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,ce);var le=function(){},pe={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};le.prototype.readResolve=function(){return le.instance()},le.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new ue(t)}if(T(arguments[0],U)){var e=arguments[0];return new ue(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return r>3&&(r=3),r<2?new ue(n):new ue(n,r)}},le.prototype.interfaces_=function(){return[S,e]},le.prototype.getClass=function(){return le},le.instance=function(){return le.instanceObject},pe.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},pe.instanceObject.get=function(){return new le},Object.defineProperties(le,pe);var he=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 wt,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 Lt;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(Tt),fe=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 ge){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}},de={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new D(n).compareTo(new D(r))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return v.isNaN(t)?t:this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof I){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,E]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},de.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},de.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,de);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new he},Object.defineProperties(ge,ye),fe.Type=ge,fe.FIXED=new ge("FIXED"),fe.FLOATING=new ge("FLOATING"),fe.FLOATING_SINGLE=new ge("FLOATING SINGLE");var _e=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?T(arguments[0],S)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(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]))},me={serialVersionUID:{configurable:!0}};_e.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new I(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new I(t.getMinX(),t.getMinY()),new I(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new I(t.getMinX(),t.getMinY()),new I(t.getMinX(),t.getMaxY()),new I(t.getMaxX(),t.getMaxY()),new I(t.getMaxX(),t.getMinY()),new I(t.getMinX(),t.getMinY())]),null)},_e.prototype.createLineString=function(t){return t?t instanceof Array?new $t(this.getCoordinateSequenceFactory().create(t),this):T(t,U)?new $t(t,this):void 0:new $t(this.getCoordinateSequenceFactory().create([]),this)},_e.prototype.createMultiLineString=function(){if(0===arguments.length)return new Vt(null,this);if(1===arguments.length){var t=arguments[0];return new Vt(t,this)}},_e.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(_e.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Zt)return this.createMultiPolygon(_e.toPolygonArray(t));if(a instanceof $t)return this.createMultiLineString(_e.toLineStringArray(t));if(a instanceof Kt)return this.createMultiPoint(_e.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},_e.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},_e.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(T(arguments[0],U)){var e=arguments[0];return new Kt(e,this)}}},_e.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_e.prototype.createPolygon=function(){if(0===arguments.length)return new Zt(null,null,this);if(1===arguments.length){if(T(arguments[0],U)){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 ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new Zt(r,i,this)}},_e.prototype.getSRID=function(){return this._SRID},_e.prototype.createGeometryCollection=function(){if(0===arguments.length)return new qt(null,this);if(1===arguments.length){var t=arguments[0];return new qt(t,this)}},_e.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},_e.prototype.getPrecisionModel=function(){return this._precisionModel},_e.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(T(arguments[0],U)){var e=arguments[0];return new ee(e,this)}}},_e.prototype.createMultiPolygon=function(){if(0===arguments.length)return new ne(null,this);if(1===arguments.length){var t=arguments[0];return new ne(t,this)}},_e.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new te(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(T(arguments[0],U)){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());Wt.copy(n,i,o,0,1),r[i]=this.createPoint(o)}return this.createMultiPoint(r)}}},_e.prototype.interfaces_=function(){return[e]},_e.prototype.getClass=function(){return _e},_e.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.getDefaultCoordinateSequenceFactory=function(){return le.instance()},_e.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},me.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(_e,me);var ve=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],be=function(t){this.geometryFactory=t||new _e};be.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Ee[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==ve.indexOf(n)?Ee[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Ee[n].apply(this,[e.geometries]):Ee[n].apply(this,[e])},be.prototype.write=function(t){var e=t.getGeometryType();if(!xe[e])throw new Error("Geometry is not supported");return xe[e].apply(this,[t])};var Ee={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Ee[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Ee.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 I(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new I(t[0],t[1]),new I(t[2],t[1]),new I(t[2],t[3]),new I(t[0],t[3]),new I(t[0],t[1])])},Point:function(t){var e=new I(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Ee.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Ee.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=Ee.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(Ee.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)}},xe={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:xe.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=xe.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(xe.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=xe.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=xe.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=xe.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=xe.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(xe[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},we=function(t){this.geometryFactory=t||new _e,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new be(this.geometryFactory)};we.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},we.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 Ie=function(){this.parser=new be(this.geometryFactory)};Ie.prototype.write=function(t){return this.parser.write(t)};var Ne=function(){},Ce={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.opposite=function(t){return t===Ne.LEFT?Ne.RIGHT:t===Ne.RIGHT?Ne.LEFT:t},Ce.ON.get=function(){return 0},Ce.LEFT.get=function(){return 1},Ce.RIGHT.get=function(){return 2},Object.defineProperties(Ne,Ce),(g.prototype=new Error).name="EmptyStackException",(y.prototype=new xt).add=function(t){return this.array_.push(t),!0},y.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Se=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Se.prototype.getCoordinate=function(){return this._minCoord},Se.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},Se.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.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=at.computeOrientation(this._minCoord,n,e),i=!1;e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===at.COUNTERCLOCKWISE?i=!0:e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===at.CLOCKWISE&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Se.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=Ne.LEFT;return n[e].y<n[e+1].y&&(r=Ne.RIGHT),r},Se.prototype.getEdge=function(){return this._orientedDe},Se.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])},Se.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)},Se.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.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)===Ne.LEFT&&(this._orientedDe=this._minDe.getSym())},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se};var Oe=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new I(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}(Z),Pe=function(){this.array_=[]};Pe.prototype.addLast=function(t){this.array_.push(t)},Pe.prototype.removeFirst=function(){return this.array_.shift()},Pe.prototype.isEmpty=function(){return 0===this.array_.length};var Te=function(){this._finder=null,this._dirEdgeList=new wt,this._nodes=new wt,this._rightMostCoord=null,this._env=null,this._finder=new Se};Te.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Te.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Te.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 Oe("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)}},Te.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Te.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate();
},Te.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ne.RIGHT)>=1&&e.getDepth(Ne.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Te.prototype.computeDepths=function(t){var e=new Lt,n=new Pe,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))}}}},Te.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Te.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Y,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},Te.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Te.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Te.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)}},Te.prototype.getNodes=function(){return this._nodes},Te.prototype.getDirectedEdges=function(){return this._dirEdgeList},Te.prototype.interfaces_=function(){return[E]},Te.prototype.getClass=function(){return Te};var Re=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[Ne.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[Ne.ON]=o,this.location[Ne.LEFT]=s,this.location[Ne.RIGHT]=a}};Re.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Re.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==O.NONE)return!1;return!0},Re.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===O.NONE&&(this.location[e]=t)},Re.prototype.isLine=function(){return 1===this.location.length},Re.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ne.ON]=this.location[Ne.ON],e[Ne.LEFT]=O.NONE,e[Ne.RIGHT]=O.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===O.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Re.prototype.getLocations=function(){return this.location},Re.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ne.LEFT];this.location[Ne.LEFT]=this.location[Ne.RIGHT],this.location[Ne.RIGHT]=t},Re.prototype.toString=function(){var t=new A;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.LEFT])),t.append(O.toLocationSymbol(this.location[Ne.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.RIGHT])),t.toString()},Re.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},Re.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},Re.prototype.isArea=function(){return this.location.length>1},Re.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===O.NONE)return!0;return!1},Re.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ne.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Re.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},Re.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Re.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re};var Le=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 Re(e),this.elt[1]=new Re(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Re(n.elt[0]),this.elt[1]=new Re(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Re(O.NONE),this.elt[1]=new Re(O.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 Re(o,s,a),this.elt[1]=new Re(o,s,a)}else if(4===arguments.length){var u=arguments[0],c=arguments[1],l=arguments[2],p=arguments[3];this.elt[0]=new Re(O.NONE,O.NONE,O.NONE),this.elt[1]=new Re(O.NONE,O.NONE,O.NONE),this.elt[u].setLocations(c,l,p)}};Le.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Le.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Le.prototype.isNull=function(t){return this.elt[t].isNull()},Le.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)}},Le.prototype.isLine=function(t){return this.elt[t].isLine()},Le.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Re(t.elt[e]):this.elt[e].merge(t.elt[e])},Le.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Le.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ne.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Le.prototype.toString=function(){var t=new A;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()},Le.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()}},Le.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Le.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ne.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Le.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Le.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Le.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Re(this.elt[t].location[0]))},Le.prototype.interfaces_=function(){return[]},Le.prototype.getClass=function(){return Le},Le.toLineLabel=function(t){for(var e=new Le(O.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Ae=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new wt,this._pts=new wt,this._label=new Le(O.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new wt,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Ae.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=at.isCCW(this._ring.getCoordinates())},Ae.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Ae.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Oe("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Oe("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.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)},Ae.prototype.getLinearRing=function(){return this._ring},Ae.prototype.getCoordinate=function(t){return this._pts.get(t)},Ae.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},Ae.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])}},Ae.prototype.isHole=function(){return this._isHole},Ae.prototype.setInResult=function(){var t=this._startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this._startDe)},Ae.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!at.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Ae.prototype.addHole=function(t){this._holes.add(t)},Ae.prototype.isShell=function(){return null===this._shell},Ae.prototype.getLabel=function(){return this._label},Ae.prototype.getEdges=function(){return this._edges},Ae.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Ae.prototype.getShell=function(){return this._shell},Ae.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,Ne.RIGHT);if(r===O.NONE)return null;if(this._label.getLocation(n)===O.NONE)return this._label.setLocation(n,r),null}},Ae.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Ae.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)},Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae};var De=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}(Ae),Me=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 wt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new De(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}(Ae),Fe=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}};Fe.prototype.setVisited=function(t){this._isVisited=t},Fe.prototype.setInResult=function(t){this._isInResult=t},Fe.prototype.isCovered=function(){return this._isCovered},Fe.prototype.isCoveredSet=function(){return this._isCoveredSet},Fe.prototype.setLabel=function(t){this._label=t},Fe.prototype.getLabel=function(){return this._label},Fe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fe.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fe.prototype.isInResult=function(){return this._isInResult},Fe.prototype.isVisited=function(){return this._isVisited},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var ke=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 Le(0,O.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=O.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==O.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 Le(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 Le)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===O.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=O.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case O.BOUNDARY:n=O.INTERIOR;break;case O.INTERIOR:default:n=O.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fe),je=function(){this.nodeMap=new p,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};je.prototype.find=function(t){return this.nodeMap.get(t)},je.prototype.addNode=function(){if(arguments[0]instanceof I){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 ke){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},je.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},je.prototype.iterator=function(){return this.nodeMap.values().iterator()},je.prototype.values=function(){return this.nodeMap.values()},je.prototype.getBoundaryNodes=function(t){for(var e=new wt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===O.BOUNDARY&&e.add(r)}return e},je.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je};var Ge=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2===(t-e+4)%4},Ge.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},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.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 m("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof I&&arguments[1]instanceof I){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new m("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Ge,Ue);var Be=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}};Be.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:at.computeOrientation(t._p0,t._p1,this._p1)},Be.prototype.getDy=function(){return this._dy},Be.prototype.getCoordinate=function(){return this._p0},Be.prototype.setNode=function(t){this._node=t},Be.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)},Be.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},Be.prototype.getDirectedCoordinate=function(){return this._p1},Be.prototype.getDx=function(){return this._dx},Be.prototype.getLabel=function(){return this._label},Be.prototype.getEdge=function(){return this._edge},Be.prototype.getQuadrant=function(){return this._quadrant},Be.prototype.getNode=function(){return this._node},Be.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},Be.prototype.computeLabel=function(t){},Be.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=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Be.prototype.interfaces_=function(){return[E]},Be.prototype.getClass=function(){return Be};var qe=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 Le(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 Oe("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,Ne.LEFT)===O.INTERIOR&&this._label.getLocation(e,Ne.RIGHT)===O.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[Ne.LEFT]+"/"+this._depth[Ne.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,O.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,O.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===Ne.LEFT&&(r=-1);var i=Ne.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===O.EXTERIOR&&e===O.INTERIOR?1:t===O.INTERIOR&&e===O.EXTERIOR?-1:0},e}(Be),Ve=function(){};Ve.prototype.createNode=function(t){return new ke(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var ze=function(){if(this._edges=new wt,this._nodes=null,this._edgeEndList=new wt,0===arguments.length)this._nodes=new je(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new je(t)}};ze.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)}},ze.prototype.find=function(t){return this._nodes.find(t)},ze.prototype.addNode=function(){if(arguments[0]instanceof ke){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof I){var e=arguments[0];return this._nodes.addNode(e)}},ze.prototype.getNodeIterator=function(){return this._nodes.iterator()},ze.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},ze.prototype.debugPrintln=function(t){z.out.println(t)},ze.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)===O.BOUNDARY},ze.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},ze.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&at.computeOrientation(t,e,r)===at.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},ze.prototype.getEdgeEnds=function(){return this._edgeEndList},ze.prototype.debugPrint=function(t){z.out.print(t)},ze.prototype.getEdgeIterator=function(){return this._edges.iterator()},ze.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},ze.prototype.insertEdge=function(t){this._edges.add(t)},ze.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},ze.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new qe(n,!0),i=new qe(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},ze.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},ze.prototype.getNodes=function(){return this._nodes.values()},ze.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},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze},ze.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Xe=function(){this._geometryFactory=null,this._shellList=new wt;var t=arguments[0];this._geometryFactory=t};Xe.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)}},Xe.prototype.computePolygons=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Xe.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 Oe("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new wt,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},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Me(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.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 p=!1;l.contains(r)&&at.isPointInRing(i,c.getCoordinates())&&(p=!0),p&&(null===o||s.contains(l))&&(o=u)}return o},Xe.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 et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Xe.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];ze.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new wt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var Ye=function(){};Ye.prototype.getBounds=function(){},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var He=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[Ye,e]},He.prototype.getClass=function(){return He};var We=function(){this._size=null,this._items=null,this._size=0,this._items=new wt,this._items.add(null)};We.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},We.prototype.size=function(){return this._size},We.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)},We.prototype.clear=function(){this._size=0,this._items.clear()},We.prototype.isEmpty=function(){return 0===this._size},We.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)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We};var $e=function(){};$e.prototype.visitItem=function(t){},$e.prototype.interfaces_=function(){return[]},$e.prototype.getClass=function(){return $e};var Qe=function(){};Qe.prototype.insert=function(t,e){},Qe.prototype.remove=function(t,e){},Qe.prototype.query=function(){},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};var Ke=function(){if(this._childBoundables=new wt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Je={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[Ye,e]},Ke.prototype.getClass=function(){return Ke},Je.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Je);var Ze=function(){};Ze.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Ze.min=function(t){return Ze.sort(t),t.get(0)},Ze.sort=function(t,e){var n=t.toArray();e?kt.sort(n,e):kt.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},Ze.singletonList=function(t){var e=new wt;return e.add(t),e};var tn=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()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.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 m("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tn(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[E]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Ke};var en=function t(){if(this._root=null,this._built=!1,
this._itemBoundables=new wt,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.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 Ke?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof He&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new wt:t}if(1===arguments.length){for(var e=arguments[0],n=new wt,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ke){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof He?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new wt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.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 Ke?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof He),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new wt;return this.isEmpty()?e:(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(T(arguments[2],$e)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)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 Ke?this.query(i,c,s):c instanceof He?s.visitItem(c.getItem()):et.shouldNeverReachHere())}else if(T(arguments[2],xt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var l=arguments[0],p=arguments[1],h=arguments[2],f=p.getChildBoundables(),d=0;d<f.size();d++){var g=f.get(d);this.getIntersectsOp().intersects(g.getBounds(),l)&&(g instanceof Ke?this.query(l,g,h):g instanceof He?h.add(g.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){return this._built?null:(this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0,void 0)},en.prototype.getRoot=function(){return this.build(),this._root},en.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 Ke&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.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 Ke){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new wt;n.add(this.createNode(e));var r=new wt(t);Ze.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},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var sn=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new wt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new an(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];return e.isNull()?null:void t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.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 wt;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},n.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(T(arguments[2],$e)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(T(arguments[2],xt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke){var a=arguments[0],u=arguments[1],c=arguments[2];t.prototype.query.call(this,a,u,c)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.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)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new wt(t);Ze.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(T(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,v.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&T(arguments[1],on)){var i=arguments[0],o=arguments[1],s=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],c=null,l=new We;for(l.add(a);!l.isEmpty()&&u>0;){var p=l.poll(),h=p.getDistance();if(h>=u)break;p.isLeaves()?(u=h,c=p):p.expandToQueue(l,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[0],d=arguments[1],g=arguments[2],y=new He(f,d),_=new tn(this.getRoot(),y,g);return this.nearestNeighbour(_)[0]}},n.prototype.interfaces_=function(){return[Qe,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return an},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[w]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[w]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),an=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 Y(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),un=function(){};un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var cn=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 I(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};cn.prototype.getCoordinate=function(){return this.coord},cn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},cn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},cn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},cn.prototype.isInterior=function(){return this._isInterior},cn.prototype.interfaces_=function(){return[E]},cn.prototype.getClass=function(){return cn};var ln=function(){this._nodeMap=new p,this._edge=null;var t=arguments[0];this._edge=t};ln.prototype.getSplitCoordinates=function(){var t=new Nt;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()},ln.prototype.addCollapsedNodes=function(){var t=new wt;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)}},ln.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},ln.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 D(e+1))}},ln.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new I(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new I(e.coord))},ln.prototype.iterator=function(){return this._nodeMap.values().iterator()},ln.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}},ln.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)},ln.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 D(e[0])),r=i}},ln.prototype.getEdge=function(){return this._edge},ln.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ln.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 I(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new I(e.coord)),new dn(o,this._edge.getData())},ln.prototype.add=function(t,e){var n=new cn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},ln.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Z("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 Z("bad split edge end point at "+i)},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var pn=function(){};pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},pn.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 m("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 I&&arguments[1]instanceof I){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new m("Cannot compute the octant for two identical points "+i);return pn.octant(s,a)}};var hn=function(){};hn.prototype.getCoordinates=function(){},hn.prototype.size=function(){},hn.prototype.getCoordinate=function(t){},hn.prototype.isClosed=function(){},hn.prototype.setData=function(t){},hn.prototype.getData=function(){},hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn};var fn=function(){};fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[hn]},fn.prototype.getClass=function(){return fn};var dn=function(){this._nodeList=new ln(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};dn.prototype.getCoordinates=function(){return this._pts},dn.prototype.size=function(){return this._pts.length},dn.prototype.getCoordinate=function(t){return this._pts[t]},dn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},dn.prototype.setData=function(t){this._data=t},dn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:pn.octant(t,e)},dn.prototype.getData=function(){return this._data},dn.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 I(n.getIntersection(i));this.addIntersection(o,r)}},dn.prototype.toString=function(){return J.toLineString(new ue(this._pts))},dn.prototype.getNodeList=function(){return this._nodeList},dn.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)},dn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},dn.prototype.interfaces_=function(){return[fn]},dn.prototype.getClass=function(){return dn},dn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new wt;return dn.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 gn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new I,this.p1=new I;else if(1===arguments.length){var t=arguments[0];this.p0=new I(t.p0),this.p1=new I(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 I(e,n),this.p1=new I(r,i)}},yn={serialVersionUID:{configurable:!0}};gn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},gn.prototype.orientationIndex=function(){if(arguments[0]instanceof gn){var t=arguments[0],e=at.orientationIndex(this.p0,this.p1,t.p0),n=at.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof I){var r=arguments[0];return at.orientationIndex(this.p0,this.p1,r)}},gn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},gn.prototype.isVertical=function(){return this.p0.x===this.p1.x},gn.prototype.equals=function(t){if(!(t instanceof gn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},gn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},gn.prototype.project=function(){if(arguments[0]instanceof I){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new I(t);var e=this.projectionFactor(t),n=new I;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 gn){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 gn(s,a)}},gn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},gn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},gn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},gn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},gn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},gn.prototype.midPoint=function(){return gn.midPoint(this.p0,this.p1)},gn.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?v.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},gn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=v.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},gn.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},gn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},gn.prototype.getLength=function(){return this.p0.distance(this.p1)},gn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},gn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},gn.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)},gn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},gn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},gn.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 I(n-u,r+a)},gn.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}},gn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||v.isNaN(e))&&(e=1),e},gn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},gn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},gn.prototype.distance=function(){if(arguments[0]instanceof gn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof I){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},gn.prototype.pointAlong=function(t){var e=new I;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},gn.prototype.hashCode=function(){var t=v.doubleToLongBits(this.p0.x);t^=31*v.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=v.doubleToLongBits(this.p1.x);return n^=31*v.doubleToLongBits(this.p1.y),e^(Math.trunc(n)^Math.trunc(n>>32))},gn.prototype.interfaces_=function(){return[E,e]},gn.prototype.getClass=function(){return gn},gn.midPoint=function(t,e){return new I((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(gn,yn);var _n=function(){this.tempEnv1=new Y,this.tempEnv2=new Y,this._overlapSeg1=new gn,this._overlapSeg2=new gn};_n.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)}},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var mn=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};mn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},mn.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)},mn.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},mn.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},mn.prototype.setId=function(t){this._id=t},mn.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},mn.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new Y(t,e)}return this._env},mn.prototype.getEndIndex=function(){return this._end},mn.prototype.getStartIndex=function(){return this._start},mn.prototype.getContext=function(){return this._context},mn.prototype.getId=function(){return this._id},mn.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),p=Math.trunc((r+i)/2);t<l&&(r<p&&this.computeOverlapsInternal(t,l,n,r,p,o),p<i&&this.computeOverlapsInternal(t,l,n,p,i,o)),l<e&&(r<p&&this.computeOverlapsInternal(l,e,n,r,p,o),p<i&&this.computeOverlapsInternal(l,e,n,p,i,o))},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(t){var e=0,n=new wt;n.add(new D(e));do{var r=vn.findChainEnd(t,e);n.add(new D(r)),e=r}while(e<t.length-1);return vn.toIntArray(n)},vn.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=Ge.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},vn.getChains=function(){if(1===arguments.length){var t=arguments[0];return vn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new wt,i=vn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new mn(e,i[o],i[o+1],n);r.add(s)}return r}},vn.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 bn=function(){};bn.prototype.computeNodes=function(t){},bn.prototype.getNodedSubstrings=function(){},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn};var En=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[bn]},En.prototype.getClass=function(){return En};var xn=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new wt,this._index=new sn,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 dn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=vn.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 wn(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 wn},Object.defineProperties(e,n),e}(En),wn=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}(_n),In=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)}},Nn={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}};In.prototype.getEndCapStyle=function(){return this._endCapStyle},In.prototype.isSingleSided=function(){return this._isSingleSided},In.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=In.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=In.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==In.JOIN_ROUND&&(this._quadrantSegments=In.DEFAULT_QUADRANT_SEGMENTS)},In.prototype.getJoinStyle=function(){return this._joinStyle},In.prototype.setJoinStyle=function(t){this._joinStyle=t},In.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},In.prototype.getSimplifyFactor=function(){return this._simplifyFactor},In.prototype.getQuadrantSegments=function(){return this._quadrantSegments},In.prototype.setEndCapStyle=function(t){this._endCapStyle=t},In.prototype.getMitreLimit=function(){return this._mitreLimit},In.prototype.setMitreLimit=function(t){this._mitreLimit=t},In.prototype.setSingleSided=function(t){this._isSingleSided=t},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},In.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Nn.CAP_ROUND.get=function(){return 1},Nn.CAP_FLAT.get=function(){return 2},Nn.CAP_SQUARE.get=function(){return 3},Nn.JOIN_ROUND.get=function(){return 1},Nn.JOIN_MITRE.get=function(){return 2},Nn.JOIN_BEVEL.get=function(){return 3},Nn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Nn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Nn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(In,Nn);var Cn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null},Sn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Cn.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);
},Cn.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]=Cn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Cn.prototype.isShallowConcavity=function(t,e,n,r){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<r},Cn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Cn.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},Cn.prototype.isConcave=function(t,e,n){var r=at.computeOrientation(t,e,n)===this._angleOrientation;return r},Cn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=at.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do e=this.deleteShallowConcavities();while(e);return this.collapseLine()},Cn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Cn.DELETE;)e++;return e},Cn.prototype.isShallow=function(t,e,n,r){return at.distancePointLine(e,t,n)<r},Cn.prototype.collapseLine=function(){for(var t=new Nt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Cn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.simplify=function(t,e){return new Cn(t).simplify(e)},Sn.INIT.get=function(){return 0},Sn.DELETE.get=function(){return 1},Sn.KEEP.get=function(){return 1},Sn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Cn,Sn);var On=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new wt},Pn={COORDINATE_ARRAY_TYPE:{configurable:!0}};On.prototype.getCoordinates=function(){return this._ptList.toArray(On.COORDINATE_ARRAY_TYPE)},On.prototype.setPrecisionModel=function(t){this._precisionModel=t},On.prototype.addPt=function(t){var e=new I(t);return this._precisionModel.makePrecise(e),this.isRedundant(e)?null:void this._ptList.add(e)},On.prototype.revere=function(){},On.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])},On.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},On.prototype.toString=function(){return(new _e).createLineString(this.getCoordinates()).toString()},On.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new I(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);return t.equals(e)?null:void this._ptList.add(t)},On.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},Pn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(On,Pn);var Tn=function(){},Rn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Tn.toDegrees=function(t){return 180*t/Math.PI},Tn.normalize=function(t){for(;t>Math.PI;)t-=Tn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Tn.PI_TIMES_2;return t},Tn.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)}},Tn.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},Tn.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},Tn.interiorAngle=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n);return Math.abs(i-r)},Tn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Tn.PI_TIMES_2;t>=Tn.PI_TIMES_2&&(t=0)}else{for(;t>=Tn.PI_TIMES_2;)t-=Tn.PI_TIMES_2;t<0&&(t=0)}return t},Tn.angleBetween=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n);return Tn.diff(r,i)},Tn.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Tn.toRadians=function(t){return t*Math.PI/180},Tn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Tn.COUNTERCLOCKWISE:n<0?Tn.CLOCKWISE:Tn.NONE},Tn.angleBetweenOriented=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n)-r;return i<=-Math.PI?i+Tn.PI_TIMES_2:i>Math.PI?i-Tn.PI_TIMES_2:i},Rn.PI_TIMES_2.get=function(){return 2*Math.PI},Rn.PI_OVER_2.get=function(){return Math.PI/2},Rn.PI_OVER_4.get=function(){return Math.PI/4},Rn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Rn.CLOCKWISE.get=function(){return at.CLOCKWISE},Rn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Tn,Rn);var Ln=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 gn,this._seg1=new gn,this._offset0=new gn,this._offset1=new gn,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 it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===In.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},An={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}};Ln.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=at.computeOrientation(this._s0,this._s1,this._s2),r=n===at.CLOCKWISE&&this._side===Ne.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Ne.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Ln.prototype.addLineEndCap=function(t,e){var n=new gn(t,e),r=new gn;this.computeOffsetSegment(n,Ne.LEFT,this._distance,r);var i=new gn;this.computeOffsetSegment(n,Ne.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 In.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case In.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case In.CAP_SQUARE:var u=new I;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new I(r.p1.x+u.x,r.p1.y+u.y),l=new I(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l)}},Ln.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Ln.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=X.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 V))throw t;o=new I(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Ln.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===at.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)},Ln.prototype.addOutsideTurn=function(t,e){return this._offset0.p1.distance(this._offset1.p0)<this._distance*Ln.OFFSET_SEGMENT_SEPARATION_FACTOR?(this._segList.addPt(this._offset0.p1),null):void(this._bufParams.getJoinStyle()===In.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===In.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)))},Ln.prototype.createSquare=function(t){this._segList.addPt(new I(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new I(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new I(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new I(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Ln.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Ln.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Ln.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Ln.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)},Ln.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Tn.angle(i,this._seg0.p0),s=Tn.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Tn.normalize(o+s),u=Tn.normalize(a+Math.PI),c=r*n,l=n-c*Math.abs(Math.sin(s)),p=i.x+c*Math.cos(u),h=i.y+c*Math.sin(u),f=new I(p,h),d=new gn(i,f),g=d.pointAlongOffset(1,l),y=d.pointAlongOffset(1,-l);this._side===Ne.LEFT?(this._segList.addPt(g),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(g))},Ln.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Ne.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},Ln.prototype.addFilletArc=function(t,e,n,r,i){var o=r===at.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 I;c<s;){var p=e+o*c;l.x=t.x+i*Math.cos(p),l.y=t.y+i*Math.sin(p),this._segList.addPt(l),c+=u}},Ln.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*Ln.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 I((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 I((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)}},Ln.prototype.createCircle=function(t){var e=new I(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Ln.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Ln.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new On,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Ln.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Ln.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===In.JOIN_BEVEL||this._bufParams.getJoinStyle()===In.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,at.CLOCKWISE,this._distance))},Ln.prototype.closeRing=function(){this._segList.closeRing()},Ln.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},An.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},An.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},An.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},An.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Ln,An);var Dn=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};Dn.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&&Ct.reverse(o),o},Dn.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},Dn.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ne.RIGHT&&(r=-r);var i=Cn.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()},Dn.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Cn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ne.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Cn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Ne.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},Dn.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case In.CAP_ROUND:e.createCircle(t);break;case In.CAP_SQUARE:e.createSquare(t)}},Dn.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()},Dn.prototype.getBufferParameters=function(){return this._bufParams},Dn.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},Dn.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Dn.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},Dn.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Cn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Cn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},Dn.prototype.getSegGen=function(t){return new Ln(this._precisionModel,this._bufParams,t)},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Dn.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new I(t[n]);return e};var Mn=function(){this._subgraphs=null,this._seg=new gn,this._cga=new at;var t=arguments[0];this._subgraphs=t},Fn={DepthSegment:{configurable:!0}};Mn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new wt,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(T(arguments[2],xt)&&arguments[0]instanceof I&&arguments[1]instanceof qe){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||at.computeOrientation(this._seg.p0,this._seg.p1,o)===at.RIGHT)){var l=s.getDepth(Ne.LEFT);this._seg.p0.equals(u[c])||(l=s.getDepth(Ne.RIGHT));var p=new kn(this._seg,l);a.add(p)}}else if(T(arguments[2],xt)&&arguments[0]instanceof I&&T(arguments[1],xt))for(var h=arguments[0],f=arguments[1],d=arguments[2],g=f.iterator();g.hasNext();){var y=g.next();y.isForward()&&this.findStabbedSegments(h,y,d)}},Mn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Ze.min(e)._leftDepth},Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Fn.DepthSegment.get=function(){return kn},Object.defineProperties(Mn,Fn);var kn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new gn(t),this._leftDepth=e};kn.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?n:0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},kn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},kn.prototype.toString=function(){return this._upwardSeg.toString()},kn.prototype.interfaces_=function(){return[E]},kn.prototype.getClass=function(){return kn};var jn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};jn.prototype.area=function(){return jn.area(this.p0,this.p1,this.p2)},jn.prototype.signedArea=function(){return jn.signedArea(this.p0,this.p1,this.p2)},jn.prototype.interpolateZ=function(t){if(null===t)throw new m("Supplied point is null.");return jn.interpolateZ(t,this.p0,this.p1,this.p2)},jn.prototype.longestSideLength=function(){return jn.longestSideLength(this.p0,this.p1,this.p2)},jn.prototype.isAcute=function(){return jn.isAcute(this.p0,this.p1,this.p2)},jn.prototype.circumcentre=function(){return jn.circumcentre(this.p0,this.p1,this.p2)},jn.prototype.area3D=function(){return jn.area3D(this.p0,this.p1,this.p2)},jn.prototype.centroid=function(){return jn.centroid(this.p0,this.p1,this.p2)},jn.prototype.inCentre=function(){return jn.inCentre(this.p0,this.p1,this.p2)},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.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)},jn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},jn.det=function(t,e,n,r){return t*r-e*n},jn.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,p=t.x-i,h=t.y-o,f=(c*p-a*h)/l,d=(-u*p+s*h)/l;return e.z+f*(n.z-e.z)+d*(r.z-e.z)},jn.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},jn.isAcute=function(t,e,n){return!!Tn.isAcute(t,e,n)&&!!Tn.isAcute(e,n,t)&&!!Tn.isAcute(n,t,e)},jn.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*jn.det(o,s,a,u),l=jn.det(s,o*o+s*s,u,a*a+u*u),p=jn.det(o,o*o+s*s,a,a*a+u*u);return new I(r-l/c,i+p/c)},jn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new X(t.x+n/2,t.y+r/2,1),o=new X(t.x-r+n/2,t.y+n+r/2,1);return new X(i,o)},jn.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 I(t.x+i*o,t.y+i*s)},jn.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,p=r*a-i*s,h=c*c+l*l+p*p,f=Math.sqrt(h)/2;return f},jn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new I(r,i)},jn.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 I(a,u)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new wt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ne.LEFT;this._distance<0&&(e=-this._distance,n=Ne.RIGHT);var r=t.getExteriorRing(),i=Ct.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,O.EXTERIOR,O.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Ct.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ne.opposite(n),O.INTERIOR,O.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new jn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Ct.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new dn(t,new Le(0,O.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=i,s=r,n=Ne.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gn.prototype.add=function(t){return t.isEmpty()?null:void(t instanceof Zt?this.addPolygon(t):t instanceof $t?this.addLineString(t):t instanceof Kt?this.addPoint(t):t instanceof te?this.addCollection(t):t instanceof Vt?this.addCollection(t):t instanceof ne?this.addCollection(t):t instanceof qt&&this.addCollection(t))},Gn.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},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Un=function(){};Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var Bn=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()};Bn.prototype.next=function(){if(this._atStart)return this._atStart=!1,Bn.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 r;var t=this._parent.getGeometryN(this._index++);return t instanceof qt?(this._subcollectionIterator=new Bn(t),this._subcollectionIterator.next()):t},Bn.prototype.remove=function(){throw new Error(this.getClass().getName())},Bn.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)},Bn.prototype.interfaces_=function(){return[Et]},Bn.prototype.getClass=function(){return Bn},Bn.isAtomic=function(t){return!(t instanceof qt)};var qn=function(){this._geom=null;var t=arguments[0];this._geom=t};qn.prototype.locate=function(t){return qn.locate(t,this._geom)},qn.prototype.interfaces_=function(){return[Un]},qn.prototype.getClass=function(){return qn},qn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},qn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!qn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(qn.isPointInRing(t,i))return!1}return!0},qn.containsPoint=function(t,e){if(e instanceof Zt)return qn.containsPointInPolygon(t,e);if(e instanceof qt)for(var n=new Bn(e);n.hasNext();){var r=n.next();if(r!==e&&qn.containsPoint(t,r))return!0}return!1},qn.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:qn.containsPoint(t,e)?O.INTERIOR:O.EXTERIOR};var Vn=function(){this._edgeMap=new p,this._edgeList=null,this._ptInAreaLocation=[O.NONE,O.NONE]};Vn.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)},Vn.prototype.propagateSideLabels=function(t){for(var e=O.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ne.LEFT)!==O.NONE&&(e=r.getLocation(t,Ne.LEFT))}if(e===O.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Ne.ON)===O.NONE&&a.setLocation(t,Ne.ON,i),a.isArea(t)){var u=a.getLocation(t,Ne.LEFT),c=a.getLocation(t,Ne.RIGHT);if(c!==O.NONE){if(c!==i)throw new Oe("side location conflict",s.getCoordinate());u===O.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else et.isTrue(a.getLocation(t,Ne.LEFT)===O.NONE,"found single null side"),a.setLocation(t,Ne.RIGHT,i),a.setLocation(t,Ne.LEFT,i)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){z.out.println("EdgeEndStar:   "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Vn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Vn.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,Ne.LEFT);et.isTrue(r!==O.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();et.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Ne.LEFT),u=s.getLocation(t,Ne.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},Vn.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},Vn.prototype.iterator=function(){return this.getEdges().iterator()},Vn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new wt(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===O.NONE&&(this._ptInAreaLocation[t]=qn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new A;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()},Vn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Vn.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)===O.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=O.NONE;if(e[u])c=O.EXTERIOR;else{var l=s.getCoordinate();c=this.getLocation(u,l,t)}a.setAllLocationsIfNull(u,c)}},Vn.prototype.getDegree=function(){return this._edgeMap.size()},Vn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var zn=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 Oe("no outgoing dirEdge found",this.getCoordinate());et.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 Ge.isNorthern(i)&&Ge.isNorthern(o)?n:Ge.isNorthern(i)||Ge.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){z.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 wt;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(Ne.LEFT),r=t.getDepth(Ne.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Oe("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(Ne.RIGHT,a),a=c.getDepth(Ne.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&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),
et.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=O.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=O.INTERIOR;break}if(r.isInResult()){t=O.EXTERIOR;break}}}if(t===O.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===O.INTERIOR):(s.isInResult()&&(i=O.EXTERIOR),a.isInResult()&&(i=O.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Le(O.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!==O.INTERIOR&&o!==O.BOUNDARY||this._label.setLocation(i,O.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Xn=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 ke(t,new zn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),Yn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Yn.prototype.compareTo=function(t){var e=t;return Yn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yn.prototype.interfaces_=function(){return[E]},Yn.prototype.getClass=function(){return Yn},Yn.orientation=function(t){return 1===Ct.increasingDirection(t)},Yn.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 p=(u+=i)===s,h=(c+=o)===a;if(p&&!h)return-1;if(!p&&h)return 1;if(p&&h)return 0}};var Hn=function(){this._edges=new wt,this._ocaMap=new p};Hn.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(")  ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Yn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Yn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Wn=function(){};Wn.prototype.processIntersections=function(t,e,n,r){},Wn.prototype.isDone=function(){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var $n=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};$n.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if($n.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},$n.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},$n.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},$n.prototype.getLineIntersector=function(){return this._li},$n.prototype.hasProperIntersection=function(){return this._hasProper},$n.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)))},$n.prototype.hasIntersection=function(){return this._hasIntersection},$n.prototype.isDone=function(){return!1},$n.prototype.hasInteriorIntersection=function(){return this._hasInterior},$n.prototype.interfaces_=function(){return[Wn]},$n.prototype.getClass=function(){return $n},$n.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Qn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new I(t),this.segmentIndex=e,this.dist=n};Qn.prototype.getSegmentIndex=function(){return this.segmentIndex},Qn.prototype.getCoordinate=function(){return this.coord},Qn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Qn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Qn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Qn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Qn.prototype.getDistance=function(){return this.dist},Qn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Qn.prototype.interfaces_=function(){return[E]},Qn.prototype.getClass=function(){return Qn};var Kn=function(){this._nodeMap=new p,this.edge=null;var t=arguments[0];this.edge=t};Kn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Kn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Kn.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}},Kn.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)},Kn.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 I(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 nr(o,new Le(this.edge._label))},Kn.prototype.add=function(t,e,n){var r=new Qn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Kn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Kn.prototype.interfaces_=function(){return[]},Kn.prototype.getClass=function(){return Kn};var Jn=function(){};Jn.prototype.getChainStartIndices=function(t){var e=0,n=new wt;n.add(new D(e));do{var r=this.findChainEnd(t,e);n.add(new D(r)),e=r}while(e<t.length-1);return Jn.toIntArray(n)},Jn.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},Jn.prototype.interfaces_=function(){return[]},Jn.prototype.getClass=function(){return Jn},Jn.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 Zn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Y,this.env2=new Y;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Jn;this.startIndex=e.getChainStartIndices(this.pts)};Zn.prototype.getCoordinates=function(){return this.pts},Zn.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},Zn.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},Zn.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],p=this.pts[o],h=s.pts[a],f=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,p),this.env2.init(h,f),!this.env1.intersects(this.env2))return null;var d=Math.trunc((i+o)/2),g=Math.trunc((a+u)/2);i<d&&(a<g&&this.computeIntersectsForChain(i,d,s,a,g,c),g<u&&this.computeIntersectsForChain(i,d,s,g,u,c)),d<o&&(a<g&&this.computeIntersectsForChain(d,o,s,a,g,c),g<u&&this.computeIntersectsForChain(d,o,s,g,u,c))}},Zn.prototype.getStartIndexes=function(){return this.startIndex},Zn.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)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var tr=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},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.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]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.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}}},tr.prototype.getDelta=function(t){return this._depth[t][Ne.RIGHT]-this._depth[t][Ne.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.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!==O.EXTERIOR&&r!==O.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===O.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Kn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,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,Le.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 Zn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Y;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 I(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 A;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,Ne.ON),e.getLocation(1,Ne.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ne.LEFT),e.getLocation(1,Ne.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ne.RIGHT),e.getLocation(1,Ne.RIGHT),2))},e}(Fe),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.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 Le(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new wt,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Mn(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new wt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Te;i.create(r),e.add(i)}}return Ze.sort(e,Ze.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new xn,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new $n(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new Dn(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new ze(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},rr.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 nr(i.getCoordinates(),new Le(s));this.insertUniqueEdge(a)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ne.LEFT),n=t.getLocation(0,Ne.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new _e,n=new wt;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=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()}};ir.prototype.rescale=function(){if(T(arguments[0],bt))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])&&z.out.println(n)}},ir.prototype.scale=function(){if(T(arguments[0],bt)){for(var t=arguments[0],e=new wt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new dn(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 I(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return Ct.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[bn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},sr={fact:{configurable:!0}};or.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 Z("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.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],p=arguments[1],h=arguments[2],f=arguments[3];if(l===h&&p===f)return null;var d=l.getCoordinates()[p],g=l.getCoordinates()[p+1],y=h.getCoordinates()[f],_=h.getCoordinates()[f+1];if(this._li.computeIntersection(d,g,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,d,g)||this.hasInteriorIntersection(this._li,y,_)))throw new Z("found non-noded intersection at "+d+"-"+g+" and "+y+"-"+_)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.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])},or.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},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Z("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},sr.fact.get=function(){return new _e},Object.defineProperties(or,sr);var ar=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 m("Scale factor must be non-zero");1!==e&&(this._pt=new I(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new I,this._p1Scaled=new I),this.initCorners(this._pt)},ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ar.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 et.isTrue(!(s&&a),"Found bad envelope test"),a},ar.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 I(this._maxx,this._maxy),this._corner[1]=new I(this._minx,this._maxy),this._corner[2]=new I(this._minx,this._miny),this._corner[3]=new I(this._maxx,this._miny)},ar.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))},ar.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ar.prototype.getCoordinate=function(){return this._originalPt},ar.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ar.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ar.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Y(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ar.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()))))},ar.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)))))},ar.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)},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ar,ur);var cr=function(){this.tempEnv1=new Y,this.selectedSegment=new gn};cr.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)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var lr=function(){this._index=null;var t=arguments[0];this._index=t},pr={HotPixelSnapAction:{configurable:!0}};lr.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 hr(e,n,r);return this._index.query(i,{interfaces_:function(){return[$e]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},pr.HotPixelSnapAction.get=function(){return hr},Object.defineProperties(lr,pr);var hr=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();return null!==this._parentEdge&&r===this._parentEdge&&n===this._hotPixelVertexIndex?null:void(this._isNodeAdded=this._hotPixel.addSnappedNode(r,n))},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new wt};fr.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)}},fr.prototype.isDone=function(){return!1},fr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},fr.prototype.interfaces_=function(){return[Wn]},fr.prototype.getClass=function(){return fr};var dr=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 it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};dr.prototype.checkCorrectness=function(t){var e=dn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof q))throw t;t.printStackTrace()}},dr.prototype.getNodedSubstrings=function(){return dn.getNodedSubstrings(this._nodedSegStrings)},dr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},dr.prototype.findInteriorIntersections=function(t,e){var n=new fr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},dr.prototype.computeVertexSnaps=function(){if(T(arguments[0],bt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof dn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new ar(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},dr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new xn,this._pointSnapper=new lr(this._noder.getIndex()),this.snapRound(t,this._li)},dr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new ar(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},dr.prototype.interfaces_=function(){return[bn]},dr.prototype.getClass=function(){return dr};var gr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new In,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}},yr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};gr.prototype.bufferFixedPrecision=function(t){var e=new ir(new dr(new fe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},gr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=gr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Oe))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=gr.precisionScaleFactor(this._argGeom,this._distance,n),i=new fe(r);this.bufferFixedPrecision(i)}},gr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Z))throw t;this._saveException=t}},gr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gr.prototype.interfaces_=function(){return[]},gr.prototype.getClass=function(){return gr},gr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new gr(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new gr(n);return o.setQuadrantSegments(i),o.getResultGeometry(r)}if(arguments[2]instanceof In&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var s=arguments[0],a=arguments[1],u=arguments[2];return new gr(s,u).getResultGeometry(a)}}else if(4===arguments.length){var c=arguments[0],l=arguments[1],p=arguments[2],h=arguments[3],f=new gr(c);return f.setQuadrantSegments(p),f.setEndCapStyle(h),
f.getResultGeometry(l)}},gr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=R.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)},yr.CAP_ROUND.get=function(){return In.CAP_ROUND},yr.CAP_BUTT.get=function(){return In.CAP_FLAT},yr.CAP_FLAT.get=function(){return In.CAP_FLAT},yr.CAP_SQUARE.get=function(){return In.CAP_SQUARE},yr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gr,yr);var _r=function(){this._pt=[new I,new I],this._distance=v.NaN,this._isNull=!0};_r.prototype.getCoordinates=function(){return this._pt},_r.prototype.getCoordinate=function(t){return this._pt[t]},_r.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)}},_r.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}},_r.prototype.getDistance=function(){return this._distance},_r.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)}},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var mr=function(){};mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},mr.computeDistance=function(){if(arguments[2]instanceof _r&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=t.getCoordinates(),i=new gn,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 _r&&arguments[0]instanceof Zt&&arguments[1]instanceof I){var a=arguments[0],u=arguments[1],c=arguments[2];mr.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)mr.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof _r&&arguments[0]instanceof lt&&arguments[1]instanceof I){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof $t)mr.computeDistance(p,h,f);else if(p instanceof Zt)mr.computeDistance(p,h,f);else if(p instanceof qt)for(var d=p,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);mr.computeDistance(y,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof _r&&arguments[0]instanceof gn&&arguments[1]instanceof I){var _=arguments[0],m=arguments[1],v=arguments[2],b=_.closestPoint(m);v.setMinimum(b,m)}};var vr=function(t){this._maxPtDist=new _r,this._inputGeom=t||null},br={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};vr.prototype.computeMaxMidpointDistance=function(t){var e=new xr(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},vr.prototype.getDistancePoints=function(){return this._maxPtDist},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},br.MaxPointDistanceFilter.get=function(){return Er},br.MaxMidpointDistanceFilter.get=function(){return xr},Object.defineProperties(vr,br);var Er=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};Er.prototype.filter=function(t){this._minPtDist.initialize(),mr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[ft]},Er.prototype.getClass=function(){return Er};var xr=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};xr.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new I((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),mr.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},xr.prototype.isDone=function(){return!1},xr.prototype.isGeometryChanged=function(){return!1},xr.prototype.getMaxPointDistance=function(){return this._maxPtDist},xr.prototype.interfaces_=function(){return[Bt]},xr.prototype.getClass=function(){return xr};var wr=function(t){this._comps=t||null};wr.prototype.filter=function(t){t instanceof Zt&&this._comps.add(t)},wr.prototype.interfaces_=function(){return[Ut]},wr.prototype.getClass=function(){return wr},wr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return wr.getPolygons(t,new wt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof qt&&e.apply(new wr(n)),n}};var Ir=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}};Ir.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof $t&&this._lines.add(t)},Ir.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},Ir.prototype.interfaces_=function(){return[ct]},Ir.prototype.getClass=function(){return Ir},Ir.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(Ir.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(Ir.getLines(e,n))}},Ir.getLines=function(){if(1===arguments.length){var t=arguments[0];return Ir.getLines(t,!1)}if(2===arguments.length){if(T(arguments[0],bt)&&T(arguments[1],bt)){for(var e=arguments[0],n=arguments[1],r=e.iterator();r.hasNext();){var i=r.next();Ir.getLines(i,n)}return n}if(arguments[0]instanceof lt&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1],a=new wt;return o.apply(new Ir(a,s)),a}if(arguments[0]instanceof lt&&T(arguments[1],bt)){var u=arguments[0],c=arguments[1];return u instanceof $t?c.add(u):u.apply(new Ir(c)),c}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&T(arguments[0],bt)&&T(arguments[1],bt)){for(var l=arguments[0],p=arguments[1],h=arguments[2],f=l.iterator();f.hasNext();){var d=f.next();Ir.getLines(d,p,h)}return p}if("boolean"==typeof arguments[2]&&arguments[0]instanceof lt&&T(arguments[1],bt)){var g=arguments[0],y=arguments[1],_=arguments[2];return g.apply(new Ir(y,_)),y}}};var Nr=function(){if(this._boundaryRule=dt.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 m("Rule must be non-null");this._boundaryRule=t}};Nr.prototype.locateInternal=function(){if(arguments[0]instanceof I&&arguments[1]instanceof Zt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return O.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===O.EXTERIOR)return O.EXTERIOR;if(r===O.BOUNDARY)return O.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===O.INTERIOR)return O.EXTERIOR;if(s===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}if(arguments[0]instanceof I&&arguments[1]instanceof $t){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return O.EXTERIOR;var c=u.getCoordinates();return u.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?at.isOnLine(a,c)?O.INTERIOR:O.EXTERIOR:O.BOUNDARY}if(arguments[0]instanceof I&&arguments[1]instanceof Kt){var l=arguments[0];return arguments[1].getCoordinate().equals2D(l)?O.INTERIOR:O.EXTERIOR}},Nr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},Nr.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},Nr.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},Nr.prototype.computeLocation=function(t,e){if(e instanceof Kt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof $t)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)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 ne)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 qt)for(var u=new Bn(e);u.hasNext();){var c=u.next();c!==e&&this.computeLocation(t,c)}},Nr.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof $t?this.locateInternal(t,e):e instanceof Zt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?O.BOUNDARY:this._numBoundaries>0||this._isIn?O.INTERIOR:O.EXTERIOR)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Cr=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}},Sr={INSIDE_AREA:{configurable:!0}};Cr.prototype.isInsideArea=function(){return this._segIndex===Cr.INSIDE_AREA},Cr.prototype.getCoordinate=function(){return this._pt},Cr.prototype.getGeometryComponent=function(){return this._component},Cr.prototype.getSegmentIndex=function(){return this._segIndex},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Sr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Cr,Sr);var Or=function(t){this._pts=t||null};Or.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Or.prototype.interfaces_=function(){return[Ut]},Or.prototype.getClass=function(){return Or},Or.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?Ze.singletonList(t):Or.getPoints(t,new wt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Kt?n.add(e):e instanceof qt&&e.apply(new Or(n)),n}};var Pr=function(){this._locations=null;var t=arguments[0];this._locations=t};Pr.prototype.filter=function(t){(t instanceof Kt||t instanceof $t||t instanceof Zt)&&this._locations.add(new Cr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[Ut]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new wt;return t.apply(new Pr(e)),e};var Tr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Nr,this._minDistanceLocation=null,this._minDistance=v.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}};Tr.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=wr.getPolygons(this._geom[e]);if(i.size()>0){var o=Pr.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&&T(arguments[0],xt)&&T(arguments[1],xt)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var l=s.get(c),p=0;p<a.size();p++)if(this.computeContainmentDistance(l,a.get(p),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Cr&&arguments[1]instanceof Zt){var h=arguments[0],f=arguments[1],d=arguments[2],g=h.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(g,f))return this._minDistance=0,d[0]=h,d[1]=new Cr(f,g),null}},Tr.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}},Tr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=Ir.getLines(this._geom[0]),n=Ir.getLines(this._geom[1]),r=Or.getPoints(this._geom[0]),i=Or.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))))},Tr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Tr.prototype.updateMinDistance=function(t,e){return null===t[0]?null:void(e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1]))},Tr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Tr.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 $t&&arguments[1]instanceof Kt){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=at.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new gn(r[o],r[o+1]).closestPoint(i);n[0]=new Cr(t,o,a),n[1]=new Cr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof $t&&arguments[1]instanceof $t){var u=arguments[0],c=arguments[1],l=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var p=u.getCoordinates(),h=c.getCoordinates(),f=0;f<p.length-1;f++)for(var d=0;d<h.length-1;d++){var g=at.distanceLineLine(p[f],p[f+1],h[d],h[d+1]);if(g<this._minDistance){this._minDistance=g;var y=new gn(p[f],p[f+1]),_=new gn(h[d],h[d+1]),m=y.closestPoints(_);l[0]=new Cr(u,f,m[0]),l[1]=new Cr(c,d,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Tr.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 Cr(i,0,i.getCoordinate()),n[1]=new Cr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Tr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new m("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Tr.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}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.distance=function(t,e){return new Tr(t,e).distance()},Tr.isWithinDistance=function(t,e,n){return new Tr(t,e,n).distance()<=n},Tr.nearestPoints=function(t,e){return new Tr(t,e).nearestPoints()};var Rr=function(){this._pt=[new I,new I],this._distance=v.NaN,this._isNull=!0};Rr.prototype.getCoordinates=function(){return this._pt},Rr.prototype.getCoordinate=function(t){return this._pt[t]},Rr.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)}},Rr.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}},Rr.prototype.toString=function(){return J.toLineString(this._pt[0],this._pt[1])},Rr.prototype.getDistance=function(){return this._distance},Rr.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)}},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr};var Lr=function(){};Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Lr.computeDistance=function(){if(arguments[2]instanceof Rr&&arguments[0]instanceof $t&&arguments[1]instanceof I)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new gn,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 Rr&&arguments[0]instanceof Zt&&arguments[1]instanceof I){var a=arguments[0],u=arguments[1],c=arguments[2];Lr.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)Lr.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof lt&&arguments[1]instanceof I){var p=arguments[0],h=arguments[1],f=arguments[2];if(p instanceof $t)Lr.computeDistance(p,h,f);else if(p instanceof Zt)Lr.computeDistance(p,h,f);else if(p instanceof qt)for(var d=p,g=0;g<d.getNumGeometries();g++){var y=d.getGeometryN(g);Lr.computeDistance(y,h,f)}else f.setMinimum(p.getCoordinate(),h)}else if(arguments[2]instanceof Rr&&arguments[0]instanceof gn&&arguments[1]instanceof I){var _=arguments[0],m=arguments[1],v=arguments[2],b=_.closestPoint(m);v.setMinimum(b,m)}};var Ar=function(){this._g0=null,this._g1=null,this._ptDist=new Rr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Dr={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Ar.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Ar.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new m("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Ar.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Ar.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Ar.prototype.computeOrientedDistance=function(t,e,n){var r=new Mr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Fr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Ar.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Ar.prototype.interfaces_=function(){return[]},Ar.prototype.getClass=function(){return Ar},Ar.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Ar(t,e).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Ar(n,r);return o.setDensifyFraction(i),o.distance()}},Dr.MaxPointDistanceFilter.get=function(){return Mr},Dr.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Ar,Dr);var Mr=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._euclideanDist=new Lr,this._geom=null;var t=arguments[0];this._geom=t};Mr.prototype.filter=function(t){this._minPtDist.initialize(),Lr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Mr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Mr.prototype.interfaces_=function(){return[ft]},Mr.prototype.getClass=function(){return Mr};var Fr=function(){this._maxPtDist=new Rr,this._minPtDist=new Rr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Fr.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 I(a,u);this._minPtDist.initialize(),Lr.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Fr.prototype.isDone=function(){return!1},Fr.prototype.isGeometryChanged=function(){return!1},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[Bt]},Fr.prototype.getClass=function(){return Fr};var kr=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},jr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};kr.prototype.checkMaximumDistance=function(t,e,n){var r=new Ar(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 "+J.toLineString(i[0],i[1])+")"}},kr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=kr.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(),kr.VERBOSE&&z.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},kr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Zt||this._input instanceof ne||this._input instanceof qt))return null;var t=this.getPolygonLines(this._input);return this.checkMinimumDistance(t,this._result,this._minValidDistance),this._isValid?void this.checkMaximumDistance(t,this._result,this._maxValidDistance):null},kr.prototype.getErrorIndicator=function(){return this._errorIndicator},kr.prototype.checkMinimumDistance=function(t,e,n){var r=new Tr(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 "+J.toLineString(i[0],i[1])+" )"}},kr.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();return this.checkMinimumDistance(this._input,t,this._minValidDistance),this._isValid?void this.checkMaximumDistance(this._input,t,this._maxValidDistance):null},kr.prototype.getErrorLocation=function(){return this._errorLocation},kr.prototype.getPolygonLines=function(t){for(var e=new wt,n=new Ir(e),r=wr.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},kr.prototype.getErrorMessage=function(){return this._errMsg},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},jr.VERBOSE.get=function(){return!1},jr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(kr,jr);var Gr=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},Ur={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.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},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Y(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Y(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")},Gr.prototype.checkDistance=function(){var t=new kr(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")},Gr.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")},Gr.prototype.checkPolygonal=function(){this._result instanceof Zt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2?null:this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){return Gr.VERBOSE?void z.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED")):null},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Ur);var Br=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Br.prototype.getCoordinates=function(){return this._pts},Br.prototype.size=function(){return this._pts.length},Br.prototype.getCoordinate=function(t){return this._pts[t]},Br.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Br.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:pn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Br.prototype.setData=function(t){this._data=t},Br.prototype.getData=function(){return this._data},Br.prototype.toString=function(){return J.toLineString(new ue(this._pts))},Br.prototype.interfaces_=function(){return[hn]},Br.prototype.getClass=function(){return Br};var qr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new wt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};qr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},qr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},qr.prototype.getIntersectionSegments=function(){return this._intSegments},qr.prototype.count=function(){return this._intersectionCount},qr.prototype.getIntersections=function(){return this._intersections},qr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},qr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},qr.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++)},qr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},qr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},qr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},qr.prototype.interfaces_=function(){return[Wn]},qr.prototype.getClass=function(){return qr},qr.createAllIntersectionsFinder=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e},qr.createAnyIntersectionFinder=function(t){return new qr(t)},qr.createIntersectionCounter=function(t){var e=new qr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Vr.prototype.execute=function(){return null!==this._segInt?null:void this.checkInteriorIntersections()},Vr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Vr.prototype.isValid=function(){return this.execute(),this._isValid},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new qr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new xn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Vr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Oe(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Vr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+J.toLineString(t[0],t[1])+" and "+J.toLineString(t[2],t[3]);
},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.computeIntersections=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var zr=function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))};zr.prototype.checkValid=function(){this._nv.checkValid()},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr},zr.toSegmentStrings=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Br(r.getCoordinates(),r))}return e},zr.checkValid=function(t){new zr(t).checkValid()};var Xr=function(t){this._mapOp=t};Xr.prototype.map=function(t){for(var e=new wt,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(_e.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var Yr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new wt,this._resultLineList=new wt;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};Yr.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)}},Yr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Ci.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Yr.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)}}},Yr.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))}},Yr.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)}},Yr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()?null:t.isVisited()?null:t.isInteriorAreaEdge()?null:t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Ci.isResultOfOp(r,e)&&e===Ci.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr};var Hr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new wt;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.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!==Ci.INTERSECTION)){var r=n.getLabel();Ci.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Wr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Wr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new wt,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ee||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new wt;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Wr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Wr.prototype.getInputGeometry=function(){return this._inputGeom},Wr.prototype.transformMultiLineString=function(t,e){for(var n=new wt,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)},Wr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Wr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformMultiPoint=function(t,e){for(var n=new wt,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)},Wr.prototype.transformMultiPolygon=function(t,e){for(var n=new wt,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)},Wr.prototype.copy=function(t){return t.copy()},Wr.prototype.transformGeometryCollection=function(t,e){for(var n=new wt,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(_e.toGeometryArray(n)):this._factory.buildGeometry(n)},Wr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Kt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof $t)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof Zt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof qt)return this.transformGeometryCollection(t,null);throw new m("Unknown Geometry subtype: "+t.getClass().getName())},Wr.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)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var $r=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new gn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof $t&&"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}};$r.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 I(o)),0===r&&this._isClosed&&t.set(t.size()-1,new I(o)))}},$r.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},$r.prototype.snapTo=function(t){var e=new Nt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},$r.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 I(i),!1)}},$r.prototype.findSegmentIndexToSnap=function(t,e){for(var n=v.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},$r.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Qr=function(t){this._srcGeom=t||null},Kr={SNAP_PRECISION_FACTOR:{configurable:!0}};Qr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new Jr(e,n).transform(this._srcGeom)},Qr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new Jr(t,n,!0).transform(this._srcGeom),i=r;return e&&T(i,Jt)&&(i=r.buffer(0)),i},Qr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Qr.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Qr.prototype.computeMinimumSegmentLength=function(t){for(var e=v.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Qr(t);r[0]=i.snapTo(e,n);var o=new Qr(e);return r[1]=o.snapTo(r[0],n),r},Qr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Qr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fe.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(Qr.computeOverlaySnapTolerance(i),Qr.computeOverlaySnapTolerance(o))}},Qr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Qr.SNAP_PRECISION_FACTOR},Qr.snapToSelf=function(t,e,n){return new Qr(t).snapToSelf(e,n)},Kr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Qr,Kr);var Jr=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 $r(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}(Wr),Zr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Zr.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},Zr.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Zr.signExpBits(this._commonBits),this._isFirst=!1,null):Zr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Zr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Zr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Zr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+"  "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Zr.signExpBits=function(t){return t>>52},Zr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Zr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Zr.getBit(t,r)!==Zr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new I(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Zr,this._commonBitsY=new Zr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new I(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ft]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.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)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[Bt]},ri.prototype.getClass=function(){return ri};var ii=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()};ii.prototype.selfSnap=function(t){return new Qr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,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},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Ci.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||z.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Qr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Qr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Ci.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Ci.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Ci.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Ci.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Ci.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Z))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Z?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Ci.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ci.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ci.DIFFERENCE)};var si=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};si.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var ai=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}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};ai.prototype.isDelete=function(){return this._eventType===ai.DELETE},ai.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ai.prototype.getObject=function(){return this._obj},ai.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},ai.prototype.getInsertEvent=function(){return this._insertEvent},ai.prototype.isInsert=function(){return this._eventType===ai.INSERT},ai.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ai.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ai.prototype.interfaces_=function(){return[E]},ai.prototype.getClass=function(){return ai},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(ai,ui);var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var li=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};li.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(li.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},li.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},li.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},li.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},li.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},li.prototype.hasProperIntersection=function(){return this._hasProper},li.prototype.hasIntersection=function(){return this._hasIntersection},li.prototype.isDone=function(){return this._isDone},li.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},li.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},li.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))))},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var pi=function(t){function e(){t.call(this),this.events=new wt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Ze.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 li&&T(arguments[0],xt)&&T(arguments[1],xt)){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]&&T(arguments[0],xt)&&arguments[1]instanceof li){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 si(n,i),s=new ai(e,n.getMinX(i),o);this.events.add(s),this.events.add(new ai(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}(ci),hi=function(){this._min=v.POSITIVE_INFINITY,this._max=v.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}};hi.prototype.getMin=function(){return this._min},hi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},hi.prototype.getMax=function(){return this._max},hi.prototype.toString=function(){return J.toLineString(new I(this._min,0),new I(this._max,0))},hi.prototype.interfaces_=function(){return[]},hi.prototype.getClass=function(){return hi},fi.NodeComparator.get=function(){return di},Object.defineProperties(hi,fi);var di=function(){};di.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},di.prototype.interfaces_=function(){return[w]},di.prototype.getClass=function(){return di};var gi=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){return this.intersects(t,e)?void n.visitItem(this._item):null},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),yi=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){return this.intersects(t,e)?(null!==this._node1&&this._node1.query(t,e,n),void(null!==this._node2&&this._node2.query(t,e,n))):null},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),_i=function(){this._leaves=new wt,this._root=null,this._level=0};_i.prototype.buildTree=function(){Ze.sort(this._leaves,new hi.NodeComparator);for(var t=this._leaves,e=null,n=new wt;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_i.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 gi(t,e,n))},_i.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_i.prototype.buildRoot=function(){return null!==this._root?null:void(this._root=this.buildTree())},_i.prototype.printNode=function(t){z.out.println(J.toLineString(new I(t._min,this._level),new I(t._max,this._level)))},_i.prototype.init=function(){return null!==this._root?null:void this.buildRoot()},_i.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 yi(t.get(n),t.get(n+1));e.add(i)}}},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var mi=function(){this._items=new wt};mi.prototype.visitItem=function(t){this._items.add(t)},mi.prototype.getItems=function(){return this._items},mi.prototype.interfaces_=function(){return[$e]},mi.prototype.getClass=function(){return mi};var vi=function(){this._index=null;var t=arguments[0];if(!T(t,Jt))throw new m("Argument must be Polygonal");this._index=new xi(t)},bi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};vi.prototype.locate=function(t){var e=new st(t),n=new Ei(e);return this._index.query(t.y,t.y,n),e.getLocation()},vi.prototype.interfaces_=function(){return[Un]},vi.prototype.getClass=function(){return vi},bi.SegmentVisitor.get=function(){return Ei},bi.IntervalIndexedGeometry.get=function(){return xi},Object.defineProperties(vi,bi);var Ei=function(){this._counter=null;var t=arguments[0];this._counter=t};Ei.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ei.prototype.interfaces_=function(){return[$e]},Ei.prototype.getClass=function(){return Ei};var xi=function(){this._index=new _i;var t=arguments[0];this.init(t)};xi.prototype.init=function(t){for(var e=Ir.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},xi.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new gn(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)}},xi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new mi;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)}},xi.prototype.interfaces_=function(){return[]},xi.prototype.getClass=function(){return xi};var wi=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new he,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Nr,2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.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;O.NONE,r.getLocation(t,Ne.ON)===O.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 li(n,!0,!1);o.setIsDoneIfProperInt(i);var s=this.createEdgeSetIntersector(),a=this._parentGeom instanceof ee||this._parentGeom instanceof Zt||this._parentGeom instanceof ne,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 li(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 Kt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,O.INTERIOR)}else if(arguments[0]instanceof I){var e=arguments[0];this.insertPoint(this._argIndex,e,O.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,O.INTERIOR,O.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],O.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],O.BOUNDARY)},e.prototype.addLineString=function(t){var e=Ct.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Le(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.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){return this.isBoundaryNode(t,e)?null:void(n===O.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=Ct.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;at.isCCW(r)&&(i=n,o=e);var s=new nr(r,new Le(this._argIndex,O.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],O.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Le(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new pi},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 ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Zt)this.addPolygon(e);else if(e instanceof $t)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{
if(!(e instanceof qt))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 T(this._parentGeom,Jt)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vi(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)?O.BOUNDARY:O.INTERIOR},e}(ze),Ii=function(){if(this._li=new it,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 wi(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=dt.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 wi(0,e,r),this._arg[1]=new wi(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 wi(0,i,s),this._arg[1]=new wi(1,o,s)}};Ii.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ii.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var Ni=function(){};Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof lt&&T(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new wt,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(T(arguments[0],bt)&&T(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new wt,u=o.iterator();u.hasNext();){var c=u.next(),l=s.map(c);null!==l&&a.add(l)}return a}},Ni.MapOp=function(){};var Ci=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Nr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new wt,this._resultLineList=new wt,this._resultPointList=new wt,this._graph=new ze(new Xn),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 Le(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 wt;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)!==O.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new wt,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 wt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),zr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new Yr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(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,Ne.RIGHT),i.getLocation(1,Ne.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):(et.isTrue(!r.isNull(i,Ne.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ne.LEFT,r.getLocation(i,Ne.LEFT)),et.isTrue(!r.isNull(i,Ne.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ne.RIGHT,r.getLocation(i,Ne.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}(Ii);Ci.overlayOp=function(t,e,n){return new Ci(t,e).getResultGeometry(n)},Ci.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Ci.createEmptyResult(Ci.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Ni.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.INTERSECTION)},Ci.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.SYMDIFFERENCE)},Ci.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Ci.INTERSECTION:o=Math.min(r,i);break;case Ci.UNION:o=Math.max(r,i);break;case Ci.DIFFERENCE:o=r;break;case Ci.SYMDIFFERENCE:o=Math.max(r,i)}return o},Ci.createEmptyResult=function(t,e,n,r){var i=null;switch(Ci.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},Ci.difference=function(t,e){return t.isEmpty()?Ci.createEmptyResult(Ci.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.DIFFERENCE))},Ci.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Ci.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),s){case Ci.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case Ci.UNION:return i===O.INTERIOR||o===O.INTERIOR;case Ci.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case Ci.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},Ci.INTERSECTION=1,Ci.UNION=2,Ci.DIFFERENCE=3,Ci.SYMDIFFERENCE=4;var Si=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Nr,this._seg=new gn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Si.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},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Oi;t.apply(e);var n=e.getLinework(),r=_e.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si};var Oi=function(){this._linework=null,this._linework=new wt};Oi.prototype.getLinework=function(){return this._linework},Oi.prototype.filter=function(t){if(t instanceof Zt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Oi.prototype.interfaces_=function(){return[Ut]},Oi.prototype.getClass=function(){return Oi};var Pi=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Pi.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)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new wt,n=Ir.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.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 p=new I(c-u,l+a);r.add(p)}if(this._doRight){var h=new I(c+u,l-a);r.add(h)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi};var Ti=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 wt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]},Ri={TOLERANCE:{configurable:!0}};Ti.prototype.reportResult=function(t,e,n){z.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},Ti.prototype.isValid=function(t){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var e=this.checkValid(t);return e},Ti.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),!!Ti.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Ti.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ti.prototype.isValidResult=function(t,e){var n=Ci.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===O.INTERIOR);return r||this.reportResult(t,e,n),r},Ti.prototype.getInvalidLocation=function(){return this._invalidLocation},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ti.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Qr.computeSizeBasedSnapTolerance(t),Qr.computeSizeBasedSnapTolerance(e))},Ti.isValid=function(t,e,n,r){return new Ti(t,e,r).isValid(n)},Ri.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ti,Ri);var Li=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Li.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)}},Li.prototype.combine=function(){for(var t=new wt,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)},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Li.combine=function(){if(1===arguments.length){var t=arguments[0];return new Li(t).combine()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Li(Li.createList(e,n)).combine()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];return new Li(Li.createList(r,i,o)).combine()}},Li.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Li.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new wt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new wt;return s.add(r),s.add(i),s.add(o),s}};var Ai=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new wt)},Di={STRTREE_NODE_CAPACITY:{configurable:!0}};Ai.prototype.reduceToGeometries=function(t){for(var e=new wt,n=t.iterator();n.hasNext();){var r=n.next(),i=null;T(r,xt)?i=this.unionTree(r):r instanceof lt&&(i=r),e.add(i)}return e},Ai.prototype.extractByEnvelope=function(t,e,n){for(var r=new wt,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)},Ai.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Li.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)},Ai.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 sn(Ai.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)},Ai.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=Ai.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ai.getGeometry(e,n),Ai.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)}},Ai.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},Ai.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ai.prototype.unionActual=function(t,e){return Ai.restrictToPolygons(t.union(e))},Ai.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ai.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new wt,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Li.combine(r)},Ai.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)}},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},Ai.restrictToPolygons=function(t){if(T(t,Jt))return t;var e=wr.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_e.toPolygonArray(e))},Ai.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ai.union=function(t){return new Ai(t).union()},Di.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ai,Di);var Mi=function(){};Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ci.createEmptyResult(Ci.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ci.UNION)},t.GeoJSONReader=we,t.GeoJSONWriter=Ie,t.OverlayOp=Ci,t.UnionOp=Mi,t.BufferOp=gr,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){"use strict";var r=n(145);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!r(t)}},function(t,e,n){"use strict";var r=n(46),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!r(t)&&hasOwnProperty.call(i,typeof t)}},function(t,e,n){"use strict";var r=n(142),i=/^\s*class[\s{\/}]/,o=Function.prototype.toString;t.exports=function(t){return!!r(t)&&!i.test(o.call(t))}},function(t,e,n){"use strict";var r=n(143);t.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},function(t,e,n){(function(t){!function(t,n){n(e)}(this,function(e){function n(t){return t&&DataView.prototype.isPrototypeOf(t)}function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function i(t){return"string"!=typeof t&&(t=String(t)),t}function o(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return E.iterable&&(e[Symbol.iterator]=function(){return e}),e}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function a(e){return e.bodyUsed?t.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function u(e){return new t(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function c(t){var e=new FileReader,n=u(e);return e.readAsArrayBuffer(t),n}function l(t){var e=new FileReader,n=u(e);return e.readAsText(t),n}function p(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}function h(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:E.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:E.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:E.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():E.arrayBuffer&&E.blob&&n(t)?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):E.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||w(t))?this._bodyArrayBuffer=h(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):E.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},E.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(c)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(p(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},E.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(t){var e=t.toUpperCase();return I.indexOf(e)>-1?e:t}function g(t,e){e=e||{};var n=e.body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function y(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function _(t){var e=new s,n=t.replace(/\r?\n[\t ]+/g," ");return n.split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e}function m(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"",this.headers=new s(e.headers),this.url=e.url||"",this._initBody(t)}function v(n,r){return new t(function(t,i){function o(){u.abort()}function s(t){try{return""===t&&b.location.href?b.location.href:t}catch(e){return t}}var a=new g(n,r);if(a.signal&&a.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;u.onload=function(){var e={status:u.status,statusText:u.statusText,headers:_(u.getAllResponseHeaders()||"")};e.url="responseURL"in u?u.responseURL:e.headers.get("X-Request-URL");var n="response"in u?u.response:u.responseText;setTimeout(function(){t(new m(n,e))},0)},u.onerror=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},u.onabort=function(){setTimeout(function(){i(new e.DOMException("Aborted","AbortError"))},0)},u.open(a.method,s(a.url),!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&(E.blob?u.responseType="blob":E.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(u.responseType="arraybuffer")),a.headers.forEach(function(t,e){u.setRequestHeader(e,t)}),a.signal&&(a.signal.addEventListener("abort",o),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",o)}),u.send("undefined"==typeof a._bodyInit?null:a._bodyInit)})}var b=function(t){return t}("undefined"!=typeof self?self:this),E={searchParams:"URLSearchParams"in b,iterable:"Symbol"in b&&"iterator"in Symbol,blob:"FileReader"in b&&"Blob"in b&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in b,arrayBuffer:"ArrayBuffer"in b};if(E.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],w=ArrayBuffer.isView||function(t){return t&&x.indexOf(Object.prototype.toString.call(t))>-1};s.prototype.append=function(t,e){t=r(t),e=i(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},s.prototype.delete=function(t){delete this.map[r(t)]},s.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},s.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},s.prototype.set=function(t,e){this.map[r(t)]=i(e)},s.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},s.prototype.keys=function(){var t=[];return this.forEach(function(e,n){t.push(n)}),o(t)},s.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},s.prototype.entries=function(){var t=[];return this.forEach(function(e,n){t.push([n,e])}),o(t)},E.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);var I=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var N=[301,302,303,307,308];m.redirect=function(t,e){if(N.indexOf(e)===-1)throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},e.DOMException=b.DOMException,"function"!=typeof e.DOMException&&(e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException),v.polyfill=!0,b.fetch||(b.fetch=v,b.Headers=s,b.Request=g,b.Response=m),e.Headers=s,e.Request=g,e.Response=m,e.fetch=v,Object.defineProperty(e,"__esModule",{value:!0})})}).call(e,n(4))},function(t,e,n){function r(t){this.options=t||{locator:{}}}function i(t,e,n){function r(e){var r=t[e];!r&&s&&(r=2==t.length?function(n){t(e,n)}:t),i[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+a(n))}||function(){}}if(!t){if(e instanceof o)return e;t=e}var i={},s=t instanceof Function;return n=n||{},r("warning"),r("error"),r("fatalError"),i}function o(){this.cdata=!1}function s(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function a(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function u(t,e,n){return"string"==typeof t?t.substr(e,n):t.length>=e+n||e?new java.lang.String(t,e,n)+"":t}function c(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}r.prototype.parseFromString=function(t,e){var n=this.options,r=new l,s=n.domBuilder||new o,a=n.errorHandler,u=n.locator,c=n.xmlns||{},p={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&s.setDocumentLocator(u),r.errorHandler=i(a,s,u),r.domBuilder=n.domBuilder||s,/\/x?html?$/.test(e)&&(p.nbsp=" ",p.copy="©",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",t?r.parse(t,c,p):r.errorHandler.error("invalid doc source"),s.doc},o.prototype={startDocument:function(){this.doc=(new p).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,n,r){var i=this.doc,o=i.createElementNS(t,n||e),a=r.length;c(this,o),this.currentElement=o,this.locator&&s(this.locator,o);for(var u=0;u<a;u++){var t=r.getURI(u),l=r.getValue(u),n=r.getQName(u),p=i.createAttributeNS(t,n);this.locator&&s(r.getLocator(u),p),p.value=p.nodeValue=l,o.setAttributeNode(p)}},endElement:function(t,e,n){var r=this.currentElement;r.tagName;this.currentElement=r.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var n=this.doc.createProcessingInstruction(t,e);this.locator&&s(this.locator,n),c(this,n)},ignorableWhitespace:function(t,e,n){},characters:function(t,e,n){if(t=u.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(t);else var r=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(t)&&this.doc.appendChild(r),this.locator&&s(this.locator,r)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,n){t=u.apply(this,arguments);var r=this.doc.createComment(t);this.locator&&s(this.locator,r),c(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,n){var r=this.doc.implementation;if(r&&r.createDocumentType){var i=r.createDocumentType(t,e,n);this.locator&&s(this.locator,i),c(this,i)}},warning:function(t){console.warn("[xmldom warning]\t"+t,a(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,a(this.locator))},fatalError:function(t){throw console.error("[xmldom fatalError]\t"+t,a(this.locator)),t}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){o.prototype[t]=function(){return null}});var l=n(148).XMLReader,p=e.DOMImplementation=n(48).DOMImplementation;e.XMLSerializer=n(48).XMLSerializer,e.DOMParser=r},function(t,e){function n(){}function r(t,e,n,r,c){function f(t){if(t>65535){t-=65536;var e=55296+(t>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}function d(t){var e=t.slice(1,-1);return e in n?n[e]:"#"===e.charAt(0)?f(parseInt(e.substr(1).replace("x","0x"))):(c.error("entity not found:"+t),t)}function g(e){
if(e>w){var n=t.substring(w,e).replace(/&#?\w+;/g,d);b&&y(w),r.characters(n,0,e-w),w=e}}function y(e,n){for(;e>=m&&(n=v.exec(t));)_=n.index,m=_+n[0].length,b.lineNumber++;b.columnNumber=e-_+1}for(var _=0,m=0,v=/.*(?:\r\n?|\n)|.*$/g,b=r.locator,E=[{currentNSMap:e}],x={},w=0;;){try{var I=t.indexOf("<",w);if(I<0){if(!t.substr(w).match(/^\s*$/)){var N=r.doc,C=N.createTextNode(t.substr(w));N.appendChild(C),r.currentElement=C}return}switch(I>w&&g(I),t.charAt(I+1)){case"/":var S=t.indexOf(">",I+3),O=t.substring(I+2,S),P=E.pop();S<0?(O=t.substring(I+2).replace(/[\s<].*/,""),c.error("end tag name: "+O+" is not complete:"+P.tagName),S=I+1+O.length):O.match(/\s</)&&(O=O.replace(/[\s<].*/,""),c.error("end tag name: "+O+" maybe not complete"),S=I+1+O.length);var T=P.localNSMap,R=P.tagName==O,L=R||P.tagName&&P.tagName.toLowerCase()==O.toLowerCase();if(L){if(r.endElement(P.uri,P.localName,O),T)for(var A in T)r.endPrefixMapping(A);R||c.fatalError("end tag name: "+O+" is not match the current start tagName:"+P.tagName)}else E.push(P);S++;break;case"?":b&&y(I),S=p(t,I,r);break;case"!":b&&y(I),S=l(t,I,r,c);break;default:b&&y(I);var D=new h,M=E[E.length-1].currentNSMap,S=o(t,I,D,M,d,c),F=D.length;if(!D.closed&&u(t,S,D.tagName,x)&&(D.closed=!0,n.nbsp||c.warning("unclosed xml attribute")),b&&F){for(var k=i(b,{}),j=0;j<F;j++){var G=D[j];y(G.offset),G.locator=i(b,{})}r.locator=k,s(D,r,M)&&E.push(D),r.locator=b}else s(D,r,M)&&E.push(D);"http://www.w3.org/1999/xhtml"!==D.uri||D.closed?S++:S=a(t,S,D.tagName,d,r)}}catch(t){c.error("element parse error: "+t),S=-1}S>w?w=S:g(Math.max(I,w)+1)}}function i(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function o(t,e,n,r,i,o){for(var s,a,u=++e,c=m;;){var l=t.charAt(u);switch(l){case"=":if(c===v)s=t.slice(e,u),c=E;else{if(c!==b)throw new Error("attribute equal must after attrName");c=E}break;case"'":case'"':if(c===E||c===v){if(c===v&&(o.warning('attribute value must after "="'),s=t.slice(e,u)),e=u+1,u=t.indexOf(l,e),!(u>0))throw new Error("attribute value no end '"+l+"' match");a=t.slice(e,u).replace(/&#?\w+;/g,i),n.add(s,a,e-1),c=w}else{if(c!=x)throw new Error('attribute value must after "="');a=t.slice(e,u).replace(/&#?\w+;/g,i),n.add(s,a,e),o.warning('attribute "'+s+'" missed start quot('+l+")!!"),e=u+1,c=w}break;case"/":switch(c){case m:n.setTagName(t.slice(e,u));case w:case I:case N:c=N,n.closed=!0;case x:case v:case b:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),c==m&&n.setTagName(t.slice(e,u)),u;case">":switch(c){case m:n.setTagName(t.slice(e,u));case w:case I:case N:break;case x:case v:a=t.slice(e,u),"/"===a.slice(-1)&&(n.closed=!0,a=a.slice(0,-1));case b:c===b&&(a=s),c==x?(o.warning('attribute "'+a+'" missed quot(")!!'),n.add(s,a.replace(/&#?\w+;/g,i),e)):("http://www.w3.org/1999/xhtml"===r[""]&&a.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+a+'" missed value!! "'+a+'" instead!!'),n.add(a,a,e));break;case E:throw new Error("attribute value missed!!")}return u;case"€":l=" ";default:if(l<=" ")switch(c){case m:n.setTagName(t.slice(e,u)),c=I;break;case v:s=t.slice(e,u),c=b;break;case x:var a=t.slice(e,u).replace(/&#?\w+;/g,i);o.warning('attribute "'+a+'" missed quot(")!!'),n.add(s,a,e);case w:c=I}else switch(c){case b:n.tagName;"http://www.w3.org/1999/xhtml"===r[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),n.add(s,s,e),e=u,c=v;break;case w:o.warning('attribute space is required"'+s+'"!!');case I:c=v,e=u;break;case E:c=x,e=u;break;case N:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function s(t,e,n){for(var r=t.tagName,i=null,o=t.length;o--;){var s=t[o],a=s.qName,u=s.value,l=a.indexOf(":");if(l>0)var p=s.prefix=a.slice(0,l),h=a.slice(l+1),f="xmlns"===p&&h;else h=a,p=null,f="xmlns"===a&&"";s.localName=h,f!==!1&&(null==i&&(i={},c(n,n={})),n[f]=i[f]=u,s.uri="http://www.w3.org/2000/xmlns/",e.startPrefixMapping(f,u))}for(var o=t.length;o--;){s=t[o];var p=s.prefix;p&&("xml"===p&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==p&&(s.uri=n[p||""]))}var l=r.indexOf(":");l>0?(p=t.prefix=r.slice(0,l),h=t.localName=r.slice(l+1)):(p=null,h=t.localName=r);var d=t.uri=n[p||""];if(e.startElement(d,h,r,t),!t.closed)return t.currentNSMap=n,t.localNSMap=i,!0;if(e.endElement(d,h,r),i)for(p in i)e.endPrefixMapping(p)}function a(t,e,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=t.indexOf("</"+n+">",e),s=t.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(n)?(i.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,r),i.characters(s,0,s.length),o)}return e+1}function u(t,e,n,r){var i=r[n];return null==i&&(i=t.lastIndexOf("</"+n+">"),i<e&&(i=t.lastIndexOf("</"+n)),r[n]=i),i<e}function c(t,e){for(var n in t)e[n]=t[n]}function l(t,e,n,r){var i=t.charAt(e+2);switch(i){case"-":if("-"===t.charAt(e+3)){var o=t.indexOf("-->",e+4);return o>e?(n.comment(t,e+4,o-e-4),o+3):(r.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==t.substr(e+3,6)){var o=t.indexOf("]]>",e+9);return n.startCDATA(),n.characters(t,e+9,o-e-9),n.endCDATA(),o+3}var s=d(t,e),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],c=a>3&&/^public$/i.test(s[2][0])&&s[3][0],l=a>4&&s[4][0],p=s[a-1];return n.startDTD(u,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function p(t,e,n){var r=t.indexOf("?>",e);if(r){var i=t.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){i[0].length;return n.processingInstruction(i[1],i[2]),r+2}return-1}return-1}function h(t){}function f(t,e){return t.__proto__=e,t}function d(t,e){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(t);n=i.exec(t);)if(r.push(n),n[1])return r}var g=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,y=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),_=new RegExp("^"+g.source+y.source+"*(?::"+g.source+y.source+"*)?$"),m=0,v=1,b=2,E=3,x=4,w=5,I=6,N=7;n.prototype={parse:function(t,e,n){var i=this.domBuilder;i.startDocument(),c(e,e={}),r(t,e,n,i,this.errorHandler),i.endDocument()}},h.prototype={setTagName:function(t){if(!_.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},add:function(t,e,n){if(!_.test(t))throw new Error("invalid attribute:"+t);this[this.length++]={qName:t,value:e,offset:n}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},f({},f.prototype)instanceof f||(f=function(t,e){function n(){}n.prototype=e,n=new n;for(e in t)n[e]=t[e];return n}),e.XMLReader=n}]);
//# sourceMappingURL=ed6090683ac14375de89.worker.js.map