zh-mapbox 0.1.26 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/index.d.ts +34 -0
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE +24 -0
- package/package.json +9 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("zMapUtil",[],t):"object"==typeof exports?exports.zMapUtil=t():e.zMapUtil=t()}(this,(()=>{return t={630:function(e){var t;t=function(){return t=[function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNotPNG=function(e){return e===o},t.isNotAPNG=function(e){return e===a},t.default=function(e){var t=new Uint8Array(e);if(Array.prototype.some.call(s,(function(e,r){return e!==t[r]})))return o;var r=!1;if(u(t,(function(e){return!(r="acTL"===e)})),!r)return a;var n=[],p=[],f=null,d=null,m=0,y=new i.APNG;if(u(t,(function(e,t,r,o){var a=new DataView(t.buffer);switch(e){case"IHDR":f=t.subarray(r+8,r+8+o),y.width=a.getUint32(r+8),y.height=a.getUint32(r+12);break;case"acTL":y.numPlays=a.getUint32(r+8+4);break;case"fcTL":d&&(y.frames.push(d),m++),(d=new i.Frame).width=a.getUint32(r+8+4),d.height=a.getUint32(r+8+8),d.left=a.getUint32(r+8+12),d.top=a.getUint32(r+8+16);var s=a.getUint16(r+8+20),u=a.getUint16(r+8+22);d.delay=1e3*s/(u=0===u?100:u),d.delay<=10&&(d.delay=100),y.playTime+=d.delay,d.disposeOp=a.getUint8(r+8+24),d.blendOp=a.getUint8(r+8+25),d.dataParts=[],0===m&&2===d.disposeOp&&(d.disposeOp=1);break;case"fdAT":d&&d.dataParts.push(t.subarray(r+8+4,r+8+o));break;case"IDAT":d&&d.dataParts.push(t.subarray(r+8,r+8+o));break;case"IEND":p.push(l(t,r,12+o));break;default:n.push(l(t,r,12+o))}})),d&&y.frames.push(d),0==y.frames.length)return a;var v=new Blob(n),g=new Blob(p);return y.frames.forEach((function(e){var t=[];t.push(s),f.set(h(e.width),0),f.set(h(e.height),4),t.push(c("IHDR",f)),t.push(v),e.dataParts.forEach((function(e){return t.push(c("IDAT",e))})),t.push(g),e.imageData=new Blob(t,{type:"image/png"}),delete e.dataParts,t=null})),y};var n=(t=r(1))&&t.__esModule?t:{default:t},i=r(2),o=new Error("Not a PNG"),a=new Error("Not an animated PNG"),s=new Uint8Array([137,80,78,71,13,10,26,10]);function u(e,t){for(var r,n,i,o=new DataView(e.buffer),a=8;n=o.getUint32(a),i=t(r=function(e,t,r){return e=Array.prototype.slice.call(e.subarray(t,t+4)),String.fromCharCode.apply(String,e)}(e,a+4),e,a,n),a+=12+n,!1!==i&&"IEND"!=r&&a<e.length;);}function l(e,t,r){var n=new Uint8Array(r);return n.set(e.subarray(t,t+r)),n}var c=function(e,t){var r=e.length+t.length,i=new Uint8Array(r+8),o=new DataView(i.buffer);return o.setUint32(0,t.length),i.set(function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}(e),4),i.set(t,8),e=(0,n.default)(i,4,r),o.setUint32(r+4,e),i},h=function(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=-1,i=t,o=t+(2<arguments.length&&void 0!==arguments[2]?arguments[2]:e.length-t);i<o;i++)n=n>>>8^r[255&(n^e[i])];return-1^n};for(var r=new Uint32Array(256),n=0;n<256;n++){for(var i=n,o=0;o<8;o++)i=0!=(1&i)?3988292384^i>>>1:i>>>1;r[n]=i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Frame=t.APNG=void 0;var n=function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e};function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=(r=r(3))&&r.__esModule?r:{default:r};function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(){a(this,s),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}function u(){a(this,u),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}t.APNG=(n(s,[{key:"createImages",value:function(){return Promise.all(this.frames.map((function(e){return e.createImage()})))}},{key:"getPlayer",value:function(e){var t=this,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return this.createImages().then((function(){return new o.default(t,e,r)}))}}]),s),t.Frame=(n(u,[{key:"createImage",value:function(){var e=this;return this.imageElement?Promise.resolve():new Promise((function(t,r){var n=URL.createObjectURL(e.imageData);e.imageElement=document.createElement("img"),e.imageElement.onload=function(){URL.revokeObjectURL(n),t()},e.imageElement.onerror=function(){URL.revokeObjectURL(n),e.imageElement=null,r(new Error("Image creation error"))},e.imageElement.src=n}))}}]),u)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e};function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}r=function(e){var t=r;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);function r(e,t,n){var i;if(this instanceof r)return(i=function(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this))).playbackRate=1,i._currentFrameNumber=0,i._ended=!1,i._paused=!0,i._numPlays=0,i._rafId=null,i._apng=e,i.context=t,i.stop(),n&&i.play(),i;throw new TypeError("Cannot call a class as a function")}return 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),n(r,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,0!==this._apng.numPlays)&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0),this._prevFrame&&1==this._prevFrame.disposeOp?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&2==this._prevFrame.disposeOp&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var e=this.currentFrame;this._prevFrame=e,this._prevFrameData=null,2==e.disposeOp&&(this._prevFrameData=this.context.getImageData(e.left,e.top,e.width,e.height)),0==e.blendOp&&this.context.clearRect(e.left,e.top,e.width,e.height),this.context.drawImage(e.imageElement,e.left,e.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var e=this,t=(this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1,performance.now()+this.currentFrame.delay/this.playbackRate);this._rafId=requestAnimationFrame((function r(n){if(!e._ended&&!e._paused){if(t<=n){for(;n-t>=e._apng.playTime/e.playbackRate;)t+=e._apng.playTime/e.playbackRate,e._numPlays++;for(;e.renderNextFrame(),t+=e.currentFrame.delay/e.playbackRate,!e._ended&&!e._paused&&t<n;);}e._rafId=requestAnimationFrame(r)}}))}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),r}(((r=r(4))&&r.__esModule?r:{default:r}).default),t.default=r},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}((e.exports=r).EventEmitter=r).prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,a,s,u,l,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw(c=arguments[1])instanceof Error?c:((l=new Error('Uncaught, unspecified "error" event. ('+c+")")).context=c,l);if(o(t=this._events[e]))return!1;if(n(t))switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),t.apply(this,a)}else if(i(t))for(a=Array.prototype.slice.call(arguments,1),r=(u=t.slice()).length,s=0;s<r;s++)u[s].apply(this,a);return!0},r.prototype.on=r.prototype.addListener=function(e,t){if(n(t))return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned&&(t=o(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&0<t&&this._events[e].length>t&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace)&&console.trace(),this;throw TypeError("listener must be a function")},r.prototype.once=function(e,t){var r;if(n(t))return r=!1,i.listener=t,this.on(e,i),this;throw TypeError("listener must be a function");function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}},r.prototype.removeListener=function(e,t){var r,o,a,s;if(!n(t))throw TypeError("listener must be a function");if(this._events&&this._events[e])if(a=(r=this._events[e]).length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=a;0<s--;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=s;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(this._events)if(this._events.removeListener)if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);this.removeAllListeners("removeListener"),this._events={}}else{if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);delete this._events[e]}else 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e];return this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){if(n(e=this._events[e]))return 1;if(e)return e.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}}],r={},e.m=t,e.c=r,e.p="",e(0);function e(n){var i;return(r[n]||(i=r[n]={exports:{},id:n,loaded:!1},t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i)).exports}var t,r},e.exports=t()},481:function(e,t){var r;void 0!==(t="function"==typeof(r=function(){var e=function(e){return e.reduce((function(e,t){return 2*e+t}),0)},t=function(e){for(var t=[],r=7;r>=0;r--)t.push(!!(e&1<<r));return t},r=function(e){this.data=e,this.len=this.data.length,this.pos=0,this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return e instanceof Uint8Array?e[this.pos++]:255&e.charCodeAt(this.pos++)},this.readBytes=function(e){for(var t=[],r=0;r<e;r++)t.push(this.readByte());return t},this.read=function(e){for(var t="",r=0;r<e;r++)t+=String.fromCharCode(this.readByte());return t},this.readUnsigned=function(){var e=this.readBytes(2);return(e[1]<<8)+e[0]}},n=function(r,n){n||(n={});var i=function(e){for(var t=[],n=0;n<e;n++)t.push(r.readBytes(3));return t},o=function(){var e,t;t="";do{e=r.readByte(),t+=r.read(e)}while(0!==e);return t},a=function(){var s={};switch(s.sentinel=r.readByte(),String.fromCharCode(s.sentinel)){case"!":s.type="ext",function(i){switch(i.label=r.readByte(),i.label){case 249:i.extType="gce",function(i){r.readByte();var o=t(r.readByte());i.reserved=o.splice(0,3),i.disposalMethod=e(o.splice(0,3)),i.userInput=o.shift(),i.transparencyGiven=o.shift(),i.delayTime=r.readUnsigned(),i.transparencyIndex=r.readByte(),i.terminator=r.readByte(),n.gce&&n.gce(i)}(i);break;case 254:i.extType="com",function(e){e.comment=o(),n.com&&n.com(e)}(i);break;case 1:i.extType="pte",function(e){r.readByte(),e.ptHeader=r.readBytes(12),e.ptData=o(),n.pte&&n.pte(e)}(i);break;case 255:i.extType="app",function(e){r.readByte(),e.identifier=r.read(8),e.authCode=r.read(3),"NETSCAPE"===e.identifier?function(e){r.readByte(),e.unknown=r.readByte(),e.iterations=r.readUnsigned(),e.terminator=r.readByte(),n.app&&n.app.NETSCAPE&&n.app.NETSCAPE(e)}(e):function(e){e.appData=o(),n.app&&n.app[e.identifier]&&n.app[e.identifier](e)}(e)}(i);break;default:i.extType="unknown",function(e){e.data=o(),n.unknown&&n.unknown(e)}(i)}}(s);break;case",":s.type="img",function(a){a.leftPos=r.readUnsigned(),a.topPos=r.readUnsigned(),a.width=r.readUnsigned(),a.height=r.readUnsigned();var s=t(r.readByte());a.lctFlag=s.shift(),a.interlaced=s.shift(),a.sorted=s.shift(),a.reserved=s.splice(0,2),a.lctSize=e(s.splice(0,3)),a.lctFlag&&(a.lct=i(1<<a.lctSize+1)),a.lzwMinCodeSize=r.readByte();var u=o();a.pixels=function(e,t){for(var r,n,i=0,o=function(e){for(var r=0,n=0;n<e;n++)t.charCodeAt(i>>3)&1<<(7&i)&&(r|=1<<n),i++;return r},a=[],s=1<<e,u=s+1,l=e+1,c=[],h=function(){c=[],l=e+1;for(var t=0;t<s;t++)c[t]=[t];c[s]=[],c[u]=null};;)if(n=r,(r=o(l))!==s){if(r===u)break;if(r<c.length)n!==s&&c.push(c[n].concat(c[r][0]));else{if(r!==c.length)throw new Error("Invalid LZW code.");c.push(c[n].concat(c[n][0]))}a.push.apply(a,c[r]),c.length===1<<l&&l<12&&l++}else h();return a}(a.lzwMinCodeSize,u),a.interlaced&&(a.pixels=function(e,t){for(var r=new Array(e.length),n=e.length/t,i=function(n,i){var o=e.slice(i*t,(i+1)*t);r.splice.apply(r,[n*t,t].concat(o))},o=[0,4,2,1],a=[8,8,4,2],s=0,u=0;u<4;u++)for(var l=o[u];l<n;l+=a[u])i(l,s),s++;return r}(a.pixels,a.width)),n.img&&n.img(a)}(s);break;case";":s.type="eof",n.eof&&n.eof(s);break;default:throw new Error("Unknown block: 0x"+s.sentinel.toString(16))}"eof"!==s.type&&setTimeout(a,0)};!function(){var o={};if(o.sig=r.read(3),o.ver=r.read(3),"GIF"!==o.sig)throw new Error("Not a GIF file.");o.width=r.readUnsigned(),o.height=r.readUnsigned();var a=t(r.readByte());o.gctFlag=a.shift(),o.colorRes=e(a.splice(0,3)),o.sorted=a.shift(),o.gctSize=e(a.splice(0,3)),o.bgColor=r.readByte(),o.pixelAspectRatio=r.readByte(),o.gctFlag&&(o.gct=i(1<<o.gctSize+1)),n.hdr&&n.hdr(o)}(),setTimeout(a,0)};return function(e){var t,i,o={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var a in e)o[a]=e[a];o.vp_w&&o.vp_h&&(o.is_vp=!0);var s=null,u=!1,l=null,c=null,h=null,p=null,f=null,d=null,m=null,y=!0,v=!1,g=[],_=[],b=o.gif;void 0===o.auto_play&&(o.auto_play=!b.getAttribute("rel:auto_play")||"1"==b.getAttribute("rel:auto_play"));var w,x,L,P,E=o.hasOwnProperty("on_end")?o.on_end:null,A=o.hasOwnProperty("loop_delay")?o.loop_delay:0,M=o.hasOwnProperty("loop_mode")?o.loop_mode:"auto",k=!o.hasOwnProperty("draw_while_loading")||o.draw_while_loading,N=!!k&&(!o.hasOwnProperty("show_progress_bar")||o.show_progress_bar),C=o.hasOwnProperty("progressbar_height")?o.progressbar_height:25,S=o.hasOwnProperty("progressbar_background_color")?o.progressbar_background_color:"rgba(255,255,255,0.4)",T=o.hasOwnProperty("progressbar_foreground_color")?o.progressbar_foreground_color:"rgba(255,0,22,.8)",I=function(){l=null,c=null,f=h,h=null,d=null},R=function(){try{n(t,z)}catch(e){F("parse")}},O=function(e,t){w.width=e*X(),w.height=t*X(),L.style.minWidth=e*X()+"px",P.width=e,P.height=t,P.style.width=e+"px",P.style.height=t+"px",P.getContext("2d").setTransform(1,0,0,1,0,0)},j=function(e,t,r){if(r&&N){var n,i,a,s=C;o.is_vp?v?(i=(o.vp_t+o.vp_h-s)/X(),s/=X(),n=o.vp_l/X()+e/t*(o.vp_w/X()),a=w.width/X()):(i=o.vp_t+o.vp_h-s,n=o.vp_l+e/t*o.vp_w,a=w.width):(i=(w.height-s)/(v?X():1),n=e/t*w.width/(v?X():1),a=w.width/(v?X():1),s/=v?X():1),x.fillStyle=S,x.fillRect(n,i,a-n,s),x.fillStyle=T,x.fillRect(0,i,n,s)}},F=function(e){s=e,i={width:b.width,height:b.height},g=[],x.fillStyle="black",x.fillRect(0,0,o.c_w?o.c_w:i.width,o.c_h?o.c_h:i.height),x.strokeStyle="red",x.lineWidth=3,x.moveTo(0,0),x.lineTo(o.c_w?o.c_w:i.width,o.c_h?o.c_h:i.height),x.moveTo(0,o.c_h?o.c_h:i.height),x.lineTo(o.c_w?o.c_w:i.width,0),x.stroke()},D=function(){d&&(g.push({data:d.getImageData(0,0,i.width,i.height),delay:c}),_.push({x:0,y:0}))},B=function(){var e=-1,t=0,r=function(t){e+=t,i()},n=function(){var n=!1,i=function(){null!==E&&E(b),t++,!1!==M||t<0?o():(n=!1,y=!1)},o=function(){if(n=y){r(1);var t=10*g[e].delay;t||(t=100),0==(e+1+g.length)%g.length?(t+=A,setTimeout(i,t)):setTimeout(o,t)}};return function(){n||setTimeout(o,0)}}(),i=function(){var t;(e=parseInt(e,10))>g.length-1&&(e=0),e<0&&(e=0),t=_[e],P.getContext("2d").putImageData(g[e].data,t.x,t.y),x.globalCompositeOperation="copy",x.drawImage(P,0,0)};return{init:function(){s||(o.c_w&&o.c_h||x.scale(X(),X()),o.auto_play?n():(e=0,i()))},step:n,play:function(){y=!0,n()},pause:function(){y=!1},playing:y,move_relative:r,current_frame:function(){return e},length:function(){return g.length},move_to:function(t){e=t,i()}}}(),U=function(e){j(t.pos,t.data.length,e)},G=function(){},H=function(e,t){return function(r){e(r),U(t)}},z={hdr:H((function(e){O((i=e).width,i.height)})),gce:H((function(e){D(),I(),l=e.transparencyGiven?e.transparencyIndex:null,c=e.delayTime,h=e.disposalMethod})),com:H(G),app:{NETSCAPE:H(G)},img:H((function(e){d||(d=P.getContext("2d"));var t=g.length,r=e.lctFlag?e.lct:i.gct;t>0&&(3===f?null!==p?d.putImageData(g[p].data,0,0):d.clearRect(m.leftPos,m.topPos,m.width,m.height):p=t-1,2===f&&d.clearRect(m.leftPos,m.topPos,m.width,m.height));var n=d.getImageData(e.leftPos,e.topPos,e.width,e.height);e.pixels.forEach((function(e,t){e!==l&&(n.data[4*t+0]=r[e][0],n.data[4*t+1]=r[e][1],n.data[4*t+2]=r[e][2],n.data[4*t+3]=255)})),d.putImageData(n,e.leftPos,e.topPos),v||(x.scale(X(),X()),v=!0),k&&(x.drawImage(P,0,0),k=o.auto_play),m=e}),!0),eof:function(e){D(),U(!1),o.c_w&&o.c_h||(w.width=i.width*X(),w.height=i.height*X()),B.init(),u=!1,Y&&Y(b)}},q=function(){var e=b.parentNode,t=document.createElement("div");w=document.createElement("canvas"),x=w.getContext("2d"),L=document.createElement("div"),P=document.createElement("canvas"),t.width=w.width=b.width,t.height=w.height=b.height,L.style.minWidth=b.width+"px",t.className="jsgif",L.className="jsgif_toolbar",t.appendChild(w),t.appendChild(L),e.insertBefore(t,b),e.removeChild(b),o.c_w&&o.c_h&&O(o.c_w,o.c_h),W=!0},X=function(){return o.max_width&&i&&i.width>o.max_width?o.max_width/i.width:1},W=!1,Y=!1,V=function(e){return!u&&(Y=e||!1,u=!0,g=[],I(),p=null,f=null,d=null,m=null,!0)},J=function(){return g.reduce((function(e,t){return e+t.delay}),0)};return{play:B.play,pause:B.pause,move_relative:B.move_relative,move_to:B.move_to,get_playing:function(){return y},get_canvas:function(){return w},get_canvas_scale:function(){return X()},get_loading:function(){return u},get_auto_play:function(){return o.auto_play},get_length:function(){return B.length()},get_frames:function(){return g},get_duration:function(){return J()},get_duration_ms:function(){return 10*J()},get_current_frame:function(){return B.current_frame()},load_url:function(e,n){if(V(n)){var i=new XMLHttpRequest;i.open("GET",e,!0),"overrideMimeType"in i?i.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in i?i.responseType="arraybuffer":i.setRequestHeader("Accept-Charset","x-user-defined"),i.onloadstart=function(){W||q()},i.onload=function(e){200!=this.status&&F("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var n=this.response;n.toString().indexOf("ArrayBuffer")>0&&(n=new Uint8Array(n)),t=new r(n),setTimeout(R,0)},i.onprogress=function(e){e.lengthComputable&&j(e.loaded,e.total,!0)},i.onerror=function(){F("xhr")},i.send()}},load:function(e){this.load_url(b.getAttribute("rel:animated_src")||b.src,e)},load_raw:function(e,n){V(n)&&(W||q(),t=new r(e),setTimeout(R,0))},set_frame_offset:function(e,t){_[e]?(void 0!==t.x&&(_[e].x=t.x),void 0!==t.y&&(_[e].y=t.y)):_[e]=t}}}})?r.apply(t,[]):r)&&(e.exports=t)},61:(e,t,r)=>{var n=r(698).default;e.exports=function(){"use strict";e.exports=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s=(w="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",u=w.asyncIterator||"@@asyncIterator",l=w.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(t){c=function(e,t,r){return e[t]=r}}function h(e,r,n,i){var o,s,u,l;return r=r&&r.prototype instanceof g?r:g,r=Object.create(r.prototype),i=new k(i||[]),a(r,"_invoke",{value:(o=e,s=n,u=i,l=f,function(e,r){if(l===m)throw new Error("Generator is already running");if(l===y){if("throw"===e)throw r;return{value:t,done:!0}}for(u.method=e,u.arg=r;;){var n=u.delegate;if(n&&(n=function e(r,n){var i=n.method,o=r.iterator[i];return o===t?(n.delegate=null,"throw"===i&&r.iterator.return&&(n.method="return",n.arg=t,e(r,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),v):"throw"===(i=p(o,r.iterator,n.arg)).type?(n.method="throw",n.arg=i.arg,n.delegate=null,v):(o=i.arg)?o.done?(n[r.resultName]=o.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}(n,u),n)){if(n===v)continue;return n}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(l===f)throw l=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(l=m,"normal"===(n=p(o,s,u)).type){if(l=u.done?y:d,n.arg===v)continue;return{value:n.arg,done:u.done}}"throw"===n.type&&(l=y,u.method="throw",u.arg=n.arg)}})}),r}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=h;var f="suspendedStart",d="suspendedYield",m="executing",y="completed",v={};function g(){}function _(){}function b(){}var w,x,L=(c(w={},s,(function(){return this})),(x=(x=Object.getPrototypeOf)&&x(x(N([]))))&&x!==i&&o.call(x,s)&&(w=x),b.prototype=g.prototype=Object.create(w));function P(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){var r;a(this,"_invoke",{value:function(i,a){function s(){return new t((function(r,s){!function r(i,a,s,u){var l;if("throw"!==(i=p(e[i],e,a)).type)return(a=(l=i.arg).value)&&"object"==n(a)&&o.call(a,"__await")?t.resolve(a.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(a).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}));u(i.arg)}(i,a,r,s)}))}return r=r?r.then(s,s):s()}})}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function N(e){if(e||""===e){var r,i=e[s];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n}).next=i}throw new TypeError(n(e)+" is not iterable")}return a(L,"constructor",{value:_.prototype=b,configurable:!0}),a(b,"constructor",{value:_,configurable:!0}),_.displayName=c(b,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){return!!(e="function"==typeof e&&e.constructor)&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,l,"GeneratorFunction")),e.prototype=Object.create(L),e},r.awrap=function(e){return{__await:e}},P(E.prototype),c(E.prototype,u,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var a=new E(h(e,t,n,i),o);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(L),c(L,l,"Generator"),c(L,s,(function(){return this})),c(L,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},r.values=N,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;0<=i;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}var a=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),M(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(r=i.completion).type&&(n=r.arg,M(i)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},r},e.exports.__esModule=!0,e.exports.default=e.exports},698:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:(e,t,r)=>{r=r(61)(),e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},r={},e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n={},(()=>{"use strict";function t(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function r(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=e.apply(r,n);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}}function i(e,t){if(null==e)return{};for(var r,n={},i=Object.keys(e),o=0;o<i.length;o++)r=i[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}e.r(n),e.d(n,{MapLayer:()=>ne,RegisterMapBoxMethod:()=>function(e,t){if(e&&e.Map){tt=e,-1===(window.mapboxgl=tt).Map.prototype._setupPainter.toString().indexOf("webgl2")&&(n=tt.Map.prototype._setupPainter,tt.Map.prototype._setupPainter=function(){var e=this._canvas.getContext;this._canvas.getContext=function(t,r){return e.apply(this,["webgl2",r])||e.apply(this,["webgl",r])||e.apply(this,["experimental-webgl",r])},n.apply(this),this._canvas.getContext=e});var n,a,c=e.Map,h=function(e,t){var n=e.prototype.setStyle,a=e.prototype.addControl;return{initData:function(){var e;this[ut]||(this[ut]={},this.style[ut]={},e=[],ht(this,{source:e=t&&Array.isArray(t)&&0<t.length&&t.every((function(e){return"string"==typeof e}))?t:e,defaultSources:e,layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{},measure:{line:0,circle:0,polygon:0}}),ht(this.style,{layerObject:{}}))},clearData:function(){ht(this,{source:pt(this,"defaultSources"),layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{}})},setPaint:function(e,t){ct(this,e,t,"setPaintProperty")},setLayout:function(e,t){ct(this,e,t,"setLayoutProperty")},customStyle:function(e){if(e&&"object"==typeof e)for(var t in e){var r,n=e[t];"string"==typeof n?lt(this,t,n):Array.isArray(n)&&(nt(n[0])||Array.isArray(n[0]))&&(r=null,"number"!=typeof n[1]&&!Array.isArray(n[1])||(r=n[1]),lt(this,t,n[0],r))}},getAllLayerAndSource:function(e,t){void 0===t&&(t=!0),null==e&&(e=pt(this,"source"));for(var r,n=this.getStyle(),i=n.layers,o=n.sources,a={layers:[],sources:[]},s=0;s<i.length;)"background"===i[s].type||e.includes(i[s].source)||(r=i[s].id,this.getLayer(r)&&(a.layers.push(u(i[s])),t||this.removeLayer(r))),s++;var l,c=[];for(l in o)c.push(l);for(var h=0;h<c.length;){var p=c[h];e.includes(p)||this.isSourceLoaded(p)&&(a.sources.push({name:p,source:u(o[p])}),t||this.removeSource(p)),h++}return a},removeAllCustomLayer:function(){var e=this,t=pt(this,"customLayer");t.forEach((function(t){e.getLayer(t.layer.id)&&e.removeLayer(t.layer.id)})),t.length=0},removeAllLayerAndSource:function(e){return null==e&&(e=pt(this,"source")),this.removeAllCustomLayer(),this.getAllLayerAndSource(e,!1)},removeEvents:function(e){var t=this;void 0===e&&(e=["click","mousemove","mouseout"]),Array.isArray(e)&&e.forEach((function(e){e in t._listeners&&(t._listeners[e]=[])}))},removePopup:function(e){e&&"string"==typeof e?["tooltip","popup"].includes(e)&&this._popups.forEach((function(t){t.options.type===e&&t.remove()})):this._popups.forEach((function(e){e.remove()}))},findCustomLayer:function(e,t){null==t&&(t=pt(this,"source"));for(var r=this.getStyle().layers,n=[],i=0;i<r.length;)"background"===r[i].type||t.includes(r[i].source)||n.push(r[i]),i++;if(e){if("string"==typeof e)return n.filter((function(t){return t.type===e}));if(Array.isArray(e)&&0<e.length)return n.filter((function(t){return e.includes(t.type)}))}return n},MapTooltip:function(e,t){return new k(this,e,t)},MapPopup:function(e,t){return new C(this,e,t)},addLayer:function(e,t){void 0===this._layers&&(this._layers=[],this._sortLayers=[]),e.id&&this._layers.push(e),"zIndex"in e&&this._sortLayers.push(e),this._lazyInitEmptyStyle();var r=pt(this,"layerIndex"),n=pt(this,"customLayer");return"custom"===e.type&&n.push({layer:e,beforeId:t}),t?-1!==(n=r.findIndex((function(e){return e.id===t})))&&r.splice(n,0,{type:e.type,id:e.id}):r.push({type:e.type,id:e.id}),this.style.addLayer(e,t),"zIndex"in e&&(n=this._sortLayers.sort((function(e,t){return e.zIndex-t.zIndex})),this.orderLayers(n.map((function(e){return e.id})))),this.fire("layerdata",o({},e,{add:!0})),this._update(!0)},removeLayer:function(e){var t=this.style.getLayer(e),r=(this._layers=this._layers.filter((function(t){return t.id!==e})),this._sortLayers=this._sortLayers.filter((function(t){return t.id!==e})),pt(this,"customLayer")),n=pt(this,"layerIndex"),i=r.findIndex((function(t){return t.layer.id===e}));return-1!==i&&r.splice(i,1),r=n.findIndex((function(t){return t.id===e})),-1!==r&&n.splice(r,1),this.style.removeLayer(e),this.fire("layerdata",o({},t,{add:!1})),this._update(!0)},moveLayer:function(e,t){var r,n=pt(this,"layerIndex"),i=n.findIndex((function(t){return t.id===e})),o=n.findIndex((function(e){return e.id===t}));return-1!==i&&-1!==o&&(r=n.splice(i,1)[0],o<0?o=0:o>n.length&&(o=n.length),n.splice(o,0,r)),this.style.moveLayer(e,t),this._update(!0)},MapLine:function(){return new T(this)},MapCustom:function(){return new I(this)},fitBoundsGeoJson:function(e,t,r){e&&(e=[[(e=V(e)).bbox[0],e.bbox[1]],[e.bbox[2],e.bbox[3]]],this.fitBoundsPosition(e,t,r))},fitBoundsPosition:function(e,t,r){var n,a,s,u;Array.isArray(e)&&0!==(null==e?void 0:e.length)&&(n=void 0===(n=(t=null!=t?t:{}).padding)?40:n,a=void 0===(a=t.animate)||a,s=void 0===(s=t.maxZoom)?15:s,u=void 0===(u=t.essential)||u,t=i(t,$e),this.fitBounds(e,o({linear:!1,padding:n,animate:a,essential:u,maxZoom:s},t),r))},getInvertMask:function(e,t){var r;if(l(e)&&0!==(e=null!=(e=e.features[0].geometry.coordinates)?e:[]).length)return r=[],e.forEach((function(e){r.push(e[0])})),t=(e=null!=t?t:{}).id,e=void 0===(e=e.layerConfig)?{paint:{"fill-color":"rgba(0,0,0,0.8)"},layout:{visibility:"visible"}}:e,o({id:void 0===t?"mask":t,type:"fill",source:{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,90],[180,90],[180,-90],[-180,-90]]].concat(r)}}}},e)},fitMap:function(){for(var e={},t=!1,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=void 0===(a=n[0])?null:a,s=void 0===(s=n[1])?null:s,u=pt(this,"bounds"),c=pt(this,"cameraOptions");a?l(a)?(t=!1,u=a,s&&!l(s)&&"object"==typeof s&&(c=s)):"object"==typeof a&&(t=!0,e=a):u&&(t=!0),t&&u&&this.fitBoundsGeoJson(u,o({},c,e))},loadImages:function(e){var t=this;return new Promise((function(r){var n={};if(e&&0!==Object.keys(e).length)for(var o in e){var a,s,u=e[o];"string"==typeof u?t.loadImage(u,l(o)):"object"==typeof u&&(u.url?(a=u.url,s=i(u,Qe),t.loadImage(a,l(o,s))):u.layer&&u.layer.render&&"function"==typeof u.layer.render&&l(o,u.config||{})(null,u.layer))}else r(n);function l(t,i){return function(o,a){n[t]={data:i,url:o?null:a},Object.keys(n).length===Object.keys(e).length&&r(n)}}}))},loadAddImages:function(e){var t=this;return new Promise((function(r){t.loadImages(e).then((function(e){for(var n in e){var i=e[n],a=o({},null==i?void 0:i.data,{type:"custom"});t.hasImage(n)||t.addImage(n,i.url,a)}r()}))}))},MapCircle:function(){return new $(this)},MapEvent:function(e){return new Q(this,e)},MapMoreCustom:function(){return new re(this)},removeLayerSource:function(e){function t(e){r.getSource(e)&&(r.removeLayer(e),r.removeSource(e))}var r=this,n=e.name,i=null!=(i=e.sources)?i:[];e=null!=(e=e.layers)?e:[],Array.isArray(n)&&0<n.length?n.forEach((function(e){t(e)})):"string"==typeof n&&t(n),0<(null==i?void 0:i.length)&&0<(null==e?void 0:e.length)&&(e.forEach((function(e){r.getLayer(e)&&r.removeLayer(e)})),i.forEach((function(e){r.getSource(e)&&r.removeSource(e)})))},removeLayerEvent:function(e,t){if(void 0===t&&(t=!0),"object"==typeof e&&null!=e)if(e.destroy&&"function"==typeof e.destroy)e.destroy();else for(var r in e)e[r]&&e[r].destroy&&"function"==typeof e[r].destroy&&(e[r].destroy(),t)&&(e[r]=null)},MapMarker:function(e){return new le(this,e)},findCustomIcon:function(){var e,t=this.style.imageManager.images,r={};for(e in t)"custom"===t[e].type&&(r[e]=t[e]);return r},getCustomLayer:function(){var e=this,t=pt(this,"customLayer"),r=[];return t.map((function(t){e.getLayer(t.layer.id)&&r.push(t.layer)})),r},setStyle:function(e,t,r){var i,o,a,s,u,l,c=this;return null!=t&&t.save&&(a=(o=null!=t?t:{}).source,o=void 0!==(o=o.custom)&&o,a=null!=(i=a=void 0===a?[]:a)?i:[],pt(this,"images"),s=pt(this,"layerSource"),u=pt(this,"customLayer"),l=this.findCustomIcon(),Array.isArray(a)&&0!==a.length?o||(a=Array.from(new Set([].concat(a,["composite","mapbox://mapbox.satellite"])))):a=["composite","mapbox://mapbox.satellite"],s=this.getAllLayerAndSource(a),this.once("style.load",(function(n){var i,o=[];for(i in l)o.push(i),c.style.imageManager.images[i]=l[i];var a=[];s.sources.map((function(e){var t=s.layers.filter((function(t){return t.source===e.name}));a.push({name:e.name,source:e.source,layer:t})})),null!=t&&t.log&&console.log(a),a.map((function(e){c.getSource(e.name)||c.addSource(e.name,e.source),e.layer.map((function(e){c.getLayer(e.id)||c.addLayer(e)}))})),u.forEach((function(e){c.getLayer(e.layer.id)||c.addLayer(e.layer,e.beforeId)})),r&&"function"==typeof r&&r({style:e,images:o,layerSource:s})}))),n.call(this,e,t)},getLayerIndex:function(e){var t=pt(this,"layerIndex");if(e){var r=t.findIndex((function(t){return t.id===e}));if(-1!==r)return r}return 0===t.length?0:t.length-1},getLayerId:function(e,t){void 0===t&&(t=0);var r=pt(this,"layerIndex");return e+=t,t=Number(e),isNaN(t)||e<0&&e>=r.length?"":null!=(r=null==r||null==(t=r[e])?void 0:t.id)?r:void 0},getMinLayerId:function(){var e=pt(this,"layerIndex");return null!=(e=null==e||null==(e=e[0])?void 0:e.id)?e:void 0},getMaxLayerId:function(){var e=pt(this,"layerIndex");return null!=(e=null==e||null==(e=e[e.length-1])?void 0:e.id)?e:void 0},getAllLayerId:function(){return pt(this,"layerIndex").map((function(e){return e.id}))},getAllLayer:function(){return pt(this,"layerIndex")},getLineLayer:function(){return pt(this,"layerIndex").map((function(e,t){return"line"!==e.type?null:{index:t,id:e.id}})).filter(Boolean)},AnimateLine:function(e,t){return new ce(this,e,t)},addHeader:function(e,t){var r,n=pt(this,"showHeader");t&&"function"==typeof t&&!n&&(r=this._requestManager.transformRequest,this._requestManager.transformRequest=function(i,a){return a=r.call(this,i,a),(i=t(i))&&"boolean"==typeof i?(n=!0,o({headers:e},a)):a})},getTileByPosition:function(e,t){var r,n;return e&&Array.isArray(e)&&2<=e.length&&e.every((function(e){return"number"==typeof e}))?(r=(e=tt.MercatorCoordinate.fromLngLat({lng:e[0],lat:e[1]})).x,e=e.y,t=null!=(n=t)?n:this.getZoom(),n=Math.floor(t),t=Math.pow(2,n),[Math.floor(r*t),Math.floor(e*t),n]):[]},getPositionByTile:function(e){var t,r,n,i;return!(e&&Array.isArray(e)&&3===e.length&&e.every((function(e){return"number"==typeof e})))||(i=e[0],t=e[1],e=Math.floor(e[2]),e=Math.pow(2,e),i<0)||t<0||e<=i||e<=t?[]:(r=w(t/e),n=b(i/e),i=b((i+1)/e),[n,w((t+1)/e),i,r])},getTilesByBounds:function(e,t){var r=void 0===(r=(t=null!=(t=t=void 0===t?{}:t)?t:{}).expand)?0:r,n=(t=void 0!==(t=t.reversal)&&t,e=null!=(i=e)?i:this.getZoom(),Math.floor(e)),i=this.getBounds().toArray(),o=(e=this.getTileByPosition(i[0],n))[0],a=e[1],s=(e=this.getTileByPosition(i[1],n))[0],u=e[1];if(u-=r="number"!=typeof r||r<0||2<r?0:r,s+=r,a+=r,!(_(o-=r)&&_(s)&&_(u)&&_(a)))return[];var l=[];if(t)for(var c=u;c<=a;c++)for(var h=o;h<=s;h++)l.push([h,c,n]);else for(var p=o;p<=s;p++)for(var f=u;f<=a;f++)l.push([p,f,n]);var d=Math.pow(2,n);return l.forEach((function(e){e[0]<0&&(e[0]=e[0]+d)})),l.filter((function(e){return 0<=e[1]}))},loadSpriteGraph:function(e){var t=this;return new Promise(function(){var n=r(s().mark((function n(i){var o,a,u,l;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e)return o=[],"object"==typeof e&&e.image&&e.json?o=[e]:Array.isArray(e)&&e.every((function(e){return"object"==typeof e&&e.image&&e.json}))&&(o=e),a={},u=function(){var e=r(s().mark((function e(){var t,r,n,i,u,l,c,h,p,f,d,m,y,v,g,_,b;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(t<o.length){if(r=o[t].image,n=o[t].json,i={},"string"==typeof n)return e.next=8,fetch(n).then((function(e){return e.json()}));e.next=12}else e.next=20;break;case 8:u=e.sent,i="object"==typeof u?u:{},e.next=13;break;case 12:"object"==typeof n&&(i=n);case 13:return e.next=15,function(){return fe.apply(this,arguments)}(r);case 15:for(c in l=e.sent,i)_=i[c],h=_.width,p=_.height,f=_.x,d=_.y,m=_.sdf,y=_.pixelRatio,v=_.stretchX,g=_.stretchY,_=_.content,b=new he({width:h,height:p}),he.copy(l,b,{x:f,y:d},{x:0,y:0},{width:h,height:p}),a[c]={data:b,pixelRatio:y,sdf:m,stretchX:v,stretchY:g,content:_};case 17:t++,e.next=1;break;case 20:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n.next=7,u();n.next=9;break;case 7:for(l in a)t.style.addImage(l,a[l]);i();case 9:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}())},MapClusterMarker:function(e){return new me(this,e)},MapSourceEvent:function(e,t){return new ve(this,e,t)},TileByGeoJson:function(e){return new ke(this,e)},MapMenu:function(e){return new Ie(this,e)},MapMeasure:function(e){return new Ye(this,e,ut)},addControl:function(e,t){return this.initData(),a.call(this,e,t)},MapTileClusterCustom:function(e){return new Ze(this,e)},updateGlyphs:function(e){this.style.updateGlyphs(e)},orderLayers:function(e){void 0===e&&(e=[]);var t=this.style._layers,r=Object.keys(t).map((function(e){return t[e]})),n=[],i=[];return e.forEach((function(e){var t;e&&(t=r.find((function(t){return t.id===e})))&&n.push(t)})),r.forEach((function(e){n.find((function(t){return t.id===e.id}))||i.push(e)})),e=i.concat(n),this.style._checkLoaded(),this.style._changed=!0,this.style._order=e.map((function(e){return e.id})),this.style._layerOrderChanged=!0,e},MapPositionImage:function(){return new Ke(this)}}}(c,t);for(a in new Event("layerdata"),h)c.prototype[a]=h[a];var p,f=tt.Style,d=function(e){var t=e.prototype.addImage,r=e.prototype.updateImage,n=e.prototype._loadSprite,o=e.prototype.queryRenderedFeatures,a=e.prototype.addLayer,s=e.prototype.removeLayer;return{addImage:function(e,r){return r.type="custom",t.call(this,e,r),this},updateImage:function(e,t){t.type="custom",r.call(this,e,t)},_loadSprite:function(e,t){var r,i=this;void 0===t&&(t=!1),n.call(this,e),t&&(r=this._availableImages.length,this.map.on("data",(function e(t){var n=i._availableImages.length;if("style"===t.dataType&&n!==r&&r<n){for(var o=i._availableImages.slice(r),a=0;a<o.length;a++)i.imageManager.images[o[a]].type="custom";i.map.off("data",e)}})))},loadSprite:function(e){this._loadSprite(e,!0)},addLayer:function(e,t){for(var r=void 0===(r=e.interactive)||r,n=(null!=this&&null!=(n=this[ut])&&n.layerObject||ht(this,{layerObject:{}}),this),i=["layerObject",e.id],o=n[ut],s=0;s<i.length-1;s++){var u=i[s];o[u]||(o[u]={}),o=o[u]}o[i[i.length-1]]=r,a.call(this,e,t)},removeLayer:function(e){var t=["layerObject",e];if(t.reduce((function(e,t){return e[t]}),this[ut])){for(var r=this[ut],n=0;n<t.length-1;n++)r=r[t[n]];r&&t[t.length-1]in r&&delete r[t[t.length-1]]}s.call(this,e)},queryRenderedFeatures:function(e,t,r){var n=void 0===(n=(t=null!=t?t:{}).interactive)||n,a=(t=i(t,et),o.call(this,e,t,r));if(n){if(0<a.length)for(var s=0;s<a.length;s++){var u=pt(this,["layerObject",a[s].layer.id]);a[s].layer.interactive=null==u||u}return a.filter((function(e){return e.layer.interactive}))}return a},updateGlyphs:function(e){this.glyphManager.setURL(e)}}}(f);for(p in d)f.prototype[p]=d[p];var m=(e=tt.Popup).prototype.setDOMContent;e.prototype._closeClick=function(){},e.prototype.setDOMContent=function(e){return e=m.call(this,e),this._closeButton&&this._closeButton.addEventListener("click",this._closeClick),e}}},RegisterMapBoxModel:()=>function(e,t){if(tt&&e&&t){(rt=e).GLTFLoader=t,window.THREE=rt;var r,n=tt.Map,i={initGLTF:function(e,t,r){return new S(e,t,r)}};for(r in i)n.prototype[r]=i[r]}},RegisterMapClass:()=>function(e,t){var r;e&&(r=(t=null!=t?t:{}).tooltipClass,t=t.popupClass,e.tooltipClass=null!=r?r:"commonTooltip",e.popupClass=null!=t?t:"commonPopup")},deepClone:()=>u,gcj02ToWgs84:()=>Pe,getAPNGSymbol:()=>function(e){var t,r=void 0===(t=(e=null!=e?e:{}).width)?50:t,n=void 0===(t=e.height)?50:t,i=void 0===(t=e.duration)?null:t,o=void 0===(t=e.url)?"":t;return new Promise((function(e){fetch(o).then((function(e){return e.arrayBuffer()})).then((function(t){var o;t=A()(t),!(0,E.isNotAPNG)(t)&&0<(null==(o=t.frames)?void 0:o.length)?(i="number"==typeof i?i:t.playTime/t.frames.length,o=t.frames.map((function(e){return URL.createObjectURL(e.imageData)})),Promise.all(o.map((function(e){var t=new Image;return t.src=e,new Promise((function(e){t.onload=function(){var i;((i=document.createElement("canvas")).width=r,i.height=n,i=i.getContext("2d")).drawImage(t,0,0,r,n),e(i.getImageData(0,0,r,n).data)}}))}))).then((function(t){t={urls:t,width:r,height:n,data:new Uint8Array(r*n*4),onAdd:function(e){this.map=e,(e=document.createElement("canvas")).width=this.width,e.height=this.height,this.canvas=e,this.context=e.getContext("2d"),this.index=0,this.duration=i,this.dataNow=performance.now()},render:function(){var e=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=e,this.map.triggerRepaint(),!0}},e(t)})).catch((function(t){e(null)}))):e(null)}))}))},getArrayDepth:()=>y,getGifSymbol:()=>function(e){var t,r=void 0===(t=(e=null!=e?e:{}).width)?50:t,n=void 0===(t=e.height)?50:t,i=void 0===(t=e.duration)?null:t,o=void 0===(t=e.url)?"":t;return new Promise((function(e){var t,a,s;o&&("gif"===(s=(a=o).split("/"))[s.length-1].split(".").pop().toLowerCase()||a.startsWith("data:image/gif"))?(s=document.createElement("div"),(a=document.createElement("img")).setAttribute("rel:animated_src",o),a.setAttribute("rel:auto_play","0"),s.appendChild(a),(t=new(P())({gif:a})).load((function(){var o=[];i="number"==typeof i?i:t.get_duration_ms()/t.get_length();for(var a,s=1;s<=t.get_length();s++){t.move_to(s);var u=((u=t.get_canvas().getContext("2d")).drawImage(t.get_canvas(),0,0,r,n),u.getImageData(0,0,r,n).data);o.push(u)}0<o.length?(a={urls:o,width:r,height:n,data:new Uint8Array(r*n*4),onAdd:function(e){this.map=e,(e=document.createElement("canvas")).width=this.width,e.height=this.height,this.canvas=e,this.context=e.getContext("2d"),this.index=0,this.duration=i,this.dataNow=performance.now()},render:function(){var e=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=e,this.map.triggerRepaint(),!0}},e(a)):e(null)}))):e(null)}))},getPositionType:()=>d,getSymbolRipple:()=>function(e){var t,r=void 0===(t=(e=null!=e?e:{}).size)?30:t,n=void 0===(t=e.duration)?1e3:t,i=void 0===(t=e.color)?"#f00":t,o=e.custom,a=v(i,!0),s=!1;return o&&"function"==typeof o&&(s=!0),{width:r,height:r,data:new Uint8Array(r*r*4),onAdd:function(e){this.map=e,(e=document.createElement("canvas")).width=this.width,e.height=this.height,this.context=e.getContext("2d")},render:function(){var e,t,u,l=this.context;return s?l=o({width:this.width,height:this.height,duration:n,color:i,context:l}):(e=performance.now()%n/n,t=r/2*.2,u=r/2*e,l.clearRect(0,0,this.width,this.height),l.beginPath(),l.arc(this.width/2,this.height/2,u,0,2*Math.PI),l.strokeStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e+.1)+")",l.lineWidth=2,l.stroke(),l.fillStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e)+")",l.fill(),l.beginPath(),l.arc(this.width/2,this.height/2,t,0,2*Math.PI),l.fillStyle="rgba("+a[0]+","+a[1]+","+a[2]+","+(1-e)+")",l.lineWidth=2+4*(1-e),l.fill()),this.data=l.getImageData(0,0,this.width,this.height).data,this.map.triggerRepaint(),!0}}},hexToRgba:()=>v,isClosedGraph:()=>m,isGeoJSON:()=>l,isNumber:()=>g,isValidNumber:()=>_,judgeSizeLngLat:()=>h,latFromMercatorY:()=>w,lngFromMercatorX:()=>b,mergeGeoJson:()=>function(){for(var e={type:"FeatureCollection",features:[]},t=[],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];for(var o=0;o<n.length;o++)Array.isArray(n[o])?t.push.apply(t,n[o]):n[o]&&"object"==typeof n[o]&&t.push(n[o]);for(var a,s=0;s<t.length;s++){var u=t[s];l(u)&&(u=u.features,(a=e.features).push.apply(a,u))}return e},object2Geojson:()=>function(e,t,r){var n=u(e);if(!Array.isArray(n))return null;e={type:"FeatureCollection"};for(var i=[],o=function(e){var o=n[e],a=function(e,t){if(t)if("string"==typeof t){var r=t.split(".").filter(Boolean);if(1!==r.length)return f(e,r);if(r=e[r[0]])return[p(r)]}else if(Array.isArray(t)){if(2===t.length)return[[e[t[0]],e[t[1]]].filter(Boolean)];if(3===t.length&&t[2])return f(e,r=t[2].split(".").filter(Boolean),[t[0],t[1]])}return[]}(o,t);0<a.length&&a.map((function(t){var a=d(t),s=!1;(s=!(!a||!("type"===a||0<t.length||"Feature"===a||"GeometryCollection"===a))||s)&&("GeometryCollection"===a?(null!=(s=t.geometries)?s:[]).forEach((function(t){var o={type:"Feature"};o.geometry=t,r&&r.key&&"string"==typeof r.key&&(r.alias&&"string"==typeof r.alias?o[r.alias]=n[e][r.key]:o[r.key]=n[e][r.key]),i.push(o)})):(s={type:"Feature"},"Feature"!==a?(s.properties=o,s.geometry="type"===a?t:{type:a,coordinates:t}):s=t,r&&r.key&&"string"==typeof r.key&&(r.alias&&"string"==typeof r.alias?s[r.alias]=n[e][r.key]:s[r.key]=n[e][r.key]),i.push(s)))}))},a=0;a<n.length;a++)o(a);return e.features=i,e},outOfChina:()=>Le,parseValue:()=>L,performChunk:()=>function(e,t,r){var n,i,o=[];"number"==typeof e?o=new Array(e):Array.isArray(e)&&(o=e),0!==o.length&&"function"==typeof t&&(!(n="function"==typeof r?r:null)&&globalThis.requestIdleCallback&&(n=function(e){requestIdleCallback((function(t){e((function(){return 0<t.timeRemaining()}))}))}),i=0,function e(){i!==o.length&&n((function(r){for(var n=Date.now();r(Date.now()-n)&&i<o.length;){var a=o[i];t(a,i),i++}e()}))}())},resversalGeojson:()=>function(e,t){if(void 0===t&&(t=!0),l(e)){for(var r={type:"FeatureCollection",features:[]},n=e.features,i=0;i<n.length;i++){var a,s=n[i],u={};for(a in s)"geometry"!==a&&"properties"!==a&&"type"!==a&&(u[a]=s[a]);var p=s.geometry.coordinates,f=s.geometry.type,d={type:f,coordinates:null};d.coordinates=("Point"===f?h:c)(p,t),r.features.push(o({type:"Feature",geometry:d,properties:s.properties},u))}return r}return null},reversalLngLat:()=>c,transformGeojson:()=>function(e,t){return l(e)&&"function"==typeof t?((e=u(e)).features.forEach((function(e){var r=e.geometry;e.geometry.coordinates=x(r.coordinates,t)})),e):null},transformLngLat:()=>x,wgs84ToGcj02:()=>function(e,t){var r,n,i,o,a;return Le(e=+e,t=+t)?[e,t]:(r=we(e-105,t-35),n=xe(e-105,t-35),i=t/180*ge,o=Math.sin(i),o=1-be*o*o,a=Math.sqrt(o),r=180*r/(_e*(1-be)/(o*a)*ge),[e+(n=180*n/(_e/a*Math.cos(i)*ge)),t+r])}});var a=e(687),s=e.n(a),u=function e(t){var r,n,i="object"!=(i=typeof(r=t))?i:Object.prototype.toString.call(r).replace(/^\[object (\S+)\]$/,"$1");if("Array"===i)n=[];else{if("Object"!==i)return t;n={}}if("Array"===i)for(var o=0,a=t.length;o<a;o++)n.push(e(t[o]));else if("Object"===i)for(var s in t)n[s]=e(t[s]);return n};function l(e){return"object"==typeof e&&null!==e&&"FeatureCollection"===e.type&&Array.isArray(e.features)}function c(e,t){return void 0===t&&(t=!0),e&&("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e))?g(e[0])?h(e,t):function e(t){for(var r=[],n=0;n<t.length;n++){var i=t[n];g(i[0])?r.push(h(i)):r.push(e(i))}return r}(e):[]}function h(e,t){void 0===t&&(t=!0);var r=Number(e[0]);return e=Number(e[1]),t&&r<e?[e,r]:[r,e]}function p(e){return"string"==typeof e?JSON.parse(e):e}function f(e,t,r){var n=[],i=2===(r=void 0===r?[]:r).length;return function e(t,o){var a;t&&o.length&&(a=o.shift(),t.hasOwnProperty(a))&&(t=L(t[a]),Array.isArray(t)?0!==o.length||i?t.forEach((function(t){i?n.push([t[r[0]],t[r[1]]]):e(t,u(o))})):t&&(a=p(t),n.push(a)):"object"==typeof t?0===o.length?n.push(i?[t[r[0]],t[r[1]]]:t):e(t,o):0===o.length&&t&&(a=p(t),n.push(a)))}(e,t),n}function d(e){if(Array.isArray(e)){var t=y(e=e.filter(Boolean));if(0!==t)switch(t){case 1:return"Point";case 2:return"LineString";case 3:return m(e.map((function(e){return[e[0],e[e.length-1]]})))?"Polygon":"MultiLineString";case 4:return"MultiPolygon";default:return null}}else if(e&&"object"==typeof e){if(["Point","LineString","Polygon","MultiLineString","MultiPolygon"].includes(e.type))return"type";if("Feature"===e.type)return"Feature";if("GeometryCollection"===e.type)return"GeometryCollection"}return null}function m(e){if(0===e.length)return!1;function t(e,t,r){return void 0===r&&(r=1e-9),Math.abs(e[0]-t[0])<r&&Math.abs(e[1]-t[1])<r}for(var r=0;r<e.length-1;r++)if(!t(e[r][1],e[r+1][0]))return!1;return t(e[0][0],e[e.length-1][1])}function y(e){return Array.isArray(e)?Array.isArray(e[0])?1+y(e[0]):1:0}function v(e,t){void 0===t&&(t=!1);var r,n,i=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,r,n){return t+t+r+r+n+n}));return(i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i))?(r=parseInt(i[1],16),n=parseInt(i[2],16),i=parseInt(i[3],16),t?[r,n,i,1]:"rgba("+r+","+n+","+i+",1)"):e}function g(e){return"number"==typeof e||!("string"!=typeof e||!e||e.includes(" ")||isNaN(Number(e)))}function _(e){return isFinite(e)&&!isNaN(e)}function b(e){return 360*e-180}function w(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function x(e,t){return e&&"function"==typeof t&&("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e))?g(e[0])?t(e):function e(t,r){for(var n=[],i=0;i<t.length;i++){var o=t[i];g(o[0])?n.push(r(o)):n.push(e(o,r))}return n}(e,t):[]}function L(e){try{return"string"==typeof e?JSON.parse(e):e}catch(t){return e}}a=e(481);var P=e.n(a),E=e(630),A=e.n(E),M=["customName"],k=function(){function e(e,t,n){var a=this,u=(this._mouseEnter=function(){var e=r(s().mark((function e(t){var r,n,i,o,u,l,c,h,p,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Map"!==t.originalEvent.target.ariaLabel)return e.abrupt("return");e.next=2;break;case 2:if(n=t.point,i=t.lngLat,o=a.map.queryRenderedFeatures(n),c=null!=(c=o[0])?c:{},u=c.properties,l=c.geometry,c.source,c=c.layer,a.layerName.includes(c.id)){e.next=8;break}return null!=(c=a.popup)&&c.remove(),e.abrupt("return");case 8:if(c=l.coordinates,h=[i.lng,i.lat],"mouseenter"===a.mouseType&&(h=a._getPosition(c)),!(0<(null==(r=h)?void 0:r.length))){e.next=17;break}for(f in p={},u)if("string"==typeof u[f]&&isNaN(Number(u[f])))try{p[f]=JSON.parse(u[f])}catch(e){p[f]=u[f]}else p[f]=u[f];return e.next=16,a._setHTML(p,h,i,l,n,o);case 16:a._mouseInOut&&"function"==typeof a._mouseInOut&&a._mouseInOut(!0,o,t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._mouseLeave=function(e){a.popup.remove();var t=e.point;e.lngLat,t=a.map.queryRenderedFeatures(t),a._mouseInOut&&"function"==typeof a._mouseInOut&&a._mouseInOut(!0,t,e)},this.map=e,"string"==typeof t?this.layerName=[t]:Array.isArray(t)&&(this.layerName=t),e=null!=(t=e.tooltipClass)?t:"commonTooltip",void 0!==(u=(t=null!=n?n:{}).customName)&&u);t=i(t,M),u=u?"":e+" ",this.className=u,null!=n&&n.className&&(u+=n.className),u=u.split(" ").filter(Boolean).join(" "),this.fullName=u,this.popup=new mapboxgl.Popup(o({},t,{className:u,closeButton:null!=(e=null==n?void 0:n.closeButton)&&e,closeOnClick:null!=(t=null==n?void 0:n.closeOnClick)&&t,anchor:null!=(u=null==n?void 0:n.anchor)?u:"left",type:"tooltip"}))}var t=e.prototype;return t.show=function(e,t){var r=this;"function"==typeof(this.htmlCallBack=e)&&(this.mouseType="mouseenter","move"===t&&(this.mouseType="mousemove"),0<(null==(e=this.layerName)?void 0:e.length))&&this.layerName.forEach((function(e){r.map.on(r.mouseType,e,r._mouseEnter).on("mouseleave",e,r._mouseLeave)}))},t.setClassName=function(e,t){var r=this;void 0===t&&(t=!1),this.popup&&"string"==typeof e&&e!==this.oldClassName&&(Array.from(this.popup._classList).map((function(e){e&&e.replaceAll(" ","")&&r.popup.addClassName(e)})),(t?this.fullName+" "+e:this.className+" "+e).split(" ").filter(Boolean).map((function(e){r.popup.addClassName(e)})),this.oldClassName=e)},t.destroy=function(){var e,t=this;null!=(e=this.popup)&&e.remove(),null!=(e=this.layerName)&&e.forEach((function(e){t.map.off(t.mouseType,e,t._mouseEnter).off("mouseleave",e,t._mouseLeave)}))},t._setHTML=function(){var e=r(s().mark((function e(t,r,n,i,o,a){var u,l,c=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.htmlCallBack(t,r,{lngLat:n,geometry:i,point:o,features:a,feature:a[0]});case 2:u=e.sent,l=function(e){c.popup.setLngLat(r).setHTML(e).addTo(c.map)},"object"==typeof u?u.hasOwnProperty("nodeType")?l(u):u.hasOwnProperty("show")&&"boolean"==typeof u.show?u.show&&l(u.data):l(""):"string"!=typeof u&&"number"!=typeof u||l(u);case 5:case"end":return e.stop()}}),e,this)})));return function(t,r,n,i,o,a){return e.apply(this,arguments)}}(),t.mouseInOut=function(e){e&&"function"==typeof e&&(this._mouseInOut=e)},t.showPosition=function(e,t){var r=this,n=this.map.project(e),i=this.map.queryRenderedFeatures(n),o=null!=(o=i.filter((function(e){return r.layerName.includes(e.layer.id)}))[0])?o:{},a=void 0===(s=o.properties)?{}:s,s=o.geometry;if(o=o.layer,this.layerName.includes((void 0===o?{}:o).id)){o=void 0===(o=(null!=s?s:{}).coordinates)?[]:o;var u=Array.isArray(e)?e:[e.lng,e.lat];if(0<(null==(o=u="mouseenter"===this.mouseType?this._getPosition(o):u)?void 0:o.length)){var l,c={};for(l in a)if("string"==typeof a[l]&&isNaN(Number(a[l])))try{c[l]=JSON.parse(a[l])}catch(e){c[l]=a[l]}else c[l]=a[l];o=t&&"object"==typeof t?t:c,this._setHTML(o,u,e,s,n,i)}}else null!=(t=this.popup)&&t.remove()},t._getPosition=function(e){return function e(t){return Array.isArray(t[0])?e(t[0]):t}(e)},e}(),N=["destroyComponent","customClick","popupClose","closeOther","noCloseLayerName","customName","offset","closeClick"],C=function(){function e(e,t,n){var a=this,u=(this._closeOtherPopup=function(){var e;a.closeOther&&null!=(e=a.map)&&null!=(e=e._popups)&&e.forEach((function(e){var t;"popup"===e.options.type&&(Array.isArray(a.noCloseLayerName)&&0<a.noCloseLayerName.length?(t=e.options.sourceName.join("|"),new RegExp(t).test(a.noCloseLayerName)&&null!=e&&null!=(t=e._onClose)&&t.call(e)):null!=e&&null!=(t=e._onClose)&&t.call(e))}))},this._click=function(){var e=r(s().mark((function e(t){var r,n,i,o,u,l,c,h,p,f,d,m,y,v;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Map"!==t.originalEvent.target.ariaLabel)return e.abrupt("return");e.next=2;break;case 2:if(a._closeOtherPopup(),r=t.point,n=t.lngLat,i=a.map.queryRenderedFeatures(r),c=null!=(c=i[0])?c:{},o=c.properties,u=c.geometry,c.source,c=c.layer,a.layerName.includes(c.id)){e.next=8;break}return e.abrupt("return");case 8:if(a.customClick){e.next=30;break}for(p in h={},o)if("string"==typeof o[p]&&isNaN(Number(o[p])))try{h[p]=JSON.parse(o[p])}catch(e){h[p]=o[p]}else h[p]=o[p];return f=u.coordinates,d=u.type,e.next=14,null==(c=a.componentCallBack)?void 0:c.call(a,{properties:h,lngLat:n,coordinates:f,point:r,features:i,feature:i[0]});case 14:if(e.t1=l=e.sent,e.t0=null!==e.t1,!e.t0){e.next=18;break}e.t0=void 0!==l;case 18:e.t0?(e.t2=l,e.next=23):e.next=22;break;case 22:e.t2={};case 23:y=e.t2,m=y.component,y=y.instance,v=n,"Point"===d&&(v=f),a.vueInstance=y,m&&(a.popup.setOffset(a.offset),a.popup.setLngLat(v).setDOMContent(m).addTo(a.map));case 30:"function"==typeof a.callBack&&a.callBack({lngLat:n,properties:o,geometry:u,point:r});case 31:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.map=e,this.popup=null,"string"==typeof t?this.layerName=[t]:Array.isArray(t)&&(this.layerName=t),void 0!==(l=(t=n||{}).destroyComponent)&&l),l=void 0!==(l=t.customClick)&&l,c=void 0!==(c=t.popupClose)&&c,h=void 0===(h=t.closeOther)||h,p=void 0===(p=t.noCloseLayerName)?[]:p,f=void 0!==(f=t.customName)&&f,d=void 0===(d=t.offset)?[0,0]:d,m=t.closeClick;t=i(t,N),e=null!=(e=e.popupClass)?e:"commonPopup",f=f?"":e+" ",this.className=f,null!=n&&n.className&&(f+=n.className),f=f.split(" ").filter(Boolean).join(" "),this.fullName=f,this.noCloseLayerName=p,this.noCloseLayerName=[],this.customClick=l,this.popupCloseSign=c,this.closeOther=h,this.offset=d="number"==typeof d?[d,d]:d,this.vueInstance=null,this.closeCallback=null,this.customClick||(this.popup=new mapboxgl.Popup(o({},t,{offset:d,className:f,closeButton:null!=(e=null==t?void 0:t.closeButton)&&e,closeOnClick:null!=(n=null==t?void 0:t.closeOnClick)&&n,anchor:null!=(p=null==t?void 0:t.anchor)?p:"bottom",focusAfterOpen:null!=(l=null==t?void 0:t.focusAfterOpen)&&l,type:"popup",sourceName:this.layerName})),m&&"function"==typeof m&&(this.popup._closeClick=m),null!=(c=this.popup)&&c.on("close",(function(e){"function"==typeof a.closeCallback&&a.closeCallback(e),a.popupCloseSign&&null!=(e=a.vueInstance)&&e.popupClose&&"function"==typeof a.vueInstance.popupClose&&a.vueInstance.popupClose(),a.vueInstance&&u&&null!=(e=a.vueInstance)&&e.$destroy()})))}var t=e.prototype;return t.show=function(e,t){var r=this;this.componentCallBack=e,this.callBack=t,0<(null==(e=this.layerName)?void 0:e.length)&&this.layerName.forEach((function(e){r.map.on("click",e,r._click)}))},t.setClassName=function(e,t){var r=this;void 0===t&&(t=!1),this.popup&&"string"==typeof e&&e!==this.oldClassName&&(Array.from(this.popup._classList).map((function(e){r.popup.removeClassName(e)})),(t?this.fullName+" "+e:this.className+" "+e).split(" ").filter(Boolean).map((function(e){e&&e.replaceAll(" ","")&&r.popup.addClassName(e)})),this.oldClassName=e)},t.showPosition=function(e,t,r,n){e&&(this._closeOtherPopup(),(r=(null!=r?r:{}).offset)&&this.popup.setOffset(r),this.popup.setLngLat(e).setDOMContent(t).addTo(this.map),n)&&"function"==typeof n&&n()},t.close=function(){var e;null!=(e=this.popup)&&e._onClose()},t.closeBack=function(e){this.closeCallback=e},t.destroy=function(){var e,t=this;null!=(e=this.popup)&&e.remove(),null!=(e=this.layerName)&&e.forEach((function(e){t.map.off("click",e,t._click)}))},e}(),S=function(){function e(e,t,r){var n=this,i=(this.clickEvent=function(e){var t=new THREE.Vector2,r=n.map.getCanvas();t.x=(e.clientX-r.getBoundingClientRect().left)/r.offsetWidth*2-1,t.y=-(e.clientY-r.getBoundingClientRect().top)/r.offsetHeight*2+1,e=(new THREE.Matrix4).getInverse(n.camera.projectionMatrix),r=(new THREE.Vector3).applyMatrix4(e),t=new THREE.Vector3(t.x,t.y,1).applyMatrix4(e).clone().sub(r).normalize(),(e=new THREE.Raycaster).set(r,t),r=e.intersectObjects(n.scene.children,!0),n.callback&&0<r.length&&(t=r[0],e=n.findProperties(t.object),n.callback(e))},this.findProperties=function(e){var t={},r=null;return"Scene"!==e.type&&(r=(e.lngLat?(t=e.properties,e):(t=(e=n.findProperties(e.parent)).properties,e)).lngLat),{properties:t,lngLat:r}},this.id="3d-"+e,this.type="custom",this.renderingMode="3d","function"==typeof r&&(this.callback=r),e=t.lngLat,r=t.url,void 0===(i=t.scale)?1:i),o=void 0===(o=t.height)?0:o,a=void 0===(a=t.rotate)?[Math.PI/2,0,0]:a,s=void 0===(s=t.properties)?{}:s,u=void 0===(u=t.AmbientLight)?{show:!0,color:16777215,intensity:.5}:u,l=void 0===(l=t.DirectionalLight)?[]:l,c=void 0===(c=t.PointLight)?[]:c;t=void 0!==(t=t.click)&&t,this.lngLat=e,this.url=r,this.scale=i,this.height=o,this.rotate=a,this.properties=s,this.AmbientLight=u,this.DirectionalLight=l,this.PointLight=c,this.click=t,this.modelAsMercatorCoordinate=mapboxgl.MercatorCoordinate.fromLngLat(e,o),this.modelTransform={translateX:this.modelAsMercatorCoordinate.x,translateY:this.modelAsMercatorCoordinate.y,translateZ:this.modelAsMercatorCoordinate.z,rotateX:a[0],rotateY:a[1],rotateZ:a[2],scale:i*this.modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()}}var t=e.prototype;return t.onAdd=function(e,t){var r,n,i=this;this.map=e,e=this.map.getCanvas(),this.camera=new THREE.PerspectiveCamera(50,e.innerWidth/e.innerHeight,.1,1e4),this.scene=new THREE.Scene,this.AmbientLight&&this.AmbientLight.show&&(n=this.AmbientLight.color||16777215,r=this.AmbientLight.intensity||.5,n=new THREE.AmbientLight(n,r),this.scene.add(n)),this.DirectionalLight&&Array.isArray(this.DirectionalLight)&&this.DirectionalLight.forEach((function(e){var t=e.color||16777215,r=e.intensity||1;e=e.position||[0,0,0],(t=new THREE.DirectionalLight(t,r)).position.set(e[0],e[1],e[2]).normalize(),i.scene.add(t)})),this.PointLight&&Array.isArray(this.PointLight)&&this.PointLight.forEach((function(e){var t=e.color||16777215,r=e.intensity||1,n=e.distance||0,o=e.decay||2;e=e.position||[0,0,0],(t=new THREE.PointLight(t,r,n,o)).position.set(e[0],e[1],e[2]).normalize(),i.scene.add(t)})),(new THREE.GLTFLoader).load(this.url,(function(e){for(var t=0;t<e.scene.children.length;t++)e.scene.children[t].properties=i.properties,e.scene.children[t].lngLat=i.lngLat;i.scene.add(e.scene)})),this.renderer=new THREE.WebGLRenderer({canvas:e,context:t,antialias:!0}),this.renderer.autoClear=!1,this.click&&this.renderer.domElement.addEventListener("click",this.clickEvent)},t.render=function(e,t){var r=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(1,0,0),this.modelTransform.rotateX),n=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,1,0),this.modelTransform.rotateY),i=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,0,1),this.modelTransform.rotateZ),o=(new THREE.Matrix4).fromArray(t);r=(new THREE.Matrix4).makeTranslation(this.modelTransform.translateX,this.modelTransform.translateY,this.modelTransform.translateZ).scale(new THREE.Vector3(this.modelTransform.scale,-this.modelTransform.scale,this.modelTransform.scale)).multiply(r).multiply(n).multiply(i),this.camera.projectionMatrix.elements=t,this.camera.projectionMatrix=o.multiply(r),this.renderer.state.reset(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},t.onRemove=function(){this.click&&this.renderer.domElement.removeEventListener("click",this.clickEvent),this.renderer&&(this.renderer.dispose(),this.renderer=null),this.scene&&(this.scene.clear(),this.scene=null)},e}(),T=function(){function e(e){this.map=e,this.sourceName=[],this.sourceType="geojson"}var t=e.prototype;return t.draw=function(e,t,r){if(e&&this.map)return"vector"===e.type?(this.sourceName=[t],this.sourceType="vector",this._clearSource(),this._addSourceLayer(t,e,r),this.sourceName):"FeatureCollection"===e.type||Array.isArray(e.features)?(this.sourceName=[t],this._clearSource(),this._addSourceLayer(t,e,r),r.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName):void 0},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._addSourceLayer=function(e,t,r){"vector"===this.sourceType?this.map.addSource(e,o({},t,r.sourceConfig)):this.map.addSource(e,o({type:"geojson",data:t},r.sourceConfig)),(t=r.beforeId||null)&&!this.map.getLayer(t)&&(t=null),this.map.addLayer(o({id:e,type:"line",source:e},r.layerConfig),t),r.lineConfig&&(this.lineName=e+"-highlight",this.map.addLayer(o({id:this.lineName,type:"line",source:e},r.lineConfig)))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){var r;(null==(r=t.map)?void 0:r.getSource(e))&&(t.map.getLayer(e)&&t.map.removeLayer(e),t.lineName&&t.map.getLayer(e+"-highlight")&&t.map.removeLayer(e+"-highlight"),t.map.removeSource(e))}))},e}(),I=function(){function e(e){this.map=e,this.sourceName=[],this.type="symbol",this.sourceType="geojson"}var t=e.prototype;return t.draw=function(e,t,r){if(e&&this.map){if("vector"===e.type)return this.sourceType="vector",this._addSourceLayer(t,e,r),this.sourceName=[t],this.sourceName;var n;if("FeatureCollection"===e.type||Array.isArray(e.features)){this.type=null!=(n=r.type)?n:"symbol";var i=r.sliceNum;if(!i||i<1e3)this.sourceName=[t],this._clearSource(),this._addSourceLayer(t,e,r);else{this._clearSource();for(var o=0,a=0;a<e.features.length;a+=i){var s={type:"FeatureCollection",features:[]},u=e.features.slice(a,i);s.features=[].concat(u),u=t+"-"+o,this.sourceName.push(u),this._addSourceLayer(u,s,r),o++}}return this.sourceName}}},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){var r;(null==(r=t.map)?void 0:r.getSource(e))&&(t.map.getLayer(e)&&t.map.removeLayer(e),t.map.removeSource(e))}))},t._addSourceLayer=function(e,t,r){"vector"===this.sourceType?this.map.addSource(e,o({},t,r.sourceConfig)):this.map.addSource(e,o({type:"geojson",data:t},r.sourceConfig)),(t=r.beforeId||null)&&!this.map.getLayer(t)&&(t=null),this.map.addLayer(o({id:e,type:this.type,source:e},r.layerConfig),t)},e}(),R={centimeters:100*(a=6371008.8),centimetres:100*a,degrees:a/111325,feet:3.28084*a,inches:39.37*a,kilometers:a/1e3,kilometres:a/1e3,meters:a,metres:a,miles:a/1609.344,millimeters:1e3*a,millimetres:1e3*a,nauticalmiles:a/1852,radians:1,yards:1.0936*a};function O(e,t,r){var n={type:"Feature"};return 0!==(r=void 0===r?{}:r).id&&!r.id||(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function j(e,t,r){if(void 0===r&&(r={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(H(e[0])&&H(e[1]))return O({type:"Point",coordinates:e},t,r);throw new Error("coordinates must contain numbers")}function F(e,t,r){void 0===r&&(r={});for(var n=0,i=e;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}return O({type:"Polygon",coordinates:e},t,r)}function D(e,t,r){if(void 0===r&&(r={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return O({type:"LineString",coordinates:e},t,r)}function B(e,t){var r={type:"FeatureCollection"};return(t=void 0===t?{}:t).id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function U(e){return e%(2*Math.PI)*180/Math.PI}function G(e){return e%360*Math.PI/180}function H(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function z(e,t,r){if(null!==e)for(var n,i,o,a=0,s=e.type,u="FeatureCollection"===s,l="Feature"===s,c=u?e.features.length:1,h=0;h<c;h++)for(var p,f,d=(f=!!(p=u?e.features[h].geometry:l?e.geometry:e)&&"GeometryCollection"===p.type)?p.geometries.length:1,m=0;m<d;m++){var y=0,v=0,g=f?p.geometries[m]:p;if(null!==g){var _=g.coordinates,b=g.type,w=!r||"Polygon"!==b&&"MultiPolygon"!==b?0:1;switch(b){case null:break;case"Point":if(!1===t(_,a,h,y,v))return!1;a++,y++;break;case"LineString":case"MultiPoint":for(n=0;n<_.length;n++){if(!1===t(_[n],a,h,y,v))return!1;a++,"MultiPoint"===b&&y++}"LineString"===b&&y++;break;case"Polygon":case"MultiLineString":for(n=0;n<_.length;n++){for(i=0;i<_[n].length-w;i++){if(!1===t(_[n][i],a,h,y,v))return!1;a++}"MultiLineString"===b&&y++,"Polygon"===b&&v++}"Polygon"===b&&y++;break;case"MultiPolygon":for(n=0;n<_.length;n++){for(i=v=0;i<_[n].length;i++){for(o=0;o<_[n][i].length-w;o++){if(!1===t(_[n][i][o],a,h,y,v))return!1;a++}v++}y++}break;case"GeometryCollection":for(n=0;n<g.geometries.length;n++)if(!1===z(g.geometries[n],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function q(e,t){for(var r,n,i,o,a,s,u,l,c,h=0,p="FeatureCollection"===e.type,f="Feature"===e.type,d=p?e.features.length:1,m=0;m<d;m++){for(a=p?e.features[m].geometry:f?e.geometry:e,u=p?e.features[m].properties:f?e.properties:{},l=p?e.features[m].bbox:f?e.bbox:void 0,c=p?e.features[m].id:f?e.id:void 0,o=(s=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,n=0;n<o;n++)if(null===(i=s?a.geometries[n]:a)){if(!1===t(null,h,u,l,c))return}else switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(i,h,u,l,c))return;break;case"GeometryCollection":for(r=0;r<i.geometries.length;r++)if(!1===t(i.geometries[r],h,u,l,c))return;break;default:throw new Error("Unknown Geometry Type")}h++}}function X(e){var t=[1/0,1/0,-1/0,-1/0];return z(e,(function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])})),t}const W=X.default=X;function Y(e,t){void 0===t&&(t={});var r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(6===e.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var a=[r,n];return F([[a,[i,n],[i,o],[r,o],a]],t.properties,{bbox:e,id:t.id})}const V=function(e){return Y(W(e))};function J(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&2<=e.length&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Z(e,t,r,n){void 0===n&&(n={});var i=G((e=J(e))[0]),o=(e=G(e[1]),r=G(r),t=function(e,t){var r=R[t=void 0===t?"kilometers":t];if(r)return e/r;throw new Error(t+" units is invalid")}(t,n.units),Math.asin(Math.sin(e)*Math.cos(t)+Math.cos(e)*Math.sin(t)*Math.cos(r)));return j([U(i+Math.atan2(Math.sin(r)*Math.sin(t)*Math.cos(e),Math.cos(t)-Math.sin(e)*Math.sin(o))),U(o)],n.properties)}const K=function(e,t,r){for(var n=(r=void 0===r?{}:r).steps||64,i=r.properties||(!Array.isArray(e)&&"Feature"===e.type&&e.properties?e.properties:{}),o=[],a=0;a<n;a++)o.push(Z(e,t,-360*a/n,r).geometry.coordinates);return o.push(o[0]),F([o],i)};var $=function(){function e(e){this.map=e,this.sourceName=[],this.lineName=""}var t=e.prototype;return t.draw=function(e,t,r){if(e){this.sourceName=[t];var n,i=null!=r?r:{},o=void 0===(n=i.radius)?0:n,a=void 0===(n=i.steps)?64:n,s=i.endRadius,u=[];if("object"==typeof e){if("FeatureCollection"!==e.type&&!Array.isArray(e.features))return;for(var l=e.features,c=0;c<l.length;c++){var h,p,f,d,m,y=l[c].geometry.coordinates;"number"==typeof y[0]&&"number"==typeof y[1]&&(y[0]<y[1]&&(h=[y[1],y[0]],y[0]=h[0],y[1]=h[1]),h=!1,p=0<(p=(h="string"==typeof o||h)?l[c].properties[o]:o)?p:0,f={steps:a,units:"kilometers",properties:l[c].properties},d=K(y,p,f),s?(m=!1,m=0<(m=(m="string"==typeof s||m)?l[c].properties[s]:s)?m:0,y=K(y,s,f),u.push(p===m?d:p<m?this._getRingJson(y.geometry.coordinates[0],d.geometry.coordinates[0],d.properties):this._getRingJson(d.geometry.coordinates[0],y.geometry.coordinates[0],d.properties))):u.push(d))}}return this._addSourceLayer(t,{type:"FeatureCollection",features:u},r),r.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName}},t._getRingJson=function(e,t,r){return{type:"Feature",geometry:{coordinates:[e,t],type:"Polygon"},properties:r}},t._addSourceLayer=function(e,t,r){this.lineName=e+"-line",r.lineConfig&&null!=(n=this.map)&&n.getLayer(this.lineName)&&this.map.removeLayer(this.lineName),null!=(n=this.map)&&n.getLayer(e)&&this.map.removeLayer(e),null!=(n=this.map)&&n.getSource(e)&&this.map.removeSource(e),this.map.addSource(e,o({type:"geojson",data:t},r.sourceConfig));var n=(null!=r?r:{}).beforeId;n&&!this.map.getLayer(n)&&(n=null),this.map.addLayer(o({id:e,type:"fill",source:e},r.layerConfig),n),r.lineConfig&&this.map.addLayer(o({id:this.lineName,type:"line",source:e},r.lineConfig),n)},t.destroy=function(){this._clearSource()},t.visible=function(e){var t,r=this;"boolean"==typeof e&&(null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")})),this.lineName)&&this.map.getLayer(this.lineName)&&this.map.setLayoutProperty(this.lineName,"visibility",e?"visible":"none")},t._clearSource=function(){var e,t=this;null!=(e=this.sourceName)&&e.forEach((function(e){t.map.getSource(e)&&(t.map.getLayer(e)&&t.map.removeLayer(e),t.lineName&&t.map.getLayer(e+"-line")&&t.map.removeLayer(e+"-line"),t.map.removeSource(e))}))},e}(),Q=function(){function e(e,t){this.map=e,this.name=[],"string"==typeof t?this.name=[t]:Array.isArray(t)&&t.every((function(e){return"string"==typeof e}))&&(this.name=t),this.event=[]}var t=e.prototype;return t.add=function(e){var t,r=this;if(0===(null==(t=this.event)?void 0:t.length)&&e&&"object"==typeof e){var n,i=function(t){var n,i;r.event.push(t),0<(null==(i=r.name)?void 0:i.length)?null!=(i=r.name)&&i.forEach((function(n){function i(r){var n;"Map"===(null==r||null==(n=r.originalEvent)||null==(n=n.target)?void 0:n.ariaLabel)&&e[t](r)}var o;r[t]=i,null!=(o=r.map)&&o.on(t,n,i)})):(r[t]=i=function(r){var n;"Map"===(null==r||null==(n=r.originalEvent)||null==(n=n.target)?void 0:n.ariaLabel)&&e[t](r)},null!=(n=r.map)&&n.on(t,i))};for(n in e)i(n)}},t.destroy=function(e){var t,r=this;e&&Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))?null!=(t=this.name)&&t.forEach((function(t){e.forEach((function(e){var n,i;r.event.includes(e)&&(i=r[e],null!=(n=r.map))&&n.off(e,t,i)}))})):0<(null==(t=this.name)?void 0:t.length)?null!=(t=this.name)&&t.forEach((function(e){r.event.forEach((function(t){var n,i=r[t];null!=(n=r.map)&&n.off(t,e,i)}))})):this.event.forEach((function(e){var t,n=r[e];null!=(t=r.map)&&t.off(e,n)}))},e}(),ee=["id","type"],te=["id","type","beforeId"],re=function(){function e(e){this.map=e,this.sourceName=[]}var t=e.prototype;return t.draw=function(e,t){var r,n,a,s,u,c=this;return l(e)||"vector"===e.type?(r=(a=null!=(a=t.sourceConfig)?a:{}).id,n=void 0===(n=a.type)?"geojson":n,a=i(a,ee),s=r,t=null!=(t=t.layerConfig)?t:{},u=[],Array.isArray(t)?u=t:"object"==typeof t&&u.push(t),u.forEach((function(e){var t;(e=e.id)&&null!=(t=c.map)&&t.getLayer(e)&&c.map.removeLayer(e)})),null!=(t=this.map)&&t.getSource(s)&&this.map.removeSource(s),"vector"===e.type?this.map.addSource(r,o({},a,e)):this.map.addSource(r,o({type:n,data:e},a)),u.forEach((function(e){var t=e.id,r=e.type,n=e.beforeId;e=i(e,te),n&&!c.map.getLayer(n)&&(n=null),c.map.addLayer(o({id:t,type:r,source:s},e),n)})),this.sourceName=[s].concat(u.map((function(e){return e.id}))).filter(Boolean),this.sourceName=Array.from(new Set(this.sourceName)),this.sourceName):[]},t.destroy=function(){var e,t,r=this;0<(null==(t=this.sourceName)?void 0:t.length)&&(1===this.sourceName.length?this.map.getSource(this.sourceName[0])&&(this.map.removeLayer(this.sourceName[0]),this.map.removeSource(this.sourceName[0])):(e=(t=this.sourceName)[0],t=t.slice(1),this.map.getSource(e)&&(this.map.getLayer(e)&&this.map.removeLayer(e),t.forEach((function(e){r.map.removeLayer(e)})),this.map.removeSource(e))))},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.sourceName)&&t.forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},e}(),ne=function(){function e(t,r,n){if((this instanceof e?this.constructor:void 0)!==e)throw new Error("MapLayer is a constructor and should be called with the new keyword");var i={layer:null,tooltip:null,popup:null};return r&&"object"==typeof r&&(i=o({},i,r)),this.name=t,this.layers=i,this.prop=null!=n?n:{},new Proxy(this,{deleteProperty:function(e,t){return(e!==this||"layers"!==t&&"name"!==t)&&(delete e[t],!0)},set:function(e,t,r){return(e!==this||"layers"!==t&&"name"!==t)&&(e[t]=r,!0)}})}var t=e.prototype;return t.addLayer=function(e){if(e&&"object"==typeof e)for(var t in e)this.layers[t]=e[t]},t.addProp=function(e){if(e&&"object"==typeof e)for(var t in e)this.prop[t]=e[t]},e}();function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var oe,ae,se,ue,le=function(){function e(e,t){this.map=e,this.markers=[],this.options=t,this.properties=[]}var t=e.prototype;return t.draw=function(e,t){if(l(e))for(var r,n=null!=(r=this.options)?r:{},i=0,a=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){var r;if(e)return"string"==typeof e?ie(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ie(e,t):void 0}(e)))return n&&(e=n),r=0,function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.features);!(c=a()).done;){var s,u,c=c.value;"Point"===c.geometry.type&&(s=n,t&&"function"==typeof t&&1===(null==(u=t({lngLat:c.geometry.coordinates,properties:c.properties,index:i}))?void 0:u.nodeType)&&(s=o({},s,{element:u})),u=new mapboxgl.Marker(s).setLngLat(c.geometry.coordinates).addTo(this.map),this.markers.push(u),this.properties.push(c.properties),i++)}},t.addEvent=function(e){var t=this;if(e&&"object"==typeof e)for(var r=0;r<this.markers.length;r++)!function(r){["dragstart","drag","dragend"].forEach((function(n){e[n]&&"function"==typeof e[n]&&t.markers[r].on(n,(function(i){e[n](o({},i,{properties:t.properties[r]}))}))}))}(r)},t.destroy=function(){for(var e=0;e<this.markers.length;e++)this.markers[e].remove();this.markers=[]},t.visible=function(e){var t;"boolean"==typeof e&&null!=(t=this.markers)&&t.forEach((function(t){t.getElement().style.display=e?"block":"none"}))},e}(),ce=function(){function e(e,t,r){var n;r=null!=(n=r)?n:{},this.map=e,this.name=t,this.dash=Array.isArray(r.dash)?r.dash:[[0,4,3],[.5,4,2.5],[1,4,2],[1.5,4,1.5],[2,4,1],[2.5,4,.5],[3,4,0],[0,.5,3,3.5],[0,1,3,3],[0,1.5,3,2.5],[0,2,3,2],[0,2.5,3,1.5],[0,3,3,1],[0,3.5,3,.5]],this.step=null!=(n=r.step)?n:50,this.animateId=null}var t=e.prototype;return t.animate=function(){var e,t=this;this.name&&this.map.getLayer(this.name)&&function r(n){(n=parseInt(n/t.step%t.dash.length))!==e&&(t.map.setPaintProperty(t.name,"line-dasharray",t.dash[e]),e=n),t.animateId=requestAnimationFrame(r)}(e=0)},t.destroy=function(){this.animateId&&(cancelAnimationFrame(this.animateId),this.animateId=null)},e}(),he=(a={},function(){function e(e,t){this.width=void 0,this.height=void 0,this.data=void 0;var r=this,n=e.width;if(e=e.height,t){if(t instanceof Uint8ClampedArray)t=new Uint8Array(t.buffer);else if(t.length!==n*e*4)throw new RangeError("mismatched image size")}else t=new Uint8Array(n*e*4);r.width=n,r.height=e,r.data=t}var t=e.prototype;return t.resize=function(t){var r,n,i;r=this,n=(t=new e(t)).width,i=t.height,n===r.width&&i===r.height||(pe(r,t,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,n),height:Math.min(r.height,i)},4),r.width=n,r.height=i,r.data=t.data)},t.replace=function(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e},t.clone=function(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))},e.copy=function(e,t,r,n,i){pe(e,t,r,n,i,4)},e}());function pe(e,t,r,n,i,o){if(0!==i.width&&0!==i.height){if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");var a=e.data,s=t.data;if(a===s)throw new RangeError("image is the same");for(var u=0;u<i.height;u++)for(var l=((r.y+u)*e.width+r.x)*o,c=((n.y+u)*t.width+n.x)*o,h=0;h<i.width*o;h++)s[c+h]=a[l+h]}}function fe(){return(fe=r(s().mark((function e(t,r){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===r&&(r=0),e.next=3,new Promise((function(e){var n=new Image;n.src=t,n.crossOrigin="Anonymous",n.onload=function(){var t=n.width,i=n.height,o=(oe=oe||window.document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");(t>oe.width||i>oe.height)&&(oe.width=t,oe.height=i),o.clearRect(-r,-r,t+2*r,i+2*r),o.drawImage(n,0,0,t,i),e(o.getImageData(-r,-r,t+2*r,i+2*r))}}));case 3:return n=e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}ae=he,void 0===ue&&(ue={}),(se="RGBAImage")?a[se]?console.error(se+" is already registered."):(Object.defineProperty(ae,"_classRegistryKey",{value:se,writeable:!1}),a[se]={klass:ae,omit:ue.omit||[]}):console.error("Can't register a class without a name.");var me=function(){function e(e,t){this.map=e,this.options=null!=t?t:{key:"id"},this.markers={},this.mapEvent=null}var t=e.prototype;return t.draw=function(e,t){var r=this,n={};this.mapEvent=function(){if(r.map.getSource(e)&&r.map.isSourceLoaded(e)){for(var i,a={},s=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){var r;if(e)return"string"==typeof e?de(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?de(e,t):void 0}(e)))return n&&(e=n),r=0,function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.map.querySourceFeatures(e));!(h=s()).done;){var u,l,c,h,p=(h=h.value).geometry.coordinates;(h=h.properties).cluster||(u=h[r.options.key],(c=r.markers[u])?(l=c.getLngLat().toArray())[0]===p[0]&&l[1]===p[1]||c.setLngLat(p):(l=null,l="function"==typeof t?t({properties:h,lngLat:p}):document.createElement("div"),c=r.markers[u]=new mapboxgl.Marker(o({},r.options,{element:l})).setLngLat(p)),a[u]=c,n[u])||c.addTo(r.map)}for(i in n)a[i]||n[i].remove();n=a}},this.map.on("render",this.mapEvent)},t.destroy=function(){for(var e in this.markers)null!=(e=this.markers[e])&&e.remove();this.markers={},this.mapEvent&&this.map.off("render",this.mapEvent)},t.visible=function(e){if("boolean"==typeof e)for(var t in this.markers)this.markers[t]&&this.markers.hasOwnProperty(t)&&(this.markers[t].getElement().style.display=e?"block":"none")},e}(),ye=["once"],ve=function(){function e(e,t,r){this.map=e,this.options=null!=r?r:{},this.sourceName=t,r=void 0===(t=(e=(this.mapEvent=null)!=r?r:{}).once)||t,t=i(e,ye),this.once=r,this.other=t}var t=e.prototype;return t.open=function(e){var t=this;this.sourceName&&(this.mapEvent=function(){var r;t.map.getSource(t.sourceName)&&t.map.isSourceLoaded(t.sourceName)&&"function"==typeof e&&(r=t.map.querySourceFeatures(t.sourceName,t.other),e(r),t.once)&&t.destroy()},this.map.on("render",this.mapEvent))},t.destroy=function(){var e;null!=(e=this.map)&&e.off("render",this.mapEvent),this.mapEvent=null},e}(),ge=Math.PI,_e=6378245,be=.006693421622965943;function we(e,t){var r=2*(e=+e)-100+3*(t=+t)+.2*t*t+.1*e*t+.2*Math.sqrt(Math.abs(e));return(r+=2*(20*Math.sin(6*e*ge)+20*Math.sin(2*e*ge))/3)+2*(20*Math.sin(t*ge)+40*Math.sin(t/3*ge))/3+2*(160*Math.sin(t/12*ge)+320*Math.sin(t*ge/30))/3}function xe(e,t){return t=300+(e=+e)+2*(t=+t)+.1*e*e+.1*e*t+.1*Math.sqrt(Math.abs(e)),(t+=2*(20*Math.sin(6*e*ge)+20*Math.sin(2*e*ge))/3)+2*(20*Math.sin(e*ge)+40*Math.sin(e/3*ge))/3+2*(150*Math.sin(e/12*ge)+300*Math.sin(e/30*ge))/3}function Le(e,t){return t=+t,!(73.66<(e=+e)&&e<135.05&&3.86<t&&t<53.55)}function Pe(e,t){var r,n,i,o,a;return Le(e,t)?[e,t]:(o=we(e-105,t-35),a=xe(e-105,t-35),r=t/180*ge,n=Math.sin(r),n=1-be*n*n,i=Math.sqrt(n),o=180*o/(_e*(1-be)/(n*i)*ge),[2*e-(e+(a=180*a/(_e/i*Math.cos(r)*ge))),2*t-(t+o)])}function Ee(e,t,r){if(void 0===r&&(r={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var n=J(e),i=(e="Feature"===(e=t).type?e.geometry:e).type,o=(t=t.bbox,e.coordinates);if(t&&0==(e=n,t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]))return!1;"Polygon"===i&&(o=[o]);for(var a=!1,s=0;s<o.length&&!a;s++)if(Ae(n,o[s][0],r.ignoreBoundary)){for(var u=!1,l=1;l<o[s].length&&!u;)Ae(n,o[s][l],!r.ignoreBoundary)&&(u=!0),l++;u||(a=!0)}return a}function Ae(e,t,r){for(var n=!1,i=0,o=(t=t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]?t.slice(0,t.length-1):t).length-1;i<t.length;o=i++){var a=t[i][0],s=t[i][1],u=t[o][0],l=t[o][1];if(e[1]*(a-u)+s*(u-e[0])+l*(e[0]-a)==0&&(a-e[0])*(u-e[0])<=0&&(s-e[1])*(l-e[1])<=0)return!r;s>e[1]!=l>e[1]&&e[0]<(u-a)*(e[1]-s)/(l-s)+a&&(n=!n)}return n}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ke=function(){function e(e,t){this.map=e,this.options=null!=t?t:{}}var t=e.prototype;return t.draw=function(e,t,r){var n;e&&t&&l(e)&&r&&(this.id=r,n=V(e).bbox,this.destroy(),this.map.addLayer(function(e,t,r){function n(e){if("FeatureCollection"===g.type){for(var t=0;t<g.features.length;t++)if(Ee(e,g.features[t]))return!0;return!1}if("Feature"===g.type)return Ee(e,g.geometry)}var i,o=r.bbox,a=r.isGCJ,s=r.replaceUrl,u=null!=(i=r.isJudgement)&&i,l=r.filter,c=r.coordTransform,h=r.judgementBox,p=r.judgementPoint,f=null!=(i=r.maxZoom)?i:18,d=null!=(i=r.minZoom)?i:0,m=null==(i=r.judgeBound)||i,y=null==(i=r.isPrecision)||i,v=null!=(i=r.expand)?i:0,g=null!=(i=r.json)?i:{},_=document.createElement("canvas"),b=0;return{id:e,type:"custom",onAdd:function(e,t){var r=this,n=(this.map=e,this.tileCache={},this.gridCache={},this.showTiles=[],e=t.createShader(t.VERTEX_SHADER),t.shaderSource(e,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),t.compileShader(e),t.createShader(t.FRAGMENT_SHADER));t.shaderSource(n,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),t.compileShader(n),this.program=t.createProgram(),t.attachShader(this.program,e),t.attachShader(this.program,n),t.linkProgram(this.program),this.map.on("move",(function(e){r.updateLayer(t)})),this.updateLayer(t)},updateLayer:function(e){var t=this.map.getZoom();y&&(t+=1.4),t<d?t=d:f<t&&(t=f),this.drawLayer(t,e)},drawLayer:function(e,t){for(var r=this,n=parseInt(e),i=(e=[(e=this.map.getBounds().toArray())[0][0],e[0][1],e[1][0],e[1][1]],Math.min(e[2],o[2])),a=Math.min(e[3],o[3]),s=Math.max(e[0],o[0]),u=(e=Math.max(e[1],o[1]),s=this.map.getTileByPosition([s,e],n),e=this.map.getTileByPosition([i,a],n),i=s[0]-v,e[0]+v),l=e[1]-v,c=s[1]+v,h=[],p=i;p<=u;p++)for(var f=l;f<=c;f++){var d={x:p,y:f,z:n};h.push(d),this.addGridCache(d,0,0),p===u&&this.addGridCache(d,1,0),f===c&&this.addGridCache(d,0,1),p===u&&f===c&&this.addGridCache(d,1,1)}a=this.map.getCenter();var m=this.map.getTileByPosition([a.lng,a.lat],n);h.sort((function(e,t){return r.tileDistance(e,m)-r.tileDistance(t,m)})),this.showTiles=[];for(var y=0,g=h;y<g.length;y++){var _,b=g[y];this.tileCache[this.createTileKey(b)]?this.showTiles.push(this.tileCache[this.createTileKey(b)]):(_=this.createTile(t,b),this.showTiles.push(_),this.tileCache[this.createTileKey(b)]=_)}},tileDistance:function(e,t){return Math.sqrt(Math.pow(e.x-t[0],2)+Math.pow(e.y-t[1],2))},addGridCache:function(e,t,r){var n,i=this.createTileKey(e.x+t,e.y+r,e.z);this.gridCache[i]||(r=(t=this.map.getPositionByTile([e.x+t,e.y+r,e.z]))[0],e=t[1],n=t[2],t=t[3],void 0!==e&&void 0!==t&&void 0!==n&&void 0!==r&&(a?(e=Pe(r,t),this.gridCache[i]={lng:e[0],lat:e[1]}):c&&"function"==typeof c?(n=c(r,t),Array.isArray(n)&&2===n.length?this.gridCache[i]={lng:n[0],lat:n[1]}:this.gridCache[i]="object"==typeof n?{lng:n.lng,lat:n.lat}:{lng:r,lat:t}):this.gridCache[i]={lng:r,lat:t}))},createTileKey:function(e,t,r){return e instanceof Object?e.z+"/"+e.x+"/"+e.y:r+"/"+e+"/"+t},createTile:function(e,r){var i,o,a,c,h,f,d,y,v=this,g=Array.isArray(t)?(x=t.length,L=t[b],x<=++b&&(b=0),s&&"function"==typeof s?s(L,r):L.replace("{z}",r.z).replace("{x}",r.x).replace("{y}",r.y)):s&&"function"==typeof s?s(t,r):t.replace("{z}",r.z).replace("{x}",r.x).replace("{y}",r.y),w={xyz:r},x=this.gridCache[this.createTileKey(r)],L=this.gridCache[this.createTileKey(r.x+1,r.y,r.z)],P=this.gridCache[this.createTileKey(r.x,r.y+1,r.z)];return r=this.gridCache[this.createTileKey(r.x+1,r.y+1,r.z)],P&&L&&P&&r&&(P=mapboxgl.MercatorCoordinate.fromLngLat(P),i=mapboxgl.MercatorCoordinate.fromLngLat(r),L=mapboxgl.MercatorCoordinate.fromLngLat(L),o=mapboxgl.MercatorCoordinate.fromLngLat(x),a=x.lat,c=x.lng,x=r.lat,r=r.lng,h=(r-c)/256,f=(a-x)/256,d=!!m&&this.getAllIn(c,x,r,a),x=new Float32Array([P.x,P.y,P.z,0,0,i.x,i.y,i.z,1,0,L.x,L.y,L.z,1,1,P.x,P.y,P.z,0,0,L.x,L.y,L.z,1,1,o.x,o.y,o.z,0,1]),w.aPos=e.getAttribLocation(this.program,"a_pos"),w.aUv=e.getAttribLocation(this.program,"a_uv"),w.uSamplerLoc=e.getUniformLocation(this.program,"u_sampler"),w.texture=e.createTexture(),(y=new Image).src=g,y.crossOrigin="anonymous",y.onload=function(){_.width=y.width,_.height=y.height;var t=_.getContext("2d"),r=(t.drawImage(y,0,0),l&&"function"==typeof l);if((u||r)&&(!d||r)){for(var i,o,s,m=t.getImageData(0,0,_.width,_.height),g=m.data.length,b=0;b<g;b+=4)d||(i=(s=Math.floor(b/4))%256,s=Math.floor(s/256),o=n([i=c+i*h,s=a-s*f]),p&&"function"==typeof p&&(o=null==(i=p(i,s))||i),m.data[b+3]=o?255:0),r&&(s=l([m.data[b],m.data[b+1],m.data[b+2],m.data[b+3]]),Array.isArray(s))&&4===s.length&&(m.data[b]=s[0],m.data[b+1]=s[1],m.data[b+2]=s[2],m.data[b+3]=s[3]);t.putImageData(m,0,0)}e.bindTexture(e.TEXTURE_2D,w.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,_),w.isLoad=!0,v.map.triggerRepaint()},w.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,w.buffer),e.bufferData(e.ARRAY_BUFFER,x,e.STATIC_DRAW)),w},getAllIn:function(e,t,r,i){var o;return h&&"function"==typeof h?null==(o=h(e,t,r,i))||o:[[e,i],[e,t],[r,t],[r,i],[(e+r)/2,i],[r,(t+i)/2],[(e+r)/2,t],[e,(t+i)/2],[(e+r)/2,(t+i)/2]].every(n)},render:function(e,t){e.useProgram(this.program),e.uniformMatrix4fv(e.getUniformLocation(this.program,"u_matrix"),!1,t);for(var r=function(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){var r;if(e)return"string"==typeof e?Me(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Me(e,t):void 0}(e)))return n&&(e=n),r=0,function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.showTiles);!(n=r()).done;){var n=n.value;n.isLoad&&(e.bindTexture(e.TEXTURE_2D,n.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.bindBuffer(e.ARRAY_BUFFER,n.buffer),e.enableVertexAttribArray(n.aPos),e.enableVertexAttribArray(n.aUv),e.vertexAttribPointer(n.aPos,3,e.FLOAT,!1,20,0),e.vertexAttribPointer(n.aUv,2,e.FLOAT,!1,20,12),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLES,0,6))}}}}(r,t,o({},this.options,{bbox:n,isGCJ:null!=(r=this.options.isGCJ)&&r,json:e}))))},t.destroy=function(){this.map.getLayer(this.id)&&this.map.removeLayer(this.id),this.map.getSource(this.id)&&this.map.removeSource(this.id)},e}();function Ne(e){return(Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ce(e){return e=function(e,t){if("object"!==Ne(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return String(e);if("object"!==Ne(r=r.call(e,"string")))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),"symbol"===Ne(e)?e:String(e)}function Se(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ce(n.key),n)}}function Te(e,t,r){t&&Se(e.prototype,t),r&&Se(e,r),Object.defineProperty(e,"prototype",{writable:!1})}var Ie=function(){function e(e,t){this.map=e,this._contextMenu=null,this._moveMenu=null,this._context=null,t=(e=(this._position=null)!=t?t:{}).move,e=void 0===(e=e.className)?"mapMenu":e,this._move=void 0!==t&&t,this._className=e}var t=e.prototype;return t.init=function(e,t){var r,n=this;this.map&&!this._context&&((r=document.createElement("div")).className=this._className,r.style.display="none",r.style.position="absolute",this.map.getCanvas().offsetParent.appendChild(r),e instanceof Element?r.appendChild(e):"string"==typeof e&&(r.innerHTML=e),this._context=r,this._contextMenu=function(e){var r;n._position=e.lngLat,t&&"function"==typeof t?(r=n.map.queryRenderedFeatures(e.point),"boolean"==typeof(r=void 0===(r=(null!=(r=t(o({},e,{features:r})))?r:{}).show)||r)&&(n.visible(r),n.updateXY(e.point))):(n.visible(!0),n.updateXY(e.point))},this.map.on("contextmenu",this._contextMenu),this._move)&&(this._moveMenu=function(e){var t;n._context&&"none"!==n._context.style.display&&n._position&&(t=n.map.project([n._position.lng,n._position.lat]),n.updateXY(t))},this.map.on("move",this._moveMenu),window.addEventListener("resize",this._moveMenu))},t.visible=function(e){this._context&&(this._context.style.display=e?"block":"none")},t.updateXY=function(e){var t,r,n,i,o;this._context&&e&&(t=isNaN(Number(e.x))?0:Number(e.x),e=isNaN(Number(e.y))?0:Number(e.y),this._move||(r=(n=this._context).offsetWidth,n=n.offsetHeight,(o=(i=this.map.getCanvas()).offsetWidth)<t+r&&(t=o-r),(o=i.offsetHeight)<e+n&&(e=o-n)),this._context.style.top=e+"px",this._context.style.left=t+"px")},t.destroy=function(){this.map&&(this.map.off("contextmenu",this._contextMenu),this._contextMenu=null,this._context&&(this._context.remove(),this._context=null),this._move)&&(this.map.off("move",this._moveMenu),window.removeEventListener("resize",this._moveMenu),this._moveMenu=null)},Te(e,[{key:"show",get:function(){var e;return null!=(e=this._context&&"none"!==this._context.style.display)&&e}}]),e}();const Re=function(e,t,r){void 0===r&&(r={}),e=J(e);var n=G((t=J(t))[1]-e[1]),i=G(t[0]-e[0]);return e=G(e[1]),t=G(t[1]),n=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(e)*Math.cos(t),function(e,t){var r=R[t=void 0===t?"kilometers":t];if(r)return e*r;throw new Error(t+" units is invalid")}(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)),r.units)};function Oe(e,t){return void 0===t&&(t={}),function(e,t,r){var n,i=r,o=!1;return n=function(e,n,a,s,u){i=!1===o&&void 0===r?e:t(i,e,n,a,s,u),o=!0},function(e,t){q(e,(function(e,r,n,i,o){var a,s=null===e?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return!1!==t(O(e,n,{bbox:i,id:o}),r,0)&&void 0}switch(s){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var u=0;u<e.coordinates.length;u++){var l=e.coordinates[u];if(!1===t(O({type:a,coordinates:l},n),r,u))return!1}}))}(e,(function(e,t,r){var i=0;if(e.geometry){var o,a,s,u,l=e.geometry.type;if("Point"!==l&&"MultiPoint"!==l)return u=s=a=0,!1!==z(e,(function(l,c,h,p,f){if(void 0===o||a<t||s<p||u<f)o=l,a=t,s=p,u=f,i=0;else{if(p=D([o,l],e.properties),!1===n(p,t,r,f,i))return!1;i++,o=l}}))&&void 0}})),i}(e,(function(e,r){return r=r.geometry.coordinates,e+Re(r[0],r[1],t)}),0)}function je(e,t,r){var n,i;return!0===(r=void 0===r?{}:r).final?(je(t,e)+180)%360:(r=J(e),e=J(t),t=G(r[0]),n=G(e[0]),r=G(r[1]),e=G(e[1]),i=Math.sin(n-t)*Math.cos(e),r=Math.cos(r)*Math.sin(e)-Math.sin(r)*Math.cos(e)*Math.cos(n-t),U(Math.atan2(i,r)))}const Fe=function(e,t){return Z(e,Re(e,t)/2,je(e,t))};var De=6378137;function Be(e){var t=0;if(e&&0<e.length){t+=Math.abs(Ue(e[0]));for(var r=1;r<e.length;r++)t-=Math.abs(Ue(e[r]))}return t}function Ue(e){var t,r,n,i,o,a,s=0,u=e.length;if(2<u){for(a=0;a<u;a++)o=a===u-2?(n=u-2,i=u-1,0):a===u-1?(n=u-1,i=0,1):(i=(n=a)+1,a+2),t=e[n],r=e[i],s+=(Ge(e[o][0])-Ge(t[0]))*Math.sin(Ge(r[1]));s=s*De*De/2}return s}function Ge(e){return e*Math.PI/180}const He=function(e,t){void 0===t&&(t={});var r=0,n=0,i=0;return z(e,(function(e){r+=e[0],n+=e[1],i++}),!0),j([r/i,n/i],t.properties)};function ze(e){return(e%=360)<0&&(e+=360),e}function qe(e){return(e%=360)<0&&(e+=360),e}const Xe=function(e,t,r,n,i){if(!(s=i=i||{})||s.constructor!==Object)throw new Error("options is invalid");var o,a,s=i.properties;if(!e)throw new Error("center is required");if(null==r)throw new Error("bearing1 is required");if(null==n)throw new Error("bearing2 is required");if(!t)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");return qe(r)===qe(n)?K(e,t,i):(o=function(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}(e),e=function(e,t,r,n,i){var o=(i=void 0===i?{}:i).steps||64,a=(r=ze(r),n=ze(n),Array.isArray(e)||"Feature"!==e.type?{}:e.properties);if(r===n)return D(K(e,t,i).geometry.coordinates[0],a);for(var s=r,u=r<n?n:n+360,l=s,c=[],h=0;l<u;)c.push(Z(e,t,l,i).geometry.coordinates),l=s+360*++h/o;return u<l&&c.push(Z(e,t,u,i).geometry.coordinates),D(c,a)}(e,t,r,n,i),a=[[o]],z(e,(function(e){a[0].push(e)})),a[0].push(o),F(a,s))};var We="zh_measure_",Ye=function(){function e(e,t,r){var n=this,i=(this._click=function(e){var t,r=e.originalEvent.target.ariaLabel;n.isOpen&&"measure"!==r&&(n.isDraw||(n.isDraw=!0,n.positions.push(n.currentPosition),n.texts.push(n.currentText)),t=e.lngLat.toArray(),r=function(){n.currentPosition.push(t),n._drawPoint(),n._drawLine(),n._measureDistance(t)},0<n.currentPosition.length?"line"===n.type||"polygon"===n.type?(e=n.currentPosition[n.currentPosition.length-1],t[0]!==e[0]||t[1]!==e[1]?r():"polygon"===n.type?2<n.currentPosition.length?(n._createTextRemove(n.index),e=[].concat(n.currentPosition,[n.currentPosition[0]]),n._updateLine(e,n.index),e=He(F([e])),n._measureArea(e.geometry.coordinates),n._callback()):1===n.currentPosition.length&&(n._removeMarker(n.index),n._removePoint(n.index),n._removeLine(n.index),n._callback()):(n._createTextRemove(n.index),1===n.currentPosition.length&&(n._removeMarker(n.index),n._removePoint(n.index),n._removeLine(n.index)),n._callback())):"sector"===n.type&&(e=n.currentPosition[n.currentPosition.length-1],t[0]===e[0]&&t[1]===e[1]||1!==n.currentPosition.length||r()):r())},this._move=function(e){n.isOpen&&(e=e.lngLat.toArray(),n.isDraw&&0<n.currentPosition.length&&("line"===n.type?n._drawMoveLine(e):"circle"===n.type?(n._drawCircle(e),n._drawMoveLine(e)):"polygon"===n.type?(1<n.currentPosition.length&&n._drawPolygon(e),n._drawMoveLine(e)):"rect"===n.type?(n._drawRect(e),n._drawMoveLine(e)):"sector"===n.type&&(1<n.currentPosition.length?n._drawSector(e):n._drawMoveLine(e))),n._drawMovePoint(e))},this._dblclick=function(e){if(n.isOpen&&n.isDraw&&("circle"===n.type&&(t=e.lngLat.toArray(),!(r=n.currentPosition[0])||r[0]===t[0]&&r[1]===t[1]?(n._removeMarker(n.index),n._removePoint(n.index),n._removeLine(n.index),n._removeCircle(n.index)):(n.currentPosition.push(t),n._drawPoint(),n._drawCircle(t,!1),n._drawLine(),r=Fe(j(t),j(n.currentPosition[0])),n._measureDistance(t),n._measureArea(r.geometry.coordinates),n._createTextRemove(n.index),n._callback())),!("polygon"===n.type&&0<n.currentPosition.length&&n.currentPosition.length<3))){if("rect"===n.type&&(t=e.lngLat.toArray(),!(r=n.currentPosition[0])||r[0]===t[0]&&r[1]===t[1]?(n._removeMarker(n.index),n._removePoint(n.index),n._removeLine(n.index),n._removeRect(n.index)):(n.currentPosition.push(t),n._drawPoint(),n._drawRect(t,!1),r=Fe(j(t),j(n.currentPosition[0])),n._measureDistance(t),n._measureArea(r.geometry.coordinates),n._createTextRemove(n.index),n._callback())),"sector"===n.type){var t=e.lngLat.toArray(),r=n.currentPosition[n.currentPosition.length-1];if(2!==n.currentPosition.length||t[0]===r[0]&&t[1]===r[1]){if(1!==n.currentPosition.length)return;n._removeMarker(n.index),n._removePoint(n.index),n._removeLine(n.index),n._removeSector(n.index)}else n._drawSector(t,!1),e=He(n.map.getSource(n.moveSectorName)._data),n._measureArea(e.geometry.coordinates),n._createTextRemove(n.index),n._callback()}null!=(r=n.moveLineLayers[n.index])&&r.destroy(),n.moveLineLayers.splice(n.index,1),n._removeMoveMarker(),n.isDraw=!1,n.currentPosition=[],n.currentText=[],n.index++}},this.map=e,e=null!=(e=(t=null!=(e=t)?e:{}).point)?e:{},null!=(i=t.pointMove)?i:{}),o=null!=(o=t.fixed)?o:[2,2],a=(this.calcAll=null==(u=t.calcAll)||u,"number"==typeof o?this.fixed=[o,o]:Array.isArray(o)&&o.every((function(e){return"number"==typeof e}))?this.fixed=o:this.fixed=[2,2],this.dash=null==(u=t.dash)||u,this.type=null!=(o=t.type)?o:"line",["line","circle","polygon","rect","sector"].includes(this.type)||(this.type="line"),this.units={line:["km","m"],circle:["km²","m²"],polygon:["km²","m²"],rect:["km²","m²"],sector:["km²","m²"]},t.units);if(a)for(var s in this.units)a[s]&&Array.isArray(a[s])&&a[s].all((function(e){return"string"==typeof e}))&&(this.units[s][0]=a[s][0],this.units[s][1]=a[s][1]);this.className=null!=(u=t.className)?u:"",this.pointMoveProps={color:null!=(o=i.color)?o:"#ffffff",radius:null!=(u=i.radius)?u:10,opacity:null!=(o=i.opacity)?o:.01,strokeWidth:null!=(u=i.strokeWidth)?u:2,strokeColor:null!=(o=i.strokeColor)?o:"#ffffff",strokeOpacity:null!=(u=i.strokeOpacity)?u:.01},this.pointProps={color:null!=(o=e.color)?o:"rgb(255,255,255)",radius:null!=(i=e.radius)?i:4,strokeWidth:null!=(u=e.strokeWidth)?u:2,strokeColor:null!=(o=e.strokeColor)?o:"#00ccff"};var u=null!=(i=t.line)?i:{};this.lineProps={color:null!=(e=u.color)?e:"#00ccff",width:null!=(o=u.width)?o:2,dasharray:null!=(i=u.dasharray)?i:[5,5]},o=null!=(e=t.fill)?e:{},this.fillProps={color:null!=(u=o.color)?u:"rgba(0,230,255,0.1)"},this._custom=r,this.isOpen=!1,this.moveMarker=null,this._init()}var t=e.prototype;return t._init=function(){var e;this.positions=[],this.currentPosition=[],this.index=null!=(e=null==(e=this.map[this._custom])||null==(e=e.measure)?void 0:e[this.type])?e:0,this.isDraw=!1,this.pointLayers=[],this.movepointLayers=[],this.lineLayers=[],this.moveLineLayers=[],this.moveCircleLayers=[],this.movePolygonLayers=[],this.moveRectLayers=[],this.moveSectorLayers=[],this.texts=[],this.currentText=[]},t.draw=function(e){e&&"function"==typeof e&&(this.callback=e),this.isOpen||(this.isOpen=!0,this.map.on("click",this._click),this.map.on("mousemove",this._move),this.map.on("dblclick",this._dblclick))},t._callback=function(){this.callback&&"function"==typeof this.callback&&this.callback()},t._drawPoint=function(){var e,t=this,r=B(this.currentPosition.map((function(e,r){return j(e,{pointIndex:r,lineIndex:t.index})})));this.pointLayer?this.map.getSource(this.pointName).setData(r):((e=this.map.MapCustom()).draw(r,this.pointName,{layerConfig:{type:"circle",paint:{"circle-color":this.pointProps.color,"circle-radius":this.pointProps.radius,"circle-stroke-width":this.pointProps.strokeWidth,"circle-stroke-color":this.pointProps.strokeColor}}}),this.pointLayers.push(e))},t._drawMovePoint=function(e){var t;e={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:e},properties:{pointIndex:0,lineIndex:this.index}}]},this.movePointLayer?this.map.getSource(this.movePointName).setData(e):((t=this.map.MapCustom()).draw(e,this.movePointName,{layerConfig:{type:"circle",paint:{"circle-opacity":this.pointMoveProps.opacity,"circle-color":this.pointMoveProps.color,"circle-radius":this.pointMoveProps.radius,"circle-stroke-width":this.pointMoveProps.strokeWidth,"circle-stroke-color":this.pointMoveProps.strokeColor,"circle-stroke-opacity":this.pointMoveProps.strokeOpacity}}}),this.movepointLayers.push(t))},t._drawLine=function(){var e,t=B([D(1<this.currentPosition.length?this.currentPosition:[this.currentPosition[0],this.currentPosition[0]],{lineIndex:this.index})]);this.lineLayer?(this.map.getSource(this.lineName).setData(t),this.map.moveLayer(this.lineName,this.pointName)):((e=this.map.MapLine()).draw(t,this.lineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width}},beforeId:this.pointName}),this.lineLayers.push(e))},t._drawMoveLine=function(e){var t=B([D([this.currentPosition[this.currentPosition.length-1],e],{lineIndex:this.index})]),r=("polygon"===this.type&&1<this.currentPosition.length&&(t=B([D([this.currentPosition[0],e,this.currentPosition[this.currentPosition.length-1]],{lineIndex:this.index})])),this.moveLineLayer?this.map.getSource(this.moveLineName).setData(t):((r=this.map.MapLine()).draw(t,this.moveLineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveLineLayers.push(r)),B([D([].concat(this.currentPosition,[e]))]));this._drawMoveMarker(this.calcAll?r:t,e)},t._drawMoveMarker=function(e,t){e=this._calcLength(e),this.moveMarker?(this.moveMarker.getElement().children[0].innerHTML=e,this.moveMarker.setLngLat(t)):(this.moveMarker=this._createMoveText(e),this.moveMarker.setLngLat(t).addTo(this.map))},t._removeMoveMarker=function(){this.moveMarker&&(this.moveMarker.remove(),this.moveMarker=null)},t._drawCircle=function(e,t){void 0===t&&(t=!0);var r,n=this.currentPosition[0],i=B([j(n,{circleIndex:this.index})]);e=Oe(B([D([n,e],{circleIndex:this.index})]),{units:"kilometers"}),this.moveCircleLayer?(r={steps:64,units:"kilometers",properties:{circleIndex:this.index}},n=B([K(n,e,r)]),this.map.getSource(this.moveCircleName).setData(n),t||this.map.setPaintProperty(this.moveCircleLayer.lineName,"line-dasharray",[])):((r=this.map.MapCircle()).draw(i,this.moveCircleName,{endRadius:e,layerConfig:{paint:{"fill-color":this.fillProps.color}},lineConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveCircleLayers.push(r))},t._drawPolygon=function(e){var t;e=B([F([[].concat(this.currentPosition,[e,this.currentPosition[0]])],{polygonIndex:this.index})]),this.movePolygonLayer?this.map.getSource(this.movePolygonName).setData(e):((t=this.map.MapMoreCustom()).draw(e,{sourceConfig:{id:this.movePolygonName,type:"geojson",data:e},layerConfig:[{id:this.movePolygonName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.moveLineName}]}),this.movePolygonLayers.push(t))},t._drawRect=function(e,t){void 0===t&&(t=!0),e=B([Y(W(D([this.currentPosition[0],e])),{properties:{rectIndex:this.index}})]),this.moveRectLayer?(this.map.getSource(this.moveRectName).setData(e),t||this.map.setPaintProperty(this.moveRectName+"-line","line-dasharray",[])):((t=this.map.MapMoreCustom()).draw(e,{sourceConfig:{id:this.moveRectName,type:"geojson",data:e},layerConfig:[{id:this.moveRectName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveRectName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveRectLayers.push(t))},t._drawSector=function(e,t){void 0===t&&(t=!0);var r=Oe(D(this.currentPosition,{units:"kilometers"})),n=je(this.currentPosition[0],this.currentPosition[1]);e=je(this.currentPosition[0],e),r=B([Xe(this.currentPosition[0],r,n,e,{units:"kilometers",properties:{sectorIndex:this.index}})]),this.moveSectorLayer?(this.map.getSource(this.moveSectorName).setData(r),t||this.map.setPaintProperty(this.moveSectorName+"-line","line-dasharray",[])):((n=this.map.MapMoreCustom()).draw(r,{sourceConfig:{id:this.moveSectorName,type:"geojson",data:r},layerConfig:[{id:this.moveSectorName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveSectorName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveSectorLayers.push(n))},t._removeRect=function(e){var t=this.moveRectLayers[e];t&&(t.destroy(),this.moveRectLayers[e]=null)},t._removeSector=function(e){var t=this.moveSectorLayers[e];t&&(t.destroy(),this.moveSectorLayers[e]=null)},t._createText=function(e,t,r){var n,i=this,o=(void 0===e&&(e="起点"),void 0===r&&(r=!0),document.createElement("div"));return((o.style.background="#ffffff",o.style.cursor="default",o.style.padding="0 5px",o.style.borderRadius="3px",o.style.display="flex",o.style.alignItems="center",o.className=this.className?this.className+" measure-box":"measure-box",o.ariaLabel="measure",n=document.createElement("span")).className="measure-text",n.innerHTML=e,n.ariaLabel="measure",o.appendChild(n),r&&((e=document.createElement("span")).className="measure-close",e.style.paddingLeft="5px",e.innerHTML="x",e.ariaLabel="measure",e.addEventListener("click",(function(e){i.isDraw||(e=e.target.parentNode._marker)&&i._removeGroup(e)})),o.appendChild(e)),n=new mapboxgl.Marker({element:o,offset:[10,0],anchor:"left"})).pointIndex=t,n.lineIndex=this.index,n.showBtn=r,this.currentText.push(n),o._marker=n},t._createMoveText=function(e){var t=document.createElement("div"),r=(t.style.background="#ffffff",t.style.cursor="default",t.style.padding="0 5px",t.style.borderRadius="3px",t.style.display="flex",t.style.alignItems="center",t.className=this.className?this.className+" measure-box":"measure-box",t.ariaLabel="measure",document.createElement("span"));return r.className="measure-text",r.innerHTML=e,r.ariaLabel="measure",t.appendChild(r),new mapboxgl.Marker({element:t,offset:[10,0],anchor:"left"})},t._createTextRemove=function(e){for(var t=this,r=document.createElement("div"),n=(r.className="measure-remove",r.style.width="15px",r.style.height="14px",r.style.marginLeft="5px",r.ariaLabel="measure",r.style.backgroundImage='url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z"/>%3C/svg>\')',r.style.backgroundSize="100% 100%",r.addEventListener("click",(function(e){t.isDraw||(e=e.target.parentNode._marker)&&t._removeGroupLine(e)})),this.texts[e]),i=null,o=n.length-1;0<=o;o--)if(n[o].showBtn){i=o;break}(null!==i?n[i]:n[n.length-1]).getElement().appendChild(r)},t._measureDistance=function(e){var t="起点",r=(1<this.currentPosition.length&&(r=B([D(this.currentPosition,{lineIndex:this.index})]),t=this._calcLength(r)),this._createText(t,this.currentPosition.length-1,"circle"!==this.type&&"rect"!==this.type&&"sector"!==this.type));return r.setLngLat(e).addTo(this.map),r},t._measureArea=function(e){var t,r,n;["circle","polygon","rect","sector"].includes(this.type)&&(r=null,"circle"===this.type?(n=Oe(B([D(this.currentPosition)]),{units:"kilometers"}),t={steps:64,units:"kilometers",properties:{circleIndex:this.index}},r=K(this.currentPosition[0],n,t)):"polygon"===this.type?r=F([[].concat(this.currentPosition,[this.currentPosition[0]])]):"rect"===this.type?r=Y(W(D(this.currentPosition)),{properties:{rectIndex:this.index}}):"sector"===this.type&&(r=this.map.getSource(this.moveSectorName)._data.features[0]),null!==r)&&(n=this._calcArea(r),this._createText(n,this.currentPosition.length,!1).setLngLat(e).addTo(this.map))},t._calcLength=function(e){return 1e3<(e=Oe(e,{units:"meters"}))?Number((e/1e3).toFixed(this.fixed[0]))+this.units.line[0]:Number(e.toFixed(this.fixed[1]))+this.units.line[1]},t._calcArea=function(e){return e=function(e){return t=function(e,t){return e+function(e){var t,r=0;switch(e.type){case"Polygon":return Be(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)r+=Be(e.coordinates[t]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(t)},r=0,q(e,(function(e,n,i,o,a){r=t(r,e)})),r;var t,r}(e),1e6<e?Number((e/1e6).toFixed(this.fixed[0]))+this.units[this.type][0]:Number(e.toFixed(this.fixed[1]))+this.units[this.type][1]},t._removeGroup=function(e){var t,r,n,i=e.lineIndex,o=e.pointIndex;e.remove(),this.texts[i].splice(o,1),this.positions[i].splice(o,1),e=this.positions[i],this._updateLine(e,i),this._updatePoint(e,i),this._updateText(e,i),"polygon"===this.type?(this._updatePolygon(e,i),n=[].concat(e,[e[0]]),this._updateLine(n,i),e.length<3?(this._removeMarker(i),this._removePoint(i),this._removeLine(i)):e.length===o&&this._createTextRemove(i),2<e.length&&(n=F([n]),t=He(n),0<(r=this.texts[i]).length)&&(r=r[r.length-1],n=this._calcArea(n),this._updateMarkerText(r,n),r.setLngLat(t.geometry.coordinates).addTo(this.map))):"line"===this.type&&(e.length<2?this._removeMarker(i):e.length===o&&this._createTextRemove(i))},t._removeGroupLine=function(e){e=e.lineIndex,this._removeMarker(e),this._removePoint(e),this._removeLine(e),"circle"===this.type?this._removeCircle(e):"polygon"===this.type?this._removePolygon(e):"rect"===this.type?this._removeRect(e):"sector"===this.type&&this._removeSector(e)},t._removeMarker=function(e){this.texts[e].forEach((function(e){e.remove()})),this.texts[e]=[]},t._updateLine=function(e,t){var r=We+"_"+this.type+"_"+t+"_line";e.length<2?this._removeLine(t):(e=B([D(e,{lineIndex:t})]),this.map.getSource(r).setData(e))},t._updatePolygon=function(e,t){var r=We+"_"+this.type+"_"+t+"_polygon_move";e.length<3?this._removePolygon(t):(t=B([F([[].concat(e,[e[0]])])]),this.map.getSource(r).setData(t))},t._removePolygon=function(e){var t=this.movePolygonLayers[e];t&&(t.destroy(),this.movePolygonLayers[e]=null)},t._removeLine=function(e){var t=this.lineLayers[e];t&&(t.destroy(),this.lineLayers[e]=null),this.currentPosition=[]},t._removeCircle=function(e){var t=this.moveCircleLayers[e];t&&(t.destroy(),this.moveCircleLayers[e]=null)},t._updatePoint=function(e,t){var r=We+"_"+this.type+"_"+t+"_point";e.length<2?this._removePoint(t):(e=B(e.map((function(e,r){return j(e,{pointIndex:r,lineIndex:t})}))),this.map.getSource(r).setData(e))},t._removePoint=function(e){var t=this.pointLayers[e];t&&(t.destroy(),this.pointLayers[e]=null)},t._updateText=function(e,t){var r=this,n=this.texts[t];e.forEach((function(t,i){var o,a="起点";0!==i&&(o=B([D(e.slice(0,i+1))]),a=r._calcLength(o)),n[i]&&(n[i].pointIndex=i,r._updateMarkerText(n[i],a))}))},t._updateMarkerText=function(e,t){e.getElement().children[0].innerHTML=t},t.off=function(){this.isDraw||(this.map.off("click",this._click),this.map.off("mousemove",this._move),this.map.off("dblclick",this._dblclick))},t.remove=function(){this.isDraw||(this.pointLayers.forEach((function(e){null!=e&&e.destroy()})),this.movepointLayers.forEach((function(e){null!=e&&e.destroy()})),this.lineLayers.forEach((function(e){null!=e&&e.destroy()})),this.moveLineLayers.forEach((function(e){null!=e&&e.destroy()})),this.texts.forEach((function(e){null!=e&&e.forEach((function(e){e.remove()}))})),this.moveCircleLayers.forEach((function(e){null!=e&&e.destroy()})),this.movePolygonLayers.forEach((function(e){null!=e&&e.destroy()})),this.moveRectLayers.forEach((function(e){null!=e&&e.destroy()})),this.moveSectorLayers.forEach((function(e){null!=e&&e.destroy()})),this._removeMoveMarker(),this._init())},t.visible=function(e){"boolean"!=typeof e||this.isDraw||(this.pointLayers.forEach((function(t){null!=t&&t.visible(e)})),this.movepointLayers.forEach((function(t){null!=t&&t.visible(e)})),this.lineLayers.forEach((function(t){null!=t&&t.visible(e)})),this.moveLineLayers.forEach((function(t){null!=t&&t.visible(e)})),this.texts.forEach((function(t){null!=t&&t.forEach((function(t){t.getElement().style.display=e?"flex":"none"}))})),this.moveCircleLayers.forEach((function(t){null!=t&&t.visible(e)})),this.movePolygonLayers.forEach((function(t){null!=t&&t.visible(e)})),this.moveRectLayers.forEach((function(t){null!=t&&t.visible(e)})),this.moveSectorLayers.forEach((function(t){null!=t&&t.visible(e)})))},t.destroy=function(){this.isOpen=!1,this.isDraw=!1,this.remove(),this.off()},Te(e,[{key:"pointName",get:function(){return We+"_"+this.type+"_"+this.index+"_point"}},{key:"movePointName",get:function(){return We+"_"+this.type+"_"+this.index+"_point_move"}},{key:"lineName",get:function(){return We+"_"+this.type+"_"+this.index+"_line"}},{key:"moveLineName",get:function(){return We+"_"+this.type+"_"+this.index+"_line_move"}},{key:"moveCircleName",get:function(){return We+"_"+this.type+"_"+this.index+"_circle_move"}},{key:"movePolygonName",get:function(){return We+"_"+this.type+"_"+this.index+"_polygon_move"}},{key:"moveRectName",get:function(){return We+"_"+this.type+"_"+this.index+"_rect_move"}},{key:"moveSectorName",get:function(){return We+"_"+this.type+"_"+this.index+"_sector_move"}},{key:"pointLayer",get:function(){return this.pointLayers[this.index]}},{key:"movePointLayer",get:function(){return this.movepointLayers[this.index]}},{key:"lineLayer",get:function(){return this.lineLayers[this.index]}},{key:"moveLineLayer",get:function(){return this.moveLineLayers[this.index]}},{key:"moveCircleLayer",get:function(){return this.moveCircleLayers[this.index]}},{key:"movePolygonLayer",get:function(){return this.movePolygonLayers[this.index]}},{key:"moveRectLayer",get:function(){return this.moveRectLayers[this.index]}},{key:"moveSectorLayer",get:function(){return this.moveSectorLayers[this.index]}}]),e}(),Ve=["id"],Je=["id","type","beforeId","source-layer"],Ze=function(){function e(e,t){void 0===t&&(t={}),this.map=e,this.sourceName=[],this.layerName=[],this.type="symbol",this.custom=null!=(t=null==(e=t)?void 0:e.custom)&&t,this.isInit=!1,this.callback=null,this.mapEvent=null}var t=e.prototype;return t.draw=function(e,t,r){if(e&&this.map)return this.callback=r,"vector"===e.type?(this.type=null!=(r=t.type)?r:"symbol",this._addSourceLayer(e,t),{source:this.sourceName,layer:this.layerName}):void 0},t.destroy=function(){this._clearSource(),this.mapEvent&&this.map.off("render",this.mapEvent)},t.visible=function(e){var t,r=this;"boolean"==typeof e&&null!=(t=this.layerName)&&t.filter((function(e){return!e.includes("__copy")})).forEach((function(t){r.map.getLayer(t)&&r.map.setLayoutProperty(t,"visibility",e?"visible":"none")}))},t._addSourceLayer=function(e,t){var r,n,a=this,s=(this.sourceName=[],this.layerName=[],n=null!=(n=t.sourceConfig)?n:{}).id,l=i(n,Ve),c=s,h=(this.map.addSource(c,o({},e,l)),this.sourceName.push(c),(n=t.beforeId||null)&&this.map.getLayer(n),s=u(t.layerConfig),[]);Array.isArray(s)?h=s:"object"==typeof s&&h.push(s),0<h.length&&(e=h[0],n={id:c+"__copy",type:"circle",source:c,"source-layer":e["source-layer"],paint:{"circle-radius":1,"circle-opacity":0},interactive:!1},this.map.addLayer(n),this.layerName.push(c+"__copy"),r={sourceLayer:e["source-layer"]},this.mapEvent=function(e){var t,n=a.map.getSource(c);n&&n.loaded()&&a.map.isSourceLoaded(c)&&(n={type:"FeatureCollection",features:a.map.querySourceFeatures(c,r)},a.custom?a.callback&&"function"==typeof a.callback&&a.callback(n):(t=c+"__geojson",a.isInit?a.map.getSource(t)&&a.map.getSource(t).setData(n):(a.map.addSource(t,o({type:"geojson",data:n},l)),a.sourceName.push(t),h.forEach((function(e){var r=(e=u(e)).id,n=e.type,s=e.beforeId;e["source-layer"],e=i(e,Je),s&&!a.map.getLayer(s)&&(s=null),a.map.addLayer(o({id:r,type:n},e,{source:t}),s),a.layerName.push(r)})),a.isInit=!0)))},this.map.on("render",this.mapEvent))},t._clearSource=function(){var e,t=this;null!=(e=this.layerName)&&e.forEach((function(e){var r;(null==(r=t.map)?void 0:r.getLayer(e))&&t.map.removeLayer(e)})),null!=(e=this.sourceName)&&e.forEach((function(e){var r;(null==(r=t.map)?void 0:r.getSource(e))&&t.map.removeSource(e)}))},e}(),Ke=function(){function e(e){this.map=e}var t=e.prototype;return t.draw=function(e){var t,r,n,i,o,a,s,u,l;this.options=e,this.layer=(t=(e=this.options).id,r=e.url,n=e.crossOrigin,i=void 0===n?"":n,n=void 0===(n=e.position)?[]:n,e=e.altitude,o=void 0===e?0:e,a=n[0],s=n[1],u=n[2],l=n[3],{id:t,type:"custom",onAdd:function(e,t){var n=this,c=t.createShader(t.VERTEX_SHADER),h=(t.shaderSource(c,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),t.compileShader(c),t.createShader(t.FRAGMENT_SHADER)),p=(t.shaderSource(h,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),t.compileShader(h),this.program=t.createProgram(),t.attachShader(this.program,c),t.attachShader(this.program,h),t.linkProgram(this.program),this.aPos=t.getAttribLocation(this.program,"a_pos"),this.aUv=t.getAttribLocation(this.program,"a_uv"),this.uSamplerLoc=t.getUniformLocation(this.program,"u_sampler"),c=mapboxgl.MercatorCoordinate.fromLngLat({lng:a,lat:s},o),h=mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:s},o),mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:l},o)),f=mapboxgl.MercatorCoordinate.fromLngLat({lng:a,lat:l},o),d=new Image;d.crossOrigin=i,d.src=r,this.texture=t.createTexture(),d.onload=function(){t.bindTexture(t.TEXTURE_2D,n.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,d)},this.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array([c.x,c.y,c.z,0,0,h.x,h.y,h.z,1,0,p.x,p.y,p.z,1,1,c.x,c.y,c.z,0,0,p.x,p.y,p.z,1,1,f.x,f.y,f.z,0,1]),t.STATIC_DRAW)},render:function(e,t){e.useProgram(this.program),e.uniformMatrix4fv(e.getUniformLocation(this.program,"u_matrix"),!1,t),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.enableVertexAttribArray(this.aPos),e.enableVertexAttribArray(this.aUv),e.vertexAttribPointer(this.aPos,3,e.FLOAT,!1,20,0),e.vertexAttribPointer(this.aUv,2,e.FLOAT,!1,20,12),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLES,0,6)}}),this.map.addLayer(this.layer)},t.visible=function(e){e?this.map.addLayer(this.layer):this.map.removeLayer(this.options.id)},t.destroy=function(){this.map.getLayer(this.options.id)&&this.map.removeLayer(this.options.id)},e}(),$e=["padding","animate","maxZoom","essential"],Qe=["url"],et=["interactive"],tt=null,rt=null,nt=function(e){return/^#([0-9a-fA-F]{3}){1,2}$/.test(e)},it=["line-color","line-opacity"],ot=["fill-color","fill-opacity"],at=["background-color","background-opacity"],st=["text-color","text-opacity"],ut="zh_custom",lt=function(e,t,r,n){if(r&&(nt(r)||Array.isArray(r))){var i=e.getLayer(t);if(i){var o=[];switch(i.type){case"line":o=it;break;case"fill":o=ot;break;case"background":o=at;break;case"symbol":o=st}0<o.length&&(e.setPaintProperty(t,o[0],r),null!==n)&&e.setPaintProperty(t,o[1],n)}}},ct=function(e,t,r,n){if(t&&r&&"string"==typeof t&&e.getLayer(t)&&"object"==typeof r)for(var i in r)null!==r[i]&&void 0!==r[i]&&e[n](t,i,r[i])};function ht(e,t){if(e&&(void 0!==e[ut]&&null!==e[ut]||(e[ut]={}),t)&&"object"==typeof t){var r,n=u(t);for(r in n)e[ut][r]=n[r]}}function pt(e,t){var r=[];return"string"==typeof t?r=t.split(".").filter(Boolean):Array.isArray(t)&&(r=t),0===r.length?null:r.reduce((function(e,t){return e[t]}),e[ut])}})(),n;function e(n){var i=r[n];return void 0!==i||(i=r[n]={exports:{}},t[n].call(i.exports,i,i.exports,e)),i.exports}var t,r,n}));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("zMapUtil",[],e):"object"==typeof exports?exports.zMapUtil=e():t.zMapUtil=e()}(this,(()=>{return e={705:(t,e,n)=>{"use strict";var i=n(540);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}e.Z=r.default=r},102:(t,e)=>{"use strict";function n(t,e,n){var i={type:"Feature"};return 0!==(n=void 0===n?{}:n).id&&!n.id||(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=e||{},i.geometry=t,i}function i(t,e,i){if(void 0===i&&(i={}),!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(f(t[0])&&f(t[1]))return n({type:"Point",coordinates:t},e,i);throw new Error("coordinates must contain numbers")}function r(t,e,i){void 0===i&&(i={});for(var r=0,o=t;r<o.length;r++){var s=o[r];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,i)}function o(t,e,i){if(void 0===i&&(i={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,i)}function s(t,e){var n={type:"FeatureCollection"};return(e=void 0===e?{}:e).id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function a(t,e,i){return n({type:"MultiLineString",coordinates:t},e,i=void 0===i?{}:i)}function u(t,e,i){return n({type:"MultiPoint",coordinates:t},e,i=void 0===i?{}:i)}function l(t,e,i){return n({type:"MultiPolygon",coordinates:t},e,i=void 0===i?{}:i)}function c(t,n){var i=e.factors[n=void 0===n?"kilometers":n];if(i)return t*i;throw new Error(n+" units is invalid")}function h(t,n){var i=e.factors[n=void 0===n?"kilometers":n];if(i)return t/i;throw new Error(n+" units is invalid")}function p(t){return t%(2*Math.PI)*180/Math.PI}function f(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/e.earthRadius,yards:1.0936133},e.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},e.feature=n,e.geometry=function(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return i(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return r(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return a(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},e.point=i,e.points=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return i(t,e)})),n)},e.polygon=r,e.polygons=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return r(t,e)})),n)},e.lineString=o,e.lineStrings=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return o(t,e)})),n)},e.featureCollection=s,e.multiLineString=a,e.multiPoint=u,e.multiPolygon=l,e.geometryCollection=function(t,e,i){return n({type:"GeometryCollection",geometries:t},e,i=void 0===i?{}:i)},e.round=function(t,e){if(!(e=void 0===e?0:e)||0<=e)return e=Math.pow(10,e||0),Math.round(t*e)/e;throw new Error("precision must be a positive number")},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){return(t%=360)<0&&(t+=360),t},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),0<=t)return c(h(t,e),n);throw new Error("length must be a positive number")},e.convertArea=function(t,n,i){if(void 0===n&&(n="meters"),void 0===i&&(i="kilometers"),!(0<=t))throw new Error("area must be a positive number");if(!(n=e.areaFactors[n]))throw new Error("invalid original units");if(i=e.areaFactors[i])return t/n*i;throw new Error("invalid final units")},e.isNumber=f,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(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(!f(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},540:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(102);function r(t,e,n){if(null!==t)for(var i,o,s,a=0,u=t.type,l="FeatureCollection"===u,c="Feature"===u,h=l?t.features.length:1,p=0;p<h;p++)for(var f,g,d=(g=!!(f=l?t.features[p].geometry:c?t.geometry:t)&&"GeometryCollection"===f.type)?f.geometries.length:1,y=0;y<d;y++){var _=0,m=0,v=g?f.geometries[y]:f;if(null!==v){var x=v.coordinates,E=v.type,b=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1;switch(E){case null:break;case"Point":if(!1===e(x,a,p,_,m))return!1;a++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<x.length;i++){if(!1===e(x[i],a,p,_,m))return!1;a++,"MultiPoint"===E&&_++}"LineString"===E&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<x.length;i++){for(o=0;o<x[i].length-b;o++){if(!1===e(x[i][o],a,p,_,m))return!1;a++}"MultiLineString"===E&&_++,"Polygon"===E&&m++}"Polygon"===E&&_++;break;case"MultiPolygon":for(i=0;i<x.length;i++){for(o=m=0;o<x[i].length;o++){for(s=0;s<x[i][o].length-b;s++){if(!1===e(x[i][o][s],a,p,_,m))return!1;a++}m++}_++}break;case"GeometryCollection":for(i=0;i<v.geometries.length;i++)if(!1===r(v.geometries[i],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function a(t,e){for(var n,i,r,o,s,a,u,l,c,h=0,p="FeatureCollection"===t.type,f="Feature"===t.type,g=p?t.features.length:1,d=0;d<g;d++){for(s=p?t.features[d].geometry:f?t.geometry:t,u=p?t.features[d].properties:f?t.properties:{},l=p?t.features[d].bbox:f?t.bbox:void 0,c=p?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null===(r=a?s.geometries[i]:s)){if(!1===e(null,h,u,l,c))return!1}else switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(r,h,u,l,c))return!1;break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(!1===e(r.geometries[n],h,u,l,c))return!1;break;default:throw new Error("Unknown Geometry Type")}h++}}function u(t,e){a(t,(function(t,n,r,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(i.feature(t,r,{bbox:o,id:s}),n,0)&&void 0}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c=t.coordinates[l];if(!1===e(i.feature({type:a,coordinates:c},r),n,l))return!1}}))}function l(t,e){u(t,(function(t,n,o){var s=0;if(t.geometry){var a,u,l,c,h=t.geometry.type;if("Point"!==h&&"MultiPoint"!==h)return c=l=u=0,!1!==r(t,(function(r,h,p,f,g){if(void 0===a||u<n||l<f||c<g)a=r,u=n,l=f,c=g,s=0;else{if(f=i.lineString([a,r],t.properties),!1===e(f,n,o,g,s))return!1;s++,a=r}}))&&void 0}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,n,r){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===e(i.lineString(s[a],t.properties),n,r,a))return!1}}}))}e.coordAll=function(t){var e=[];return r(t,(function(t){e.push(t)})),e},e.coordEach=r,e.coordReduce=function(t,e,n,i){var o=n;return r(t,(function(t,i,r,s,a){o=0===i&&void 0===n?t:e(o,t,i,r,s,a)}),i),o},e.featureEach=s,e.featureReduce=function(t,e,n){var i=n;return s(t,(function(t,r){i=0===r&&void 0===n?t:e(i,t,r)})),i},e.findPoint=function(t,e){if(!i.isObject(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),u=u||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":u=u||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 l=n.coordinates;switch(n.type){case"Point":return i.point(l,u,e);case"MultiPoint":return o<0&&(o=l.length+o),i.point(l[o],u,e);case"LineString":return a<0&&(a=l.length+a),i.point(l[a],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a),i.point(l[s][a],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),i.point(l[o][a],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a),i.point(l[o][s][a],u,e)}throw new Error("geojson is invalid")},e.findSegment=function(t,e){if(!i.isObject(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),u=u||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":u=u||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 l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),i.lineString([l[a],l[a+1]],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a-1),i.lineString([l[s][a],l[s][a+1]],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),i.lineString([l[o][a],l[o][a+1]],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a-1),i.lineString([l[o][s][a],l[o][s][a+1]],u,e)}throw new Error("geojson is invalid")},e.flattenEach=u,e.flattenReduce=function(t,e,n){var i=n;return u(t,(function(t,r,o){i=0===r&&0===o&&void 0===n?t:e(i,t,r,o)})),i},e.geomEach=a,e.geomReduce=function(t,e,n){var i=n;return a(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)})),i},e.lineEach=c,e.lineReduce=function(t,e,n){var i=n;return c(t,(function(t,r,o,s){i=0===r&&void 0===n?t:e(i,t,r,o,s)})),i},e.propEach=o,e.propReduce=function(t,e,n){var i=n;return o(t,(function(t,r){i=0===r&&void 0===n?t:e(i,t,r)})),i},e.segmentEach=l,e.segmentReduce=function(t,e,n){var i=n,r=!1;return l(t,(function(t,o,s,a,u){i=!1===r&&void 0===n?t:e(i,t,o,s,a,u),r=!0})),i}},630:function(t){var e;e=function(){return e=[function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=function(t){return t===o},e.isNotAPNG=function(t){return t===s},e.default=function(t){var e=new Uint8Array(t);if(Array.prototype.some.call(a,(function(t,n){return t!==e[n]})))return o;var n=!1;if(u(e,(function(t){return!(n="acTL"===t)})),!n)return s;var i=[],p=[],f=null,g=null,d=0,y=new r.APNG;if(u(e,(function(t,e,n,o){var s=new DataView(e.buffer);switch(t){case"IHDR":f=e.subarray(n+8,n+8+o),y.width=s.getUint32(n+8),y.height=s.getUint32(n+12);break;case"acTL":y.numPlays=s.getUint32(n+8+4);break;case"fcTL":g&&(y.frames.push(g),d++),(g=new r.Frame).width=s.getUint32(n+8+4),g.height=s.getUint32(n+8+8),g.left=s.getUint32(n+8+12),g.top=s.getUint32(n+8+16);var a=s.getUint16(n+8+20),u=s.getUint16(n+8+22);g.delay=1e3*a/(u=0===u?100:u),g.delay<=10&&(g.delay=100),y.playTime+=g.delay,g.disposeOp=s.getUint8(n+8+24),g.blendOp=s.getUint8(n+8+25),g.dataParts=[],0===d&&2===g.disposeOp&&(g.disposeOp=1);break;case"fdAT":g&&g.dataParts.push(e.subarray(n+8+4,n+8+o));break;case"IDAT":g&&g.dataParts.push(e.subarray(n+8,n+8+o));break;case"IEND":p.push(l(e,n,12+o));break;default:i.push(l(e,n,12+o))}})),g&&y.frames.push(g),0==y.frames.length)return s;var _=new Blob(i),m=new Blob(p);return y.frames.forEach((function(t){var e=[];e.push(a),f.set(h(t.width),0),f.set(h(t.height),4),e.push(c("IHDR",f)),e.push(_),t.dataParts.forEach((function(t){return e.push(c("IDAT",t))})),e.push(m),t.imageData=new Blob(e,{type:"image/png"}),delete t.dataParts,e=null})),y};var i=(e=n(1))&&e.__esModule?e:{default:e},r=n(2),o=new Error("Not a PNG"),s=new Error("Not an animated PNG"),a=new Uint8Array([137,80,78,71,13,10,26,10]);function u(t,e){for(var n,i,r,o=new DataView(t.buffer),s=8;i=o.getUint32(s),r=e(n=function(t,e,n){return t=Array.prototype.slice.call(t.subarray(e,e+4)),String.fromCharCode.apply(String,t)}(t,s+4),t,s,i),s+=12+i,!1!==r&&"IEND"!=n&&s<t.length;);}function l(t,e,n){var i=new Uint8Array(n);return i.set(t.subarray(e,e+n)),i}var c=function(t,e){var n=t.length+e.length,r=new Uint8Array(n+8),o=new DataView(r.buffer);return o.setUint32(0,e.length),r.set(function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(t),4),r.set(e,8),t=(0,i.default)(r,4,n),o.setUint32(n+4,t),r},h=function(t){return new Uint8Array([t>>>24&255,t>>>16&255,t>>>8&255,255&t])}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,i=-1,r=e,o=e+(2<arguments.length&&void 0!==arguments[2]?arguments[2]:t.length-e);r<o;r++)i=i>>>8^n[255&(i^t[r])];return-1^i};for(var n=new Uint32Array(256),i=0;i<256;i++){for(var r=i,o=0;o<8;o++)r=0!=(1&r)?3988292384^r>>>1:r>>>1;n[i]=r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var i=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t};function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=(n=n(3))&&n.__esModule?n:{default:n};function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(){s(this,a),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}function u(){s(this,u),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}e.APNG=(i(a,[{key:"createImages",value:function(){return Promise.all(this.frames.map((function(t){return t.createImage()})))}},{key:"getPlayer",value:function(t){var e=this,n=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return this.createImages().then((function(){return new o.default(e,t,n)}))}}]),a),e.Frame=(i(u,[{key:"createImage",value:function(){var t=this;return this.imageElement?Promise.resolve():new Promise((function(e,n){var i=URL.createObjectURL(t.imageData);t.imageElement=document.createElement("img"),t.imageElement.onload=function(){URL.revokeObjectURL(i),e()},t.imageElement.onerror=function(){URL.revokeObjectURL(i),t.imageElement=null,n(new Error("Image creation error"))},t.imageElement.src=i}))}}]),u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t};function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}n=function(t){var e=n;if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);function n(t,e,i){var r;if(this instanceof n)return(r=function(t,e){if(t)return!e||"object"!=typeof e&&"function"!=typeof e?t:e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this))).playbackRate=1,r._currentFrameNumber=0,r._ended=!1,r._paused=!0,r._numPlays=0,r._rafId=null,r._apng=t,r.context=e,r.stop(),i&&r.play(),r;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t),i(n,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,0!==this._apng.numPlays)&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0),this._prevFrame&&1==this._prevFrame.disposeOp?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&2==this._prevFrame.disposeOp&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var t=this.currentFrame;this._prevFrame=t,this._prevFrameData=null,2==t.disposeOp&&(this._prevFrameData=this.context.getImageData(t.left,t.top,t.width,t.height)),0==t.blendOp&&this.context.clearRect(t.left,t.top,t.width,t.height),this.context.drawImage(t.imageElement,t.left,t.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var t=this,e=(this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1,performance.now()+this.currentFrame.delay/this.playbackRate);this._rafId=requestAnimationFrame((function n(i){if(!t._ended&&!t._paused){if(e<=i){for(;i-e>=t._apng.playTime/t.playbackRate;)e+=t._apng.playTime/t.playbackRate,t._numPlays++;for(;t.renderNextFrame(),e+=t.currentFrame.delay/t.playbackRate,!t._ended&&!t._paused&&e<i;);}t._rafId=requestAnimationFrame(n)}}))}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),n}(((n=n(4))&&n.__esModule?n:{default:n}).default),e.default=n},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}((t.exports=n).EventEmitter=n).prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,a,u,l,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length))throw(c=arguments[1])instanceof Error?c:((l=new Error('Uncaught, unspecified "error" event. ('+c+")")).context=c,l);if(o(e=this._events[t]))return!1;if(i(e))switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),e.apply(this,s)}else if(r(e))for(s=Array.prototype.slice.call(arguments,1),n=(u=e.slice()).length,a=0;a<n;a++)u[a].apply(this,s);return!0},n.prototype.on=n.prototype.addListener=function(t,e){if(i(e))return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?r(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,r(this._events[t])&&!this._events[t].warned&&(e=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&0<e&&this._events[t].length>e&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace)&&console.trace(),this;throw TypeError("listener must be a function")},n.prototype.once=function(t,e){var n;if(i(e))return n=!1,r.listener=e,this.on(t,r),this;throw TypeError("listener must be a function");function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}},n.prototype.removeListener=function(t,e){var n,o,s,a;if(!i(e))throw TypeError("listener must be a function");if(this._events&&this._events[t])if(s=(n=this._events[t]).length,o=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(a=s;0<a--;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=a;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(this._events)if(this._events.removeListener)if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);this.removeAllListeners("removeListener"),this._events={}}else{if(i(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);delete this._events[t]}else 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t];return this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){if(i(t=this._events[t]))return 1;if(t)return t.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}}],n={},t.m=e,t.c=n,t.p="",t(0);function t(i){var r;return(n[i]||(r=n[i]={exports:{},id:i,loaded:!1},e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r)).exports}var e,n},t.exports=e()},787:(t,e,n)=>{var i=n(582),r=n(102),o=n(540),s=n(705).Z,a=o.featureEach,u=(o.coordEach,r.polygon,r.featureCollection);function l(t){return(t=new i(t)).insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),i.prototype.insert.call(this,t)},t.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})):a(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})),i.prototype.load.call(this,e)},t.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),i.prototype.remove.call(this,t,e)},t.clear=function(){return i.prototype.clear.call(this)},t.search=function(t){return t=i.prototype.search.call(this,this.toBBox(t)),u(t)},t.collides=function(t){return i.prototype.collides.call(this,this.toBBox(t))},t.all=function(){var t=i.prototype.all.call(this);return u(t)},t.toJSON=function(){return i.prototype.toJSON.call(this)},t.fromJSON=function(t){return i.prototype.fromJSON.call(this,t)},t.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else{if("Feature"!==t.type&&"FeatureCollection"!==t.type)throw new Error("invalid geojson");e=s(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},t}t.exports=l,t.exports.default=l},481:function(t,e){var n;void 0!==(e="function"==typeof(n=function(){var t=function(t){return t.reduce((function(t,e){return 2*t+e}),0)},e=function(t){for(var e=[],n=7;n>=0;n--)e.push(!!(t&1<<n));return e},n=function(t){this.data=t,this.len=this.data.length,this.pos=0,this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return t instanceof Uint8Array?t[this.pos++]:255&t.charCodeAt(this.pos++)},this.readBytes=function(t){for(var e=[],n=0;n<t;n++)e.push(this.readByte());return e},this.read=function(t){for(var e="",n=0;n<t;n++)e+=String.fromCharCode(this.readByte());return e},this.readUnsigned=function(){var t=this.readBytes(2);return(t[1]<<8)+t[0]}},i=function(n,i){i||(i={});var r=function(t){for(var e=[],i=0;i<t;i++)e.push(n.readBytes(3));return e},o=function(){var t,e;e="";do{t=n.readByte(),e+=n.read(t)}while(0!==t);return e},s=function(){var a={};switch(a.sentinel=n.readByte(),String.fromCharCode(a.sentinel)){case"!":a.type="ext",function(r){switch(r.label=n.readByte(),r.label){case 249:r.extType="gce",function(r){n.readByte();var o=e(n.readByte());r.reserved=o.splice(0,3),r.disposalMethod=t(o.splice(0,3)),r.userInput=o.shift(),r.transparencyGiven=o.shift(),r.delayTime=n.readUnsigned(),r.transparencyIndex=n.readByte(),r.terminator=n.readByte(),i.gce&&i.gce(r)}(r);break;case 254:r.extType="com",function(t){t.comment=o(),i.com&&i.com(t)}(r);break;case 1:r.extType="pte",function(t){n.readByte(),t.ptHeader=n.readBytes(12),t.ptData=o(),i.pte&&i.pte(t)}(r);break;case 255:r.extType="app",function(t){n.readByte(),t.identifier=n.read(8),t.authCode=n.read(3),"NETSCAPE"===t.identifier?function(t){n.readByte(),t.unknown=n.readByte(),t.iterations=n.readUnsigned(),t.terminator=n.readByte(),i.app&&i.app.NETSCAPE&&i.app.NETSCAPE(t)}(t):function(t){t.appData=o(),i.app&&i.app[t.identifier]&&i.app[t.identifier](t)}(t)}(r);break;default:r.extType="unknown",function(t){t.data=o(),i.unknown&&i.unknown(t)}(r)}}(a);break;case",":a.type="img",function(s){s.leftPos=n.readUnsigned(),s.topPos=n.readUnsigned(),s.width=n.readUnsigned(),s.height=n.readUnsigned();var a=e(n.readByte());s.lctFlag=a.shift(),s.interlaced=a.shift(),s.sorted=a.shift(),s.reserved=a.splice(0,2),s.lctSize=t(a.splice(0,3)),s.lctFlag&&(s.lct=r(1<<s.lctSize+1)),s.lzwMinCodeSize=n.readByte();var u=o();s.pixels=function(t,e){for(var n,i,r=0,o=function(t){for(var n=0,i=0;i<t;i++)e.charCodeAt(r>>3)&1<<(7&r)&&(n|=1<<i),r++;return n},s=[],a=1<<t,u=a+1,l=t+1,c=[],h=function(){c=[],l=t+1;for(var e=0;e<a;e++)c[e]=[e];c[a]=[],c[u]=null};;)if(i=n,(n=o(l))!==a){if(n===u)break;if(n<c.length)i!==a&&c.push(c[i].concat(c[n][0]));else{if(n!==c.length)throw new Error("Invalid LZW code.");c.push(c[i].concat(c[i][0]))}s.push.apply(s,c[n]),c.length===1<<l&&l<12&&l++}else h();return s}(s.lzwMinCodeSize,u),s.interlaced&&(s.pixels=function(t,e){for(var n=new Array(t.length),i=t.length/e,r=function(i,r){var o=t.slice(r*e,(r+1)*e);n.splice.apply(n,[i*e,e].concat(o))},o=[0,4,2,1],s=[8,8,4,2],a=0,u=0;u<4;u++)for(var l=o[u];l<i;l+=s[u])r(l,a),a++;return n}(s.pixels,s.width)),i.img&&i.img(s)}(a);break;case";":a.type="eof",i.eof&&i.eof(a);break;default:throw new Error("Unknown block: 0x"+a.sentinel.toString(16))}"eof"!==a.type&&setTimeout(s,0)};!function(){var o={};if(o.sig=n.read(3),o.ver=n.read(3),"GIF"!==o.sig)throw new Error("Not a GIF file.");o.width=n.readUnsigned(),o.height=n.readUnsigned();var s=e(n.readByte());o.gctFlag=s.shift(),o.colorRes=t(s.splice(0,3)),o.sorted=s.shift(),o.gctSize=t(s.splice(0,3)),o.bgColor=n.readByte(),o.pixelAspectRatio=n.readByte(),o.gctFlag&&(o.gct=r(1<<o.gctSize+1)),i.hdr&&i.hdr(o)}(),setTimeout(s,0)};return function(t){var e,r,o={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var s in t)o[s]=t[s];o.vp_w&&o.vp_h&&(o.is_vp=!0);var a=null,u=!1,l=null,c=null,h=null,p=null,f=null,g=null,d=null,y=!0,_=!1,m=[],v=[],x=o.gif;void 0===o.auto_play&&(o.auto_play=!x.getAttribute("rel:auto_play")||"1"==x.getAttribute("rel:auto_play"));var E,b,I,w,N=o.hasOwnProperty("on_end")?o.on_end:null,L=o.hasOwnProperty("loop_delay")?o.loop_delay:0,S=o.hasOwnProperty("loop_mode")?o.loop_mode:"auto",C=!o.hasOwnProperty("draw_while_loading")||o.draw_while_loading,P=!!C&&(!o.hasOwnProperty("show_progress_bar")||o.show_progress_bar),M=o.hasOwnProperty("progressbar_height")?o.progressbar_height:25,T=o.hasOwnProperty("progressbar_background_color")?o.progressbar_background_color:"rgba(255,255,255,0.4)",R=o.hasOwnProperty("progressbar_foreground_color")?o.progressbar_foreground_color:"rgba(255,0,22,.8)",O=function(){l=null,c=null,f=h,h=null,g=null},A=function(){try{i(e,j)}catch(t){k("parse")}},D=function(t,e){E.width=t*X(),E.height=e*X(),I.style.minWidth=t*X()+"px",w.width=t,w.height=e,w.style.width=t+"px",w.style.height=e+"px",w.getContext("2d").setTransform(1,0,0,1,0,0)},F=function(t,e,n){if(n&&P){var i,r,s,a=M;o.is_vp?_?(r=(o.vp_t+o.vp_h-a)/X(),a/=X(),i=o.vp_l/X()+t/e*(o.vp_w/X()),s=E.width/X()):(r=o.vp_t+o.vp_h-a,i=o.vp_l+t/e*o.vp_w,s=E.width):(r=(E.height-a)/(_?X():1),i=t/e*E.width/(_?X():1),s=E.width/(_?X():1),a/=_?X():1),b.fillStyle=T,b.fillRect(i,r,s-i,a),b.fillStyle=R,b.fillRect(0,r,i,a)}},k=function(t){a=t,r={width:x.width,height:x.height},m=[],b.fillStyle="black",b.fillRect(0,0,o.c_w?o.c_w:r.width,o.c_h?o.c_h:r.height),b.strokeStyle="red",b.lineWidth=3,b.moveTo(0,0),b.lineTo(o.c_w?o.c_w:r.width,o.c_h?o.c_h:r.height),b.moveTo(0,o.c_h?o.c_h:r.height),b.lineTo(o.c_w?o.c_w:r.width,0),b.stroke()},G=function(){g&&(m.push({data:g.getImageData(0,0,r.width,r.height),delay:c}),v.push({x:0,y:0}))},B=function(){var t=-1,e=0,n=function(e){t+=e,r()},i=function(){var i=!1,r=function(){null!==N&&N(x),e++,!1!==S||e<0?o():(i=!1,y=!1)},o=function(){if(i=y){n(1);var e=10*m[t].delay;e||(e=100),0==(t+1+m.length)%m.length?(e+=L,setTimeout(r,e)):setTimeout(o,e)}};return function(){i||setTimeout(o,0)}}(),r=function(){var e;(t=parseInt(t,10))>m.length-1&&(t=0),t<0&&(t=0),e=v[t],w.getContext("2d").putImageData(m[t].data,e.x,e.y),b.globalCompositeOperation="copy",b.drawImage(w,0,0)};return{init:function(){a||(o.c_w&&o.c_h||b.scale(X(),X()),o.auto_play?i():(t=0,r()))},step:i,play:function(){y=!0,i()},pause:function(){y=!1},playing:y,move_relative:n,current_frame:function(){return t},length:function(){return m.length},move_to:function(e){t=e,r()}}}(),U=function(t){F(e.pos,e.data.length,t)},q=function(){},z=function(t,e){return function(n){t(n),U(e)}},j={hdr:z((function(t){D((r=t).width,r.height)})),gce:z((function(t){G(),O(),l=t.transparencyGiven?t.transparencyIndex:null,c=t.delayTime,h=t.disposalMethod})),com:z(q),app:{NETSCAPE:z(q)},img:z((function(t){g||(g=w.getContext("2d"));var e=m.length,n=t.lctFlag?t.lct:r.gct;e>0&&(3===f?null!==p?g.putImageData(m[p].data,0,0):g.clearRect(d.leftPos,d.topPos,d.width,d.height):p=e-1,2===f&&g.clearRect(d.leftPos,d.topPos,d.width,d.height));var i=g.getImageData(t.leftPos,t.topPos,t.width,t.height);t.pixels.forEach((function(t,e){t!==l&&(i.data[4*e+0]=n[t][0],i.data[4*e+1]=n[t][1],i.data[4*e+2]=n[t][2],i.data[4*e+3]=255)})),g.putImageData(i,t.leftPos,t.topPos),_||(b.scale(X(),X()),_=!0),C&&(b.drawImage(w,0,0),C=o.auto_play),d=t}),!0),eof:function(t){G(),U(!1),o.c_w&&o.c_h||(E.width=r.width*X(),E.height=r.height*X()),B.init(),u=!1,H&&H(x)}},V=function(){var t=x.parentNode,e=document.createElement("div");E=document.createElement("canvas"),b=E.getContext("2d"),I=document.createElement("div"),w=document.createElement("canvas"),e.width=E.width=x.width,e.height=E.height=x.height,I.style.minWidth=x.width+"px",e.className="jsgif",I.className="jsgif_toolbar",e.appendChild(E),e.appendChild(I),t.insertBefore(e,x),t.removeChild(x),o.c_w&&o.c_h&&D(o.c_w,o.c_h),Y=!0},X=function(){return o.max_width&&r&&r.width>o.max_width?o.max_width/r.width:1},Y=!1,H=!1,W=function(t){return!u&&(H=t||!1,u=!0,m=[],O(),p=null,f=null,g=null,d=null,!0)},J=function(){return m.reduce((function(t,e){return t+e.delay}),0)};return{play:B.play,pause:B.pause,move_relative:B.move_relative,move_to:B.move_to,get_playing:function(){return y},get_canvas:function(){return E},get_canvas_scale:function(){return X()},get_loading:function(){return u},get_auto_play:function(){return o.auto_play},get_length:function(){return B.length()},get_frames:function(){return m},get_duration:function(){return J()},get_duration_ms:function(){return 10*J()},get_current_frame:function(){return B.current_frame()},load_url:function(t,i){if(W(i)){var r=new XMLHttpRequest;r.open("GET",t,!0),"overrideMimeType"in r?r.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in r?r.responseType="arraybuffer":r.setRequestHeader("Accept-Charset","x-user-defined"),r.onloadstart=function(){Y||V()},r.onload=function(t){200!=this.status&&k("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var i=this.response;i.toString().indexOf("ArrayBuffer")>0&&(i=new Uint8Array(i)),e=new n(i),setTimeout(A,0)},r.onprogress=function(t){t.lengthComputable&&F(t.loaded,t.total,!0)},r.onerror=function(){k("xhr")},r.send()}},load:function(t){this.load_url(x.getAttribute("rel:animated_src")||x.src,t)},load_raw:function(t,i){W(i)&&(Y||V(),e=new n(t),setTimeout(A,0))},set_frame_offset:function(t,e){v[t]?(void 0!==e.x&&(v[t].x=e.x),void 0!==e.y&&(v[t].y=e.y)):v[t]=e}}}})?n.apply(e,[]):n)&&(t.exports=e)},676:function(t){t.exports=function(){"use strict";var t=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function e(t,e){return t>e?1:t<e?-1:0}function n(e,n,i){for(var r=new t(null,null),o=r,s=r;;){var a=i(e,n.key);if(a<0){if(null===n.left)break;if(i(e,n.left.key)<0){var u=n.left;if(n.left=u.right,u.right=n,null===(n=u).left)break}s.left=n,s=n,n=n.left}else{if(!(a>0))break;if(null===n.right)break;if(i(e,n.right.key)>0&&(u=n.right,n.right=u.left,u.left=n,null===(n=u).right))break;o.right=n,o=n,n=n.right}}return o.right=n.left,s.left=n.right,n.left=r.right,n.right=r.left,n}function i(e,i,r,o){var s=new t(e,i);if(null===r)return s.left=s.right=null,s;var a=o(e,(r=n(e,r,o)).key);return a<0?(s.left=r.left,s.right=r,r.left=null):a>=0&&(s.right=r.right,s.left=r,r.right=null),s}function r(t,e,i){var r=null,o=null;if(e){var s=i((e=n(t,e,i)).key,t);0===s?(r=e.left,o=e.right):s<0?(o=e.right,e.right=null,r=e):(r=e.left,e.left=null,o=e)}return{left:r,right:o}}function o(t,e,i){return null===e?t:(null===t||((e=n(t.key,e,i)).left=t),e)}function s(t,e,n,i,r){if(t){i(e+(n?"└── ":"├── ")+r(t)+"\n");var o=e+(n?" ":"│ ");t.left&&s(t.left,o,!1,i,r),t.right&&s(t.right,o,!0,i,r)}}var a=function(){function a(t){void 0===t&&(t=e),this._root=null,this._size=0,this._comparator=t}return a.prototype.insert=function(t,e){return this._size++,this._root=i(t,e,this._root,this._comparator)},a.prototype.add=function(e,i){var r=new t(e,i);null===this._root&&(r.left=r.right=null,this._size++,this._root=r);var o=this._comparator,s=n(e,this._root,o),a=o(e,s.key);return 0===a?this._root=s:(a<0?(r.left=s.left,r.right=s,s.left=null):a>0&&(r.right=s.right,r.left=s,s.right=null),this._size++,this._root=r),this._root},a.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},a.prototype._remove=function(t,e,i){var r;return null===e?null:0===i(t,(e=n(t,e,i)).key)?(null===e.left?r=e.right:(r=n(t,e.left,i)).right=e.right,this._size--,r):e},a.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=n(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},a.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(0===i)return e;e=i<0?e.left:e.right}return null},a.prototype.find=function(t){return this._root&&(this._root=n(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},a.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(0===i)return!0;e=i<0?e.left:e.right}return!1},a.prototype.forEach=function(t,e){for(var n=this._root,i=[],r=!1;!r;)null!==n?(i.push(n),n=n.left):0!==i.length?(n=i.pop(),t.call(e,n),n=n.right):r=!0;return this},a.prototype.range=function(t,e,n,i){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(i,s))return this;s=s.right}return this},a.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},a.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},a.prototype.min=function(){return this._root?this.minNode(this._root).key:null},a.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},a.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},a.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},a.prototype.at=function(t){for(var e=this._root,n=!1,i=0,r=[];!n;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},a.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var r=i(t.key,e.key);if(0===r)break;r<0?(n=e,e=e.left):e=e.right}return n},a.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var r=i(t.key,e.key);if(0===r)break;r<0?e=e.left:(n=e,e=e.right)}return n},a.prototype.clear=function(){return this._root=null,this._size=0,this},a.prototype.toList=function(){return function(e){for(var n=e,i=[],r=!1,o=new t(null,null),s=o;!r;)n?(i.push(n),n=n.left):i.length>0?n=(n=s=s.next=i.pop()).right:r=!0;return s.next=null,o.next}(this._root)},a.prototype.load=function(e,n,i){void 0===n&&(n=[]),void 0===i&&(i=!1);var r=e.length,o=this._comparator;if(i&&c(e,n,0,r-1,o),null===this._root)this._root=u(e,n,0,r),this._size=r;else{var s=function(e,n,i){for(var r=new t(null,null),o=r,s=e,a=n;null!==s&&null!==a;)i(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),r.next}(this.toList(),function(e,n){for(var i=new t(null,null),r=i,o=0;o<e.length;o++)r=r.next=new t(e[o],n[o]);return r.next=null,i.next}(e,n),o);r=this._size+r,this._root=l({head:s},0,r)}return this},a.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(a.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),a.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return s(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},a.prototype.update=function(t,e,n){var s=this._comparator,a=r(t,this._root,s),u=a.left,l=a.right;s(t,e)<0?l=i(e,n,l,s):u=i(e,n,u,s),this._root=o(u,l,s)},a.prototype.split=function(t){return r(t,this._root,this._comparator)},a.prototype[Symbol.iterator]=function(){var t,e,n;return function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}(this,(function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[3,6]:null===t?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return 0===e.length?[3,4]:[4,t=e.pop()];case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}}))},a}();function u(e,n,i,r){var o=r-i;if(o>0){var s=i+Math.floor(o/2),a=e[s],l=n[s],c=new t(a,l);return c.left=u(e,n,i,s),c.right=u(e,n,s+1,r),c}return null}function l(t,e,n){var i=n-e;if(i>0){var r=e+Math.floor(i/2),o=l(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=l(t,r+1,n),s}return null}function c(t,e,n,i,r){if(!(n>=i)){for(var o=t[n+i>>1],s=n-1,a=i+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var u=t[s];t[s]=t[a],t[a]=u,u=e[s],e[s]=e[a],e[a]=u}c(t,e,n,a,r),c(t,e,a+1,i,r)}}const h=(t,e)=>t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y,p=(t,e)=>{if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;const n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,i=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:i,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}};let f=Number.EPSILON;void 0===f&&(f=Math.pow(2,-52));const g=f*f,d=(t,e)=>{if(-f<t&&t<f&&-f<e&&e<f)return 0;const n=t-e;return n*n<g*t*e?0:t<e?-1:1};class y{constructor(){this.tree=new a,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===d(e.key,n.key))return this.tree.remove(t),n.key;const i=this.tree.next(e);return null!==i&&0===d(e.key,i.key)?(this.tree.remove(t),i.key):t}}const _=new class{constructor(){this.reset()}reset(){this.xRounder=new y,this.yRounder=new y}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}},m=134217729;function v(t,e,n,i,r){let o,s,a,u,l=e[0],c=i[0],h=0,p=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=i[++p]);let f=0;if(h<t&&p<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=e[++h]):(s=c+o,a=o-(s-c),c=i[++p]),o=s,0!==a&&(r[f++]=a);h<t&&p<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++p]),o=s,0!==a&&(r[f++]=a);for(;h<t;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h],o=s,0!==a&&(r[f++]=a);for(;p<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++p],o=s,0!==a&&(r[f++]=a);return 0===o&&0!==f||(r[f++]=o),f}function x(t){return new Float64Array(t)}const E=x(4),b=x(8),I=x(12),w=x(16),N=x(4);const L=(t,e)=>t.x*e.y-t.y*e.x,S=(t,e)=>t.x*e.x+t.y*e.y,C=(t,e,n)=>{const i=function(t,e,n,i,r,o){const s=(e-o)*(n-r),a=(t-r)*(i-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,e,n,i,r,o,s){let a,u,l,c,h,p,f,g,d,y,_,x,L,S,C,P,M,T;const R=t-r,O=n-r,A=e-o,D=i-o;S=R*D,p=m*R,f=p-(p-R),g=R-f,p=m*D,d=p-(p-D),y=D-d,C=g*y-(S-f*d-g*d-f*y),P=A*O,p=m*A,f=p-(p-A),g=A-f,p=m*O,d=p-(p-O),y=O-d,M=g*y-(P-f*d-g*d-f*y),_=C-M,h=C-_,E[0]=C-(_+h)+(h-M),x=S+_,h=x-S,L=S-(x-h)+(_-h),_=L-P,h=L-_,E[1]=L-(_+h)+(h-P),T=x+_,h=T-x,E[2]=x-(T-h)+(_-h),E[3]=T;let F=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,E),k=22204460492503146e-32*s;if(F>=k||-F>=k)return F;if(h=t-R,a=t-(R+h)+(h-r),h=n-O,l=n-(O+h)+(h-r),h=e-A,u=e-(A+h)+(h-o),h=i-D,c=i-(D+h)+(h-o),0===a&&0===u&&0===l&&0===c)return F;if(k=11093356479670487e-47*s+33306690738754706e-32*Math.abs(F),F+=R*c+D*a-(A*l+O*u),F>=k||-F>=k)return F;S=a*D,p=m*a,f=p-(p-a),g=a-f,p=m*D,d=p-(p-D),y=D-d,C=g*y-(S-f*d-g*d-f*y),P=u*O,p=m*u,f=p-(p-u),g=u-f,p=m*O,d=p-(p-O),y=O-d,M=g*y-(P-f*d-g*d-f*y),_=C-M,h=C-_,N[0]=C-(_+h)+(h-M),x=S+_,h=x-S,L=S-(x-h)+(_-h),_=L-P,h=L-_,N[1]=L-(_+h)+(h-P),T=x+_,h=T-x,N[2]=x-(T-h)+(_-h),N[3]=T;const G=v(4,E,4,N,b);S=R*c,p=m*R,f=p-(p-R),g=R-f,p=m*c,d=p-(p-c),y=c-d,C=g*y-(S-f*d-g*d-f*y),P=A*l,p=m*A,f=p-(p-A),g=A-f,p=m*l,d=p-(p-l),y=l-d,M=g*y-(P-f*d-g*d-f*y),_=C-M,h=C-_,N[0]=C-(_+h)+(h-M),x=S+_,h=x-S,L=S-(x-h)+(_-h),_=L-P,h=L-_,N[1]=L-(_+h)+(h-P),T=x+_,h=T-x,N[2]=x-(T-h)+(_-h),N[3]=T;const B=v(G,b,4,N,I);S=a*c,p=m*a,f=p-(p-a),g=a-f,p=m*c,d=p-(p-c),y=c-d,C=g*y-(S-f*d-g*d-f*y),P=u*l,p=m*u,f=p-(p-u),g=u-f,p=m*l,d=p-(p-l),y=l-d,M=g*y-(P-f*d-g*d-f*y),_=C-M,h=C-_,N[0]=C-(_+h)+(h-M),x=S+_,h=x-S,L=S-(x-h)+(_-h),_=L-P,h=L-_,N[1]=L-(_+h)+(h-P),T=x+_,h=T-x,N[2]=x-(T-h)+(_-h),N[3]=T;const U=v(B,I,4,N,w);return w[U-1]}(t,e,n,i,r,o,l)}(t.x,t.y,e.x,e.y,n.x,n.y);return i>0?-1:i<0?1:0},P=t=>Math.sqrt(S(t,t)),M=(t,e,n)=>{const i={x:e.x-t.x,y:e.y-t.y},r={x:n.x-t.x,y:n.y-t.y};return L(r,i)/P(r)/P(i)},T=(t,e,n)=>{const i={x:e.x-t.x,y:e.y-t.y},r={x:n.x-t.x,y:n.y-t.y};return S(r,i)/P(r)/P(i)},R=(t,e,n)=>0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n},O=(t,e,n)=>0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)};class A{static compare(t,e){const n=A.comparePoints(t.point,e.point);return 0!==n?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:F.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(void 0===n.segment.consumedBy)for(let i=e+1;i<t;i++){const t=this.point.events[i];void 0===t.consumedBy&&n.otherSE.point.events===t.otherSE.point.events&&n.segment.consume(t.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}getLeftmostComparator(t){const e=new Map,n=n=>{const i=n.otherSE;e.set(n,{sine:M(this.point,t.point,i.point),cosine:T(this.point,t.point,i.point)})};return(t,i)=>{e.has(t)||n(t),e.has(i)||n(i);const{sine:r,cosine:o}=e.get(t),{sine:s,cosine:a}=e.get(i);return r>=0&&s>=0?o<a?1:o>a?-1:0:r<0&&s<0?o<a?-1:o>a?1:0:s<r?-1:s>r?1:0}}}let D=0;class F{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(r<i)return-1;const s=t.leftSE.point.y,a=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n<i){if(a<s&&a<u)return 1;if(a>s&&a>u)return-1;const n=t.comparePoint(e.leftSE.point);if(n<0)return 1;if(n>0)return-1;const i=e.comparePoint(t.rightSE.point);return 0!==i?i:-1}if(n>i){if(s<a&&s<l)return-1;if(s>a&&s>l)return 1;const n=e.comparePoint(t.leftSE.point);if(0!==n)return n;const i=t.comparePoint(e.rightSE.point);return i<0?1:i>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(r<o){const n=e.comparePoint(t.rightSE.point);if(0!==n)return n}if(r>o){const n=t.comparePoint(e.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(r!==o){const t=u-s,e=r-n,c=l-a,h=o-i;if(t>e&&c<h)return 1;if(t<e&&c>h)return-1}return r>o?1:r<o||u<l?-1:u>l?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++D,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,r,o;const s=A.comparePoints(t,e);if(s<0)i=t,r=e,o=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);i=e,r=t,o=-1}const a=new A(i,!0),u=new A(r,!1);return new F(a,u,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const r=(t.y-e.y)/i.y,o=e.x+r*i.x;if(t.x===o)return 0;const s=(t.x-e.x)/i.x,a=e.y+s*i.y;return t.y===a?0:t.y<a?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=p(e,n);if(null===i)return null;const r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,u=h(e,s)&&0===this.comparePoint(s),l=h(n,r)&&0===t.comparePoint(r),c=h(e,a)&&0===this.comparePoint(a),f=h(n,o)&&0===t.comparePoint(o);if(l&&u)return f&&!c?o:!f&&c?a:null;if(l)return c&&r.x===a.x&&r.y===a.y?null:r;if(u)return f&&o.x===s.x&&o.y===s.y?null:s;if(f&&c)return null;if(f)return o;if(c)return a;const g=((t,e,n,i)=>{if(0===e.x)return O(n,i,t.x);if(0===i.x)return O(t,e,n.x);if(0===e.y)return R(n,i,t.y);if(0===i.y)return R(t,e,n.y);const r=L(e,i);if(0==r)return null;const o={x:n.x-t.x,y:n.y-t.y},s=L(o,e)/r,a=L(o,i)/r;return{x:(t.x+a*e.x+(n.x+s*i.x))/2,y:(t.y+a*e.y+(n.y+s*i.y))/2}})(r,this.vector(),s,t.vector());return null===g?null:h(i,g)?_.round(g.x,g.y):null}split(t){const e=[],n=void 0!==t.events,i=new A(t,!0),r=new A(t,!1),o=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(i);const s=new F(i,o,this.rings.slice(),this.windings.slice());return A.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),A.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t<e;t++)this.windings[t]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=F.compare(e,n);if(0!==i){if(i>0){const t=e;e=n,n=t}if(e.prev===n){const t=e;e=n,n=t}for(let t=0,i=n.rings.length;t<i;t++){const i=n.rings[t],r=n.windings[t],o=e.rings.indexOf(i);-1===o?(e.rings.push(i),e.windings.push(r)):e.windings[o]+=r}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let t=0,i=this.rings.length;t<i;t++){const i=this.rings[t],r=this.windings[t],o=e.indexOf(i);-1===o?(e.push(i),n.push(r)):n[o]+=r}const r=[],o=[];for(let t=0,i=e.length;t<i;t++){if(0===n[t])continue;const i=e[t],s=i.poly;if(-1===o.indexOf(s))if(i.isExterior)r.push(s);else{-1===o.indexOf(s)&&o.push(s);const t=r.indexOf(i.poly);-1!==t&&r.splice(t,1)}}for(let t=0,e=r.length;t<e;t++){const e=r[t].multiPoly;-1===i.indexOf(e)&&i.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Y.type){case"union":{const n=0===t.length,i=0===e.length;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===Y.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2==1;break}case"difference":{const n=t=>1===t.length&&t[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${Y.type}`)}return this._isInResult}}class k{constructor(t,e,n){if(!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=_.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let r=i;for(let e=1,n=t.length;e<n;e++){if("number"!=typeof t[e][0]||"number"!=typeof t[e][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=_.round(t[e][0],t[e][1]);n.x===r.x&&n.y===r.y||(this.segments.push(F.fromRing(r,n,this)),n.x<this.bbox.ll.x&&(this.bbox.ll.x=n.x),n.y<this.bbox.ll.y&&(this.bbox.ll.y=n.y),n.x>this.bbox.ur.x&&(this.bbox.ur.x=n.x),n.y>this.bbox.ur.y&&(this.bbox.ur.y=n.y),r=n)}i.x===r.x&&i.y===r.y||this.segments.push(F.fromRing(r,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}class G{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new k(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let e=1,n=t.length;e<n;e++){const n=new k(t[e],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getSweepEvents();for(let e=0,i=n.length;e<i;e++)t.push(n[e])}return t}}class B{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let e=0,n=t.length;e<n;e++){const n=new G(t[e],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getSweepEvents();for(let e=0,i=n.length;e<i;e++)t.push(n[e])}return t}}class U{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];if(!i.isInResult()||i.ringOut)continue;let r=null,o=i.leftSE,s=i.rightSE;const a=[o],u=o.point,l=[];for(;r=o,o=s,a.push(o),o.point!==u;)for(;;){const t=o.getAvailableLinkedEvents();if(0===t.length){const t=a[0].point,e=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${t.x}, ${t.y}]. Last matching segment found ends at [${e.x}, ${e.y}].`)}if(1===t.length){s=t[0].otherSE;break}let n=null;for(let t=0,e=l.length;t<e;t++)if(l[t].point===o.point){n=t;break}if(null!==n){const t=l.splice(n)[0],i=a.splice(t.index);i.unshift(i[0].otherSE),e.push(new U(i.reverse()));continue}l.push({index:a.length,point:o.point});const i=o.getLeftmostComparator(r);s=t.sort(i)[0].otherSE;break}e.push(new U(a))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let n=1,i=this.events.length-1;n<i;n++){const i=this.events[n].point,r=this.events[n+1].point;0!==C(i,t,r)&&(e.push(i),t=i)}if(1===e.length)return null;const n=e[0],i=e[1];0===C(n,t,i)&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,a=[];for(let t=o;t!=s;t+=r)a.push([e[t].x,e[t].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let e=1,n=this.events.length;e<n;e++){const n=this.events[e];A.compare(t,n)>0&&(t=n)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class q{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}class z{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];if(!i.poly)if(i.isExteriorRing())e.push(new q(i));else{const t=i.enclosingRing();t.poly||e.push(new q(t)),t.poly.addInterior(i)}}return e}}class j{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.compare;this.queue=t,this.tree=new a(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r,o,s=i,a=i;for(;void 0===r;)s=this.tree.prev(s),null===s?r=null:void 0===s.key.consumedBy&&(r=s.key);for(;void 0===o;)a=this.tree.next(a),null===a?o=null:void 0===a.key.consumedBy&&(o=a.key);if(t.isLeft){let i=null;if(r){const t=r.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(i=t),!r.isAnEndpoint(t))){const e=this._splitSafely(r,t);for(let t=0,i=e.length;t<i;t++)n.push(e[t])}}let s=null;if(o){const t=o.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(s=t),!o.isAnEndpoint(t))){const e=this._splitSafely(o,t);for(let t=0,i=e.length;t<i;t++)n.push(e[t])}}if(null!==i||null!==s){let t=null;t=null===i?s:null===s||A.comparePoints(i,s)<=0?i:s,this.queue.remove(e.rightSE),n.push(e.rightSE);const r=e.split(t);for(let t=0,e=r.length;t<e;t++)n.push(r[t])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=r)}else{if(r&&o){const t=r.getIntersection(o);if(null!==t){if(!r.isAnEndpoint(t)){const e=this._splitSafely(r,t);for(let t=0,i=e.length;t<i;t++)n.push(e[t])}if(!o.isAnEndpoint(t)){const e=this._splitSafely(o,t);for(let t=0,i=e.length;t<i;t++)n.push(e[t])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),void 0===t.consumedBy&&this.tree.add(t),i}}const V="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,X="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Y=new class{run(t,e,n){Y.type=t,_.reset();const i=[new B(e,!0)];for(let t=0,e=n.length;t<e;t++)i.push(new B(n[t],!1));if(Y.numMultiPolys=i.length,"difference"===Y.type){const t=i[0];let e=1;for(;e<i.length;)null!==p(i[e].bbox,t.bbox)?e++:i.splice(e,1)}if("intersection"===Y.type)for(let t=0,e=i.length;t<e;t++){const e=i[t];for(let n=t+1,r=i.length;n<r;n++)if(null===p(e.bbox,i[n].bbox))return[]}const r=new a(A.compare);for(let t=0,e=i.length;t<e;t++){const e=i[t].getSweepEvents();for(let t=0,n=e.length;t<n;t++)if(r.insert(e[t]),r.size>V)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new j(r);let s=r.size,u=r.pop();for(;u;){const t=u.key;if(r.size===s){const e=t.segment;throw new Error(`Unable to pop() ${t.isLeft?"left":"right"} SweepEvent [${t.point.x}, ${t.point.y}] from segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] from queue.`)}if(r.size>V)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>X)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const e=o.process(t);for(let t=0,n=e.length;t<n;t++){const n=e[t];void 0===n.consumedBy&&r.insert(n)}s=r.size,u=r.pop()}_.reset();const l=U.factory(o.segments);return new z(l).getGeom()}};return{union:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Y.run("union",t,n)},intersection:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Y.run("intersection",t,n)},xor:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Y.run("xor",t,n)},difference:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Y.run("difference",t,n)}}}()},582:function(t){t.exports=function(){"use strict";function t(t,i,r,o,s){!function t(n,i,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,u=i-r+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);t(n,i,Math.max(r,Math.floor(i-u*c/a+h)),Math.min(o,Math.floor(i+(a-u)*c/a+h)),s)}var p=n[i],f=r,g=o;for(e(n,r,i),s(n[o],p)>0&&e(n,r,o);f<g;){for(e(n,f,g),f++,g--;s(n[f],p)<0;)f++;for(;s(n[g],p)>0;)g--}0===s(n[r],p)?e(n,r,g):e(n,++g,o),g<=i&&(r=g+1),i<=g&&(o=g-1)}}(t,i,r||0,o||t.length-1,s||n)}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,r){r||(r=g(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(r,t.leaf?i(s):s)}return r}function a(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(e,n,i,r,o){for(var s=[n,i];s.length;)if(!((i=s.pop())-(n=s.pop())<=r)){var a=n+Math.ceil((i-n)/r/2)*r;t(e,a,n,i,o),s.push(n,a,a,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var i=this.toBBox,r=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?i(s):s;f(t,a)&&(e.leaf?n.push(s):p(t,a)?this._all(s,n):r.push(s))}e=r.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var i=0;i<e.children.length;i++){var r=e.children[i],o=e.leaf?this.toBBox(r):r;if(f(t,o)){if(e.leaf||p(t,o))return!0;n.push(r)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=g([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,i,o,s=this.data,a=this.toBBox(t),u=[],l=[];s||u.length;){if(s||(s=u.pop(),i=u[u.length-1],n=l.pop(),o=!0),s.leaf){var c=r(t,s.children,e);if(-1!==c)return s.children.splice(c,1),u.push(s),this._condense(u),this}o||s.leaf||!p(s,a)?i?(n++,s=i.children[n],o=!1):s=null:(u.push(s),l.push(n),n=0,i=s,s=s.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,i){var r,s=n-e+1,a=this._maxEntries;if(s<=a)return o(r=g(t.slice(e,n+1)),this.toBBox),r;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(r=g([])).leaf=!1,r.height=i;var u=Math.ceil(s/a),l=u*Math.ceil(Math.sqrt(a));d(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var h=Math.min(c+l-1,n);d(t,c,h,u,this.compareMinY);for(var p=c;p<=h;p+=u){var f=Math.min(p+u-1,h);r.children.push(this._build(t,p,f,i-1))}}return o(r,this.toBBox),r},i.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var r=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var u=e.children[a],l=c(u),h=(p=t,f=u,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l);h<o?(o=h,r=l<r?l:r,s=u):h===o&&l<r&&(r=l,s=u)}e=s||e.children[0]}var p,f;return e},i.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(i,this.data,e,r);for(o.children.push(t),a(o,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)},i.prototype._split=function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),a=g(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},i.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var i,r,o,a,u,l,h,p=1/0,f=1/0,g=e;g<=n-e;g++){var d=s(t,0,g,this.toBBox),y=s(t,g,n,this.toBBox),_=(r=d,o=y,a=Math.max(r.minX,o.minX),u=Math.max(r.minY,o.minY),l=Math.min(r.maxX,o.maxX),h=Math.min(r.maxY,o.maxY),Math.max(0,l-a)*Math.max(0,h-u)),m=c(d)+c(y);_<p?(p=_,i=g,f=m<f?m:f):_===p&&m<f&&(f=m,i=g)}return i||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:u,r=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var r=this.toBBox,o=s(t,0,e,r),u=s(t,n-e,n,r),l=h(o)+h(u),c=e;c<n-e;c++){var p=t.children[c];a(o,t.leaf?r(p):p),l+=h(o)}for(var f=n-e-1;f>=e;f--){var g=t.children[f];a(u,t.leaf?r(g):g),l+=h(u)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()},675:function(t,e){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function i(t){this.message=t||""}function r(t){this.message=t||""}function o(){}function s(t){return null===t?At:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function l(t){return null===t?null:t.left}function c(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function p(){}function f(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function g(){}function d(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments&&parseInt(Number(arguments[1]),10)||0;i=i<0?Math.max(n+i,0):Math.min(i,n);var r=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(r=r<0?Math.max(n+arguments[2],0):Math.min(r,n);i<r;)e[i]=t,++i;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(){},m=(_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n},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(){},x={MAX_VALUE:{configurable:!0}},E=(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)},x.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(v,x),function(){}),b=function(){},I=function(){},w=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}},L=(w.prototype.setOrdinate=function(t,e){switch(t){case w.X:this.x=e;break;case w.Y:this.y=e;break;case w.Z:this.z=e;break;default:throw new m("Invalid ordinate index: "+t)}},w.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)}},w.prototype.getOrdinate=function(t){switch(t){case w.X:return this.x;case w.Y:return this.y;case w.Z:return this.z}throw new m("Invalid ordinate index: "+t)},w.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)},w.prototype.equals=function(t){return t instanceof w&&this.equals2D(t)},w.prototype.equalInZ=function(t,e){return _.equalsWithTolerance(this.z,t.z,e)},w.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},w.prototype.clone=function(){},w.prototype.copy=function(){return new w(this)},w.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},w.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},w.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},w.prototype.hashCode=function(){var t=17;return 37*(t=37*t+w.hashCode(this.x))+w.hashCode(this.y)},w.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},w.prototype.interfaces_=function(){return[E,b,e]},w.prototype.getClass=function(){return w},w.hashCode=function(){if(1===arguments.length){var t=v.doubleToLongBits(arguments[0]);return Math.trunc((t^t)>>>32)}},N.DimensionalComparator.get=function(){return L},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(w,N),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}}),S=(L.prototype.compare=function(t,e){var n=t,i=e,r=L.compare(n.x,i.x);if(0!==r)return r;var o=L.compare(n.y,i.y);return 0!==o?o:this._dimensionsToTest<=2?0:L.compare(n.z,i.z)},L.prototype.interfaces_=function(){return[I]},L.prototype.getClass=function(){return L},L.compare=function(t,e){return t<e?-1:t>e?1:v.isNaN(t)?v.isNaN(e)?0:-1:v.isNaN(e)?1:0},function(){}),C=(S.prototype.create=function(){},S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},function(){}),P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}},M=(C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C},C.toLocationSymbol=function(t){switch(t){case C.EXTERIOR:return"e";case C.BOUNDARY:return"b";case C.INTERIOR:return"i";case C.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(C,P),function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}),T=function(){},R={LOG_10:{configurable:!0}},O=(T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return v.isInfinite(e)||v.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,i){var r=t;return e<r&&(r=e),n<r&&(r=n),i<r&&(r=i),r},T.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 i=arguments[0],r=arguments[1],o=arguments[2];return i<r?r:i>o?o:i}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var i=arguments[1],r=arguments[2],o=arguments[3],s=arguments[0];return i>s&&(s=i),r>s&&(s=r),o>s&&(s=o),s}},T.average=function(t,e){return(t+e)/2},R.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,R),function(t){this.str=t}),A=(O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str},function(t){this.value=t}),D=(A.prototype.intValue=function(){return this.value},A.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},A.isNaN=function(t){return Number.isNaN(t)},function(){}),F=(D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()},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"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}}),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}},G=(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(),i=F.magnitude(n._hi),r=F.TEN.pow(i);(n=n.divide(r)).gt(F.TEN)?(n=n.divide(F.TEN),i+=1):n.lt(F.ONE)&&(n=n.multiply(F.TEN),i-=1);for(var o=i+1,s=new O,a=F.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(F.valueOf(l)).multiply(F.TEN),c&&n.selfAdd(F.TEN);var p=!0,f=F.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=i,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,i,r,o,s=arguments[0],a=arguments[1],u=null,l=null,c=null,h=null;return r=this._hi/s,h=(u=(c=F.SPLIT*r)-(u=c-r))*(l=(h=F.SPLIT*s)-(l=h-s))-(o=r*s)+u*(i=s-l)+(n=r-u)*l+n*i,h=r+(c=(this._hi-o-h+this._lo-r*a)/s),this._hi=h,this._lo=r-h+c,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){var t,e,n,i,r=arguments[0],o=null,s=null,a=null,u=null;return t=(n=this._hi/r._hi)-(o=(a=F.SPLIT*n)-(o=a-n)),u=o*(s=(u=F.SPLIT*r._hi)-(s=u-r._hi))-(i=n*r._hi)+o*(e=r._hi-s)+t*s+t*e,a=(this._hi-i-u+this._lo-n*r._lo)/r._hi,new F(u=n+a,n-u+a)}if("number"==typeof arguments[0]){var l=arguments[0];return v.isNaN(l)?F.createNaN():F.copy(this).selfDivide(l,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),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(e),(i/=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),i=this.subtract(n.sqr())._hi*(.5*t);return n.add(i)},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,n,i,r,o,s=arguments[0],a=null;return a=(i=this._hi+s)-(r=i-this._hi),n=(o=(a=s-r+(this._hi-a))+this._lo)+(i-(e=i+o)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var u,l,c,h,p=arguments[0],f=arguments[1],g=null,d=null,y=null;c=this._hi+p,l=this._lo+f,d=c-(y=c-this._hi),g=l-(h=l-this._lo);var _=(u=c+(y=(d=p-y+(this._hi-d))+l))+(y=(g=f-h+(this._lo-g))+(y+(c-u))),m=y+(u-_);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,i,r=arguments[0],o=arguments[1],s=null,a=null,u=null,l=null;s=(u=F.SPLIT*this._hi)-this._hi,l=F.SPLIT*r,s=u-s,n=this._hi-s,a=l-r;var c=(u=this._hi*r)+(l=s*(a=l-a)-u+s*(i=r-a)+n*a+n*i+(this._hi*o+this._lo*r)),h=l+(s=u-c);return this._hi=c,this._lo=h,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),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(i<0)r="0."+F.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length;r=n+F.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+r:r},F.prototype.reciprocal=function(){var t,e,n,i,r=null,o=null,s=null,a=null;t=(n=1/this._hi)-(r=(s=F.SPLIT*n)-(r=s-n)),o=(a=F.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(i=n*this._hi)-(a=r*(o=a-o)-i+r*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new F(u,n-u+s)},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),i=F.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var o=n.charAt(0)+"."+r;return this.isNegative()?"-"+o+i:o+i},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],i=arguments[1];this._hi=n,this._lo=i}},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,b]},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])return new F(arguments[0])},F.sqrt=function(t){return F.valueOf(t).sqrt()},F.parse=function(t){for(var e=0,n=t.length;D.isWhitespace(t.charAt(e));)e++;var i=!1;if(e<n){var r=t.charAt(e);"-"!==r&&"+"!==r||(e++,"-"===r&&(i=!0))}for(var o=new F,s=0,a=0,u=0;!(e>=n);){var l=t.charAt(e);if(e++,D.isDigit(l)){var c=l-"0";o.selfMultiply(F.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){var h=t.substring(e);try{u=A.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=s}}var p=o,f=s-a-u;if(0===f)p=o;else if(f>0){var g=F.TEN.pow(f);p=o.divide(g)}else if(f<0){var d=F.TEN.pow(-f);p=o.multiply(d)}return i?p.negate():p},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),i=Math.trunc(Math.floor(n));return 10*Math.pow(10,i)<=e&&(i+=1),i},F.stringOfChar=function(t,e){for(var n=new O,i=0;i<e;i++)n.append(t);return n.toString()},k.PI.get=function(){return new F(3.141592653589793,12246467991473532e-32)},k.TWO_PI.get=function(){return new F(6.283185307179586,24492935982947064e-32)},k.PI_2.get=function(){return new F(1.5707963267948966,6123233995736766e-32)},k.E.get=function(){return new F(2.718281828459045,14456468917292502e-32)},k.NaN.get=function(){return new F(v.NaN,v.NaN)},k.EPS.get=function(){return 123259516440783e-46},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),function(){}),B={DP_SAFE_EPSILON:{configurable:!0}},U=(G.prototype.interfaces_=function(){return[]},G.prototype.getClass=function(){return G},G.orientationIndex=function(t,e,n){var i=G.orientationIndexFilter(t,e,n);if(i<=1)return i;var r=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 r.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},G.signOfDet2x2=function(t,e,n,i){return t.multiply(i).selfSubtract(e.multiply(n)).signum()},G.intersection=function(t,e,n,i){var r=F.valueOf(i.y).selfSubtract(n.y).selfMultiply(F.valueOf(e.x).selfSubtract(t.x)),o=F.valueOf(i.x).selfSubtract(n.x).selfMultiply(F.valueOf(e.y).selfSubtract(t.y)),s=r.subtract(o),a=F.valueOf(i.x).selfSubtract(n.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),u=F.valueOf(i.y).selfSubtract(n.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),l=a.subtract(u).selfDivide(s).doubleValue(),c=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).doubleValue(),h=F.valueOf(e.x).selfSubtract(t.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),p=F.valueOf(e.y).selfSubtract(t.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(p).selfDivide(s).doubleValue(),g=F.valueOf(n.y).selfAdd(F.valueOf(i.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new w(c,g)},G.orientationIndexFilter=function(t,e,n){var i=null,r=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=r-o;if(r>0){if(o<=0)return G.signum(s);i=r+o}else{if(!(r<0))return G.signum(s);if(o>=0)return G.signum(s);i=-r-o}var a=G.DP_SAFE_EPSILON*i;return s>=a||-s>=a?G.signum(s):2},G.signum=function(t){return t>0?1:t<0?-1:0},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(G,B),function(){}),q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}},z=(q.X.get=function(){return 0},q.Y.get=function(){return 1},q.Z.get=function(){return 2},q.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[b]},U.prototype.getClass=function(){return U},Object.defineProperties(U,q),function(){}),j=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}(z),V=function(){},X=(V.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;s<e+r;s++)n[i+o]=t[s],o++},V.getProperty=function(t){return{"line.separator":"\n"}[t]},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],i=arguments[1];this.x=n,this.y=i,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var r=arguments[0],o=arguments[1];this.x=r.y*o.w-o.y*r.w,this.y=o.x*r.w-r.x*o.w,this.w=r.x*o.y-o.x*r.y}else if(arguments[0]instanceof w&&arguments[1]instanceof w){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],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}else if(4===arguments.length){var h=arguments[0],p=arguments[1],f=arguments[2],g=arguments[3],d=h.y-p.y,y=p.x-h.x,_=h.x*p.y-p.x*h.y,m=f.y-g.y,v=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-v*_,this.y=m*_-d*x,this.w=d*v-m*y}}),Y=(X.prototype.getY=function(){var t=this.y/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;return t},X.prototype.getX=function(){var t=this.x/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;return t},X.prototype.getCoordinate=function(){var t=new w;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,i){var r=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-i.y,u=i.x-n.x,l=n.x*i.y-i.x*n.y,c=r*u-a*o,h=(o*l-u*s)/c,p=(a*s-r*l)/c;if(v.isNaN(h)||v.isInfinite(h)||v.isNaN(p)||v.isInfinite(p))throw new j;return new w(h,p)},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 w){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 i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.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}},W=(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,i=this._maxx<t._maxx?this._maxx:t._maxx,r=this._maxy<t._maxy?this._maxy:t._maxy;return new Y(e,i,n,r)},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 w){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],i=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&i>=this._miny&&i<=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 w){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||i>this._maxy||i<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 w){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],i=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=i,this._maxy=i):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),i<this._miny&&(this._miny=i),i>this._maxy&&(this._maxy=i))}},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){if(this.isNull())return null;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 w){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},Y.prototype.centre=function(){return this.isNull()?null:new w((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 w){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],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];r<o?(this._minx=r,this._maxx=o):(this._minx=o,this._maxx=r),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 37*(t=37*(t=37*(t=37*t+w.hashCode(this._minx))+w.hashCode(this._maxx))+w.hashCode(this._miny))+w.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 i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(i.x,r.x),c=Math.max(i.x,r.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(i.y,r.y),c=Math.max(i.y,r.y),l>u||c<a))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Y,H),{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*$/}),J=function(t){this.geometryFactory=t||new _e},K=(J.prototype.read=function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var r=W.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((r=W.emptyTypeStr.exec(t))[2]=void 0),r&&(n=r[1].toLowerCase(),i=r[2],Z[n]&&(e=Z[n].apply(this,[i]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},J.prototype.write=function(t){return this.extractGeometry(t)},J.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!K[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+K[e].apply(this,[t])+")"},{coordinate:function(t){return t.x+" "+t.y},point:function(t){return K.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+K.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,i=t._points._coordinates.length;n<i;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,i=t._points._coordinates.length;n<i;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+K.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+K.linestring.apply(this,[t._shell])+")");for(var n=0,i=t._holes.length;n<i;++n)e.push("("+K.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push("("+K.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,i=t._geometries.length;n<i;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}}),Z={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(W.spaces);return this.geometryFactory.createPoint(new w(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(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(W.trimParens,"$1"),i.push(Z.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(i)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(W.spaces),i.push(new w(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;r<o;++r)e=n[r].trim().split(W.spaces),i.push(new w(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(W.parenComma),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(W.trimParens,"$1"),i.push(Z.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(i)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,i,r,o=t.trim().split(W.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(W.trimParens,"$1"),n=Z.linestring.apply(this,[e]),i=this.geometryFactory.createLinearRing(n._points),0===a?r=i:s.push(i);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(W.doubleParenComma),i=[],r=0,o=n.length;r<o;++r)e=n[r].replace(W.trimParens,"$1"),i.push(Z.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(i)},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=[],i=0,r=e.length;i<r;++i)n.push(this.read(e[i]));return this.geometryFactory.createGeometryCollection(n)}},$=function(t){this.parser=new J(t)},Q=($.prototype.write=function(t){return this.parser.write(t)},$.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"},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}(Q),et=function(){},nt=(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;if(1===arguments.length)et.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new tt:new tt(t)},et.equals=function(){var t,e,n;if(2===arguments.length)et.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))},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 w,this._intPt[1]=new w,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0}),it={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}},rt=(nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;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,i){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=i,this._result=this.computeIntersect(t,e,n,i)},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 $.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+$.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 i=Math.abs(n.x-e.x),r=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=i>r?i:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=i>r?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 i=t.x-e.x,r=t.y-e.y,o=Math.sqrt(i*i+r*r);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},it.DONT_INTERSECT.get=function(){return 0},it.DO_INTERSECT.get=function(){return 1},it.COLLINEAR.get=function(){return 2},it.NO_INTERSECTION.get=function(){return 0},it.POINT_INTERSECTION.get=function(){return 1},it.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,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],i=arguments[2];if(this._isProper=!1,Y.intersects(n,i,e)&&0===at.orientationIndex(n,i,e)&&0===at.orientationIndex(i,n,e))return this._isProper=!0,(e.equals(n)||e.equals(i))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},e.prototype.safeHCoordinateIntersection=function(t,n,i,r){var o=null;try{o=X.intersection(t,n,i,r)}catch(s){if(!(s instanceof j))throw s;o=e.nearestEndpoint(t,n,i,r)}return o},e.prototype.intersection=function(t,n,i,r){var o=this.intersectionWithNormalization(t,n,i,r);return this.isInSegmentEnvelopes(o)||(o=new w(e.nearestEndpoint(t,n,i,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,i){var r=t,o=Math.abs(r);return Math.abs(e)<o&&(r=e,o=Math.abs(e)),Math.abs(n)<o&&(r=n,o=Math.abs(n)),Math.abs(i)<o&&(r=i),r},e.prototype.checkDD=function(t,e,n,i,r){var o=G.intersection(t,e,n,i),s=this.isInSegmentEnvelopes(o);V.out.println("DD in env = "+s+" --------------------- "+o),r.distance(o)>1e-4&&V.out.println("Distance = "+r.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,i){var r=new w(t),o=new w(e),s=new w(n),a=new w(i),u=new w;this.normalizeToEnvCentre(r,o,s,a,u);var l=this.safeHCoordinateIntersection(r,o,s,a);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,i,r){var o=Y.intersects(e,n,i),s=Y.intersects(e,n,r),a=Y.intersects(i,r,e),u=Y.intersects(i,r,n);return o&&s?(this._intPt[0]=i,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,i,r){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,l=n.x<i.x?n.x:i.x,c=n.y<i.y?n.y:i.y,h=n.x>i.x?n.x:i.x,p=n.y>i.y?n.y:i.y,f=((o>l?o:l)+(a<h?a:h))/2,g=((s>c?s:c)+(u<p?u:p))/2;r.x=f,r.y=g,t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},e.prototype.computeIntersect=function(e,n,i,r){if(this._isProper=!1,!Y.intersects(e,n,i,r))return t.NO_INTERSECTION;var o=at.orientationIndex(e,n,i),s=at.orientationIndex(e,n,r);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(i,r,e),u=at.orientationIndex(i,r,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,i,r):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(i)||e.equals2D(r)?this._intPt[0]=e:n.equals2D(i)||n.equals2D(r)?this._intPt[0]=n:0===o?this._intPt[0]=new w(i):0===s?this._intPt[0]=new w(r):0===a?this._intPt[0]=new w(e):0===u&&(this._intPt[0]=new w(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,i,r)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,i){var r=t,o=at.distancePointLine(t,n,i),s=at.distancePointLine(e,n,i);return s<o&&(o=s,r=e),(s=at.distancePointLine(n,t,e))<o&&(o=s,r=n),(s=at.distancePointLine(i,t,e))<o&&(o=s,r=i),r},e}(nt)),ot=function(){},st=(ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ot.signOfDet2x2(i,r,o,s)},ot.signOfDet2x2=function(t,e,n,i){var r=null,o=null,s=null;if(r=1,0===t||0===i)return 0===e||0===n?0:e>0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(e>0?i>0?e<=i||(r=-r,o=t,t=n,n=o,o=e,e=i,i=o):e<=-i?(r=-r,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):i>0?-e<=i?(r=-r,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),t>0){if(!(n>0))return r;if(!(t<=n))return r}else{if(n>0)return-r;if(!(t>=n))return-r;r=-r,t=-t,n=-n}for(;;){if((i-=(s=Math.floor(n/t))*e)<0)return-r;if(i>e)return r;if(t>(n-=s*t)+n){if(e<i+i)return r}else{if(e>i+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n)return r;if((e-=(s=Math.floor(t/n))*i)<0)return r;if(e>i)return-r;if(n>(t-=s*n)+t){if(i<e+e)return-r}else{if(i>e+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}),at=(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,i=e.x;return n>i&&(n=e.x,i=t.x),this._p.x>=n&&this._p.x<=i&&(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 r=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(r,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()!==C.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?C.BOUNDARY:this._crossingCount%2==1?C.INTERIOR:C.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 w&&M(arguments[1],U)){for(var t=arguments[1],e=new st(arguments[0]),n=new w,i=new w,r=1;r<t.size();r++)if(t.getCoordinate(r,n),t.getCoordinate(r-1,i),e.countSegment(n,i),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof w&&arguments[1]instanceof Array){for(var o=arguments[1],s=new st(arguments[0]),a=1;a<o.length;a++){var u=o[a],l=o[a-1];if(s.countSegment(u,l),s.isOnSegment())return s.getLocation()}return s.getLocation()}},function(){}),ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}},lt=(at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return G.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,i=1;i<t.length-1;i++){var r=t[i].x-n,o=t[i+1].y;e+=r*(t[i-1].y-o)}return e/2}if(M(arguments[0],U)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new w,l=new w,c=new w;s.getCoordinate(0,l),s.getCoordinate(1,c);var h=l.x;c.x-=h;for(var p=0,f=1;f<a-1;f++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(f+1,c),c.x-=h,p+=l.x*(u.y-c.y);return p/2}},at.distanceLineLine=function(t,e,n,i){if(t.equals(e))return at.distancePointLine(t,n,i);if(n.equals(i))return at.distancePointLine(i,t,e);var r=!1;if(Y.intersects(t,e,n,i)){var o=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(0===o)r=!0;else{var s=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.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)&&(r=!0)}}else r=!0;return r?T.min(at.distancePointLine(t,n,i),at.distancePointLine(e,n,i),at.distancePointLine(n,t,e),at.distancePointLine(i,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==C.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new w;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;s<e;s++){t.getCoordinate(s,i);var a=i.x,u=i.y,l=a-r,c=u-o;n+=Math.sqrt(l*l+c*c),r=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],i=0,r=1;r<=e;r++){var o=t[r];o.y>n.y&&(n=o,i=r)}var s=i;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==i);var a=i;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==i);var u=t[s],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=at.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(r)*Math.sqrt(i)},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]),i=0;i<e.length-1;i++){var r=at.distancePointLine(t,e[i],e[i+1]);r<n&&(n=r)}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),l=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(l<=0)return o.distance(s);if(l>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(c)*Math.sqrt(u)}},at.isOnLine=function(t,e){for(var n=new rt,i=1;i<e.length;i++){var r=e[i-1],o=e[i];if(n.computeIntersection(t,r,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),function(){}),ct=(lt.prototype.filter=function(t){},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return 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()}),ht={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}},pt=(ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.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],i=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,i)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new m("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Y(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.prototype.compare=function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var r=n.next(),o=i.next(),s=r.compareTo(o);if(0!==s)return s}return n.hasNext()?1:i.hasNext()?-1:0},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[b,E,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},ht.serialVersionUID.get=function(){return 0x799ea46522854c00},ht.SORTINDEX_POINT.get=function(){return 0},ht.SORTINDEX_MULTIPOINT.get=function(){return 1},ht.SORTINDEX_LINESTRING.get=function(){return 2},ht.SORTINDEX_LINEARRING.get=function(){return 3},ht.SORTINDEX_MULTILINESTRING.get=function(){return 4},ht.SORTINDEX_POLYGON.get=function(){return 5},ht.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ht.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ht.geometryChangedFilter.get=function(){return pt},Object.defineProperties(ct,ht),function(){}),ft=(pt.interfaces_=function(){return[lt]},pt.filter=function(t){t.geometryChangedAction()},function(){}),gt=(ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},function(){}),dt={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}},yt=(gt.prototype.isInBoundary=function(t){},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},dt.Mod2BoundaryNodeRule.get=function(){return yt},dt.EndPointBoundaryNodeRule.get=function(){return _t},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return mt},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return vt},dt.MOD2_BOUNDARY_RULE.get=function(){return new yt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return gt.MOD2_BOUNDARY_RULE},Object.defineProperties(gt,dt),function(){}),_t=(yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[gt]},yt.prototype.getClass=function(){return yt},function(){}),mt=(_t.prototype.isInBoundary=function(t){return t>0},_t.prototype.interfaces_=function(){return[gt]},_t.prototype.getClass=function(){return _t},function(){}),vt=(mt.prototype.isInBoundary=function(t){return t>1},mt.prototype.interfaces_=function(){return[gt]},mt.prototype.getClass=function(){return mt},function(){}),xt=(vt.prototype.isInBoundary=function(t){return 1===t},vt.prototype.interfaces_=function(){return[gt]},vt.prototype.getClass=function(){return vt},function(){}),Et=(xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException",function(){}),bt=(Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){},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}(xt)),It=((i.prototype=new Error).name="NoSuchElementException",function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&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,xt]},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 wt(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,i=this.array_.length;n<i;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(bt)),wt=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 i;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],i=arguments[1];this.ensureCapacity(n.length),this.add(n,i)}}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[1],n=!1,i=arguments[0].iterator();i.hasNext();)this.add(i.next(),e),n=!0;return n}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],i=arguments[1];return this.add(n,i,!0),!0}if(arguments[0]instanceof w&&"boolean"==typeof arguments[1]){var r=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(r))return null;t.prototype.add.call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var l=0;l<a.length;l++)this.add(a[l],u);else for(var c=a.length-1;c>=0;c--)this.add(a[c],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof w){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(h<f&&this.get(h).equals2D(p))return null}}t.prototype.add.call(this,h,p)}}else if(4===arguments.length){var g=arguments[0],d=arguments[1],y=arguments[2],_=arguments[3],m=1;y>_&&(m=-1);for(var v=y;v!==_;v+=m)this.add(g[v],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new w(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(It),Lt=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}},Ct=(St.ForwardComparator.get=function(){return Ct},St.BidirectionalComparator.get=function(){return Pt},St.coordArrayType.get=function(){return new Array(0).fill(null)},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Lt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(Lt.indexOf(i,e)<0)return i}return null},Lt.scroll=function(t,e){var n=Lt.indexOf(e,t);if(n<0)return null;var i=new Array(t.length).fill(null);V.arraycopy(t,n,i,0,t.length-n),V.arraycopy(t,0,i,t.length-n,n),V.arraycopy(i,0,t,0,t.length)},Lt.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 i=arguments[0],r=arguments[1],o=arguments[2];if(i===r)return!0;if(null===i||null===r)return!1;if(i.length!==r.length)return!1;for(var s=0;s<i.length;s++)if(0!==o.compare(i[s],r[s]))return!1;return!0}},Lt.intersection=function(t,e){for(var n=new Nt,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},Lt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Lt.removeRepeatedPoints=function(t){return Lt.hasRepeatedPoints(t)?new Nt(t,!1).toCoordinateArray():t},Lt.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;i<=n;i++){var r=t[i];t[i]=t[e-i],t[e-i]=r}},Lt.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var i=new Array(e).fill(null);if(0===e)return i;for(var r=0,o=0;o<t.length;o++)null!==t[o]&&(i[r++]=t[o]);return i},Lt.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 w(t[n]);return e}if(5===arguments.length)for(var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new w(i[r+u])},Lt.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=e[t.length-n-1];if(0!==i.compareTo(r))return!1}return!0},Lt.envelope=function(t){for(var e=new Y,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Lt.toCoordinateArray=function(t){return t.toArray(Lt.coordArrayType)},Lt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Lt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Lt.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(0!==i)return i}return 1},Lt.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(0!==i)return i;n++}return n<e.length?-1:n<t.length?1:0},Lt.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},Lt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var i=(n=T.clamp(n,-1,t.length))-e+1;n<0&&(i=0),e>=t.length&&(i=0),n<e&&(i=0);var r=new Array(i).fill(null);if(0===i)return r;for(var o=0,s=e;s<=n;s++)r[o++]=t[s];return r},Object.defineProperties(Lt,St),function(){}),Pt=(Ct.prototype.compare=function(t,e){return Lt.compare(t,e)},Ct.prototype.interfaces_=function(){return[I]},Ct.prototype.getClass=function(){return Ct},function(){}),Mt=(Pt.prototype.compare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;var r=Lt.compare(n,i);return Lt.isEqualReversed(n,i)?0:r},Pt.prototype.OLDcompare=function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;for(var r=Lt.increasingDirection(n),o=Lt.increasingDirection(i),s=r>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(i[a]);if(0!==l)return l;s+=r,a+=o}return 0},Pt.prototype.interfaces_=function(){return[I]},Pt.prototype.getClass=function(){return Pt},function(){}),Tt=(Mt.prototype.get=function(){},Mt.prototype.put=function(){},Mt.prototype.size=function(){},Mt.prototype.values=function(){},Mt.prototype.entrySet=function(){},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}(Mt)),Rt=((r.prototype=new Error).name="OperationNotSupported",(o.prototype=new xt).contains=function(){},function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&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 Ot(this)},e}(o)),Ot=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 i;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new r},e}(Et),At=0,Dt=((h.prototype=new Tt).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},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:At,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do{if(n=r,(i=t.compareTo(r.key))<0)r=r.left;else{if(!(i>0)){var o=r.value;return r.value=e,o}r=r.right}}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:n,color:At,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===l(a(a(t)))){var e=c(a(a(t)));1===s(e)?(u(a(t),At),u(e,At),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),At),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=l(a(a(t)));1===s(n)?(u(a(t),At),u(n,At),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),At),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=At},h.prototype.values=function(){var t=new It,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new Rt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.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}},h.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}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.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,i=t;null!==n&&i===n.right;)i=n,n=n.parent;return n},h.prototype.size=function(){return this.size_},function(){}),Ft=(Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},p.prototype=new o,(f.prototype=new p).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 r},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)},function(t){this.treeSet_=t,this.position_=0}),kt=(Ft.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new i;return this.treeSet_.array_[this.position_++]},Ft.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ft.prototype.remove=function(){throw new r},function(){}),Gt=(kt.sort=function(){var t,e,n,i,r=arguments[0];if(1===arguments.length)i=function(t,e){return t.compareTo(e)},r.sort(i);else if(2===arguments.length)n=arguments[1],i=function(t,e){return n.compare(t,e)},r.sort(i);else if(3===arguments.length){(e=r.slice(arguments[1],arguments[2])).sort();var o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length));for(r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t])}else if(4===arguments.length)for(e=r.slice(arguments[1],arguments[2]),n=arguments[3],i=function(t,e){return n.compare(t,e)},e.sort(i),o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length)),r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t])},kt.asList=function(t){for(var e=new It,n=0,i=t.length;n<i;n++)e.add(t[n]);return e},function(){}),Bt={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}},Ut=(Bt.P.get=function(){return 0},Bt.L.get=function(){return 1},Bt.A.get=function(){return 2},Bt.FALSE.get=function(){return-1},Bt.TRUE.get=function(){return-2},Bt.DONTCARE.get=function(){return-3},Bt.SYM_FALSE.get=function(){return"F"},Bt.SYM_TRUE.get=function(){return"T"},Bt.SYM_DONTCARE.get=function(){return"*"},Bt.SYM_P.get=function(){return"0"},Bt.SYM_L.get=function(){return"1"},Bt.SYM_A.get=function(){return"2"},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.toDimensionSymbol=function(t){switch(t){case Gt.FALSE:return Gt.SYM_FALSE;case Gt.TRUE:return Gt.SYM_TRUE;case Gt.DONTCARE:return Gt.SYM_DONTCARE;case Gt.P:return Gt.SYM_P;case Gt.L:return Gt.SYM_L;case Gt.A:return Gt.SYM_A}throw new m("Unknown dimension value: "+t)},Gt.toDimensionValue=function(t){switch(D.toUpperCase(t)){case Gt.SYM_FALSE:return Gt.FALSE;case Gt.SYM_TRUE:return Gt.TRUE;case Gt.SYM_DONTCARE:return Gt.DONTCARE;case Gt.SYM_P:return Gt.P;case Gt.SYM_L:return Gt.L;case Gt.SYM_A:return Gt.A}throw new m("Unknown dimension symbol: "+t)},Object.defineProperties(Gt,Bt),function(){}),qt=(Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},function(){}),zt=(qt.prototype.filter=function(t,e){},qt.prototype.isDone=function(){},qt.prototype.isGeometryChanged=function(){},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return 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 i=this._geometries[n].getCoordinates(),r=0;r<i.length;r++)t[++e]=i[r];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 i=e;if(this._geometries.length!==i._geometries.length)return!1;for(var r=0;r<this._geometries.length;r++)if(!this._geometries[r].equalsExact(i._geometries[r],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=Gt.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=Gt.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 i=arguments[1],r=arguments[0],o=this.getNumGeometries(),s=r.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),l=r.getGeometryN(a),c=u.compareToSameClass(l,i);if(0!==c)return c;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(M(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(M(arguments[0],qt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var i=0;i<this._geometries.length&&(this._geometries[i].apply(n),!n.isDone());i++);n.isGeometryChanged()&&this.geometryChanged()}else if(M(arguments[0],Ut)){var r=arguments[0];r.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(r)}else if(M(arguments[0],lt)){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}(ct)),jt=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 ct.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()?Gt.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 Vt(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[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(zt),Vt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=gt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i}},Xt=(Vt.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)},Vt.prototype.getBoundary=function(){return this._geom instanceof Jt?this.boundaryLineString(this._geom):this._geom instanceof jt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Vt.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()])},Vt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Vt.prototype.computeBoundaryCoordinates=function(t){var e=new It;this._endpointMap=new h;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);0!==i.getNumPoints()&&(this.addEndpoint(i.getCoordinateN(0)),this.addEndpoint(i.getCoordinateN(i.getNumPoints()-1)))}for(var r=this._endpointMap.entrySet().iterator();r.hasNext();){var o=r.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return Lt.toCoordinateArray(e)},Vt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.getBoundary=function(){return 1===arguments.length?new Vt(arguments[0]).getBoundary():2===arguments.length?new Vt(arguments[0],arguments[1]).getBoundary():void 0},function(){this.count=null}),Yt=(Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},function(){}),Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}},Wt=(Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;i<e;i++)n[i]=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 i=arguments[0],r=arguments[1],o="",s=new function(){}(new function(){}(Yt.getStackTrace(i))),a=0;a<r;a++)try{o+=s.readLine()+Yt.NEWLINE}catch(t){if(!(t instanceof g))throw t;et.shouldNeverReachHere()}return o}},Yt.split=function(t,e){for(var n=e.length,i=new It,r=""+t,o=r.indexOf(e);o>=0;){var s=r.substring(0,o);i.add(s),o=(r=r.substring(o+n)).indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),u=0;u<a.length;u++)a[u]=i.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 V.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Yt,Ht),function(){}),Jt=(Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.copyCoord=function(t,e,n,i){for(var r=Math.min(t.getDimension(),n.getDimension()),o=0;o<r;o++)n.setOrdinate(i,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 i=Math.min(t.getDimension(),e.getDimension()),r=0;r<n;r++)for(var o=0;o<i;o++){var s=t.getOrdinate(r,o),a=e.getOrdinate(r,o);if(!(t.getOrdinate(r,o)===e.getOrdinate(r,o)||v.isNaN(s)&&v.isNaN(a)))return!1}return!0},Wt.extend=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();if(Wt.copy(e,0,i,0,r),r>0)for(var o=r;o<n;o++)Wt.copy(e,r-1,i,o,1);return i},Wt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;i<=n;i++)Wt.swap(t,i,e-i)},Wt.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var r=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,r)}},Wt.copy=function(t,e,n,i,r){for(var o=0;o<r;o++)Wt.copyCoord(t,e+o,n,i+o)},Wt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),i=new O;i.append("(");for(var r=0;r<e;r++){r>0&&i.append(" ");for(var o=0;o<n;o++)o>0&&i.append(","),i.append(Yt.toString(t.getOrdinate(r,o)))}return i.append(")"),i.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 i=t.create(n,e.getDimension()),r=e.size();Wt.copy(e,0,i,0,r);for(var o=r;o<n;o++)Wt.copy(e,0,i,o,1);return i},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 i=e;if(this._points.size()!==i._points.size())return!1;for(var r=0;r<this._points.size();r++)if(!this.equal(this._points.getCoordinate(r),i._points.getCoordinate(r),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()?Gt.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 i=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==i)return i;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var r=arguments[0];return arguments[1].compare(this._points,r._points)}},e.prototype.apply=function(){if(M(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(M(arguments[0],qt)){var n=arguments[0];if(0===this._points.size())return null;for(var i=0;i<this._points.size()&&(n.filter(this._points,i),!n.isDone());i++);n.isGeometryChanged()&&this.geometryChanged()}else(M(arguments[0],Ut)||M(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Vt(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[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(ct)),Kt=function(){},Zt=(Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return 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 Gt.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(M(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(M(arguments[0],qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(M(arguments[0],Ut)||M(arguments[0],lt))&&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[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(ct)),$t=function(){},Qt=($t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},function(t){function e(e,n,i){if(t.call(this,i),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(),i=0;i<n.length;i++)t[++e]=n[i];for(var r=0;r<this._holes.length;r++)for(var o=this._holes[r].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 i=t.getX(n);if(i!==e.getMinX()&&i!==e.getMaxX())return!1;var r=t.getY(n);if(r!==e.getMinY()&&r!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),l=t.getY(a);if(u!==o==(l!==s))return!1;o=u,s=l}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=e,r=this._shell,o=i._shell;if(!r.equalsExact(o,n))return!1;if(this._holes.length!==i._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(i._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 i=new Array(e.getCoordinates().length-1).fill(null);V.arraycopy(e.getCoordinates(),0,i,0,i.length);var r=Lt.minCoordinate(e.getCoordinates());Lt.scroll(i,r),V.arraycopy(i,0,e.getCoordinates(),0,i.length),e.getCoordinates()[i.length]=i[0],at.isCCW(e.getCoordinates())===n&&Lt.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 i=arguments[1],r=arguments[0],o=this._shell,s=r._shell,a=o.compareToSameClass(s,i);if(0!==a)return a;for(var u=this.getNumInteriorRing(),l=r.getNumInteriorRing(),c=0;c<u&&c<l;){var h=this.getInteriorRingN(c),p=r.getInteriorRingN(c),f=h.compareToSameClass(p,i);if(0!==f)return f;c++}return c<u?1:c<l?-1:0}},e.prototype.apply=function(t){if(M(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(M(t,qt)){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(M(t,Ut))t.filter(this);else if(M(t,lt)){t.filter(this),this._shell.apply(t);for(var i=0;i<this._holes.length;i++)this._holes[i].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),i=0;i<n.length;i++)n[i]=this._holes[i].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[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(ct)),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 ct.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 Gt.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[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(zt),ee=function(t){function e(e,n){e instanceof w&&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 ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Gt.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}(Jt),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 ct.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 It,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),i=0;i<n.getNumGeometries();i++)t.add(n.getGeometryN(i));var r=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(r))},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[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(zt),ie=function(t){this._factory=t||null,this._isUserDataCopied=!1},re={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}},oe=(ie.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},ie.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},ie.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof zt?this.editGeometryCollection(t,e):t instanceof Qt?this.editPolygon(t,e):t instanceof Zt||t instanceof Jt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},ie.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),i=new It,r=0;r<n.getNumGeometries();r++){var o=this.edit(n.getGeometryN(r),e);null===o||o.isEmpty()||i.add(o)}return n.getClass()===te?this._factory.createMultiPoint(i.toArray([])):n.getClass()===jt?this._factory.createMultiLineString(i.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(i.toArray([])):this._factory.createGeometryCollection(i.toArray([]))},ie.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 i=this.edit(n.getExteriorRing(),e);if(null===i||i.isEmpty())return this._factory.createPolygon();for(var r=new It,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||r.add(s)}return this._factory.createPolygon(i,r.toArray([]))},ie.prototype.interfaces_=function(){return[]},ie.prototype.getClass=function(){return ie},ie.GeometryEditorOperation=function(){},re.NoOpGeometryOperation.get=function(){return oe},re.CoordinateOperation.get=function(){return se},re.CoordinateSequenceOperation.get=function(){return ae},Object.defineProperties(ie,re),function(){}),se=(oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe},function(){}),ae=(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 Jt?e.createLineString(n):t instanceof Zt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},se.prototype.getClass=function(){return se},function(){}),ue=(ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Jt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Zt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[ie.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae},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 w}else if(M(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 i=0;i<this._coordinates.length;i++)this._coordinates[i]=n.getCoordinateCopy(i)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var r=arguments[0],o=arguments[1];this._coordinates=r,this._dimension=o,null===r&&(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 w}}),le={serialVersionUID:{configurable:!0}},ce=(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 w(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 O(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},le.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,le),function(){}),he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}},pe=(ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ue(arguments[0]);if(M(arguments[0],U))return new ue(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ue(t):new ue(t,e)}},ce.prototype.interfaces_=function(){return[S,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,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 It,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 Rt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Mt)),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 de){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 i=arguments[0];this._modelType=i._modelType,this._scale=i._scale}},ge={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}},de=(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(),i=e.getMaximumSignificantDigits();return new A(n).compareTo(new A(i))},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)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof w){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},ge.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},ge.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,ge),function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)}),ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}},_e=(de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new pe},Object.defineProperties(de,ye),fe.Type=de,fe.FIXED=new de("FIXED"),fe.FLOATING=new de("FLOATING"),fe.FLOATING_SINGLE=new de("FLOATING SINGLE"),function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?M(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}},ve=(_e.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new w(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new w(t.getMinX(),t.getMinY()),new w(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new w(t.getMinX(),t.getMinY()),new w(t.getMinX(),t.getMaxY()),new w(t.getMaxX(),t.getMaxY()),new w(t.getMaxX(),t.getMinY()),new w(t.getMinX(),t.getMinY())]),null)},_e.prototype.createLineString=function(t){return t?t instanceof Array?new Jt(this.getCoordinateSequenceFactory().create(t),this):M(t,U)?new Jt(t,this):void 0:new Jt(this.getCoordinateSequenceFactory().create([]),this)},_e.prototype.createMultiLineString=function(){return 0===arguments.length?new jt(null,this):1===arguments.length?new jt(arguments[0],this):void 0},_e.prototype.buildGeometry=function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(_e.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Qt)return this.createMultiPolygon(_e.toPolygonArray(t));if(a instanceof Jt)return this.createMultiLineString(_e.toLineStringArray(t));if(a instanceof Zt)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 w){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(M(arguments[0],U))return new Zt(arguments[0],this)}},_e.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_e.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(M(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)return new Qt(arguments[0],arguments[1],this)},_e.prototype.getSRID=function(){return this._SRID},_e.prototype.createGeometryCollection=function(){return 0===arguments.length?new zt(null,this):1===arguments.length?new zt(arguments[0],this):void 0},_e.prototype.createGeometry=function(t){return new ie(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(M(arguments[0],U))return new ee(arguments[0],this)}},_e.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},_e.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),i=0;i<e.size();i++){var r=this.getCoordinateSequenceFactory().create(1,e.getDimension());Wt.copy(e,i,r,0,1),n[i]=this.createPoint(r)}return this.createMultiPoint(n)}}},_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 ce.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),["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"]),xe=function(t){this.geometryFactory=t||new _e},Ee=(xe.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])},xe.prototype.write=function(t){var e=t.getGeometryType();if(!be[e])throw new Error("Geometry is not supported");return be[e].apply(this,[t])},{Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var i=t.geometry.type;if(!Ee[i])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 i=t[n];e.push(new w(i[0],i[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new w(t[0],t[1]),new w(t[2],t[1]),new w(t[2],t[3]),new w(t[0],t[3]),new w(t[0],t[1])])},Point:function(t){var e=new w(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),i=[],r=1;r<t.length;++r){var o=t[r],s=Ee.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);i.push(a)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(Ee.Polygon.apply(this,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(this.read(i))}return this.geometryFactory.createGeometryCollection(e)}}),be={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:be.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=be.Point.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),i=0;i<n.length;++i){var r=n[i];e.push(be.coordinate.apply(this,[r]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=be.LineString.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=be.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var i=0;i<t._holes.length;++i){var r=t._holes[i],o=be.LineString.apply(this,[r]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=be.Polygon.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var i=t._geometries[n],r=i.getGeometryType();e.push(be[r].apply(this,[i]))}return{type:"GeometryCollection",geometries:e}}},Ie=function(t){this.geometryFactory=t||new _e,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xe(this.geometryFactory)},we=(Ie.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},Ie.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])},function(){this.parser=new xe(this.geometryFactory)}),Ne=(we.prototype.write=function(t){return this.parser.write(t)},function(){}),Le={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}},Se=(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},Le.ON.get=function(){return 0},Le.LEFT.get=function(){return 1},Le.RIGHT.get=function(){return 2},Object.defineProperties(Ne,Le),(d.prototype=new Error).name="EmptyStackException",(y.prototype=new bt).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 d;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new d;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},function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}),Ce=(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],i=at.computeOrientation(this._minCoord,n,e),r=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&i===at.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&i===at.CLOCKWISE)&&(r=!0),r&&(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 i=Ne.LEFT;return n[e].y<n[e+1].y&&(i=Ne.RIGHT),i},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},function(t){function e(n,i){t.call(this,e.msgWithCoord(n,i)),this.pt=i?new w(i):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}(Q)),Pe=function(){this.array_=[]},Me=(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},function(){this._finder=null,this._dirEdgeList=new It,this._nodes=new It,this._rightMostCoord=null,this._env=null,this._finder=new Se}),Te=(Me.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Me.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Me.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){e=i;break}}if(null===e)throw new Ce("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var r=t.getEdges().iterator();r.hasNext();){var o=r.next();o.setVisited(!0),this.copySymDepths(o)}},Me.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Me.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Me.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)}},Me.prototype.computeDepths=function(t){var e=new Rt,n=new Pe,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.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))}}}},Me.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Me.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(),i=0;i<n.length-1;i++)t.expandToInclude(n[i]);this._env=t}return this._env},Me.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Me.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Me.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();this._dirEdgeList.add(i);var r=i.getSym().getNode();r.isVisited()||e.push(r)}},Me.prototype.getNodes=function(){return this._nodes},Me.prototype.getDirectedEdges=function(){return this._dirEdgeList},Me.prototype.interfaces_=function(){return[E]},Me.prototype.getClass=function(){return Me},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 i=arguments[0];if(this.init(i.location.length),null!==i)for(var r=0;r<this.location.length;r++)this.location[r]=i.location[r]}}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=(Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==C.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===C.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.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]=C.NONE,e[Ne.RIGHT]=C.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===C.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.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},Te.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(C.toLocationSymbol(this.location[Ne.LEFT])),t.append(C.toLocationSymbol(this.location[Ne.ON])),this.location.length>1&&t.append(C.toLocationSymbol(this.location[Ne.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:C.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===C.NONE)return!0;return!1},Te.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}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(C.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},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 Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.elt[0]=new Te(C.NONE),this.elt[1]=new Te(C.NONE),this.elt[i].setLocation(r)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new Te(o,s,a),this.elt[1]=new Te(o,s,a)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Te(C.NONE,C.NONE,C.NONE),this.elt[1]=new Te(C.NONE,C.NONE,C.NONE),this.elt[u].setLocations(l,c,h)}}),Oe=(Re.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Re.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Re.prototype.isNull=function(t){return this.elt[t].isNull()},Re.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)}},Re.prototype.isLine=function(t){return this.elt[t].isLine()},Re.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Re.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Re.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)}},Re.prototype.toString=function(){var t=new O;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()},Re.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()}},Re.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Re.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],i=arguments[1],r=arguments[2];this.elt[n].setLocation(i,r)}},Re.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Re.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Re.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.toLineLabel=function(t){for(var e=new Re(C.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e},function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new It,this._pts=new It,this._label=new Re(C.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new It,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}),Ae=(Oe.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())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ce("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ce("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var i=e.getLabel();et.isTrue(i.isArea()),this.mergeLabel(i),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.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},Oe.prototype.addPoints=function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var o=r;o<i.length;o++)this._pts.add(i[o])}else{var s=i.length-2;n&&(s=i.length-1);for(var a=s;a>=0;a--)this._pts.add(i[a])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.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},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.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[1],n=arguments[0].getLocation(e,Ne.RIGHT);if(n===C.NONE)return null;if(this._label.getLocation(e)===C.NONE)return this._label.setLocation(e,n),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.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)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},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}(Oe)),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.buildMinimalRings=function(){var t=new It,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ae(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}(Oe),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}},ke=(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},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 Re(0,C.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=C.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==C.BOUNDARY&&(n=i)}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 Re(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 Re)for(var n=arguments[0],i=0;i<2;i++){var r=this.computeMergedLocation(n,i);this._label.getLocation(i)===C.NONE&&this._label.setLocation(i,r)}},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=C.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case C.BOUNDARY:n=C.INTERIOR;break;case C.INTERIOR:default:n=C.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fe)),Ge=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t},Be=(Ge.prototype.find=function(t){return this.nodeMap.get(t)},Ge.prototype.addNode=function(){if(arguments[0]instanceof w){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],i=this.nodeMap.get(n.getCoordinate());return null===i?(this.nodeMap.put(n.getCoordinate(),n),n):(i.mergeLabel(n),i)}},Ge.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Ge.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ge.prototype.values=function(){return this.nodeMap.values()},Ge.prototype.getBoundaryNodes=function(t){for(var e=new It,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===C.BOUNDARY&&e.add(i)}return e},Ge.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},function(){}),Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}},qe=(Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Be.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},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.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?Be.NE:Be.SE:e>=0?Be.NW:Be.SW}if(arguments[0]instanceof w&&arguments[1]instanceof w){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new m("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Be.NE:Be.SE:i.y>=n.y?Be.NW:Be.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(Be,Ue),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],i=arguments[2];this._edge=e,this.init(n,i),this._label=null}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=r,this.init(o,s),this._label=a}}),ze=(qe.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)},qe.prototype.getDy=function(){return this._dy},qe.prototype.getCoordinate=function(){return this._p0},qe.prototype.setNode=function(t){this._node=t},qe.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf("."),r=n.substring(i+1);t.print(" "+r+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},qe.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},qe.prototype.getDirectedCoordinate=function(){return this._p1},qe.prototype.getDx=function(){return this._dx},qe.prototype.getLabel=function(){return this._label},qe.prototype.getEdge=function(){return this._edge},qe.prototype.getQuadrant=function(){return this._quadrant},qe.prototype.getNode=function(){return this._node},qe.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},qe.prototype.computeLabel=function(t){},qe.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=Be.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},qe.prototype.interfaces_=function(){return[E]},qe.prototype.getClass=function(){return 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 i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-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 Re(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 Ce("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)===C.INTERIOR&&this._label.getLocation(e,Ne.RIGHT)===C.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,C.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,C.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 i=1;t===Ne.LEFT&&(i=-1);var r=Ne.opposite(t),o=e+n*i;this.setDepth(t,e),this.setDepth(r,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===C.EXTERIOR&&e===C.INTERIOR?1:t===C.INTERIOR&&e===C.EXTERIOR?-1:0},e}(qe)),je=function(){},Ve=(je.prototype.createNode=function(t){return new ke(t,null)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je},function(){if(this._edges=new It,this._nodes=null,this._edgeEndList=new It,0===arguments.length)this._nodes=new Ge(new je);else if(1===arguments.length){var t=arguments[0];this._nodes=new Ge(t)}}),Xe=(Ve.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)}},Ve.prototype.find=function(t){return this._nodes.find(t)},Ve.prototype.addNode=function(){if(arguments[0]instanceof ke){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof w){var e=arguments[0];return this._nodes.addNode(e)}},Ve.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ve.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ve.prototype.debugPrintln=function(t){V.out.println(t)},Ve.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var i=n.getLabel();return null!==i&&i.getLocation(t)===C.BOUNDARY},Ve.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ve.prototype.matchInSameDirection=function(t,e,n,i){return!!t.equals(n)&&at.computeOrientation(t,e,i)===at.COLLINEAR&&Be.quadrant(t,e)===Be.quadrant(n,i)},Ve.prototype.getEdgeEnds=function(){return this._edgeEndList},Ve.prototype.debugPrint=function(t){V.out.print(t)},Ve.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ve.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),r=i.getCoordinates();if(this.matchInSameDirection(t,e,r[0],r[1]))return i;if(this.matchInSameDirection(t,e,r[r.length-1],r[r.length-2]))return i}return null},Ve.prototype.insertEdge=function(t){this._edges.add(t)},Ve.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ve.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var i=new ze(n,!0),r=new ze(n,!1);i.setSym(r),r.setSym(i),this.add(i),this.add(r)}},Ve.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ve.prototype.getNodes=function(){return this._nodes.values()},Ve.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var i=this._edges.get(n),r=i.getCoordinates();if(t.equals(r[0])&&e.equals(r[1]))return i}return null},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()},function(){this._geometryFactory=null,this._shellList=new It;var t=arguments[0];this._geometryFactory=t}),Ye=(Xe.prototype.sortShellsAndHoles=function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isHole()?n.add(r):e.add(r)}},Xe.prototype.computePolygons=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var i=n.next().toPolygon(this._geometryFactory);e.add(i)}return e},Xe.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(null===i.getShell()){var r=this.findEdgeRingContaining(i,t);if(null===r)throw new Ce("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(r)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var i=new It,r=t.iterator();r.hasNext();){var o=r.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 i.add(o)}return i},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 It,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new De(i,this._geometryFactory);e.add(r),r.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(i)&&at.isPointInRing(r,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=u)}return o},Xe.prototype.findShell=function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,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];Ve.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new It,o=this.buildMinimalEdgeRings(i,this._shellList,r);this.sortShellsAndHoles(o,this._shellList,r),this.placeFreeHoles(this._shellList,r)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe},function(){}),He=(Ye.prototype.getBounds=function(){},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}),We=(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},function(){this._size=null,this._items=null,this._size=0,this._items=new It,this._items.add(null)}),Je=(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},function(){}),Ke=(Je.prototype.visitItem=function(t){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je},function(){}),Ze=(Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke},function(){if(this._childBoundables=new It,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}}),$e={serialVersionUID:{configurable:!0}},Qe=(Ze.prototype.getLevel=function(){return this._level},Ze.prototype.size=function(){return this._childBoundables.size()},Ze.prototype.getChildBoundables=function(){return this._childBoundables},Ze.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ze.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ze.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ze.prototype.interfaces_=function(){return[Ye,e]},Ze.prototype.getClass=function(){return Ze},$e.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ze,$e),function(){}),tn=(Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.sort=function(t,e){var n=t.toArray();e?kt.sort(n,e):kt.sort(n);for(var i=t.iterator(),r=0,o=n.length;r<o;r++)i.next(),i.set(n[r])},Qe.singletonList=function(t){var e=new It;return e.add(t),e},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()}),en=(tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),i=tn.isComposite(this._boundable2);if(n&&i)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(i)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,i){for(var r=t.getChildBoundables().iterator();r.hasNext();){var o=r.next(),s=new tn(o,e,this._itemDistance);s.getDistance()<i&&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 Ze},function t(){if(this._root=null,this._built=!1,this._itemBoundables=new It,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}},rn=(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 Ze?t+=this.size(n):n instanceof He&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var r=i.next();r instanceof He&&r.getItem()===e&&(n=r)}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 It:t}if(1===arguments.length){for(var e=arguments[0],n=new It,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();if(r instanceof Ze){var o=this.itemsTree(r);null!==o&&n.add(o)}else r instanceof He?n.add(r.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 It;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];if(et.isTrue(n>-2),i.getLevel()===n)return r.add(i),null;for(var o=i.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Ze?this.boundablesAtLevel(n,s,r):(et.isTrue(s instanceof He),-1===n&&r.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new It;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,i)}else if(3===arguments.length)if(M(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)for(var r=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);this.getIntersectsOp().intersects(u.getBounds(),r)&&(u instanceof Ze?this.query(r,u,o):u instanceof He?o.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(M(arguments[2],bt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)for(var l=arguments[0],c=arguments[2],h=arguments[1].getChildBoundables(),p=0;p<h.size();p++){var f=h.get(p);this.getIntersectsOp().intersects(f.getBounds(),l)&&(f instanceof Ze?this.query(l,f,c):f instanceof He?c.add(f.getItem()):et.shouldNeverReachHere())}},en.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},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],i=arguments[1],r=arguments[2],o=this.removeItem(i,r);if(o)return!0;for(var s=null,a=i.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Ze&&(o=this.remove(n,u,r))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&i.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 Ze){var i=this.depth(n);i>t&&(t=i)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new It;n.add(this.createNode(e));var i=new It(t);Qe.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var o=r.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),function(){}),on=function(){},sn=(on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},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 i={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 It,i=0;i<t.length;i++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[i],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];if(e.isNull())return null;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)),i=new Array(e).fill(null),r=t.iterator(),o=0;o<e;o++){i[o]=new It;for(var s=0;r.hasNext()&&s<n;){var a=r.next();i[o].add(a),s++}}return i},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],i=arguments[1];t.prototype.query.call(this,n,i)}else if(3===arguments.length)if(M(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var r=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,r,o,s)}else if(M(arguments[2],bt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var a=arguments[0],u=arguments[1],l=arguments[2];t.prototype.query.call(this,a,u,l)}},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 i=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),r=new It(t);Qe.sort(r,n.xComparator);var o=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(i))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(M(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 i=arguments[0];return this.nearestNeighbour(i,v.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&M(arguments[1],on)){var r=arguments[0],o=arguments[1],s=new tn(this.getRoot(),r.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],l=null,c=new We;for(c.add(a);!c.isEmpty()&&u>0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],g=new He(arguments[0],arguments[1]),d=new tn(this.getRoot(),g,f);return this.nearestNeighbour(d)[0]}},n.prototype.interfaces_=function(){return[Ke,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())},i.STRtreeNode.get=function(){return an},i.serialVersionUID.get=function(){return 0x39920f7d5f261e0},i.xComparator.get=function(){return{interfaces_:function(){return[I]},compare:function(e,i){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(i.getBounds()))}}},i.yComparator.get=function(){return{interfaces_:function(){return[I]},compare:function(e,i){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(i.getBounds()))}}},i.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},i.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,i),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}(Ze),un=function(){},ln=(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 i=un.relativeSign(e.x,n.x),r=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(i,r);case 1:return un.compareValue(r,i);case 2:return un.compareValue(r,-i);case 3:return un.compareValue(-i,r);case 4:return un.compareValue(-i,-r);case 5:return un.compareValue(-r,-i);case 6:return un.compareValue(-r,i);case 7:return un.compareValue(i,-r)}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},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],i=arguments[3];this._segString=t,this.coord=new w(e),this.segmentIndex=n,this._segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}),cn=(ln.prototype.getCoordinate=function(){return this.coord},ln.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ln.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)},ln.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ln.prototype.isInterior=function(){return this._isInterior},ln.prototype.interfaces_=function(){return[E]},ln.prototype.getClass=function(){return ln},function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t}),hn=(cn.prototype.getSplitCoordinates=function(){var t=new Nt;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},cn.prototype.addCollapsedNodes=function(){var t=new It;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)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),i=this._edge.getCoordinate(e+2);n.equals2D(i)&&t.add(new A(e+1))}},cn.prototype.addEdgeCoordinates=function(t,e,n){var i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);n.add(new w(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));r&&n.add(new w(e.coord))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},cn.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,1===i&&(n[0]=t.segmentIndex+1,!0)},cn.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),i=n.next();n.hasNext();){var r=n.next();this.findCollapseIndex(i,r,e)&&t.add(new A(e[0])),i=r}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this._edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new w(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return r&&(o[s]=new w(e.coord)),new gn(o,this._edge.getData())},cn.prototype.add=function(t,e){var n=new ln(this._edge,t,e,this._edge.getSegmentOctant(e)),i=this._nodeMap.get(n);return null!==i?(et.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this._nodeMap.put(n,n),n)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Q("bad split edge start point at "+n);var i=t.get(t.size()-1).getCoordinates(),r=i[i.length-1];if(!r.equals2D(e[e.length-1]))throw new Q("bad split edge end point at "+r)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},function(){}),pn=(hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.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),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}if(arguments[0]instanceof w&&arguments[1]instanceof w){var r=arguments[0],o=arguments[1],s=o.x-r.x,a=o.y-r.y;if(0===s&&0===a)throw new m("Cannot compute the octant for two identical points "+r);return hn.octant(s,a)}},function(){}),fn=(pn.prototype.getCoordinates=function(){},pn.prototype.size=function(){},pn.prototype.getCoordinate=function(t){},pn.prototype.isClosed=function(){},pn.prototype.setData=function(t){},pn.prototype.getData=function(){},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn},function(){}),gn=(fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[pn]},fn.prototype.getClass=function(){return fn},function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),dn=(gn.prototype.getCoordinates=function(){return this._pts},gn.prototype.size=function(){return this._pts.length},gn.prototype.getCoordinate=function(t){return this._pts[t]},gn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},gn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},gn.prototype.setData=function(t){this._data=t},gn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hn.octant(t,e)},gn.prototype.getData=function(){return this._data},gn.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[1],i=arguments[3],r=new w(arguments[0].getIntersection(i));this.addIntersection(r,n)}},gn.prototype.toString=function(){return $.toLineString(new ue(this._pts))},gn.prototype.getNodeList=function(){return this._nodeList},gn.prototype.addIntersectionNode=function(t,e){var n=e,i=n+1;if(i<this._pts.length){var r=this._pts[i];t.equals2D(r)&&(n=i)}return this._nodeList.add(t,n)},gn.prototype.addIntersections=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},gn.prototype.interfaces_=function(){return[fn]},gn.prototype.getClass=function(){return gn},gn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new It;return gn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],i=arguments[0].iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(n)},function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new w,this.p1=new w;else if(1===arguments.length){var t=arguments[0];this.p0=new w(t.p0),this.p1=new w(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],i=arguments[2],r=arguments[3];this.p0=new w(e,n),this.p1=new w(i,r)}}),yn={serialVersionUID:{configurable:!0}},_n=(dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){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||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof w){var i=arguments[0];return at.orientationIndex(this.p0,this.p1,i)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new rt;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof w){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new w(t);var e=this.projectionFactor(t),n=new w;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 dn){var i=arguments[0],r=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(r>=1&&o>=1)return null;if(r<=0&&o<=0)return null;var s=this.project(i.p0);r<0&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(i.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new dn(s,a)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.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,i=e*e+n*n;return i<=0?v.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),i=v.MAX_VALUE,r=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(r=s.distance(t.p1))<i&&(i=r,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(r=a.distance(this.p0))<i&&(i=r,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(r=u.distance(this.p1))<i&&(i=r,n[0]=this.p1,n[1]=u),n},dn.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},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.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)},dn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof j))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(r*r+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*r/s,u=e*o/s}return new w(n-u,i+a)},dn.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}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||v.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof w){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new w;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},dn.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)},dn.prototype.interfaces_=function(){return[E,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new w((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,yn),function(){this.tempEnv1=new Y,this.tempEnv2=new Y,this._overlapSeg1=new dn,this._overlapSeg2=new dn}),mn=(_n.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},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],i=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=i}),vn=(mn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},mn.prototype.computeSelect=function(t,e,n,i){var r=this._pts[e],o=this._pts[n];if(i.tempEnv1.init(r,o),n-e==1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,i),s<n&&this.computeSelect(t,s,n,i)},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,i,r,o){var s=this._pts[t],a=this._pts[e],u=n._pts[i],l=n._pts[r];if(e-t==1&&r-i==1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((i+r)/2);t<c&&(i<h&&this.computeOverlapsInternal(t,c,n,i,h,o),h<r&&this.computeOverlapsInternal(t,c,n,h,r,o)),c<e&&(i<h&&this.computeOverlapsInternal(c,e,n,i,h,o),h<r&&this.computeOverlapsInternal(c,e,n,h,r,o))},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},function(){}),xn=(vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(t){var e=0,n=new It;n.add(new A(e));do{var i=vn.findChainEnd(t,e);n.add(new A(i)),e=i}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 i=Be.quadrant(t[n],t[n+1]),r=e+1;r<t.length&&(t[r-1].equals2D(t[r])||Be.quadrant(t[r-1],t[r])===i);)r++;return r-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],i=new It,r=vn.getChainStartIndices(e),o=0;o<r.length-1;o++){var s=new mn(e,r[o],r[o+1],n);i.add(s)}return i}},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},function(){}),En=(xn.prototype.computeNodes=function(t){},xn.prototype.getNodedSubstrings=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}),bn=(En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[xn]},En.prototype.getClass=function(){return En},function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new It,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 gn.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 In(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),i=this._index.query(n.getEnvelope()).iterator();i.hasNext();){var r=i.next();if(r.getId()>n.getId()&&(n.computeOverlaps(r,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return In},Object.defineProperties(e,n),e}(En)),In=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[1],n=arguments[2],i=arguments[3],r=arguments[0].getContext(),o=n.getContext();this._si.processIntersections(r,e,o,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(_n),wn=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],i=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(i)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(r),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}},Ln=(wn.prototype.getEndCapStyle=function(){return this._endCapStyle},wn.prototype.isSingleSided=function(){return this._isSingleSided},wn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=wn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=wn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==wn.JOIN_ROUND&&(this._quadrantSegments=wn.DEFAULT_QUADRANT_SEGMENTS)},wn.prototype.getJoinStyle=function(){return this._joinStyle},wn.prototype.setJoinStyle=function(t){this._joinStyle=t},wn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},wn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},wn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},wn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},wn.prototype.getMitreLimit=function(){return this._mitreLimit},wn.prototype.setMitreLimit=function(t){this._mitreLimit=t},wn.prototype.setSingleSided=function(t){this._isSingleSided=t},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.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(wn,Nn),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=(Ln.prototype.isDeletable=function(t,e,n,i){var r=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(r,o,s)&&!!this.isShallow(r,o,s,i)&&this.isShallowSampled(r,o,t,n,i)},Ln.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),i=!1;n<this._inputLine.length;){var r=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Ln.DELETE,r=!0,i=!0),t=r?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return i},Ln.prototype.isShallowConcavity=function(t,e,n,i){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<i},Ln.prototype.isShallowSampled=function(t,e,n,i,r){var o=Math.trunc((i-n)/Ln.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<i;s+=o)if(!this.isShallow(t,e,this._inputLine[s],r))return!1;return!0},Ln.prototype.isConcave=function(t,e,n){return at.computeOrientation(t,e,n)===this._angleOrientation},Ln.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()},Ln.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Ln.DELETE;)e++;return e},Ln.prototype.isShallow=function(t,e,n,i){return at.distancePointLine(e,t,n)<i},Ln.prototype.collapseLine=function(){for(var t=new Nt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Ln.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.simplify=function(t,e){return new Ln(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(Ln,Sn),function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new It}),Pn={COORDINATE_ARRAY_TYPE:{configurable:!0}},Mn=(Cn.prototype.getCoordinates=function(){return this._ptList.toArray(Cn.COORDINATE_ARRAY_TYPE)},Cn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Cn.prototype.addPt=function(t){var e=new w(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Cn.prototype.revere=function(){},Cn.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var i=t.length-1;i>=0;i--)this.addPt(t[i])},Cn.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},Cn.prototype.toString=function(){return(new _e).createLineString(this.getCoordinates()).toString()},Cn.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new w(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},Cn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Pn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Cn,Pn),function(){}),Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}},Rn=(Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.toDegrees=function(t){return 180*t/Math.PI},Mn.normalize=function(t){for(;t>Math.PI;)t-=Mn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Mn.PI_TIMES_2;return t},Mn.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],i=n.x-e.x,r=n.y-e.y;return Math.atan2(r,i)}},Mn.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)>0},Mn.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0},Mn.interiorAngle=function(t,e,n){var i=Mn.angle(e,t),r=Mn.angle(e,n);return Math.abs(r-i)},Mn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Mn.PI_TIMES_2;t>=Mn.PI_TIMES_2&&(t=0)}else{for(;t>=Mn.PI_TIMES_2;)t-=Mn.PI_TIMES_2;t<0&&(t=0)}return t},Mn.angleBetween=function(t,e,n){var i=Mn.angle(e,t),r=Mn.angle(e,n);return Mn.diff(i,r)},Mn.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Mn.toRadians=function(t){return t*Math.PI/180},Mn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Mn.COUNTERCLOCKWISE:n<0?Mn.CLOCKWISE:Mn.NONE},Mn.angleBetweenOriented=function(t,e,n){var i=Mn.angle(e,t),r=Mn.angle(e,n)-i;return r<=-Math.PI?r+Mn.PI_TIMES_2:r>Math.PI?r-Mn.PI_TIMES_2:r},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return at.CLOCKWISE},Tn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Mn,Tn),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 dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],i=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new rt,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===wn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(i)}),On={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}},An=(Rn.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),i=n===at.CLOCKWISE&&this._side===Ne.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Ne.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Rn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),i=new dn;this.computeOffsetSegment(n,Ne.LEFT,this._distance,i);var r=new dn;this.computeOffsetSegment(n,Ne.RIGHT,this._distance,r);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case wn.CAP_ROUND:this._segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(r.p1);break;case wn.CAP_FLAT:this._segList.addPt(i.p1),this._segList.addPt(r.p1);break;case wn.CAP_SQUARE:var u=new w;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var l=new w(i.p1.x+u.x,i.p1.y+u.y),c=new w(r.p1.x+u.x,r.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},Rn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Rn.prototype.addMitreJoin=function(t,e,n,i){var r=!0,o=null;try{o=X.intersection(e.p0,e.p1,n.p0,n.p1),(i<=0?1:o.distance(t)/Math.abs(i))>this._bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof j))throw t;o=new w(0,0),r=!1}r?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this._bufParams.getMitreLimit())},Rn.prototype.addFilletCorner=function(t,e,n,i,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);i===at.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,i,r),this._segList.addPt(n)},Rn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Rn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===wn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===wn.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))},Rn.prototype.createSquare=function(t){this._segList.addPt(new w(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new w(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new w(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new w(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Rn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Rn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Rn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Rn.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)},Rn.prototype.addLimitedMitreJoin=function(t,e,n,i){var r=this._seg0.p1,o=Mn.angle(r,this._seg0.p0),s=Mn.angleBetweenOriented(this._seg0.p0,r,this._seg1.p1)/2,a=Mn.normalize(o+s),u=Mn.normalize(a+Math.PI),l=i*n,c=n-l*Math.abs(Math.sin(s)),h=r.x+l*Math.cos(u),p=r.y+l*Math.sin(u),f=new w(h,p),g=new dn(r,f),d=g.pointAlongOffset(1,c),y=g.pointAlongOffset(1,-c);this._side===Ne.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},Rn.prototype.computeOffsetSegment=function(t,e,n,i){var r=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=r*n*o/a,l=r*n*s/a;i.p0.x=t.p0.x-l,i.p0.y=t.p0.y+u,i.p1.x=t.p1.x-l,i.p1.y=t.p1.y+u},Rn.prototype.addFilletArc=function(t,e,n,i,r){var o=i===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,l=0,c=new w;l<s;){var h=e+o*l;c.x=t.x+r*Math.cos(h),c.y=t.y+r*Math.sin(h),this._segList.addPt(c),l+=u}},Rn.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*Rn.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 w((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 i=new w((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Rn.prototype.createCircle=function(t){var e=new w(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Rn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Rn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Cn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Rn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Rn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===wn.JOIN_BEVEL||this._bufParams.getJoinStyle()===wn.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))},Rn.prototype.closeRing=function(){this._segList.closeRing()},Rn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Rn,On),function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}),Dn=(An.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var o=r.getCoordinates();return n&&Lt.reverse(o),o},An.prototype.computeSingleSidedBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var r=Ln.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{n.addSegments(t,!1);var a=Ln.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment(),n.closeRing()},An.prototype.computeRingBufferCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);e===Ne.RIGHT&&(i=-i);var r=Ln.simplify(t,i),o=r.length-1;n.initSideSegments(r[o-1],r[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(r[s],a)}n.closeRing()},An.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),i=Ln.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],Ne.LEFT);for(var o=2;o<=r;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var s=Ln.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()},An.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case wn.CAP_ROUND:e.createCircle(t);break;case wn.CAP_SQUARE:e.createSquare(t)}},An.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),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this._bufParams.isSingleSided()){var r=e<0;this.computeSingleSidedBufferCurve(t,r,i)}else this.computeLineBufferCurve(t,i);return i.getCoordinates()},An.prototype.getBufferParameters=function(){return this._bufParams},An.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},An.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return An.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},An.prototype.computeOffsetCurve=function(t,e,n){var i=this.simplifyTolerance(this._distance);if(e){var r=Ln.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{var a=Ln.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()},An.prototype.getSegGen=function(t){return new Rn(this._precisionModel,this._bufParams,t)},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new w(t[n]);return e},function(){this._subgraphs=null,this._seg=new dn,this._cga=new at;var t=arguments[0];this._subgraphs=t}),Fn={DepthSegment:{configurable:!0}},kn=(Dn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new It,n=this._subgraphs.iterator();n.hasNext();){var i=n.next(),r=i.getEnvelope();t.y<r.getMinY()||t.y>r.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if(M(arguments[2],bt)&&arguments[0]instanceof w&&arguments[1]instanceof ze){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+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 c=s.getDepth(Ne.LEFT);this._seg.p0.equals(u[l])||(c=s.getDepth(Ne.RIGHT));var h=new kn(this._seg,c);a.add(h)}}else if(M(arguments[2],bt)&&arguments[0]instanceof w&&M(arguments[1],bt))for(var p=arguments[0],f=arguments[2],g=arguments[1].iterator();g.hasNext();){var d=g.next();d.isForward()&&this.findStabbedSegments(p,d,f)}},Dn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Qe.min(e)._leftDepth},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Fn.DepthSegment.get=function(){return kn},Object.defineProperties(Dn,Fn),function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e}),Gn=(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||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},function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null}),Bn=(Gn.prototype.area=function(){return Gn.area(this.p0,this.p1,this.p2)},Gn.prototype.signedArea=function(){return Gn.signedArea(this.p0,this.p1,this.p2)},Gn.prototype.interpolateZ=function(t){if(null===t)throw new m("Supplied point is null.");return Gn.interpolateZ(t,this.p0,this.p1,this.p2)},Gn.prototype.longestSideLength=function(){return Gn.longestSideLength(this.p0,this.p1,this.p2)},Gn.prototype.isAcute=function(){return Gn.isAcute(this.p0,this.p1,this.p2)},Gn.prototype.circumcentre=function(){return Gn.circumcentre(this.p0,this.p1,this.p2)},Gn.prototype.area3D=function(){return Gn.area3D(this.p0,this.p1,this.p2)},Gn.prototype.centroid=function(){return Gn.centroid(this.p0,this.p1,this.p2)},Gn.prototype.inCentre=function(){return Gn.inCentre(this.p0,this.p1,this.p2)},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.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)},Gn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Gn.det=function(t,e,n,i){return t*i-e*n},Gn.interpolateZ=function(t,e,n,i){var r=e.x,o=e.y,s=n.x-r,a=i.x-r,u=n.y-o,l=i.y-o,c=s*l-a*u,h=t.x-r,p=t.y-o,f=(l*h-a*p)/c,g=(-u*h+s*p)/c;return e.z+f*(n.z-e.z)+g*(i.z-e.z)},Gn.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),o=n.distance(t),s=i;return r>s&&(s=r),o>s&&(s=o),s},Gn.isAcute=function(t,e,n){return!!Mn.isAcute(t,e,n)&&!!Mn.isAcute(e,n,t)&&!!Mn.isAcute(n,t,e)},Gn.circumcentre=function(t,e,n){var i=n.x,r=n.y,o=t.x-i,s=t.y-r,a=e.x-i,u=e.y-r,l=2*Gn.det(o,s,a,u),c=Gn.det(s,o*o+s*s,u,a*a+u*u),h=Gn.det(o,o*o+s*s,a,a*a+u*u);return new w(i-c/l,r+h/l)},Gn.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,r=new X(t.x+n/2,t.y+i/2,1),o=new X(t.x-i+n/2,t.y+n+i/2,1);return new X(r,o)},Gn.angleBisector=function(t,e,n){var i=e.distance(t),r=i/(i+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new w(t.x+r*o,t.y+r*s)},Gn.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=r*u-o*a,c=o*s-i*u,h=i*a-r*s,p=l*l+c*c+h*h;return Math.sqrt(p)/2},Gn.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,r=(t.y+e.y+n.y)/3;return new w(i,r)},Gn.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o,a=(i*t.x+r*e.x+o*n.x)/s,u=(i*t.y+r*e.y+o*n.y)/s;return new w(a,u)},function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}),Un=(Bn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.prototype.addPolygon=function(t){var e=this._distance,n=Ne.LEFT;this._distance<0&&(e=-this._distance,n=Ne.RIGHT);var i=t.getExteriorRing(),r=Lt.removeRepeatedPoints(i.getCoordinates());if(this._distance<0&&this.isErodedCompletely(i,this._distance))return null;if(this._distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,C.EXTERIOR,C.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Lt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ne.opposite(n),C.INTERIOR,C.EXTERIOR)}},Bn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Gn(t[0],t[1],t[2]),i=n.inCentre();return at.distancePointLine(i,n.p0,n.p1)<Math.abs(e)},Bn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Lt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var i=new gn(t,new Re(0,C.BOUNDARY,e,n));this._curveList.add(i)},Bn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Bn.prototype.addPolygonRing=function(t,e,n,i,r){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=i,s=r;t.length>=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=r,s=i,n=Ne.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Bn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Jt?this.addLineString(t):t instanceof Zt?this.addPoint(t):(t instanceof te||t instanceof jt||t instanceof ne||t instanceof zt)&&this.addCollection(t)},Bn.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 i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>r},Bn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},function(){}),qn=(Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},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()}),zn=(qn.prototype.next=function(){if(this._atStart)return this._atStart=!1,qn.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 i;var t=this._parent.getGeometryN(this._index++);return t instanceof zt?(this._subcollectionIterator=new qn(t),this._subcollectionIterator.next()):t},qn.prototype.remove=function(){throw new Error(this.getClass().getName())},qn.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)},qn.prototype.interfaces_=function(){return[Et]},qn.prototype.getClass=function(){return qn},qn.isAtomic=function(t){return!(t instanceof zt)},function(){this._geom=null;var t=arguments[0];this._geom=t}),jn=(zn.prototype.locate=function(t){return zn.locate(t,this._geom)},zn.prototype.interfaces_=function(){return[Un]},zn.prototype.getClass=function(){return zn},zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zn.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var r=e.getInteriorRingN(i);if(zn.isPointInRing(t,r))return!1}return!0},zn.containsPoint=function(t,e){if(e instanceof Qt)return zn.containsPointInPolygon(t,e);if(e instanceof zt)for(var n=new qn(e);n.hasNext();){var i=n.next();if(i!==e&&zn.containsPoint(t,i))return!0}return!1},zn.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:zn.containsPoint(t,e)?C.INTERIOR:C.EXTERIOR},function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[C.NONE,C.NONE]}),Vn=(jn.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)},jn.prototype.propagateSideLabels=function(t){for(var e=C.NONE,n=this.iterator();n.hasNext();){var i=n.next().getLabel();i.isArea(t)&&i.getLocation(t,Ne.LEFT)!==C.NONE&&(e=i.getLocation(t,Ne.LEFT))}if(e===C.NONE)return null;for(var r=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Ne.ON)===C.NONE&&a.setLocation(t,Ne.ON,r),a.isArea(t)){var u=a.getLocation(t,Ne.LEFT),l=a.getLocation(t,Ne.RIGHT);if(l!==C.NONE){if(l!==r)throw new Ce("side location conflict",s.getCoordinate());u===C.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),r=u}else et.isTrue(a.getLocation(t,Ne.LEFT)===C.NONE,"found single null side"),a.setLocation(t,Ne.RIGHT,r),a.setLocation(t,Ne.LEFT,r)}}},jn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},jn.prototype.print=function(t){V.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},jn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel().getLocation(t,Ne.LEFT);et.isTrue(i!==C.NONE,"Found unlabelled area edge");for(var r=i,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!==r)return!1;r=a}return!0},jn.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},jn.prototype.iterator=function(){return this.getEdges().iterator()},jn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new It(this._edgeMap.values())),this._edgeList},jn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===C.NONE&&(this._ptInAreaLocation[t]=zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},jn.prototype.toString=function(){var t=new O;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()},jn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},jn.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 i=n.next().getLabel(),r=0;r<2;r++)i.isLine(r)&&i.getLocation(r)===C.BOUNDARY&&(e[r]=!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 l=C.NONE;if(e[u])l=C.EXTERIOR;else{var c=s.getCoordinate();l=this.getLocation(u,c,t)}a.setAllLocationsIfNull(u,l)}},jn.prototype.getDegree=function(){return this._edgeMap.size()},jn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},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,i=0;i<this._resultAreaEdgeList.size();i++){var r=this._resultAreaEdgeList.get(i),o=r.getSym();if(r.getLabel().isArea())switch(null===t&&r.isInResult()&&(t=r),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!r.isInResult())continue;e.setNext(r),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Ce("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 i=t.get(e-1),r=n.getQuadrant(),o=i.getQuadrant();return Be.isNorthern(r)&&Be.isNorthern(o)?n:Be.isNorthern(r)||Be.isNorthern(o)?0!==n.getDy()?n:0!==i.getDy()?i:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):i},e.prototype.print=function(t){V.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 It;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 i=this._edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ne.LEFT),i=t.getDepth(Ne.RIGHT),r=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new Ce("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(Ne.RIGHT,s),s=u.getDepth(Ne.LEFT)}return s}},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,i=this._SCANNING_FOR_INCOMING,r=this._resultAreaEdgeList.size()-1;r>=0;r--){var o=this._resultAreaEdgeList.get(r),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),i){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),i=this._SCANNING_FOR_INCOMING}}i===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],i=0,r=this.iterator();r.hasNext();)r.next().getEdgeRing()===n&&i++;return i}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=C.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=C.INTERIOR;break}if(i.isInResult()){t=C.EXTERIOR;break}}}if(t===C.NONE)return null;for(var r=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(r===C.INTERIOR):(s.isInResult()&&(r=C.EXTERIOR),a.isInResult()&&(r=C.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Re(C.NONE);for(var n=this.iterator();n.hasNext();)for(var i=n.next().getEdge().getLabel(),r=0;r<2;r++){var o=i.getLocation(r);o!==C.INTERIOR&&o!==C.BOUNDARY||this._label.setLocation(r,C.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jn)),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 Vn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Yn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)},Hn=(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===Lt.increasingDirection(t)},Yn.compareOriented=function(t,e,n,i){for(var r=e?1:-1,o=i?1:-1,s=e?t.length:-1,a=i?n.length:-1,u=e?0:t.length-1,l=i?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=r)===s,p=(l+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}},function(){this._edges=new It,this._ocaMap=new h}),Wn=(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 i=n.getCoordinates(),r=0;r<i.length;r++)r>0&&t.print(","),t.print(i[r].x+" "+i[r].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},function(){}),Jn=(Wn.prototype.processIntersections=function(t,e,n,i){},Wn.prototype.isDone=function(){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn},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}),Kn=(Jn.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(Jn.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.size()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},Jn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Jn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Jn.prototype.getLineIntersector=function(){return this._li},Jn.prototype.hasProperIntersection=function(){return this._hasProper},Jn.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Jn.prototype.hasIntersection=function(){return this._hasIntersection},Jn.prototype.isDone=function(){return!1},Jn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Jn.prototype.interfaces_=function(){return[Wn]},Jn.prototype.getClass=function(){return Jn},Jn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new w(t),this.segmentIndex=e,this.dist=n}),Zn=(Kn.prototype.getSegmentIndex=function(){return this.segmentIndex},Kn.prototype.getCoordinate=function(){return this.coord},Kn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Kn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Kn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Kn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Kn.prototype.getDistance=function(){return this.dist},Kn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Kn.prototype.interfaces_=function(){return[E]},Kn.prototype.getClass=function(){return Kn},function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t}),$n=(Zn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Zn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Zn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},Zn.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)},Zn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new w(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new ni(o,new Re(this.edge._label))},Zn.prototype.add=function(t,e,n){var i=new Kn(t,e,n),r=this._nodeMap.get(i);return null!==r?r:(this._nodeMap.put(i,i),i)},Zn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},function(){}),Qn=($n.prototype.getChainStartIndices=function(t){var e=0,n=new It;n.add(new A(e));do{var i=this.findChainEnd(t,e);n.add(new A(i)),e=i}while(e<t.length-1);return $n.toIntArray(n)},$n.prototype.findChainEnd=function(t,e){for(var n=Be.quadrant(t[e],t[e+1]),i=e+1;i<t.length&&Be.quadrant(t[i-1],t[i])===n;)i++;return i-1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.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},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 $n;this.startIndex=e.getChainStartIndices(this.pts)}),ti=(Qn.prototype.getCoordinates=function(){return this.pts},Qn.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},Qn.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},Qn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(6===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],l=arguments[5],c=this.pts[r],h=this.pts[o],p=s.pts[a],f=s.pts[u];if(o-r==1&&u-a==1)return l.addIntersections(this.e,r,s.e,a),null;if(this.env1.init(c,h),this.env2.init(p,f),!this.env1.intersects(this.env2))return null;var g=Math.trunc((r+o)/2),d=Math.trunc((a+u)/2);r<g&&(a<d&&this.computeIntersectsForChain(r,g,s,a,d,l),d<u&&this.computeIntersectsForChain(r,g,s,d,u,l)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,l),d<u&&this.computeIntersectsForChain(g,o,s,d,u,l))}},Qn.prototype.getStartIndexes=function(){return this.startIndex},Qn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var i=0;i<t.startIndex.length-1;i++)this.computeIntersectsForChain(n,t,i,e)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},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}),ei={NULL_VALUE:{configurable:!0}},ni=(ti.prototype.getDepth=function(t,e){return this._depth[t][e]},ti.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},ti.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]!==ti.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===ti.NULL_VALUE}if(2===arguments.length){var i=arguments[0],r=arguments[1];return this._depth[i][r]===ti.NULL_VALUE}},ti.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 i=0;this._depth[t][n]>e&&(i=1),this._depth[t][n]=i}}},ti.prototype.getDelta=function(t){return this._depth[t][Ne.RIGHT]-this._depth[t][Ne.LEFT]},ti.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?C.EXTERIOR:C.INTERIOR},ti.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},ti.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 i=t.getLocation(e,n);i!==C.EXTERIOR&&i!==C.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=ti.depthAtLocation(i):this._depth[e][n]+=ti.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],o=arguments[1];arguments[2]===C.INTERIOR&&this._depth[r][o]++}},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.depthAtLocation=function(t){return t===C.EXTERIOR?0:t===C.INTERIOR?1:ti.NULL_VALUE},ei.NULL_VALUE.get=function(){return-1},Object.defineProperties(ti,ei),function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new ti,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.pts=i,this._label=r}}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,Re.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 i=!0,r=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(i=!1),this.pts[s].equals2D(n.pts[--o])||(r=!1),!i&&!r)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 Qn(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,i){var r=new w(t.getIntersection(i)),o=e,s=t.getEdgeDistance(n,i),a=o+1;if(a<this.pts.length){var u=this.pts[a];r.equals2D(u)&&(o=a,s=0)}this.eiList.add(r,o,s)},e.prototype.toString=function(){var t=new O;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 i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},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)),ii=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Hn,this._bufParams=t||null},ri=(ii.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},ii.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Re(t.getLabel())).flip(),n.merge(i);var r=ii.depthDelta(i),o=e.getDepthDelta()+r;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(ii.depthDelta(t.getLabel()))},ii.prototype.buildSubgraphs=function(t,e){for(var n=new It,i=t.iterator();i.hasNext();){var r=i.next(),o=r.getRightmostCoordinate(),s=new Dn(n).getDepth(o);r.computeDepth(s),r.findResultEdges(),n.add(r),e.add(r.getDirectedEdges(),r.getNodes())}},ii.prototype.createSubgraphs=function(t){for(var e=new It,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var r=new Me;r.create(i),e.add(r)}}return Qe.sort(e,Qe.reverseOrder()),e},ii.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},ii.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new bn,n=new rt;return n.setPrecisionModel(t),e.setSegmentIntersector(new Jn(n)),e},ii.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var i=new An(n,this._bufParams),r=new Bn(t,e,i).getCurves();if(r.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(r,n),this._graph=new Ve(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)},ii.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var i=n.getNodedSubstrings().iterator();i.hasNext();){var r=i.next(),o=r.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=r.getData(),a=new ni(r.getCoordinates(),new Re(s));this.insertUniqueEdge(a)}}},ii.prototype.setNoder=function(t){this._workingNoder=t},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.depthDelta=function(t){var e=t.getLocation(0,Ne.LEFT),n=t.getLocation(0,Ne.RIGHT);return e===C.INTERIOR&&n===C.EXTERIOR?1:e===C.EXTERIOR&&n===C.INTERIOR?-1:0},ii.convertSegStrings=function(t){for(var e=new _e,n=new It;t.hasNext();){var i=t.next(),r=e.createLineString(i.getCoordinates());n.add(r)}return e.buildGeometry(n)},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],i=arguments[1],r=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=i,this._offsetX=r,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}}),oi=(ri.prototype.rescale=function(){if(M(arguments[0],xt))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],i=0;i<n.length;i++)n[i].x=n[i].x/this._scaleFactor+this._offsetX,n[i].y=n[i].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&V.out.println(n)}},ri.prototype.scale=function(){if(M(arguments[0],xt)){for(var t=arguments[0],e=new It,n=t.iterator();n.hasNext();){var i=n.next();e.add(new gn(this.scale(i.getCoordinates()),i.getData()))}return e}if(arguments[0]instanceof Array){for(var r=arguments[0],o=new Array(r.length).fill(null),s=0;s<r.length;s++)o[s]=new w(Math.round((r[s].x-this._offsetX)*this._scaleFactor),Math.round((r[s].y-this._offsetY)*this._scaleFactor),r[s].z);return Lt.removeRepeatedPoints(o)}},ri.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ri.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ri.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ri.prototype.interfaces_=function(){return[xn]},ri.prototype.getClass=function(){return ri},function(){this._li=new rt,this._segStrings=null;var t=arguments[0];this._segStrings=t}),si={fact:{configurable:!0}},ai=(oi.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],i=arguments[1].iterator();i.hasNext();)for(var r=i.next().getCoordinates(),o=1;o<r.length-1;o++)if(r[o].equals(n))throw new Q("found endpt/interior pt intersection at index "+o+" :pt "+n)},oi.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 i=n.next();this.checkInteriorIntersections(e,i)}else if(2===arguments.length)for(var r=arguments[0],o=arguments[1],s=r.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var l=0;l<a.length-1;l++)this.checkInteriorIntersections(r,u,o,l);else if(4===arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3];if(c===p&&h===f)return null;var g=c.getCoordinates()[h],d=c.getCoordinates()[h+1],y=p.getCoordinates()[f],_=p.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,_)))throw new Q("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+_)}},oi.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},oi.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(),i=0;i<n.length-2;i++)this.checkCollapse(n[i],n[i+1],n[i+2])},oi.prototype.hasInteriorIntersection=function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var r=t.getIntersection(i);if(!r.equals(e)&&!r.equals(n))return!0}return!1},oi.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Q("found non-noded collapse at "+oi.fact.createLineString([t,e,n]))},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},si.fact.get=function(){return new _e},Object.defineProperties(oi,si),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 w(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new w,this._p1Scaled=new w),this.initCorners(this._pt)}),ui={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}},li=(ai.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>i||this._maxy<r||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return et.isTrue(!(s&&a),"Found bad envelope test"),a},ai.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 w(this._maxx,this._maxy),this._corner[1]=new w(this._minx,this._maxy),this._corner[2]=new w(this._minx,this._miny),this._corner[3]=new w(this._maxx,this._miny)},ai.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))},ai.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ai.prototype.getCoordinate=function(){return this._originalPt},ai.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ai.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ai.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},ai.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()))))},ai.prototype.intersectsToleranceSquare=function(t,e){var n=!1,i=!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()&&(i=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&i||t.equals(this._pt)||e.equals(this._pt)))))},ai.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},ui.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ai,ui),function(){this.tempEnv1=new Y,this.selectedSegment=new dn}),ci=(li.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},function(){this._index=null;var t=arguments[0];this._index=t}),hi={HotPixelSnapAction:{configurable:!0}},pi=(ci.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],i=arguments[2],r=e.getSafeEnvelope(),o=new pi(e,n,i);return this._index.query(r,{interfaces_:function(){return[Je]},visitItem:function(t){t.select(r,o)}}),o.isNodeAdded()}},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},hi.HotPixelSnapAction.get=function(){return pi},Object.defineProperties(ci,hi),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],i=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=i}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[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(li)),fi=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new It},gi=(fi.prototype.processIntersections=function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this._li.computeIntersection(r,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,i,1)}},fi.prototype.isDone=function(){return!1},fi.prototype.getInteriorIntersections=function(){return this._interiorIntersections},fi.prototype.interfaces_=function(){return[Wn]},fi.prototype.getClass=function(){return fi},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 rt,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()}),di=(gi.prototype.checkCorrectness=function(t){var e=gn.getNodedSubstrings(t),n=new oi(e);try{n.checkValid()}catch(t){if(!(t instanceof z))throw t;t.printStackTrace()}},gi.prototype.getNodedSubstrings=function(){return gn.getNodedSubstrings(this._nodedSegStrings)},gi.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},gi.prototype.findInteriorIntersections=function(t,e){var n=new fi(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},gi.prototype.computeVertexSnaps=function(){if(M(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof gn)for(var n=arguments[0],i=n.getCoordinates(),r=0;r<i.length;r++){var o=new ai(i[r],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,r)&&n.addIntersection(i[r],r)}},gi.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new bn,this._pointSnapper=new ci(this._noder.getIndex()),this.snapRound(t,this._li)},gi.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=new ai(n,this._scaleFactor,this._li);this._pointSnapper.snap(i)}},gi.prototype.interfaces_=function(){return[xn]},gi.prototype.getClass=function(){return gi},function(){if(this._argGeom=null,this._distance=null,this._bufParams=new wn,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}}),yi={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}},_i=(di.prototype.bufferFixedPrecision=function(t){var e=new ri(new gi(new fe(1)),t.getScale()),n=new ii(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},di.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=di.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Ce))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],i=di.precisionScaleFactor(this._argGeom,this._distance,n),r=new fe(i);this.bufferFixedPrecision(r)}},di.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()},di.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},di.prototype.bufferOriginalPrecision=function(){try{var t=new ii(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Q))throw t;this._saveException=t}},di.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},di.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new di(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],i=new di(arguments[0]);return i.setQuadrantSegments(n),i.getResultGeometry(e)}if(arguments[2]instanceof wn&&arguments[0]instanceof ct&&"number"==typeof arguments[1]){var r=arguments[1];return new di(arguments[0],arguments[2]).getResultGeometry(r)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],u=new di(arguments[0]);return u.setQuadrantSegments(s),u.setEndCapStyle(a),u.getResultGeometry(o)}},di.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=T.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(r)/Math.log(10)+1);return Math.pow(10,o)},yi.CAP_ROUND.get=function(){return wn.CAP_ROUND},yi.CAP_BUTT.get=function(){return wn.CAP_FLAT},yi.CAP_FLAT.get=function(){return wn.CAP_FLAT},yi.CAP_SQUARE.get=function(){return wn.CAP_SQUARE},yi.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(di,yi),function(){this._pt=[new w,new w],this._distance=v.NaN,this._isNull=!0}),mi=(_i.prototype.getCoordinates=function(){return this._pt},_i.prototype.getCoordinate=function(t){return this._pt[t]},_i.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 i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},_i.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],i=arguments[1],r=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=r,this._isNull=!1}},_i.prototype.getDistance=function(){return this._distance},_i.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 i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i},function(){}),vi=(mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi},mi.computeDistance=function(){if(arguments[2]instanceof _i&&arguments[0]instanceof Jt&&arguments[1]instanceof w)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),i=new dn,r=0;r<n.length-1;r++){i.setCoordinates(n[r],n[r+1]);var o=i.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof _i&&arguments[0]instanceof Qt&&arguments[1]instanceof w){var s=arguments[0],a=arguments[1],u=arguments[2];mi.computeDistance(s.getExteriorRing(),a,u);for(var l=0;l<s.getNumInteriorRing();l++)mi.computeDistance(s.getInteriorRingN(l),a,u)}else if(arguments[2]instanceof _i&&arguments[0]instanceof ct&&arguments[1]instanceof w){var c=arguments[0],h=arguments[1],p=arguments[2];if(c instanceof Jt)mi.computeDistance(c,h,p);else if(c instanceof Qt)mi.computeDistance(c,h,p);else if(c instanceof zt)for(var f=c,g=0;g<f.getNumGeometries();g++){var d=f.getGeometryN(g);mi.computeDistance(d,h,p)}else p.setMinimum(c.getCoordinate(),h)}else if(arguments[2]instanceof _i&&arguments[0]instanceof dn&&arguments[1]instanceof w){var y=arguments[1],_=arguments[2],m=arguments[0].closestPoint(y);_.setMinimum(m,y)}},function(t){this._maxPtDist=new _i,this._inputGeom=t||null}),xi={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}},Ei=(vi.prototype.computeMaxMidpointDistance=function(t){var e=new bi(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vi.prototype.computeMaxVertexDistance=function(t){var e=new Ei(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vi.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},vi.prototype.getDistancePoints=function(){return this._maxPtDist},vi.prototype.interfaces_=function(){return[]},vi.prototype.getClass=function(){return vi},xi.MaxPointDistanceFilter.get=function(){return Ei},xi.MaxMidpointDistanceFilter.get=function(){return bi},Object.defineProperties(vi,xi),function(t){this._maxPtDist=new _i,this._minPtDist=new _i,this._geom=t||null}),bi=(Ei.prototype.filter=function(t){this._minPtDist.initialize(),mi.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ei.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ei.prototype.interfaces_=function(){return[ft]},Ei.prototype.getClass=function(){return Ei},function(t){this._maxPtDist=new _i,this._minPtDist=new _i,this._geom=t||null}),Ii=(bi.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),i=t.getCoordinate(e),r=new w((n.x+i.x)/2,(n.y+i.y)/2);this._minPtDist.initialize(),mi.computeDistance(this._geom,r,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},bi.prototype.isDone=function(){return!1},bi.prototype.isGeometryChanged=function(){return!1},bi.prototype.getMaxPointDistance=function(){return this._maxPtDist},bi.prototype.interfaces_=function(){return[qt]},bi.prototype.getClass=function(){return bi},function(t){this._comps=t||null}),wi=(Ii.prototype.filter=function(t){t instanceof Qt&&this._comps.add(t)},Ii.prototype.interfaces_=function(){return[Ut]},Ii.prototype.getClass=function(){return Ii},Ii.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Ii.getPolygons(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof zt&&e.apply(new Ii(n)),n}},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}}),Ni=(wi.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 Jt&&this._lines.add(t)},wi.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},wi.prototype.interfaces_=function(){return[lt]},wi.prototype.getClass=function(){return wi},wi.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(wi.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(wi.getLines(e,n))}},wi.getLines=function(){if(1===arguments.length){var t=arguments[0];return wi.getLines(t,!1)}if(2===arguments.length){if(M(arguments[0],xt)&&M(arguments[1],xt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var i=n.next();wi.getLines(i,e)}return e}if(arguments[0]instanceof ct&&"boolean"==typeof arguments[1]){var r=arguments[0],o=arguments[1],s=new It;return r.apply(new wi(s,o)),s}if(arguments[0]instanceof ct&&M(arguments[1],xt)){var a=arguments[0],u=arguments[1];return a instanceof Jt?u.add(a):a.apply(new wi(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&M(arguments[0],xt)&&M(arguments[1],xt)){for(var l=arguments[1],c=arguments[2],h=arguments[0].iterator();h.hasNext();){var p=h.next();wi.getLines(p,l,c)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&M(arguments[1],xt)){var f=arguments[1],g=arguments[2];return arguments[0].apply(new wi(f,g)),f}}},function(){if(this._boundaryRule=gt.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}}),Li=(Ni.prototype.locateInternal=function(){if(arguments[0]instanceof w&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return C.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===C.EXTERIOR)return C.EXTERIOR;if(i===C.BOUNDARY)return C.BOUNDARY;for(var r=0;r<e.getNumInteriorRing();r++){var o=e.getInteriorRingN(r),s=this.locateInPolygonRing(t,o);if(s===C.INTERIOR)return C.EXTERIOR;if(s===C.BOUNDARY)return C.BOUNDARY}return C.INTERIOR}if(arguments[0]instanceof w&&arguments[1]instanceof Jt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return C.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!a.equals(l[0])&&!a.equals(l[l.length-1])?at.isOnLine(a,l)?C.INTERIOR:C.EXTERIOR:C.BOUNDARY}if(arguments[0]instanceof w&&arguments[1]instanceof Zt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?C.INTERIOR:C.EXTERIOR}},Ni.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):C.EXTERIOR},Ni.prototype.intersects=function(t,e){return this.locate(t,e)!==C.EXTERIOR},Ni.prototype.updateLocationInfo=function(t){t===C.INTERIOR&&(this._isIn=!0),t===C.BOUNDARY&&this._numBoundaries++},Ni.prototype.computeLocation=function(t,e){if(e instanceof Zt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Jt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Qt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof jt)for(var n=e,i=0;i<n.getNumGeometries();i++){var r=n.getGeometryN(i);this.updateLocationInfo(this.locateInternal(t,r))}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 zt)for(var u=new qn(e);u.hasNext();){var l=u.next();l!==e&&this.computeLocation(t,l)}},Ni.prototype.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:e instanceof Jt||e instanceof Qt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?C.BOUNDARY:this._numBoundaries>0||this._isIn?C.INTERIOR:C.EXTERIOR)},Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];this._component=e,this._segIndex=n,this._pt=i}}),Si={INSIDE_AREA:{configurable:!0}},Ci=(Li.prototype.isInsideArea=function(){return this._segIndex===Li.INSIDE_AREA},Li.prototype.getCoordinate=function(){return this._pt},Li.prototype.getGeometryComponent=function(){return this._component},Li.prototype.getSegmentIndex=function(){return this._segIndex},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li},Si.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Li,Si),function(t){this._pts=t||null}),Pi=(Ci.prototype.filter=function(t){t instanceof Zt&&this._pts.add(t)},Ci.prototype.interfaces_=function(){return[Ut]},Ci.prototype.getClass=function(){return Ci},Ci.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Zt?Qe.singletonList(t):Ci.getPoints(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof zt&&e.apply(new Ci(n)),n}},function(){this._locations=null;var t=arguments[0];this._locations=t}),Mi=(Pi.prototype.filter=function(t){(t instanceof Zt||t instanceof Jt||t instanceof Qt)&&this._locations.add(new Li(t,0,t.getCoordinate()))},Pi.prototype.interfaces_=function(){return[Ut]},Pi.prototype.getClass=function(){return Pi},Pi.getLocations=function(t){var e=new It;return t.apply(new Pi(e)),e},function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Ni,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],i=arguments[1],r=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=i,this._terminateDistance=r}}),Ti=(Mi.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],i=1-e,r=Ii.getPolygons(this._geom[e]);if(r.size()>0){var o=Pi.getLocations(this._geom[i]);if(this.computeContainmentDistance(o,r,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[i]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&M(arguments[0],bt)&&M(arguments[1],bt)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Li&&arguments[1]instanceof Qt){var p=arguments[0],f=arguments[1],g=arguments[2],d=p.getCoordinate();if(C.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=p,g[1]=new Li(f,d),null}},Mi.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this._minDistance<=this._terminateDistance)return null}},Mi.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=wi.getLines(this._geom[0]),n=wi.getLines(this._geom[1]),i=Ci.getPoints(this._geom[0]),r=Ci.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,r,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(i,r,t),void this.updateMinDistance(t,!1))))},Mi.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Mi.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Mi.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Mi.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 Jt&&arguments[1]instanceof Zt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;o<i.length-1;o++){var s=at.distancePointLine(r,i[o],i[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new dn(i[o],i[o+1]).closestPoint(r);n[0]=new Li(t,o,a),n[1]=new Li(e,0,r)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Jt&&arguments[1]instanceof Jt){var u=arguments[0],l=arguments[1],c=arguments[2];if(u.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),p=l.getCoordinates(),f=0;f<h.length-1;f++)for(var g=0;g<p.length-1;g++){var d=at.distanceLineLine(h[f],h[f+1],p[g],p[g+1]);if(d<this._minDistance){this._minDistance=d;var y=new dn(h[f],h[f+1]),_=new dn(p[g],p[g+1]),m=y.closestPoints(_);c[0]=new Li(u,f,m[0]),c[1]=new Li(l,g,m[1])}if(this._minDistance<=this._terminateDistance)return null}}},Mi.prototype.computeMinDistancePoints=function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o),a=r.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Li(r,0,r.getCoordinate()),n[1]=new Li(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Mi.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)},Mi.prototype.computeMinDistanceLines=function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this._minDistance<=this._terminateDistance)return null}},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.distance=function(t,e){return new Mi(t,e).distance()},Mi.isWithinDistance=function(t,e,n){return new Mi(t,e,n).distance()<=n},Mi.nearestPoints=function(t,e){return new Mi(t,e).nearestPoints()},function(){this._pt=[new w,new w],this._distance=v.NaN,this._isNull=!0}),Ri=(Ti.prototype.getCoordinates=function(){return this._pt},Ti.prototype.getCoordinate=function(t){return this._pt[t]},Ti.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 i=e.distance(n);i<this._distance&&this.initialize(e,n,i)}},Ti.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],i=arguments[1],r=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(i),this._distance=r,this._isNull=!1}},Ti.prototype.toString=function(){return $.toLineString(this._pt[0],this._pt[1])},Ti.prototype.getDistance=function(){return this._distance},Ti.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 i=e.distance(n);i>this._distance&&this.initialize(e,n,i)}},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},function(){}),Oi=(Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.computeDistance=function(){if(arguments[2]instanceof Ti&&arguments[0]instanceof Jt&&arguments[1]instanceof w)for(var t=arguments[0],e=arguments[1],n=arguments[2],i=new dn,r=t.getCoordinates(),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 Ti&&arguments[0]instanceof Qt&&arguments[1]instanceof w){var a=arguments[0],u=arguments[1],l=arguments[2];Ri.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)Ri.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof Ti&&arguments[0]instanceof ct&&arguments[1]instanceof w){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Jt)Ri.computeDistance(h,p,f);else if(h instanceof Qt)Ri.computeDistance(h,p,f);else if(h instanceof zt)for(var g=h,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Ri.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof Ti&&arguments[0]instanceof dn&&arguments[1]instanceof w){var _=arguments[1],m=arguments[2],v=arguments[0].closestPoint(_);m.setMinimum(v,_)}},function(){this._g0=null,this._g1=null,this._ptDist=new Ti,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}),Ai={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}},Di=(Oi.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Oi.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new m("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Oi.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Oi.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Oi.prototype.computeOrientedDistance=function(t,e,n){var i=new Di(e);if(t.apply(i),n.setMaximum(i.getMaxPointDistance()),this._densifyFrac>0){var r=new Fi(e,this._densifyFrac);t.apply(r),n.setMaximum(r.getMaxPointDistance())}},Oi.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.distance=function(){if(2===arguments.length)return new Oi(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Oi(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Ai.MaxPointDistanceFilter.get=function(){return Di},Ai.MaxDensifiedByFractionDistanceFilter.get=function(){return Fi},Object.defineProperties(Oi,Ai),function(){this._maxPtDist=new Ti,this._minPtDist=new Ti,this._euclideanDist=new Ri,this._geom=null;var t=arguments[0];this._geom=t}),Fi=(Di.prototype.filter=function(t){this._minPtDist.initialize(),Ri.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Di.prototype.getMaxPointDistance=function(){return this._maxPtDist},Di.prototype.interfaces_=function(){return[ft]},Di.prototype.getClass=function(){return Di},function(){this._maxPtDist=new Ti,this._minPtDist=new Ti,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))}),ki=(Fi.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),i=t.getCoordinate(e),r=(i.x-n.x)/this._numSubSegs,o=(i.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*r,u=n.y+s*o,l=new w(a,u);this._minPtDist.initialize(),Ri.computeDistance(this._geom,l,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Fi.prototype.isDone=function(){return!1},Fi.prototype.isGeometryChanged=function(){return!1},Fi.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fi.prototype.interfaces_=function(){return[qt]},Fi.prototype.getClass=function(){return Fi},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}),Gi={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}},Bi=(ki.prototype.checkMaximumDistance=function(t,e,n){var i=new Oi(e,t);if(i.setDensifyFraction(.25),this._maxDistanceFound=i.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var r=i.getCoordinates();this._errorLocation=r[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+$.toLineString(r[0],r[1])+")"}},ki.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=ki.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(),ki.VERBOSE&&V.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},ki.prototype.checkNegativeValid=function(){if(!(this._input instanceof Qt||this._input instanceof ne||this._input instanceof zt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},ki.prototype.getErrorIndicator=function(){return this._errorIndicator},ki.prototype.checkMinimumDistance=function(t,e,n){var i=new Mi(t,e,n);if(this._minDistanceFound=i.distance(),this._minDistanceFound<n){this._isValid=!1;var r=i.nearestPoints();this._errorLocation=i.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+$.toLineString(r[0],r[1])+" )"}},ki.prototype.checkPositiveValid=function(){var t=this._result.getBoundary();if(this.checkMinimumDistance(this._input,t,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,t,this._maxValidDistance)},ki.prototype.getErrorLocation=function(){return this._errorLocation},ki.prototype.getPolygonLines=function(t){for(var e=new It,n=new wi(e),i=Ii.getPolygons(t).iterator();i.hasNext();)i.next().apply(n);return t.getFactory().buildGeometry(e)},ki.prototype.getErrorMessage=function(){return this._errMsg},ki.prototype.interfaces_=function(){return[]},ki.prototype.getClass=function(){return ki},Gi.VERBOSE.get=function(){return!1},Gi.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(ki,Gi),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}),Ui={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}},qi=(Bi.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},Bi.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Bi.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")},Bi.prototype.checkDistance=function(){var t=new ki(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")},Bi.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")},Bi.prototype.checkPolygonal=function(){this._result instanceof Qt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Bi.prototype.getErrorIndicator=function(){return this._errorIndicator},Bi.prototype.getErrorLocation=function(){return this._errorLocation},Bi.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Bi.prototype.report=function(t){if(!Bi.VERBOSE)return null;V.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Bi.prototype.getErrorMessage=function(){return this._errorMsg},Bi.prototype.interfaces_=function(){return[]},Bi.prototype.getClass=function(){return Bi},Bi.isValidMsg=function(t,e,n){var i=new Bi(t,e,n);return i.isValid()?null:i.getErrorMessage()},Bi.isValid=function(t,e,n){return!!new Bi(t,e,n).isValid()},Ui.VERBOSE.get=function(){return!1},Ui.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Bi,Ui),function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),zi=(qi.prototype.getCoordinates=function(){return this._pts},qi.prototype.size=function(){return this._pts.length},qi.prototype.getCoordinate=function(t){return this._pts[t]},qi.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},qi.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},qi.prototype.setData=function(t){this._data=t},qi.prototype.getData=function(){return this._data},qi.prototype.toString=function(){return $.toLineString(new ue(this._pts))},qi.prototype.interfaces_=function(){return[pn]},qi.prototype.getClass=function(){return qi},function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new It,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null}),ji=(zi.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zi.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zi.prototype.getIntersectionSegments=function(){return this._intSegments},zi.prototype.count=function(){return this._intersectionCount},zi.prototype.getIntersections=function(){return this._intersections},zi.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zi.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zi.prototype.processIntersections=function(t,e,n,i){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===i)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,i))return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=r,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++)},zi.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zi.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zi.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zi.prototype.interfaces_=function(){return[Wn]},zi.prototype.getClass=function(){return zi},zi.createAllIntersectionsFinder=function(t){var e=new zi(t);return e.setFindAllIntersections(!0),e},zi.createAnyIntersectionFinder=function(t){return new zi(t)},zi.createIntersectionCounter=function(t){var e=new zi(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},function(){this._li=new rt,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t}),Vi=(ji.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},ji.prototype.getIntersections=function(){return this._segInt.getIntersections()},ji.prototype.isValid=function(){return this.execute(),this._isValid},ji.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},ji.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zi(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new bn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},ji.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ce(this.getErrorMessage(),this._segInt.getInteriorIntersection())},ji.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+$.toLineString(t[0],t[1])+" and "+$.toLineString(t[2],t[3])},ji.prototype.interfaces_=function(){return[]},ji.prototype.getClass=function(){return ji},ji.computeIntersections=function(t){var e=new ji(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},function t(){this._nv=null;var e=arguments[0];this._nv=new ji(t.toSegmentStrings(e))}),Xi=(Vi.prototype.checkValid=function(){this._nv.checkValid()},Vi.prototype.interfaces_=function(){return[]},Vi.prototype.getClass=function(){return Vi},Vi.toSegmentStrings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var i=n.next();e.add(new qi(i.getCoordinates(),i))}return e},Vi.checkValid=function(t){new Vi(t).checkValid()},function(t){this._mapOp=t}),Yi=(Xi.prototype.map=function(t){for(var e=new It,n=0;n<t.getNumGeometries();n++){var i=this._mapOp.map(t.getGeometryN(n));i.isEmpty()||e.add(i)}return t.getFactory().createGeometryCollection(_e.toGeometryArray(e))},Xi.prototype.interfaces_=function(){return[]},Xi.prototype.getClass=function(){return Xi},Xi.map=function(t,e){return new Xi(e).map(t)},function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new It,this._resultLineList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n}),Hi=(Yi.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)}},Yi.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yi.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yi.prototype.collectLineEdge=function(t,e,n){var i=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Lr.isResultOfOp(i,e)||r.isCovered()||(n.add(r),t.setVisitedEdge(!0)))},Yi.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(),i=n.getEdge();if(n.isLineEdge()&&!i.isCoveredSet()){var r=this._op.isCoveredByA(n.getCoordinate());i.setCovered(r)}}},Yi.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},Yi.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),i=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(i),n.setInResult(!0)}},Yi.prototype.collectBoundaryTouchEdge=function(t,e,n){var i=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Lr.isResultOfOp(i,e)&&e===Lr.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yi.prototype.interfaces_=function(){return[]},Yi.prototype.getClass=function(){return Yi},function(){this._op=null,this._geometryFactory=null,this._resultPointList=new It;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e}),Wi=(Hi.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hi.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!==Lr.INTERSECTION)){var i=n.getLabel();Lr.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},Hi.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hi.prototype.interfaces_=function(){return[]},Hi.prototype.getClass=function(){return Hi},function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}),Ji=(Wi.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Wi.prototype.transformPolygon=function(t,e){var n=!0,i=this.transformLinearRing(t.getExteriorRing(),t);null!==i&&i instanceof ee&&!i.isEmpty()||(n=!1);for(var r=new It,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ee||(n=!1),r.add(s))}if(n)return this._factory.createPolygon(i,r.toArray([]));var a=new It;return null!==i&&a.add(i),a.addAll(r),this._factory.buildGeometry(a)},Wi.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Wi.prototype.getInputGeometry=function(){return this._inputGeom},Wi.prototype.transformMultiLineString=function(t,e){for(var n=new It,i=0;i<t.getNumGeometries();i++){var r=this.transformLineString(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},Wi.prototype.transformCoordinates=function(t,e){return this.copy(t)},Wi.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Wi.prototype.transformMultiPoint=function(t,e){for(var n=new It,i=0;i<t.getNumGeometries();i++){var r=this.transformPoint(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},Wi.prototype.transformMultiPolygon=function(t,e){for(var n=new It,i=0;i<t.getNumGeometries();i++){var r=this.transformPolygon(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this._factory.buildGeometry(n)},Wi.prototype.copy=function(t){return t.copy()},Wi.prototype.transformGeometryCollection=function(t,e){for(var n=new It,i=0;i<t.getNumGeometries();i++){var r=this.transform(t.getGeometryN(i));null!==r&&(this._pruneEmptyGeometry&&r.isEmpty()||n.add(r))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(_e.toGeometryArray(n)):this._factory.buildGeometry(n)},Wi.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Zt)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 Jt)return this.transformLineString(t,null);if(t instanceof jt)return this.transformMultiLineString(t,null);if(t instanceof Qt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof zt)return this.transformGeometryCollection(t,null);throw new m("Unknown Geometry subtype: "+t.getClass().getName())},Wi.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var i=n.size();return i>0&&i<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Wi.prototype.interfaces_=function(){return[]},Wi.prototype.getClass=function(){return Wi},function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Jt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=i}}),Ki=(Ji.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i<n;i++){var r=t.get(i),o=this.findSnapForVertex(r,e);null!==o&&(t.set(i,new w(o)),0===i&&this._isClosed&&t.set(t.size()-1,new w(o)))}},Ji.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},Ji.prototype.snapTo=function(t){var e=new Nt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Ji.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 i=0;i<n;i++){var r=e[i],o=this.findSegmentIndexToSnap(r,t);o>=0&&t.add(o+1,new w(r),!1)}},Ji.prototype.findSegmentIndexToSnap=function(t,e){for(var n=v.MAX_VALUE,i=-1,r=0;r<e.size()-1;r++){if(this._seg.p0=e.get(r),this._seg.p1=e.get(r+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,i=r)}return i},Ji.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Ji.prototype.interfaces_=function(){return[]},Ji.prototype.getClass=function(){return Ji},Ji.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])},function(t){this._srcGeom=t||null}),Zi={SNAP_PRECISION_FACTOR:{configurable:!0}},$i=(Ki.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new $i(e,n).transform(this._srcGeom)},Ki.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),i=new $i(t,n,!0).transform(this._srcGeom),r=i;return e&&M(r,$t)&&(r=i.buffer(0)),r},Ki.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Ki.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},Ki.prototype.computeMinimumSegmentLength=function(t){for(var e=v.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);i<e&&(e=i)}return e},Ki.prototype.interfaces_=function(){return[]},Ki.prototype.getClass=function(){return Ki},Ki.snap=function(t,e,n){var i=new Array(2).fill(null),r=new Ki(t);i[0]=r.snapTo(e,n);var o=new Ki(e);return i[1]=o.snapTo(i[0],n),i},Ki.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Ki.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fe.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(Ki.computeOverlaySnapTolerance(r),Ki.computeOverlaySnapTolerance(o))}},Ki.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Ki.SNAP_PRECISION_FACTOR},Ki.snapToSelf=function(t,e,n){return new Ki(t).snapToSelf(e,n)},Zi.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Ki,Zi),function(t){function e(e,n,i){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==i&&i}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 Ji(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wi)),Qi=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},tr=(Qi.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},Qi.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qi.signExpBits(this._commonBits),this._isFirst=!1,null):Qi.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qi.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qi.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qi.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),i=n.substring(n.length-64);return i.substring(0,1)+" "+i.substring(1,12)+"(exp) "+i.substring(12)+" [ "+e+" ]"}},Qi.prototype.interfaces_=function(){return[]},Qi.prototype.getClass=function(){return Qi},Qi.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Qi.signExpBits=function(t){return t>>52},Qi.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qi.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(Qi.getBit(t,i)!==Qi.getBit(e,i))return n;n++}return 52},function(){this._commonCoord=null,this._ccFilter=new nr}),er={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}},nr=(tr.prototype.addCommonBits=function(t){var e=new ir(this._commonCoord);t.apply(e),t.geometryChanged()},tr.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new w(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ir(e);return t.apply(n),t.geometryChanged(),t},tr.prototype.getCommonCoordinate=function(){return this._commonCoord},tr.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},er.CommonCoordinateFilter.get=function(){return nr},er.Translater.get=function(){return ir},Object.defineProperties(tr,er),function(){this._commonBitsX=new Qi,this._commonBitsY=new Qi}),ir=(nr.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},nr.prototype.getCommonCoordinate=function(){return new w(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},nr.prototype.interfaces_=function(){return[ft]},nr.prototype.getClass=function(){return nr},function(){this.trans=null;var t=arguments[0];this.trans=t}),rr=(ir.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},ir.prototype.isDone=function(){return!1},ir.prototype.isGeometryChanged=function(){return!0},ir.prototype.interfaces_=function(){return[qt]},ir.prototype.getClass=function(){return ir},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()}),or=(rr.prototype.selfSnap=function(t){return new Ki(t).snapTo(t,this._snapTolerance)},rr.prototype.removeCommonBits=function(t){this._cbr=new tr,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},rr.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},rr.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Lr.overlayOp(e[0],e[1],t);return this.prepareResult(n)},rr.prototype.checkValid=function(t){t.isValid()||V.out.println("Snapped geometry is invalid")},rr.prototype.computeSnapTolerance=function(){this._snapTolerance=Ki.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},rr.prototype.snap=function(t){var e=this.removeCommonBits(t);return Ki.snap(e[0],e[1],this._snapTolerance)},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.overlayOp=function(t,e,n){return new rr(t,e).getResultGeometry(n)},rr.union=function(t,e){return rr.overlayOp(t,e,Lr.UNION)},rr.intersection=function(t,e){return rr.overlayOp(t,e,Lr.INTERSECTION)},rr.symDifference=function(t,e){return rr.overlayOp(t,e,Lr.SYMDIFFERENCE)},rr.difference=function(t,e){return rr.overlayOp(t,e,Lr.DIFFERENCE)},function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e}),sr=(or.prototype.getResultGeometry=function(t){var e=null,n=!1,i=null;try{e=Lr.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;i=t}if(!n)try{e=rr.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?i:t}return e},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},or.overlayOp=function(t,e,n){return new or(t,e).getResultGeometry(n)},or.union=function(t,e){return or.overlayOp(t,e,Lr.UNION)},or.intersection=function(t,e){return or.overlayOp(t,e,Lr.INTERSECTION)},or.symDifference=function(t,e){return or.overlayOp(t,e,Lr.SYMDIFFERENCE)},or.difference=function(t,e){return or.overlayOp(t,e,Lr.DIFFERENCE)},function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}),ar=(sr.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},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 i=arguments[0],r=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=i,this._xValue=r,this._obj=o}}),ur={INSERT:{configurable:!0},DELETE:{configurable:!0}},lr=(ar.prototype.isDelete=function(){return this._eventType===ar.DELETE},ar.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ar.prototype.getObject=function(){return this._obj},ar.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},ar.prototype.getInsertEvent=function(){return this._insertEvent},ar.prototype.isInsert=function(){return this._eventType===ar.INSERT},ar.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ar.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ar.prototype.interfaces_=function(){return[E]},ar.prototype.getClass=function(){return ar},ur.INSERT.get=function(){return 1},ur.DELETE.get=function(){return 2},Object.defineProperties(ar,ur),function(){}),cr=(lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},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}),hr=(cr.prototype.isTrivialIntersection=function(t,e,n,i){if(t===n&&1===this._li.getIntersectionNum()){if(cr.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},cr.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},cr.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},cr.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},cr.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next().getCoordinate();if(t.isIntersection(i))return!0}return!1},cr.prototype.hasProperIntersection=function(){return this._hasProper},cr.prototype.hasIntersection=function(){return this._hasIntersection},cr.prototype.isDone=function(){return this._isDone},cr.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},cr.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},cr.prototype.addIntersections=function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this._li.computeIntersection(r,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,i,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))))},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},cr.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},function(t){function e(){t.call(this),this.events=new It,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.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 cr&&M(arguments[0],bt)&&M(arguments[1],bt)){var i=arguments[0],r=arguments[1],o=arguments[2];this.addEdges(i,i),this.addEdges(r,r),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&M(arguments[0],bt)&&arguments[1]instanceof cr){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(),i=n.getStartIndexes(),r=0;r<i.length-1;r++){var o=new sr(n,r),s=new ar(e,n.getMinX(r),o);this.events.add(s),this.events.add(new ar(n.getMaxX(r),s))}},e.prototype.processOverlaps=function(t,e,n,i){for(var r=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(r.computeIntersections(a,i),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[1],i=arguments[0].iterator();i.hasNext();){var r=i.next();this.addEdge(r,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(lr)),pr=function(){this._min=v.POSITIVE_INFINITY,this._max=v.NEGATIVE_INFINITY},fr={NodeComparator:{configurable:!0}},gr=(pr.prototype.getMin=function(){return this._min},pr.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},pr.prototype.getMax=function(){return this._max},pr.prototype.toString=function(){return $.toLineString(new w(this._min,0),new w(this._max,0))},pr.prototype.interfaces_=function(){return[]},pr.prototype.getClass=function(){return pr},fr.NodeComparator.get=function(){return gr},Object.defineProperties(pr,fr),function(){}),dr=(gr.prototype.compare=function(t,e){var n=t,i=e,r=(n._min+n._max)/2,o=(i._min+i._max)/2;return r<o?-1:r>o?1:0},gr.prototype.interfaces_=function(){return[I]},gr.prototype.getClass=function(){return gr},function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],i=arguments[2];this._min=e,this._max=n,this._item=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pr)),yr=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pr),_r=function(){this._leaves=new It,this._root=null,this._level=0},mr=(_r.prototype.buildTree=function(){Qe.sort(this._leaves,new pr.NodeComparator);for(var t=this._leaves,e=null,n=new It;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_r.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 dr(t,e,n))},_r.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_r.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},_r.prototype.printNode=function(t){V.out.println($.toLineString(new w(t._min,this._level),new w(t._max,this._level)))},_r.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},_r.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(i);else{var r=new yr(t.get(n),t.get(n+1));e.add(r)}}},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},function(){this._items=new It}),vr=(mr.prototype.visitItem=function(t){this._items.add(t)},mr.prototype.getItems=function(){return this._items},mr.prototype.interfaces_=function(){return[Je]},mr.prototype.getClass=function(){return mr},function(){this._index=null;var t=arguments[0];if(!M(t,$t))throw new m("Argument must be Polygonal");this._index=new br(t)}),xr={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}},Er=(vr.prototype.locate=function(t){var e=new st(t),n=new Er(e);return this._index.query(t.y,t.y,n),e.getLocation()},vr.prototype.interfaces_=function(){return[Un]},vr.prototype.getClass=function(){return vr},xr.SegmentVisitor.get=function(){return Er},xr.IntervalIndexedGeometry.get=function(){return br},Object.defineProperties(vr,xr),function(){this._counter=null;var t=arguments[0];this._counter=t}),br=(Er.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Er.prototype.interfaces_=function(){return[Je]},Er.prototype.getClass=function(){return Er},function(){this._index=new _r;var t=arguments[0];this.init(t)}),Ir=(br.prototype.init=function(t){for(var e=wi.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},br.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),i=Math.min(n.p0.y,n.p1.y),r=Math.max(n.p0.y,n.p1.y);this._index.insert(i,r,n)}},br.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new mr;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2];this._index.query(i,r,o)}},br.prototype.interfaces_=function(){return[]},br.prototype.getClass=function(){return br},function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new pe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Ni,2===arguments.length){var e=arguments[0],n=arguments[1],i=gt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=i,null!==n&&this.add(n)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=r,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 i=this._nodes.addNode(n).getLabel(),r=1;C.NONE,i.getLocation(t,Ne.ON)===C.BOUNDARY&&r++;var o=e.determineBoundary(this._boundaryNodeRule,r);i.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[1],i=arguments[2],r=new cr(arguments[0],!0,!1);r.setIsDoneIfProperInt(i);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof ee||this._parentGeom instanceof Qt||this._parentGeom instanceof ne,a=n||!s;return o.computeIntersections(this._edges,r,a),this.addSelfIntersectionNodes(this._argIndex),r}},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 i=new cr(e,n,!0);return i.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,i),i},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 Zt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,C.INTERIOR)}else if(arguments[0]instanceof w){var e=arguments[0];this.insertPoint(this._argIndex,e,C.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),C.EXTERIOR,C.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,C.INTERIOR,C.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],C.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],C.BOUNDARY)},e.prototype.addLineString=function(t){var e=Lt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new ni(e,new Re(this._argIndex,C.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,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===C.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 i=Lt.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=i[0],null;var r=e,o=n;at.isCCW(i)&&(r=n,o=e);var s=new ni(i,new Re(this._argIndex,C.BOUNDARY,r,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,i[0],C.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var i=this._nodes.addNode(e),r=i.getLabel();null===r?i._label=new Re(t,n):r.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new hr},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,i)}},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 Qt)this.addPolygon(e);else if(e instanceof Jt)this.addLineString(e);else if(e instanceof Zt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof jt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof zt))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 M(this._parentGeom,$t)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vr(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)?C.BOUNDARY:C.INTERIOR},e}(Ve)),wr=function(){if(this._li=new rt,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 Ir(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=gt.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 Ir(0,e,i),this._arg[1]=new Ir(1,n,i)}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];r.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Ir(0,r,s),this._arg[1]=new Ir(1,o,s)}},Nr=(wr.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},wr.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},function(){}),Lr=(Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Nr.map=function(){if(arguments[0]instanceof ct&&M(arguments[1],Nr.MapOp)){for(var t=arguments[0],e=arguments[1],n=new It,i=0;i<t.getNumGeometries();i++){var r=e.map(t.getGeometryN(i));null!==r&&n.add(r)}return t.getFactory().buildGeometry(n)}if(M(arguments[0],xt)&&M(arguments[1],Nr.MapOp)){for(var o=arguments[0],s=arguments[1],a=new It,u=o.iterator();u.hasNext();){var l=u.next(),c=s.map(l);null!==c&&a.add(c)}return a}},Nr.MapOp=function(){},function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Ni,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Hn,this._resultPolyList=new It,this._resultLineList=new It,this._resultPointList=new It,this._graph=new Ve(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(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Re(t.getLabel())).flip();var r=e.getDepth();r.isNull()&&r.add(n),r.add(i),n.merge(i)}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,i,r){var o=new It;return o.addAll(t),o.addAll(n),o.addAll(i),o.isEmpty()?e.createEmptyResult(r,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 i=n.next();if(this._ptLocator.locate(t,i)!==C.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new It,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 It;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Vi.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 i=new Yi(this,this._geomFact,this._ptLocator);this._resultLineList=i.build(t);var r=new Hi(this,this._geomFact,this._ptLocator);this._resultPointList=r.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 i=n.next(),r=i.getLabel();r.isArea()&&!i.isInteriorAreaEdge()&&e.isResultOfOp(r.getLocation(0,Ne.RIGHT),r.getLocation(1,Ne.RIGHT),t)&&i.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),i=e.getDepth();if(!i.isNull()){i.normalize();for(var r=0;r<2;r++)n.isNull(r)||!n.isArea()||i.isNull(r)||(0===i.getDelta(r)?n.toLine(r):(et.isTrue(!i.isNull(r,Ne.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(r,Ne.LEFT,i.getLocation(r,Ne.LEFT)),et.isTrue(!i.isNull(r,Ne.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(r,Ne.RIGHT,i.getLocation(r,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}(wr)),Sr=(Lr.overlayOp=function(t,e,n){return new Lr(t,e).getResultGeometry(n)},Lr.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Lr.createEmptyResult(Lr.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xi.map(t,{interfaces_:function(){return[Nr.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),or.overlayOp(t,e,Lr.INTERSECTION)},Lr.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Lr.createEmptyResult(Lr.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),or.overlayOp(t,e,Lr.SYMDIFFERENCE)},Lr.resultDimension=function(t,e,n){var i=e.getDimension(),r=n.getDimension(),o=-1;switch(t){case Lr.INTERSECTION:o=Math.min(i,r);break;case Lr.UNION:o=Math.max(i,r);break;case Lr.DIFFERENCE:o=i;break;case Lr.SYMDIFFERENCE:o=Math.max(i,r)}return o},Lr.createEmptyResult=function(t,e,n,i){var r=null;switch(Lr.resultDimension(t,e,n)){case-1:r=i.createGeometryCollection(new Array(0).fill(null));break;case 0:r=i.createPoint();break;case 1:r=i.createLineString();break;case 2:r=i.createPolygon()}return r},Lr.difference=function(t,e){return t.isEmpty()?Lr.createEmptyResult(Lr.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),or.overlayOp(t,e,Lr.DIFFERENCE))},Lr.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),i=t.getLocation(1);return Lr.isResultOfOp(n,i,e)}if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];switch(r===C.BOUNDARY&&(r=C.INTERIOR),o===C.BOUNDARY&&(o=C.INTERIOR),s){case Lr.INTERSECTION:return r===C.INTERIOR&&o===C.INTERIOR;case Lr.UNION:return r===C.INTERIOR||o===C.INTERIOR;case Lr.DIFFERENCE:return r===C.INTERIOR&&o!==C.INTERIOR;case Lr.SYMDIFFERENCE:return r===C.INTERIOR&&o!==C.INTERIOR||r!==C.INTERIOR&&o===C.INTERIOR}return!1}},Lr.INTERSECTION=1,Lr.UNION=2,Lr.DIFFERENCE=3,Lr.SYMDIFFERENCE=4,function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Ni,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)}),Cr=(Sr.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),i=0;i<n.size()-1;i++)if(n.getCoordinate(i,this._seg.p0),n.getCoordinate(i+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Sr.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?C.BOUNDARY:this._ptLocator.locate(t,this._g)},Sr.prototype.extractLinework=function(t){var e=new Cr;t.apply(e);var n=e.getLinework(),i=_e.toLineStringArray(n);return t.getFactory().createMultiLineString(i)},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr},function(){this._linework=null,this._linework=new It}),Pr=(Cr.prototype.getLinework=function(){return this._linework},Cr.prototype.filter=function(t){if(t instanceof Qt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Cr.prototype.interfaces_=function(){return[Ut]},Cr.prototype.getClass=function(){return Cr},function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t}),Mr=(Pr.prototype.extractPoints=function(t,e,n){for(var i=t.getCoordinates(),r=0;r<i.length-1;r++)this.computeOffsetPoints(i[r],i[r+1],e,n)},Pr.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pr.prototype.getPoints=function(t){for(var e=new It,n=wi.getLines(this._g).iterator();n.hasNext();){var i=n.next();this.extractPoints(i,t,e)}return e},Pr.prototype.computeOffsetPoints=function(t,e,n,i){var r=e.x-t.x,o=e.y-t.y,s=Math.sqrt(r*r+o*o),a=n*r/s,u=n*o/s,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new w(l-u,c+a);i.add(h)}if(this._doRight){var p=new w(l+u,c-a);i.add(p)}},Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},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 It;var e=arguments[0],n=arguments[1],i=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,i],this._locFinder=[new Sr(this._geom[0],this._boundaryDistanceTolerance),new Sr(this._geom[1],this._boundaryDistanceTolerance),new Sr(this._geom[2],this._boundaryDistanceTolerance)]}),Tr={TOLERANCE:{configurable:!0}},Rr=(Mr.prototype.reportResult=function(t,e,n){V.out.println("Overlay result invalid - A:"+C.toLocationSymbol(e[0])+" B:"+C.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+C.toLocationSymbol(e[2]))},Mr.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Mr.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 i=arguments[0],r=arguments[1];return this._location[0]=this._locFinder[0].getLocation(r),this._location[1]=this._locFinder[1].getLocation(r),this._location[2]=this._locFinder[2].getLocation(r),!!Mr.hasLocation(this._location,C.BOUNDARY)||this.isValidResult(i,this._location)}},Mr.prototype.addTestPts=function(t){var e=new Pr(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Mr.prototype.isValidResult=function(t,e){var n=Lr.isResultOfOp(e[0],e[1],t),i=!(n^e[2]===C.INTERIOR);return i||this.reportResult(t,e,n),i},Mr.prototype.getInvalidLocation=function(){return this._invalidLocation},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Mr.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Ki.computeSizeBasedSnapTolerance(t),Ki.computeSizeBasedSnapTolerance(e))},Mr.isValid=function(t,e,n,i){return new Mr(t,e,i).isValid(n)},Tr.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Mr,Tr),function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e}),Or=(Rr.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);this._skipEmpty&&i.isEmpty()||e.add(i)}},Rr.prototype.combine=function(){for(var t=new It,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)},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.combine=function(){if(1===arguments.length)return new Rr(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Rr(Rr.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];return new Rr(Rr.createList(n,i,r)).combine()}},Rr.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Rr.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new It;return n.add(t),n.add(e),n}if(3===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=new It;return s.add(i),s.add(r),s.add(o),s}},function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new It)}),Ar={STRTREE_NODE_CAPACITY:{configurable:!0}},Dr=(Or.prototype.reduceToGeometries=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var i=n.next(),r=null;M(i,bt)?r=this.unionTree(i):i instanceof ct&&(r=i),e.add(r)}return e},Or.prototype.extractByEnvelope=function(t,e,n){for(var i=new It,r=0;r<e.getNumGeometries();r++){var o=e.getGeometryN(r);o.getEnvelopeInternal().intersects(t)?i.add(o):n.add(o)}return this._geomFactory.buildGeometry(i)},Or.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i))return Rr.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var r=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,r)},Or.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(Or.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var i=t.itemsTree();return this.unionTree(i)},Or.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],i=arguments[2];if(i-n<=1){var r=Or.getGeometry(e,n);return this.unionSafe(r,null)}if(i-n==2)return this.unionSafe(Or.getGeometry(e,n),Or.getGeometry(e,n+1));var o=Math.trunc((i+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,i);return this.unionSafe(s,a)}},Or.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e=null===e?i.copy():e.union(i)}return e},Or.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Or.prototype.unionActual=function(t,e){return Or.restrictToPolygons(t.union(e))},Or.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Or.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var i=new It,r=this.extractByEnvelope(n,t,i),o=this.extractByEnvelope(n,e,i),s=this.unionActual(r,o);return i.add(s),Rr.combine(i)},Or.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)}},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.restrictToPolygons=function(t){if(M(t,$t))return t;var e=Ii.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_e.toPolygonArray(e))},Or.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Or.union=function(t){return new Or(t).union()},Ar.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Or,Ar),function(){});Dr.prototype.interfaces_=function(){return[]},Dr.prototype.getClass=function(){return Dr},Dr.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Lr.createEmptyResult(Lr.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),or.overlayOp(t,e,Lr.UNION)},t.GeoJSONReader=Ie,t.GeoJSONWriter=we,t.OverlayOp=Lr,t.UnionOp=Dr,t.BufferOp=di,Object.defineProperty(t,"__esModule",{value:!0})}(e)},61:(t,e,n)=>{var i=n(698).default;t.exports=function(){"use strict";t.exports=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var e,n={},r=Object.prototype,o=r.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a=(E="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",u=E.asyncIterator||"@@asyncIterator",l=E.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,n){return t[e]=n}}function h(t,n,i,r){var o,a,u,l;return n=n&&n.prototype instanceof m?n:m,n=Object.create(n.prototype),r=new C(r||[]),s(n,"_invoke",{value:(o=t,a=i,u=r,l=f,function(t,n){if(l===d)throw new Error("Generator is already running");if(l===y){if("throw"===t)throw n;return{value:e,done:!0}}for(u.method=t,u.arg=n;;){var i=u.delegate;if(i&&(i=function t(n,i){var r=i.method,o=n.iterator[r];return o===e?(i.delegate=null,"throw"===r&&n.iterator.return&&(i.method="return",i.arg=e,t(n,i),"throw"===i.method)||"return"!==r&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_):"throw"===(r=p(o,n.iterator,i.arg)).type?(i.method="throw",i.arg=r.arg,i.delegate=null,_):(o=r.arg)?o.done?(i[n.resultName]=o.value,i.next=n.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,_):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,_)}(i,u),i)){if(i===_)continue;return i}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(l===f)throw l=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(l=d,"normal"===(i=p(o,a,u)).type){if(l=u.done?y:g,i.arg===_)continue;return{value:i.arg,done:u.done}}"throw"===i.type&&(l=y,u.method="throw",u.arg=i.arg)}})}),n}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var f="suspendedStart",g="suspendedYield",d="executing",y="completed",_={};function m(){}function v(){}function x(){}var E,b,I=(c(E={},a,(function(){return this})),(b=(b=Object.getPrototypeOf)&&b(b(P([]))))&&b!==r&&o.call(b,a)&&(E=b),x.prototype=m.prototype=Object.create(E));function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){var n;s(this,"_invoke",{value:function(r,s){function a(){return new e((function(n,a){!function n(r,s,a,u){var l;if("throw"!==(r=p(t[r],t,s)).type)return(s=(l=r.arg).value)&&"object"==i(s)&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}));u(r.arg)}(r,s,n,a)}))}return n=n?n.then(a,a):a()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function P(t){if(t||""===t){var n,r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(r=function i(){for(;++n<t.length;)if(o.call(t,n))return i.value=t[n],i.done=!1,i;return i.value=e,i.done=!0,i}).next=r}throw new TypeError(i(t)+" is not iterable")}return s(I,"constructor",{value:v.prototype=x,configurable:!0}),s(x,"constructor",{value:v,configurable:!0}),v.displayName=c(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){return!!(t="function"==typeof t&&t.constructor)&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(I),t},n.awrap=function(t){return{__await:t}},w(N.prototype),c(N.prototype,u,(function(){return this})),n.AsyncIterator=N,n.async=function(t,e,i,r,o){void 0===o&&(o=Promise);var s=new N(h(t,e,i,r),o);return n.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},w(I),c(I,l,"Generator"),c(I,a,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e,n=Object(t),i=[];for(e in n)i.push(e);return i.reverse(),function t(){for(;i.length;){var e=i.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},n.values=P,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(i,r){return a.type="throw",a.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var r=this.tryEntries.length-1;0<=r;--r){var s=this.tryEntries[r],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),l=o.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}var s=(r=r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc?null:r)?r.completion:{};return s.type=t,s.arg=e,r?(this.method="next",this.next=r.finallyLoc,_):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),_},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),_}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,i,r=this.tryEntries[e];if(r.tryLoc===t)return"throw"===(n=r.completion).type&&(i=n.arg,S(r)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:P(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),_}},n},t.exports.__esModule=!0,t.exports.default=t.exports},698:t=>{function e(n){return t.exports=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},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:(t,e,n)=>{n=n(61)(),t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},n={},t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i={},(()=>{"use strict";function e(t,e,n,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(i,r)}function n(t){return function(){var n=this,i=arguments;return new Promise((function(r,o){var s=t.apply(n,i);function a(t){e(s,r,o,a,u,"next",t)}function u(t){e(s,r,o,a,u,"throw",t)}a(void 0)}))}}function r(t,e){if(null==t)return{};for(var n,i={},r=Object.keys(t),o=0;o<r.length;o++)n=r[o],0<=e.indexOf(n)||(i[n]=t[n]);return i}function o(){return(o=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,i=arguments[e];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}t.r(i),t.d(i,{MapLayer:()=>yt,RegisterMapBoxMethod:()=>function(t,e){if(t&&t.Map){ri=t,-1===(window.mapboxgl=ri).Map.prototype._setupPainter.toString().indexOf("webgl2")&&(i=ri.Map.prototype._setupPainter,ri.Map.prototype._setupPainter=function(){var t=this._canvas.getContext;this._canvas.getContext=function(e,n){return t.apply(this,["webgl2",n])||t.apply(this,["webgl",n])||t.apply(this,["experimental-webgl",n])},i.apply(this),this._canvas.getContext=t});var i,s,u=t.Map,h=function(t,e){var i=t.prototype.setStyle,s=t.prototype.addControl;return{initData:function(){var t;this[hi]||(this[hi]={},this.style[hi]={},t=[],gi(this,{source:t=e&&Array.isArray(e)&&0<e.length&&e.every((function(t){return"string"==typeof t}))?e:t,defaultSources:t,layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{},measure:{line:0,circle:0,polygon:0}}),gi(this.style,{layerObject:{}}))},clearData:function(){gi(this,{source:di(this,"defaultSources"),layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{}})},setPaint:function(t,e){fi(this,t,e,"setPaintProperty")},setLayout:function(t,e){fi(this,t,e,"setLayoutProperty")},customStyle:function(t){if(t&&"object"==typeof t)for(var e in t){var n,i=t[e];"string"==typeof i?pi(this,e,i):Array.isArray(i)&&(si(i[0])||Array.isArray(i[0]))&&(n=null,"number"!=typeof i[1]&&!Array.isArray(i[1])||(n=i[1]),pi(this,e,i[0],n))}},getAllLayerAndSource:function(t,e){void 0===e&&(e=!0),null==t&&(t=di(this,"source"));for(var n,i=this.getStyle(),r=i.layers,o=i.sources,s={layers:[],sources:[]},a=0;a<r.length;)"background"===r[a].type||t.includes(r[a].source)||(n=r[a].id,this.getLayer(n)&&(s.layers.push(l(r[a])),e||this.removeLayer(n))),a++;var u,c=[];for(u in o)c.push(u);for(var h=0;h<c.length;){var p=c[h];t.includes(p)||this.isSourceLoaded(p)&&(s.sources.push({name:p,source:l(o[p])}),e||this.removeSource(p)),h++}return s},removeAllCustomLayer:function(){var t=this,e=di(this,"customLayer");e.forEach((function(e){t.getLayer(e.layer.id)&&t.removeLayer(e.layer.id)})),e.length=0},removeAllLayerAndSource:function(t){return null==t&&(t=di(this,"source")),this.removeAllCustomLayer(),this.getAllLayerAndSource(t,!1)},removeEvents:function(t){var e=this;void 0===t&&(t=["click","mousemove","mouseout"]),Array.isArray(t)&&t.forEach((function(t){t in e._listeners&&(e._listeners[t]=[])}))},removePopup:function(t){t&&"string"==typeof t?["tooltip","popup"].includes(t)&&this._popups.forEach((function(e){e.options.type===t&&e.remove()})):this._popups.forEach((function(t){t.remove()}))},findCustomLayer:function(t,e){null==e&&(e=di(this,"source"));for(var n=this.getStyle().layers,i=[],r=0;r<n.length;)"background"===n[r].type||e.includes(n[r].source)||i.push(n[r]),r++;if(t){if("string"==typeof t)return i.filter((function(e){return e.type===t}));if(Array.isArray(t)&&0<t.length)return i.filter((function(e){return t.includes(e.type)}))}return i},MapTooltip:function(t,e){return new M(this,t,e)},MapPopup:function(t,e){return new R(this,t,e)},addLayer:function(t,e){void 0===this._layers&&(this._layers=[],this._sortLayers=[]),t.id&&this._layers.push(t),"zIndex"in t&&this._sortLayers.push(t),this._lazyInitEmptyStyle();var n=di(this,"layerIndex"),i=di(this,"customLayer");return"custom"===t.type&&i.push({layer:t,beforeId:e}),e?-1!==(i=n.findIndex((function(t){return t.id===e})))&&n.splice(i,0,{type:t.type,id:t.id}):n.push({type:t.type,id:t.id}),this.style.addLayer(t,e),"zIndex"in t&&(i=this._sortLayers.sort((function(t,e){return t.zIndex-e.zIndex})),this.orderLayers(i.map((function(t){return t.id})))),this.fire("layerdata",o({},t,{add:!0})),this._update(!0)},removeLayer:function(t){var e=this.style.getLayer(t),n=(this._layers=this._layers.filter((function(e){return e.id!==t})),this._sortLayers=this._sortLayers.filter((function(e){return e.id!==t})),di(this,"customLayer")),i=di(this,"layerIndex"),r=n.findIndex((function(e){return e.layer.id===t}));return-1!==r&&n.splice(r,1),n=i.findIndex((function(e){return e.id===t})),-1!==n&&i.splice(n,1),this.style.removeLayer(t),this.fire("layerdata",o({},e,{add:!1})),this._update(!0)},moveLayer:function(t,e){var n,i=di(this,"layerIndex"),r=i.findIndex((function(e){return e.id===t})),o=i.findIndex((function(t){return t.id===e}));return-1!==r&&-1!==o&&(n=i.splice(r,1)[0],o<0?o=0:o>i.length&&(o=i.length),i.splice(o,0,n)),this.style.moveLayer(t,e),this._update(!0)},MapLine:function(){return new A(this)},MapCustom:function(){return new D(this)},fitBoundsGeoJson:function(t,e,n){t&&(t=[[(t=rt(t)).bbox[0],t.bbox[1]],[t.bbox[2],t.bbox[3]]],this.fitBoundsPosition(t,e,n))},fitBoundsPosition:function(t,e,n){var i,s,a,u;Array.isArray(t)&&0!==(null==t?void 0:t.length)&&(i=void 0===(i=(e=null!=e?e:{}).padding)?40:i,s=void 0===(s=e.animate)||s,a=void 0===(a=e.maxZoom)?15:a,u=void 0===(u=e.essential)||u,e=r(e,ei),this.fitBounds(t,o({linear:!1,padding:i,animate:s,essential:u,maxZoom:a},e),n))},getInvertMask:function(t,e){var n;if(c(t)&&0!==(t=null!=(t=t.features[0].geometry.coordinates)?t:[]).length)return n=[],t.forEach((function(t){n.push(t[0])})),e=(t=null!=e?e:{}).id,t=void 0===(t=t.layerConfig)?{paint:{"fill-color":"rgba(0,0,0,0.8)"},layout:{visibility:"visible"}}:t,o({id:void 0===e?"mask":e,type:"fill",source:{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,90],[180,90],[180,-90],[-180,-90]]].concat(n)}}}},t)},fitMap:function(){for(var t={},e=!1,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var s=void 0===(s=i[0])?null:s,a=void 0===(a=i[1])?null:a,u=di(this,"bounds"),l=di(this,"cameraOptions");s?c(s)?(e=!1,u=s,a&&!c(a)&&"object"==typeof a&&(l=a)):"object"==typeof s&&(e=!0,t=s):u&&(e=!0),e&&u&&this.fitBoundsGeoJson(u,o({},l,t))},loadImages:function(t){var e=this;return new Promise((function(n){var i={};if(t&&0!==Object.keys(t).length)for(var o in t){var s,a,u=t[o];"string"==typeof u?e.loadImage(u,l(o)):"object"==typeof u&&(u.url?(s=u.url,a=r(u,ni),e.loadImage(s,l(o,a))):u.layer&&u.layer.render&&"function"==typeof u.layer.render&&l(o,u.config||{})(null,u.layer))}else n(i);function l(e,r){return function(o,s){i[e]={data:r,url:o?null:s},Object.keys(i).length===Object.keys(t).length&&n(i)}}}))},loadAddImages:function(t){var e=this;return new Promise((function(n){e.loadImages(t).then((function(t){for(var i in t){var r=t[i],s=o({},null==r?void 0:r.data,{type:"custom"});e.hasImage(i)||e.addImage(i,r.url,s)}n()}))}))},MapCircle:function(){return new ht(this)},MapEvent:function(t){return new pt(this,t)},MapMoreCustom:function(){return new dt(this)},removeLayerSource:function(t){function e(t){n.getSource(t)&&(n.removeLayer(t),n.removeSource(t))}var n=this,i=t.name,r=null!=(r=t.sources)?r:[];t=null!=(t=t.layers)?t:[],Array.isArray(i)&&0<i.length?i.forEach((function(t){e(t)})):"string"==typeof i&&e(i),0<(null==r?void 0:r.length)&&0<(null==t?void 0:t.length)&&(t.forEach((function(t){n.getLayer(t)&&n.removeLayer(t)})),r.forEach((function(t){n.getSource(t)&&n.removeSource(t)})))},removeLayerEvent:function(t,e){if(void 0===e&&(e=!0),"object"==typeof t&&null!=t)if(t.destroy&&"function"==typeof t.destroy)t.destroy();else for(var n in t)t[n]&&t[n].destroy&&"function"==typeof t[n].destroy&&(t[n].destroy(),e)&&(t[n]=null)},MapMarker:function(t){return new xt(this,t)},findCustomIcon:function(){var t,e=this.style.imageManager.images,n={};for(t in e)"custom"===e[t].type&&(n[t]=e[t]);return n},getCustomLayer:function(){var t=this,e=di(this,"customLayer"),n=[];return e.map((function(e){t.getLayer(e.layer.id)&&n.push(e.layer)})),n},setStyle:function(t,e,n){var r,o,s,a,u,l,c=this;return null!=e&&e.save&&(s=(o=null!=e?e:{}).source,o=void 0!==(o=o.custom)&&o,s=null!=(r=s=void 0===s?[]:s)?r:[],di(this,"images"),a=di(this,"layerSource"),u=di(this,"customLayer"),l=this.findCustomIcon(),Array.isArray(s)&&0!==s.length?o||(s=Array.from(new Set([].concat(s,["composite","mapbox://mapbox.satellite"])))):s=["composite","mapbox://mapbox.satellite"],a=this.getAllLayerAndSource(s),this.once("style.load",(function(i){var r,o=[];for(r in l)o.push(r),c.style.imageManager.images[r]=l[r];var s=[];a.sources.map((function(t){var e=a.layers.filter((function(e){return e.source===t.name}));s.push({name:t.name,source:t.source,layer:e})})),null!=e&&e.log&&console.log(s),s.map((function(t){c.getSource(t.name)||c.addSource(t.name,t.source),t.layer.map((function(t){c.getLayer(t.id)||c.addLayer(t)}))})),u.forEach((function(t){c.getLayer(t.layer.id)||c.addLayer(t.layer,t.beforeId)})),n&&"function"==typeof n&&n({style:t,images:o,layerSource:a})}))),i.call(this,t,e)},getLayerIndex:function(t){var e=di(this,"layerIndex");if(t){var n=e.findIndex((function(e){return e.id===t}));if(-1!==n)return n}return 0===e.length?0:e.length-1},getLayerId:function(t,e){void 0===e&&(e=0);var n=di(this,"layerIndex");return t+=e,e=Number(t),isNaN(e)||t<0&&t>=n.length?"":null!=(n=null==n||null==(e=n[t])?void 0:e.id)?n:void 0},getMinLayerId:function(){var t=di(this,"layerIndex");return null!=(t=null==t||null==(t=t[0])?void 0:t.id)?t:void 0},getMaxLayerId:function(){var t=di(this,"layerIndex");return null!=(t=null==t||null==(t=t[t.length-1])?void 0:t.id)?t:void 0},getAllLayerId:function(){return di(this,"layerIndex").map((function(t){return t.id}))},getAllLayer:function(){return di(this,"layerIndex")},getLineLayer:function(){return di(this,"layerIndex").map((function(t,e){return"line"!==t.type?null:{index:e,id:t.id}})).filter(Boolean)},AnimateLine:function(t,e){return new Et(this,t,e)},addHeader:function(t,e){var n,i=di(this,"showHeader");e&&"function"==typeof e&&!i&&(n=this._requestManager.transformRequest,this._requestManager.transformRequest=function(r,s){return s=n.call(this,r,s),(r=e(r))&&"boolean"==typeof r?(i=!0,o({headers:t},s)):s})},getTileByPosition:function(t,e){var n,i;return t&&Array.isArray(t)&&2<=t.length&&t.every((function(t){return"number"==typeof t}))?(n=(t=ri.MercatorCoordinate.fromLngLat({lng:t[0],lat:t[1]})).x,t=t.y,e=null!=(i=e)?i:this.getZoom(),i=Math.floor(e),e=Math.pow(2,i),[Math.floor(n*e),Math.floor(t*e),i]):[]},getPositionByTile:function(t){var e,n,i,r;return!(t&&Array.isArray(t)&&3===t.length&&t.every((function(t){return"number"==typeof t})))||(r=t[0],e=t[1],t=Math.floor(t[2]),t=Math.pow(2,t),r<0)||e<0||t<=r||t<=e?[]:(n=I(e/t),i=b(r/t),r=b((r+1)/t),[i,I((e+1)/t),r,n])},getTilesByBounds:function(t,e){var n=void 0===(n=(e=null!=(e=e=void 0===e?{}:e)?e:{}).expand)?0:n,i=(e=void 0!==(e=e.reversal)&&e,t=null!=(r=t)?r:this.getZoom(),Math.floor(t)),r=this.getBounds().toArray(),o=(t=this.getTileByPosition(r[0],i))[0],s=t[1],a=(t=this.getTileByPosition(r[1],i))[0],u=t[1];if(u-=n="number"!=typeof n||n<0||2<n?0:n,a+=n,s+=n,!(E(o-=n)&&E(a)&&E(u)&&E(s)))return[];var l=[];if(e)for(var c=u;c<=s;c++)for(var h=o;h<=a;h++)l.push([h,c,i]);else for(var p=o;p<=a;p++)for(var f=u;f<=s;f++)l.push([p,f,i]);var g=Math.pow(2,i);return l.forEach((function(t){t[0]<0&&(t[0]=t[0]+g)})),l.filter((function(t){return 0<=t[1]}))},loadSpriteGraph:function(t){var e=this;return new Promise(function(){var i=n(a().mark((function i(r){var o,s,u,l;return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t)return o=[],"object"==typeof t&&t.image&&t.json?o=[t]:Array.isArray(t)&&t.every((function(t){return"object"==typeof t&&t.image&&t.json}))&&(o=t),s={},u=function(){var t=n(a().mark((function t(){var e,n,i,r,u,l,c,h,p,f,g,d,y,_,m,v,x;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(e<o.length){if(n=o[e].image,i=o[e].json,r={},"string"==typeof i)return t.next=8,fetch(i).then((function(t){return t.json()}));t.next=12}else t.next=20;break;case 8:u=t.sent,r="object"==typeof u?u:{},t.next=13;break;case 12:"object"==typeof i&&(r=i);case 13:return t.next=15,function(){return wt.apply(this,arguments)}(n);case 15:for(c in l=t.sent,r)v=r[c],h=v.width,p=v.height,f=v.x,g=v.y,d=v.sdf,y=v.pixelRatio,_=v.stretchX,m=v.stretchY,v=v.content,x=new bt({width:h,height:p}),bt.copy(l,x,{x:f,y:g},{x:0,y:0},{width:h,height:p}),s[c]={data:x,pixelRatio:y,sdf:d,stretchX:_,stretchY:m,content:v};case 17:e++,t.next=1;break;case 20:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),i.next=7,u();i.next=9;break;case 7:for(l in s)e.style.addImage(l,s[l]);r();case 9:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}())},MapClusterMarker:function(t){return new Lt(this,t)},MapSourceEvent:function(t,e){return new Ct(this,t,e)},TileByGeoJson:function(t){return new Bt(this,t)},MapMenu:function(t){return new Vt(this,t)},MapMeasure:function(t){return new re(this,t,hi)},addControl:function(t,e){return this.initData(),s.call(this,t,e)},MapTileClusterCustom:function(t){return new ae(this,t)},updateGlyphs:function(t){this.style.updateGlyphs(t)},orderLayers:function(t){void 0===t&&(t=[]);var e=this.style._layers,n=Object.keys(e).map((function(t){return e[t]})),i=[],r=[];return t.forEach((function(t){var e;t&&(e=n.find((function(e){return e.id===t})))&&i.push(e)})),n.forEach((function(t){i.find((function(e){return e.id===t.id}))||r.push(t)})),t=r.concat(i),this.style._checkLoaded(),this.style._changed=!0,this.style._order=t.map((function(t){return t.id})),this.style._layerOrderChanged=!0,t},MapPositionImage:function(){return new ue(this)}}}(u,e);for(s in new Event("layerdata"),h)u.prototype[s]=h[s];var p,f=ri.Style,g=function(t){var e=t.prototype.addImage,n=t.prototype.updateImage,i=t.prototype._loadSprite,o=t.prototype.queryRenderedFeatures,s=t.prototype.addLayer,a=t.prototype.removeLayer;return{addImage:function(t,n){return n.type="custom",e.call(this,t,n),this},updateImage:function(t,e){e.type="custom",n.call(this,t,e)},_loadSprite:function(t,e){var n,r=this;void 0===e&&(e=!1),i.call(this,t),e&&(n=this._availableImages.length,this.map.on("data",(function t(e){var i=r._availableImages.length;if("style"===e.dataType&&i!==n&&n<i){for(var o=r._availableImages.slice(n),s=0;s<o.length;s++)r.imageManager.images[o[s]].type="custom";r.map.off("data",t)}})))},loadSprite:function(t){this._loadSprite(t,!0)},addLayer:function(t,e){for(var n=void 0===(n=t.interactive)||n,i=(null!=this&&null!=(i=this[hi])&&i.layerObject||gi(this,{layerObject:{}}),this),r=["layerObject",t.id],o=i[hi],a=0;a<r.length-1;a++){var u=r[a];o[u]||(o[u]={}),o=o[u]}o[r[r.length-1]]=n,s.call(this,t,e)},removeLayer:function(t){var e=["layerObject",t];if(e.reduce((function(t,e){return t[e]}),this[hi])){for(var n=this[hi],i=0;i<e.length-1;i++)n=n[e[i]];n&&e[e.length-1]in n&&delete n[e[e.length-1]]}a.call(this,t)},queryRenderedFeatures:function(t,e,n){var i=void 0===(i=(e=null!=e?e:{}).interactive)||i,s=(e=r(e,ii),o.call(this,t,e,n));if(i){if(0<s.length)for(var a=0;a<s.length;a++){var u=di(this,["layerObject",s[a].layer.id]);s[a].layer.interactive=null==u||u}return s.filter((function(t){return t.layer.interactive}))}return s},updateGlyphs:function(t){this.glyphManager.setURL(t)}}}(f);for(p in g)f.prototype[p]=g[p];var d=(t=ri.Popup).prototype.setDOMContent;t.prototype._closeClick=function(){},t.prototype.setDOMContent=function(t){return t=d.call(this,t),this._closeButton&&this._closeButton.addEventListener("click",this._closeClick),t}}},RegisterMapBoxModel:()=>function(t,e){if(ri&&t&&e){(oi=t).GLTFLoader=e,window.THREE=oi;var n,i=ri.Map,r={initGLTF:function(t,e,n){return new O(t,e,n)}};for(n in r)i.prototype[n]=r[n]}},RegisterMapClass:()=>function(t,e){var n;t&&(n=(e=null!=e?e:{}).tooltipClass,e=e.popupClass,t.tooltipClass=null!=n?n:"commonTooltip",t.popupClass=null!=e?e:"commonPopup")},convertPolygonToLinePolygon:()=>function(t,e){if(c(t)){var n=t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})),i=(n=[].concat(n.map((function(t){return he(t)})),t.features.filter((function(t){return"LineString"===t.geometry.type||"MultiLineString"===t.geometry.type}))),[]);if(n.forEach((function(t){t=Fn(t,e,{units:"meters"}),i.push.apply(i,t.features)})),0<i.length)return{type:"FeatureCollection",features:i}}return null},deepClone:()=>l,gcj02ToWgs84:()=>Dt,getAPNGSymbol:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).width)?50:e,i=void 0===(e=t.height)?50:e,r=void 0===(e=t.duration)?null:e,o=void 0===(e=t.url)?"":e;return new Promise((function(t){fetch(o).then((function(t){return t.arrayBuffer()})).then((function(e){var o;e=C()(e),!(0,S.isNotAPNG)(e)&&0<(null==(o=e.frames)?void 0:o.length)?(r="number"==typeof r?r:e.playTime/e.frames.length,o=e.frames.map((function(t){return URL.createObjectURL(t.imageData)})),Promise.all(o.map((function(t){var e=new Image;return e.src=t,new Promise((function(t){e.onload=function(){var r;((r=document.createElement("canvas")).width=n,r.height=i,r=r.getContext("2d")).drawImage(e,0,0,n,i),t(r.getImageData(0,0,n,i).data)}}))}))).then((function(e){e={urls:e,width:n,height:i,data:new Uint8Array(n*i*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.canvas=t,this.context=t.getContext("2d"),this.index=0,this.duration=r,this.dataNow=performance.now()},render:function(){var t=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=t,this.map.triggerRepaint(),!0}},t(e)})).catch((function(e){t(null)}))):t(null)}))}))},getArrayDepth:()=>_,getGifSymbol:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).width)?50:e,i=void 0===(e=t.height)?50:e,r=void 0===(e=t.duration)?null:e,o=void 0===(e=t.url)?"":e;return new Promise((function(t){var e,s,a;o&&("gif"===(a=(s=o).split("/"))[a.length-1].split(".").pop().toLowerCase()||s.startsWith("data:image/gif"))?(a=document.createElement("div"),(s=document.createElement("img")).setAttribute("rel:animated_src",o),s.setAttribute("rel:auto_play","0"),a.appendChild(s),(e=new(L())({gif:s})).load((function(){var o=[];r="number"==typeof r?r:e.get_duration_ms()/e.get_length();for(var s,a=1;a<=e.get_length();a++){e.move_to(a);var u=((u=e.get_canvas().getContext("2d")).drawImage(e.get_canvas(),0,0,n,i),u.getImageData(0,0,n,i).data);o.push(u)}0<o.length?(s={urls:o,width:n,height:i,data:new Uint8Array(n*i*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.canvas=t,this.context=t.getContext("2d"),this.index=0,this.duration=r,this.dataNow=performance.now()},render:function(){var t=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=t,this.map.triggerRepaint(),!0}},t(s)):t(null)}))):t(null)}))},getPositionType:()=>d,getSymbolRipple:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).size)?30:e,i=void 0===(e=t.duration)?1e3:e,r=void 0===(e=t.color)?"#f00":e,o=t.custom,s=m(r,!0),a=!1;return o&&"function"==typeof o&&(a=!0),{width:n,height:n,data:new Uint8Array(n*n*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.context=t.getContext("2d")},render:function(){var t,e,u,l=this.context;return a?l=o({width:this.width,height:this.height,duration:i,color:r,context:l}):(t=performance.now()%i/i,e=n/2*.2,u=n/2*t,l.clearRect(0,0,this.width,this.height),l.beginPath(),l.arc(this.width/2,this.height/2,u,0,2*Math.PI),l.strokeStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t+.1)+")",l.lineWidth=2,l.stroke(),l.fillStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t)+")",l.fill(),l.beginPath(),l.arc(this.width/2,this.height/2,e,0,2*Math.PI),l.fillStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t)+")",l.lineWidth=2+4*(1-t),l.fill()),this.data=l.getImageData(0,0,this.width,this.height).data,this.map.triggerRepaint(),!0}}},hexToRgba:()=>m,invertMask:()=>function(t,e){if(c(t)){var n=(e&&Array.isArray(e)&&"Polygon"===d(e)||(e=[[[-180,90],[180,90],[180,-90],[-180,-90],[-180,90]]]),t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})));if(0===n.length)return null;if(1===n)return{type:"FeatureCollection",features:n};for(var i=n[0],r=0;r<n.slice(1).length;r++)i=ti(i,n[r+1]);return{type:"FeatureCollection",features:[Qn(i,U(e))]}}},isClosedGraph:()=>y,isGeoJSON:()=>c,isNumber:()=>x,isValidNumber:()=>E,judgeSizeLngLat:()=>p,latFromMercatorY:()=>I,lngFromMercatorX:()=>b,mergeGeoJson:()=>function(){for(var t={type:"FeatureCollection",features:[]},e=[],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];for(var o=0;o<i.length;o++)Array.isArray(i[o])?e.push.apply(e,i[o]):i[o]&&"object"==typeof i[o]&&e.push(i[o]);for(var s,a=0;a<e.length;a++){var u=e[a];c(u)&&(u=u.features,(s=t.features).push.apply(s,u))}return t},object2Geojson:()=>function(t,e,n){var i=l(t);if(i&&"Object"===u(i)&&(i=[i]),!Array.isArray(i))return null;t={type:"FeatureCollection"};for(var r=[],o=function(t){var o=i[t],s=function(t,e){if(e)if("string"==typeof e){var n=e.split(".").filter(Boolean);if(1!==n.length)return g(t,n);if(n=t[n[0]])return[f(n)]}else if(Array.isArray(e)){if(2===e.length)return[[t[e[0]],t[e[1]]].filter(Boolean)];if(3===e.length&&e[2])return g(t,n=e[2].split(".").filter(Boolean),[e[0],e[1]])}return[]}(o,e);0<s.length&&s.map((function(e){var s=d(e),a=!1;(a=!(!s||!("type"===s||0<e.length||"Feature"===s||"GeometryCollection"===s))||a)&&("GeometryCollection"===s?(null!=(a=e.geometries)?a:[]).forEach((function(e){var o={type:"Feature"};o.geometry=e,n&&n.key&&"string"==typeof n.key&&(n.alias&&"string"==typeof n.alias?o[n.alias]=i[t][n.key]:o[n.key]=i[t][n.key]),r.push(o)})):(a={type:"Feature"},"Feature"!==s?(a.properties=o,a.geometry="type"===s?e:{type:s,coordinates:e}):a=e,n&&n.key&&"string"==typeof n.key&&(n.alias&&"string"==typeof n.alias?a[n.alias]=i[t][n.key]:a[n.key]=i[t][n.key]),r.push(a)))}))},s=0;s<i.length;s++)o(s);return t.features=r,t},outOfChina:()=>At,parseValue:()=>N,performChunk:()=>function(t,e,n){var i,r,o=[];"number"==typeof t?o=new Array(t):Array.isArray(t)&&(o=t),0!==o.length&&"function"==typeof e&&(!(i="function"==typeof n?n:null)&&globalThis.requestIdleCallback&&(i=function(t){requestIdleCallback((function(e){t((function(){return 0<e.timeRemaining()}))}))}),r=0,function t(){r!==o.length&&i((function(n){for(var i=Date.now();n(Date.now()-i)&&r<o.length;){var s=o[r];e(s,r),r++}t()}))}())},pointNearOnLine:()=>function(t,e){return Array.isArray(t)&&Array.isArray(e)?(e=q(e),t=B(t),qn(e,t,{units:"miles"}).geometry.coordinates):null},polygonCenter:()=>function(t){var e;return c(t)?(e={type:"FeatureCollection",features:[]},t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})).forEach((function(t){a=nt(n=t),a=Kn(a,(a[2]-a[0])/100,{units:"degrees"}),i=0,r=null,s=he(n),a.features.forEach((function(t){var e;Ft(t,n)&&(e="FeatureCollection"===s.type?Math.min.apply(Math,s.features.map((function(e){return Xn(t,e,{units:"degrees"})}))):Xn(t,s,{units:"degrees"}),i<e)&&(i=e,r=t)}));var n,i,r,s,a=(r||Qt(n)).geometry.coordinates;e.features.push({type:"Feature",geometry:{type:"Point",coordinates:a},properties:o({},t.properties)})})),e):null},resversalGeojson:()=>v,reversalGeojson:()=>function(t,e){return void 0===e&&(e=!0),v(t,e=!0)},reversalLngLat:()=>h,transformGeojson:()=>function(t,e){return c(t)&&"function"==typeof e?((t=l(t)).features.forEach((function(t){var n=t.geometry;t.geometry.coordinates=w(n.coordinates,e)})),t):null},transformLngLat:()=>w,wgs84ToGcj02:()=>function(t,e){var n,i,r,o,s;return At(t=+t,e=+e)?[t,e]:(n=Rt(t-105,e-35),i=Ot(t-105,e-35),r=e/180*Pt,o=Math.sin(r),o=1-Tt*o*o,s=Math.sqrt(o),n=180*n/(Mt*(1-Tt)/(o*s)*Pt),[t+(i=180*i/(Mt/s*Math.cos(r)*Pt)),e+n])}});var s=t(687),a=t.n(s),u=function(t){var e=typeof t;return"object"!=e?e:Object.prototype.toString.call(t).replace(/^\[object (\S+)\]$/,"$1")},l=function t(e){var n,i=u(e);if("Array"===i)n=[];else{if("Object"!==i)return e;n={}}if("Array"===i)for(var r=0,o=e.length;r<o;r++)n.push(t(e[r]));else if("Object"===i)for(var s in e)n[s]=t(e[s]);return n};function c(t){return"object"==typeof t&&null!==t&&"FeatureCollection"===t.type&&Array.isArray(t.features)}function h(t,e){return void 0===e&&(e=!0),t&&("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))?x(t[0])?p(t,e):function t(e){for(var n=[],i=0;i<e.length;i++){var r=e[i];x(r[0])?n.push(p(r)):n.push(t(r))}return n}(t):[]}function p(t,e){void 0===e&&(e=!0);var n=Number(t[0]);return t=Number(t[1]),e&&n<t?[t,n]:[n,t]}function f(t){return"string"==typeof t?JSON.parse(t):t}function g(t,e,n){var i=[],r=2===(n=void 0===n?[]:n).length;return function t(e,o){var s;e&&o.length&&(s=o.shift(),e.hasOwnProperty(s))&&(e=N(e[s]),Array.isArray(e)?0!==o.length||r?e.forEach((function(e){r?i.push([e[n[0]],e[n[1]]]):t(e,l(o))})):e&&(s=f(e),i.push(s)):"object"==typeof e?0===o.length?i.push(r?[e[n[0]],e[n[1]]]:e):t(e,o):0===o.length&&e&&(s=f(e),i.push(s)))}(t,e),i}function d(t){if(Array.isArray(t)){var e=_(t=t.filter(Boolean));if(0!==e)switch(e){case 1:return"Point";case 2:return"LineString";case 3:return y(t.map((function(t){return[t[0],t[t.length-1]]})))?"Polygon":"MultiLineString";case 4:return"MultiPolygon";default:return null}}else if(t&&"object"==typeof t){if(["Point","LineString","Polygon","MultiLineString","MultiPolygon"].includes(t.type))return"type";if("Feature"===t.type)return"Feature";if("GeometryCollection"===t.type)return"GeometryCollection"}return null}function y(t){if(0===t.length)return!1;function e(t,e,n){return void 0===n&&(n=1e-9),Math.abs(t[0]-e[0])<n&&Math.abs(t[1]-e[1])<n}for(var n=0;n<t.length-1;n++)if(!e(t[n][1],t[n+1][0]))return!1;return e(t[0][0],t[t.length-1][1])}function _(t){return Array.isArray(t)?Array.isArray(t[0])?1+_(t[0]):1:0}function m(t,e){void 0===e&&(e=!1);var n,i,r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,i){return e+e+n+n+i+i}));return(r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r))?(n=parseInt(r[1],16),i=parseInt(r[2],16),r=parseInt(r[3],16),e?[n,i,r,1]:"rgba("+n+","+i+","+r+",1)"):t}function v(t,e){if(void 0===e&&(e=!0),c(t)){for(var n={type:"FeatureCollection",features:[]},i=t.features,r=0;r<i.length;r++){var s,a=i[r],u={};for(s in a)"geometry"!==s&&"properties"!==s&&"type"!==s&&(u[s]=a[s]);var l=a.geometry.coordinates,f=a.geometry.type,g={type:f,coordinates:null};g.coordinates=("Point"===f?p:h)(l,e),n.features.push(o({type:"Feature",geometry:g,properties:a.properties},u))}return n}return null}function x(t){return"number"==typeof t||!("string"!=typeof t||!t||t.includes(" ")||isNaN(Number(t)))}function E(t){return isFinite(t)&&!isNaN(t)}function b(t){return 360*t-180}function I(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function w(t,e){return t&&"function"==typeof e&&("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))?x(t[0])?e(t):function t(e,n){for(var i=[],r=0;r<e.length;r++){var o=e[r];x(o[0])?i.push(n(o)):i.push(t(o,n))}return i}(t,e):[]}function N(t){try{return"string"==typeof t?JSON.parse(t):t}catch(e){return t}}s=t(481);var L=t.n(s),S=t(630),C=t.n(S),P=["customName"],M=function(){function t(t,e,i){var s=this,u=(this._mouseEnter=function(){var t=n(a().mark((function t(e){var n,i,r,o,u,l,c,h,p,f;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("Map"!==e.originalEvent.target.ariaLabel)return t.abrupt("return");t.next=2;break;case 2:if(i=e.point,r=e.lngLat,o=s.map.queryRenderedFeatures(i),c=null!=(c=o[0])?c:{},u=c.properties,l=c.geometry,c.source,c=c.layer,s.layerName.includes(c.id)){t.next=8;break}return null!=(c=s.popup)&&c.remove(),t.abrupt("return");case 8:if(s._mouseEnterProcessed)return t.abrupt("return");t.next=10;break;case 10:if(s._mouseEnterProcessed=!0,c=l.coordinates,h=[r.lng,r.lat],"mouseenter"===s.mouseType&&(h=s._getPosition(c)),!(0<(null==(n=h)?void 0:n.length))){t.next=20;break}for(f in p={},u)if("string"==typeof u[f]&&isNaN(Number(u[f])))try{p[f]=JSON.parse(u[f])}catch(t){p[f]=u[f]}else p[f]=u[f];return t.next=19,s._setHTML(p,h,r,l,i,o);case 19:s._mouseInOut&&"function"==typeof s._mouseInOut&&s._mouseInOut(!0,o,e);case 20:setTimeout((function(){s._mouseEnterProcessed=!1}),0);case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this._mouseLeave=function(t){var e;s._mouseLeaveProcessed||(s._mouseLeaveProcessed=!0,s.popup.remove(),e=t.point,t.lngLat,e=s.map.queryRenderedFeatures(e),s._mouseInOut&&"function"==typeof s._mouseInOut&&s._mouseInOut(!0,e,t),setTimeout((function(){s._mouseLeaveProcessed=!1}),0))},this.map=t,"string"==typeof e?this.layerName=[e]:Array.isArray(e)&&(this.layerName=e),t=null!=(e=t.tooltipClass)?e:"commonTooltip",void 0!==(u=(e=null!=i?i:{}).customName)&&u);e=r(e,P),u=u?"":t+" ",this.className=u,null!=i&&i.className&&(u+=i.className),u=u.split(" ").filter(Boolean).join(" "),this.fullName=u,this.popup=new mapboxgl.Popup(o({},e,{className:u,closeButton:null!=(t=null==i?void 0:i.closeButton)&&t,closeOnClick:null!=(e=null==i?void 0:i.closeOnClick)&&e,anchor:null!=(u=null==i?void 0:i.anchor)?u:"left",type:"tooltip"}))}var e=t.prototype;return e.show=function(t,e){var n=this;"function"==typeof(this.htmlCallBack=t)&&(this.mouseType="mouseenter","move"===e&&(this.mouseType="mousemove"),0<(null==(t=this.layerName)?void 0:t.length))&&this.layerName.forEach((function(t){n.map.on(n.mouseType,t,n._mouseEnter).on("mouseleave",t,n._mouseLeave)}))},e.setClassName=function(t,e){var n=this;void 0===e&&(e=!1),this.popup&&"string"==typeof t&&t!==this.oldClassName&&(Array.from(this.popup._classList).map((function(t){t&&t.replaceAll(" ","")&&n.popup.addClassName(t)})),(e?this.fullName+" "+t:this.className+" "+t).split(" ").filter(Boolean).map((function(t){n.popup.addClassName(t)})),this.oldClassName=t)},e.destroy=function(){var t,e=this;null!=(t=this.popup)&&t.remove(),null!=(t=this.layerName)&&t.forEach((function(t){e.map.off(e.mouseType,t,e._mouseEnter).off("mouseleave",t,e._mouseLeave)}))},e._setHTML=function(){var t=n(a().mark((function t(e,n,i,r,o,s){var u,l,c=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.htmlCallBack(e,n,{lngLat:i,geometry:r,point:o,features:s,feature:s[0]});case 2:u=t.sent,l=function(t){c.popup.setLngLat(n).setHTML(t).addTo(c.map)},"object"==typeof u?u.hasOwnProperty("nodeType")?l(u):u.hasOwnProperty("show")&&"boolean"==typeof u.show?u.show&&l(u.data):l(""):"string"!=typeof u&&"number"!=typeof u||l(u);case 5:case"end":return t.stop()}}),t,this)})));return function(e,n,i,r,o,s){return t.apply(this,arguments)}}(),e.mouseInOut=function(t){t&&"function"==typeof t&&(this._mouseInOut=t)},e.showPosition=function(t,e){var n=this,i=this.map.project(t),r=this.map.queryRenderedFeatures(i),o=null!=(o=r.filter((function(t){return n.layerName.includes(t.layer.id)}))[0])?o:{},s=void 0===(a=o.properties)?{}:a,a=o.geometry;if(o=o.layer,this.layerName.includes((void 0===o?{}:o).id)){o=void 0===(o=(null!=a?a:{}).coordinates)?[]:o;var u=Array.isArray(t)?t:[t.lng,t.lat];if(0<(null==(o=u="mouseenter"===this.mouseType?this._getPosition(o):u)?void 0:o.length)){var l,c={};for(l in s)if("string"==typeof s[l]&&isNaN(Number(s[l])))try{c[l]=JSON.parse(s[l])}catch(t){c[l]=s[l]}else c[l]=s[l];o=e&&"object"==typeof e?e:c,this._setHTML(o,u,t,a,i,r)}}else null!=(e=this.popup)&&e.remove()},e._getPosition=function(t){return function t(e){return Array.isArray(e[0])?t(e[0]):e}(t)},t}(),T=["destroyComponent","customClick","popupClose","closeOther","noCloseLayerName","customName","offset","closeClick"],R=function(){function t(t,e,i){var s=this,u=(this._closeOtherPopup=function(){var t;s.closeOther&&null!=(t=s.map)&&null!=(t=t._popups)&&t.forEach((function(t){var e;"popup"===t.options.type&&(Array.isArray(s.noCloseLayerName)&&0<s.noCloseLayerName.length?(e=t.options.sourceName.join("|"),new RegExp(e).test(s.noCloseLayerName)&&null!=t&&null!=(e=t._onClose)&&e.call(t)):null!=t&&null!=(e=t._onClose)&&e.call(t))}))},this._click=function(){var t=n(a().mark((function t(e){var n,i,r,o,u,l,c,h,p,f,g,d,y,_;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("Map"!==e.originalEvent.target.ariaLabel)return t.abrupt("return");t.next=2;break;case 2:if(s._closeOtherPopup(),n=e.point,i=e.lngLat,r=s.map.queryRenderedFeatures(n),c=null!=(c=r[0])?c:{},o=c.properties,u=c.geometry,c.source,c=c.layer,s.layerName.includes(c.id)){t.next=8;break}return t.abrupt("return");case 8:if(s.customClick){t.next=30;break}for(p in h={},o)if("string"==typeof o[p]&&isNaN(Number(o[p])))try{h[p]=JSON.parse(o[p])}catch(t){h[p]=o[p]}else h[p]=o[p];return f=u.coordinates,g=u.type,t.next=14,null==(c=s.componentCallBack)?void 0:c.call(s,{properties:h,lngLat:i,coordinates:f,point:n,features:r,feature:r[0]});case 14:if(t.t1=l=t.sent,t.t0=null!==t.t1,!t.t0){t.next=18;break}t.t0=void 0!==l;case 18:t.t0?(t.t2=l,t.next=23):t.next=22;break;case 22:t.t2={};case 23:y=t.t2,d=y.component,y=y.instance,_=i,"Point"===g&&(_=f),s.vueInstance=y,d&&(s.popup.setOffset(s.offset),s.popup.setLngLat(_).setDOMContent(d).addTo(s.map));case 30:"function"!=typeof s.callBack||s._clickProcessed||(s._clickProcessed=!0,s.callBack({lngLat:i,properties:o,geometry:u,point:n}),setTimeout((function(){s._clickProcessed=!1}),0));case 31:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.map=t,this.popup=null,"string"==typeof e?this.layerName=[e]:Array.isArray(e)&&(this.layerName=e),void 0!==(l=(e=i||{}).destroyComponent)&&l),l=void 0!==(l=e.customClick)&&l,c=void 0!==(c=e.popupClose)&&c,h=void 0===(h=e.closeOther)||h,p=void 0===(p=e.noCloseLayerName)?[]:p,f=void 0!==(f=e.customName)&&f,g=void 0===(g=e.offset)?[0,0]:g,d=e.closeClick;e=r(e,T),t=null!=(t=t.popupClass)?t:"commonPopup",f=f?"":t+" ",this.className=f,null!=i&&i.className&&(f+=i.className),f=f.split(" ").filter(Boolean).join(" "),this.fullName=f,this.noCloseLayerName=p,this.noCloseLayerName=[],this.customClick=l,this.popupCloseSign=c,this.closeOther=h,this.offset=g="number"==typeof g?[g,g]:g,this.vueInstance=null,this.closeCallback=null,this.customClick||(this.popup=new mapboxgl.Popup(o({},e,{offset:g,className:f,closeButton:null!=(t=null==e?void 0:e.closeButton)&&t,closeOnClick:null!=(i=null==e?void 0:e.closeOnClick)&&i,anchor:null!=(p=null==e?void 0:e.anchor)?p:"bottom",focusAfterOpen:null!=(l=null==e?void 0:e.focusAfterOpen)&&l,type:"popup",sourceName:this.layerName})),d&&"function"==typeof d&&(this.popup._closeClick=d),null!=(c=this.popup)&&c.on("close",(function(t){"function"==typeof s.closeCallback&&s.closeCallback(t),s.popupCloseSign&&null!=(t=s.vueInstance)&&t.popupClose&&"function"==typeof s.vueInstance.popupClose&&s.vueInstance.popupClose(),s.vueInstance&&u&&null!=(t=s.vueInstance)&&t.$destroy()})))}var e=t.prototype;return e.show=function(t,e){var n=this;this.componentCallBack=t,this.callBack=e,0<(null==(t=this.layerName)?void 0:t.length)&&this.layerName.forEach((function(t){n.map.on("click",t,n._click)}))},e.setClassName=function(t,e){var n=this;void 0===e&&(e=!1),this.popup&&"string"==typeof t&&t!==this.oldClassName&&(Array.from(this.popup._classList).map((function(t){n.popup.removeClassName(t)})),(e?this.fullName+" "+t:this.className+" "+t).split(" ").filter(Boolean).map((function(t){t&&t.replaceAll(" ","")&&n.popup.addClassName(t)})),this.oldClassName=t)},e.showPosition=function(t,e,n,i){t&&(this._closeOtherPopup(),(n=(null!=n?n:{}).offset)&&this.popup.setOffset(n),this.popup.setLngLat(t).setDOMContent(e).addTo(this.map),i)&&"function"==typeof i&&i()},e.close=function(){var t;null!=(t=this.popup)&&t._onClose()},e.closeBack=function(t){this.closeCallback=t},e.destroy=function(){var t,e=this;null!=(t=this.popup)&&t.remove(),null!=(t=this.layerName)&&t.forEach((function(t){e.map.off("click",t,e._click)}))},t}(),O=function(){function t(t,e,n){var i=this,r=(this.clickEvent=function(t){var e=new THREE.Vector2,n=i.map.getCanvas();e.x=(t.clientX-n.getBoundingClientRect().left)/n.offsetWidth*2-1,e.y=-(t.clientY-n.getBoundingClientRect().top)/n.offsetHeight*2+1,t=(new THREE.Matrix4).getInverse(i.camera.projectionMatrix),n=(new THREE.Vector3).applyMatrix4(t),e=new THREE.Vector3(e.x,e.y,1).applyMatrix4(t).clone().sub(n).normalize(),(t=new THREE.Raycaster).set(n,e),n=t.intersectObjects(i.scene.children,!0),i.callback&&0<n.length&&(e=n[0],t=i.findProperties(e.object),i.callback(t))},this.findProperties=function(t){var e={},n=null;return"Scene"!==t.type&&(n=(t.lngLat?(e=t.properties,t):(e=(t=i.findProperties(t.parent)).properties,t)).lngLat),{properties:e,lngLat:n}},this.id="3d-"+t,this.type="custom",this.renderingMode="3d","function"==typeof n&&(this.callback=n),t=e.lngLat,n=e.url,void 0===(r=e.scale)?1:r),o=void 0===(o=e.height)?0:o,s=void 0===(s=e.rotate)?[Math.PI/2,0,0]:s,a=void 0===(a=e.properties)?{}:a,u=void 0===(u=e.AmbientLight)?{show:!0,color:16777215,intensity:.5}:u,l=void 0===(l=e.DirectionalLight)?[]:l,c=void 0===(c=e.PointLight)?[]:c;e=void 0!==(e=e.click)&&e,this.lngLat=t,this.url=n,this.scale=r,this.height=o,this.rotate=s,this.properties=a,this.AmbientLight=u,this.DirectionalLight=l,this.PointLight=c,this.click=e,this.modelAsMercatorCoordinate=mapboxgl.MercatorCoordinate.fromLngLat(t,o),this.modelTransform={translateX:this.modelAsMercatorCoordinate.x,translateY:this.modelAsMercatorCoordinate.y,translateZ:this.modelAsMercatorCoordinate.z,rotateX:s[0],rotateY:s[1],rotateZ:s[2],scale:r*this.modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()}}var e=t.prototype;return e.onAdd=function(t,e){var n,i,r=this;this.map=t,t=this.map.getCanvas(),this.camera=new THREE.PerspectiveCamera(50,t.innerWidth/t.innerHeight,.1,1e4),this.scene=new THREE.Scene,this.AmbientLight&&this.AmbientLight.show&&(i=this.AmbientLight.color||16777215,n=this.AmbientLight.intensity||.5,i=new THREE.AmbientLight(i,n),this.scene.add(i)),this.DirectionalLight&&Array.isArray(this.DirectionalLight)&&this.DirectionalLight.forEach((function(t){var e=t.color||16777215,n=t.intensity||1;t=t.position||[0,0,0],(e=new THREE.DirectionalLight(e,n)).position.set(t[0],t[1],t[2]).normalize(),r.scene.add(e)})),this.PointLight&&Array.isArray(this.PointLight)&&this.PointLight.forEach((function(t){var e=t.color||16777215,n=t.intensity||1,i=t.distance||0,o=t.decay||2;t=t.position||[0,0,0],(e=new THREE.PointLight(e,n,i,o)).position.set(t[0],t[1],t[2]).normalize(),r.scene.add(e)})),(new THREE.GLTFLoader).load(this.url,(function(t){for(var e=0;e<t.scene.children.length;e++)t.scene.children[e].properties=r.properties,t.scene.children[e].lngLat=r.lngLat;r.scene.add(t.scene)})),this.renderer=new THREE.WebGLRenderer({canvas:t,context:e,antialias:!0}),this.renderer.autoClear=!1,this.click&&this.renderer.domElement.addEventListener("click",this.clickEvent)},e.render=function(t,e){var n=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(1,0,0),this.modelTransform.rotateX),i=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,1,0),this.modelTransform.rotateY),r=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,0,1),this.modelTransform.rotateZ),o=(new THREE.Matrix4).fromArray(e);n=(new THREE.Matrix4).makeTranslation(this.modelTransform.translateX,this.modelTransform.translateY,this.modelTransform.translateZ).scale(new THREE.Vector3(this.modelTransform.scale,-this.modelTransform.scale,this.modelTransform.scale)).multiply(n).multiply(i).multiply(r),this.camera.projectionMatrix.elements=e,this.camera.projectionMatrix=o.multiply(n),this.renderer.state.reset(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},e.onRemove=function(){this.click&&this.renderer.domElement.removeEventListener("click",this.clickEvent),this.renderer&&(this.renderer.dispose(),this.renderer=null),this.scene&&(this.scene.clear(),this.scene=null)},t}(),A=function(){function t(t){this.map=t,this.sourceName=[],this.sourceType="geojson"}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map)return"vector"===t.type?(this.sourceName=[e],this.sourceType="vector",this._clearSource(),this._addSourceLayer(e,t,n),this.sourceName):"FeatureCollection"===t.type||Array.isArray(t.features)?(this.sourceName=[e],this._clearSource(),this._addSourceLayer(e,t,n),n.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName):void 0},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._addSourceLayer=function(t,e,n){"vector"===this.sourceType?this.map.addSource(t,o({},e,n.sourceConfig)):this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig)),(e=n.beforeId||null)&&!this.map.getLayer(e)&&(e=null),this.map.addLayer(o({id:t,type:"line",source:t},n.layerConfig),e),n.lineConfig&&(this.lineName=t+"-highlight",this.map.addLayer(o({id:this.lineName,type:"line",source:t},n.lineConfig)))},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.lineName&&e.map.getLayer(t+"-highlight")&&e.map.removeLayer(t+"-highlight"),e.map.removeSource(t))}))},t}(),D=function(){function t(t){this.map=t,this.sourceName=[],this.type="symbol",this.sourceType="geojson"}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map){if("vector"===t.type)return this.sourceType="vector",this._addSourceLayer(e,t,n),this.sourceName=[e],this.sourceName;var i;if("FeatureCollection"===t.type||Array.isArray(t.features)){this.type=null!=(i=n.type)?i:"symbol";var r=n.sliceNum;if(!r||r<1e3)this.sourceName=[e],this._clearSource(),this._addSourceLayer(e,t,n);else{this._clearSource();for(var o=0,s=0;s<t.features.length;s+=r){var a={type:"FeatureCollection",features:[]},u=t.features.slice(s,r);a.features=[].concat(u),u=e+"-"+o,this.sourceName.push(u),this._addSourceLayer(u,a,n),o++}}return this.sourceName}}},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.map.removeSource(t))}))},e._addSourceLayer=function(t,e,n){"vector"===this.sourceType?this.map.addSource(t,o({},e,n.sourceConfig)):this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig)),(e=n.beforeId||null)&&!this.map.getLayer(e)&&(e=null),this.map.addLayer(o({id:t,type:this.type,source:t},n.layerConfig),e)},t}(),F=6371008.8,k={centimeters:100*F,centimetres:100*F,degrees:F/111325,feet:3.28084*F,inches:39.37*F,kilometers:F/1e3,kilometres:F/1e3,meters:F,metres:F,miles:F/1609.344,millimeters:1e3*F,millimetres:1e3*F,nauticalmiles:F/1852,radians:1,yards:1.0936*F};function G(t,e,n){var i={type:"Feature"};return 0!==(n=void 0===n?{}:n).id&&!n.id||(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=e||{},i.geometry=t,i}function B(t,e,n){if(void 0===n&&(n={}),!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(J(t[0])&&J(t[1]))return G({type:"Point",coordinates:t},e,n);throw new Error("coordinates must contain numbers")}function U(t,e,n){void 0===n&&(n={});for(var i=0,r=t;i<r.length;i++){var o=r[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(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return G({type:"Polygon",coordinates:t},e,n)}function q(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return G({type:"LineString",coordinates:t},e,n)}function z(t,e){var n={type:"FeatureCollection"};return(e=void 0===e?{}:e).id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function j(t,e,n){return G({type:"MultiPolygon",coordinates:t},e,n=void 0===n?{}:n)}function V(t,e){var n=k[e=void 0===e?"kilometers":e];if(n)return t*n;throw new Error(e+" units is invalid")}function X(t,e){var n=k[e=void 0===e?"kilometers":e];if(n)return t/n;throw new Error(e+" units is invalid")}function Y(t){return t%(2*Math.PI)*180/Math.PI}function H(t){return t%360*Math.PI/180}function W(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),0<=t)return V(X(t,e),n);throw new Error("length must be a positive number")}function J(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function K(t,e,n){if(null!==t)for(var i,r,o,s=0,a=t.type,u="FeatureCollection"===a,l="Feature"===a,c=u?t.features.length:1,h=0;h<c;h++)for(var p,f,g=(f=!!(p=u?t.features[h].geometry:l?t.geometry:t)&&"GeometryCollection"===p.type)?p.geometries.length:1,d=0;d<g;d++){var y=0,_=0,m=f?p.geometries[d]:p;if(null!==m){var v=m.coordinates,x=m.type,E=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1;switch(x){case null:break;case"Point":if(!1===e(v,s,h,y,_))return!1;s++,y++;break;case"LineString":case"MultiPoint":for(i=0;i<v.length;i++){if(!1===e(v[i],s,h,y,_))return!1;s++,"MultiPoint"===x&&y++}"LineString"===x&&y++;break;case"Polygon":case"MultiLineString":for(i=0;i<v.length;i++){for(r=0;r<v[i].length-E;r++){if(!1===e(v[i][r],s,h,y,_))return!1;s++}"MultiLineString"===x&&y++,"Polygon"===x&&_++}"Polygon"===x&&y++;break;case"MultiPolygon":for(i=0;i<v.length;i++){for(r=_=0;r<v[i].length;r++){for(o=0;o<v[i][r].length-E;o++){if(!1===e(v[i][r][o],s,h,y,_))return!1;s++}_++}y++}break;case"GeometryCollection":for(i=0;i<m.geometries.length;i++)if(!1===K(m.geometries[i],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function Z(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function $(t,e){for(var n,i,r,o,s,a,u,l,c,h=0,p="FeatureCollection"===t.type,f="Feature"===t.type,g=p?t.features.length:1,d=0;d<g;d++){for(s=p?t.features[d].geometry:f?t.geometry:t,u=p?t.features[d].properties:f?t.properties:{},l=p?t.features[d].bbox:f?t.bbox:void 0,c=p?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null===(r=a?s.geometries[i]:s)){if(!1===e(null,h,u,l,c))return}else switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(r,h,u,l,c))return;break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(!1===e(r.geometries[n],h,u,l,c))return;break;default:throw new Error("Unknown Geometry Type")}h++}}function Q(t,e){$(t,(function(t,n,i,r,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(G(t,i,{bbox:r,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(G({type:s,coordinates:l},i),n,u))return!1}}))}function tt(t,e){Q(t,(function(t,n,i){var r=0;if(t.geometry){var o,s,a,u,l=t.geometry.type;if("Point"!==l&&"MultiPoint"!==l)return u=a=s=0,!1!==K(t,(function(l,c,h,p,f){if(void 0===o||s<n||a<p||u<f)o=l,s=n,a=p,u=f,r=0;else{if(p=q([o,l],t.properties),!1===e(p,n,i,f,r))return!1;r++,o=l}}))&&void 0}}))}function et(t){var e=[1/0,1/0,-1/0,-1/0];return K(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}const nt=et.default=et;function it(t,e){void 0===e&&(e={});var n=Number(t[0]),i=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,i];return U([[s,[r,i],[r,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}const rt=function(t){return it(nt(t))};function ot(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&2<=t.length&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function st(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function at(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function ut(t){return"Feature"===t.type?t.geometry:t}function lt(t,e,n,i){void 0===i&&(i={});var r=H((t=ot(t))[0]),o=(t=H(t[1]),n=H(n),e=X(e,i.units),Math.asin(Math.sin(t)*Math.cos(e)+Math.cos(t)*Math.sin(e)*Math.cos(n)));return B([Y(r+Math.atan2(Math.sin(n)*Math.sin(e)*Math.cos(t),Math.cos(e)-Math.sin(t)*Math.sin(o))),Y(o)],i.properties)}const ct=function(t,e,n){for(var i=(n=void 0===n?{}:n).steps||64,r=n.properties||(!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{}),o=[],s=0;s<i;s++)o.push(lt(t,e,-360*s/i,n).geometry.coordinates);return o.push(o[0]),U([o],r)};var ht=function(){function t(t){this.map=t,this.sourceName=[],this.lineName=""}var e=t.prototype;return e.draw=function(t,e,n){if(t){this.sourceName=[e];var i,r=null!=n?n:{},o=void 0===(i=r.radius)?0:i,s=void 0===(i=r.steps)?64:i,a=r.endRadius,u=[];if("object"==typeof t){if("FeatureCollection"!==t.type&&!Array.isArray(t.features))return;for(var l=t.features,c=0;c<l.length;c++){var h,p,f,g,d,y=l[c].geometry.coordinates;"number"==typeof y[0]&&"number"==typeof y[1]&&(y[0]<y[1]&&(h=[y[1],y[0]],y[0]=h[0],y[1]=h[1]),h=!1,p=0<(p=(h="string"==typeof o||h)?l[c].properties[o]:o)?p:0,f={steps:s,units:"kilometers",properties:l[c].properties},g=ct(y,p,f),a?(d=!1,d=0<(d=(d="string"==typeof a||d)?l[c].properties[a]:a)?d:0,y=ct(y,a,f),u.push(p===d?g:p<d?this._getRingJson(y.geometry.coordinates[0],g.geometry.coordinates[0],g.properties):this._getRingJson(g.geometry.coordinates[0],y.geometry.coordinates[0],g.properties))):u.push(g))}}return this._addSourceLayer(e,{type:"FeatureCollection",features:u},n),n.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName}},e._getRingJson=function(t,e,n){return{type:"Feature",geometry:{coordinates:[t,e],type:"Polygon"},properties:n}},e._addSourceLayer=function(t,e,n){this.lineName=t+"-line",n.lineConfig&&null!=(i=this.map)&&i.getLayer(this.lineName)&&this.map.removeLayer(this.lineName),null!=(i=this.map)&&i.getLayer(t)&&this.map.removeLayer(t),null!=(i=this.map)&&i.getSource(t)&&this.map.removeSource(t),this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig));var i=(null!=n?n:{}).beforeId;i&&!this.map.getLayer(i)&&(i=null),this.map.addLayer(o({id:t,type:"fill",source:t},n.layerConfig),i),n.lineConfig&&this.map.addLayer(o({id:this.lineName,type:"line",source:t},n.lineConfig),i)},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&(null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")})),this.lineName)&&this.map.getLayer(this.lineName)&&this.map.setLayoutProperty(this.lineName,"visibility",t?"visible":"none")},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){e.map.getSource(t)&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.lineName&&e.map.getLayer(t+"-line")&&e.map.removeLayer(t+"-line"),e.map.removeSource(t))}))},t}(),pt=function(){function t(t,e){this.map=t,this.name=[],"string"==typeof e?this.name=[e]:Array.isArray(e)&&e.every((function(t){return"string"==typeof t}))&&(this.name=e),this.event=[]}var e=t.prototype;return e.add=function(t){var e,n=this;if(0===(null==(e=this.event)?void 0:e.length)&&t&&"object"==typeof t){var i,r=function(e){var i,r;n.event.push(e),0<(null==(r=n.name)?void 0:r.length)?null!=(r=n.name)&&r.forEach((function(i){function r(n){var i;"Map"===(null==n||null==(i=n.originalEvent)||null==(i=i.target)?void 0:i.ariaLabel)&&t[e](n)}var o;n[e]=r,null!=(o=n.map)&&o.on(e,i,r)})):(n[e]=r=function(n){var i;"Map"===(null==n||null==(i=n.originalEvent)||null==(i=i.target)?void 0:i.ariaLabel)&&t[e](n)},null!=(i=n.map)&&i.on(e,r))};for(i in t)r(i)}},e.destroy=function(t){var e,n=this;t&&Array.isArray(t)&&t.every((function(t){return"string"==typeof t}))?null!=(e=this.name)&&e.forEach((function(e){t.forEach((function(t){var i,r;n.event.includes(t)&&(r=n[t],null!=(i=n.map))&&i.off(t,e,r)}))})):0<(null==(e=this.name)?void 0:e.length)?null!=(e=this.name)&&e.forEach((function(t){n.event.forEach((function(e){var i,r=n[e];null!=(i=n.map)&&i.off(e,t,r)}))})):this.event.forEach((function(t){var e,i=n[t];null!=(e=n.map)&&e.off(t,i)}))},t}(),ft=["id","type"],gt=["id","type","beforeId"],dt=function(){function t(t){this.map=t,this.sourceName=[]}var e=t.prototype;return e.draw=function(t,e){var n,i,s,a,u,l=this;return c(t)||"vector"===t.type?(n=(s=null!=(s=e.sourceConfig)?s:{}).id,i=void 0===(i=s.type)?"geojson":i,s=r(s,ft),a=n,e=null!=(e=e.layerConfig)?e:{},u=[],Array.isArray(e)?u=e:"object"==typeof e&&u.push(e),u.forEach((function(t){var e;(t=t.id)&&null!=(e=l.map)&&e.getLayer(t)&&l.map.removeLayer(t)})),null!=(e=this.map)&&e.getSource(a)&&this.map.removeSource(a),"vector"===t.type?this.map.addSource(n,o({},s,t)):this.map.addSource(n,o({type:i,data:t},s)),u.forEach((function(t){var e=t.id,n=t.type,i=t.beforeId;t=r(t,gt),i&&!l.map.getLayer(i)&&(i=null),l.map.addLayer(o({id:e,type:n,source:a},t),i)})),this.sourceName=[a].concat(u.map((function(t){return t.id}))).filter(Boolean),this.sourceName=Array.from(new Set(this.sourceName)),this.sourceName):[]},e.destroy=function(){var t,e,n=this;0<(null==(e=this.sourceName)?void 0:e.length)&&(1===this.sourceName.length?this.map.getSource(this.sourceName[0])&&(this.map.removeLayer(this.sourceName[0]),this.map.removeSource(this.sourceName[0])):(t=(e=this.sourceName)[0],e=e.slice(1),this.map.getSource(t)&&(this.map.getLayer(t)&&this.map.removeLayer(t),e.forEach((function(t){n.map.removeLayer(t)})),this.map.removeSource(t))))},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},t}(),yt=function(){function t(e,n,i){if((this instanceof t?this.constructor:void 0)!==t)throw new Error("MapLayer is a constructor and should be called with the new keyword");var r={layer:null,tooltip:null,popup:null};return n&&"object"==typeof n&&(r=o({},r,n)),this.name=e,this.layers=r,this.prop=null!=i?i:{},new Proxy(this,{deleteProperty:function(t,e){return(t!==this||"layers"!==e&&"name"!==e)&&(delete t[e],!0)},set:function(t,e,n){return(t!==this||"layers"!==e&&"name"!==e)&&(t[e]=n,!0)}})}var e=t.prototype;return e.addLayer=function(t){if(t&&"object"==typeof t)for(var e in t)this.layers[e]=t[e]},e.addProp=function(t){if(t&&"object"==typeof t)for(var e in t)this.prop[e]=t[e]},t}();function _t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var mt,vt,xt=function(){function t(t,e){this.map=t,this.markers=[],this.options=e,this.properties=[]}var e=t.prototype;return e.draw=function(t,e){if(c(t))for(var n,i=null!=(n=this.options)?n:{},r=0,s=function(t,e){var n,i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){var n;if(t)return"string"==typeof t?_t(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_t(t,e):void 0}(t)))return i&&(t=i),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.features);!(l=s()).done;){var a,u,l=l.value;"Point"===l.geometry.type&&(a=i,e&&"function"==typeof e&&1===(null==(u=e({lngLat:l.geometry.coordinates,properties:l.properties,index:r}))?void 0:u.nodeType)&&(a=o({},a,{element:u})),u=new mapboxgl.Marker(a).setLngLat(l.geometry.coordinates).addTo(this.map),this.markers.push(u),this.properties.push(l.properties),r++)}},e.addEvent=function(t){var e=this;if(t&&"object"==typeof t)for(var n=0;n<this.markers.length;n++)!function(n){["dragstart","drag","dragend"].forEach((function(i){t[i]&&"function"==typeof t[i]&&e.markers[n].on(i,(function(r){t[i](o({},r,{properties:e.properties[n]}))}))}))}(n)},e.destroy=function(){for(var t=0;t<this.markers.length;t++)this.markers[t].remove();this.markers=[]},e.visible=function(t){var e;"boolean"==typeof t&&null!=(e=this.markers)&&e.forEach((function(e){e.getElement().style.display=t?"block":"none"}))},t}(),Et=function(){function t(t,e,n){var i;n=null!=(i=n)?i:{},this.map=t,this.name=e,this.dash=Array.isArray(n.dash)?n.dash:[[0,4,3],[.5,4,2.5],[1,4,2],[1.5,4,1.5],[2,4,1],[2.5,4,.5],[3,4,0],[0,.5,3,3.5],[0,1,3,3],[0,1.5,3,2.5],[0,2,3,2],[0,2.5,3,1.5],[0,3,3,1],[0,3.5,3,.5]],this.step=null!=(i=n.step)?i:50,this.animateId=null}var e=t.prototype;return e.animate=function(){var t,e=this;this.name&&this.map.getLayer(this.name)&&function n(i){(i=parseInt(i/e.step%e.dash.length))!==t&&(e.map.setPaintProperty(e.name,"line-dasharray",e.dash[t]),t=i),e.animateId=requestAnimationFrame(n)}(t=0)},e.destroy=function(){this.animateId&&(cancelAnimationFrame(this.animateId),this.animateId=null)},t}(),bt=(s={},function(){function t(t,e){this.width=void 0,this.height=void 0,this.data=void 0;var n=this,i=t.width;if(t=t.height,e){if(e instanceof Uint8ClampedArray)e=new Uint8Array(e.buffer);else if(e.length!==i*t*4)throw new RangeError("mismatched image size")}else e=new Uint8Array(i*t*4);n.width=i,n.height=t,n.data=e}var e=t.prototype;return e.resize=function(e){var n,i,r;n=this,i=(e=new t(e)).width,r=e.height,i===n.width&&r===n.height||(It(n,e,{x:0,y:0},{x:0,y:0},{width:Math.min(n.width,i),height:Math.min(n.height,r)},4),n.width=i,n.height=r,n.data=e.data)},e.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},e.clone=function(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))},t.copy=function(t,e,n,i,r){It(t,e,n,i,r,4)},t}());function It(t,e,n,i,r,o){if(0!==r.width&&0!==r.height){if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||i.x>e.width-r.width||i.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");var s=t.data,a=e.data;if(s===a)throw new RangeError("image is the same");for(var u=0;u<r.height;u++)for(var l=((n.y+u)*t.width+n.x)*o,c=((i.y+u)*e.width+i.x)*o,h=0;h<r.width*o;h++)a[c+h]=s[l+h]}}function wt(){return(wt=n(a().mark((function t(e,n){var i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===n&&(n=0),t.next=3,new Promise((function(t){var i=new Image;i.src=e,i.crossOrigin="Anonymous",i.onload=function(){var e=i.width,r=i.height,o=(mt=mt||window.document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");(e>mt.width||r>mt.height)&&(mt.width=e,mt.height=r),o.clearRect(-n,-n,e+2*n,r+2*n),o.drawImage(i,0,0,e,r),t(o.getImageData(-n,-n,e+2*n,r+2*n))}}));case 3:return i=t.sent,t.abrupt("return",i);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}On=bt,void 0===vt&&(vt={}),(an="RGBAImage")?s[an]?console.error(an+" is already registered."):(Object.defineProperty(On,"_classRegistryKey",{value:an,writeable:!1}),s[an]={klass:On,omit:vt.omit||[]}):console.error("Can't register a class without a name.");var Lt=function(){function t(t,e){this.map=t,this.options=null!=e?e:{key:"id"},this.markers={},this.mapEvent=null}var e=t.prototype;return e.draw=function(t,e){var n=this,i={};this.mapEvent=function(){if(n.map.getSource(t)&&n.map.isSourceLoaded(t)){for(var r,s={},a=function(t,e){var n,i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){var n;if(t)return"string"==typeof t?Nt(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(t,e):void 0}(t)))return i&&(t=i),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.map.querySourceFeatures(t));!(h=a()).done;){var u,l,c,h,p=(h=h.value).geometry.coordinates;(h=h.properties).cluster||(u=h[n.options.key],(c=n.markers[u])?(l=c.getLngLat().toArray())[0]===p[0]&&l[1]===p[1]||c.setLngLat(p):(l=null,l="function"==typeof e?e({properties:h,lngLat:p}):document.createElement("div"),c=n.markers[u]=new mapboxgl.Marker(o({},n.options,{element:l})).setLngLat(p)),s[u]=c,i[u])||c.addTo(n.map)}for(r in i)s[r]||i[r].remove();i=s}},this.map.on("render",this.mapEvent)},e.destroy=function(){for(var t in this.markers)null!=(t=this.markers[t])&&t.remove();this.markers={},this.mapEvent&&this.map.off("render",this.mapEvent)},e.visible=function(t){if("boolean"==typeof t)for(var e in this.markers)this.markers[e]&&this.markers.hasOwnProperty(e)&&(this.markers[e].getElement().style.display=t?"block":"none")},t}(),St=["once"],Ct=function(){function t(t,e,n){this.map=t,this.options=null!=n?n:{},this.sourceName=e,n=void 0===(e=(t=(this.mapEvent=null)!=n?n:{}).once)||e,e=r(t,St),this.once=n,this.other=e}var e=t.prototype;return e.open=function(t){var e=this;this.sourceName&&(this.mapEvent=function(){var n;e.map.getSource(e.sourceName)&&e.map.isSourceLoaded(e.sourceName)&&"function"==typeof t&&(n=e.map.querySourceFeatures(e.sourceName,e.other),t(n),e.once)&&e.destroy()},this.map.on("render",this.mapEvent))},e.destroy=function(){var t;null!=(t=this.map)&&t.off("render",this.mapEvent),this.mapEvent=null},t}(),Pt=Math.PI,Mt=6378245,Tt=.006693421622965943;function Rt(t,e){var n=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return(n+=2*(20*Math.sin(6*t*Pt)+20*Math.sin(2*t*Pt))/3)+2*(20*Math.sin(e*Pt)+40*Math.sin(e/3*Pt))/3+2*(160*Math.sin(e/12*Pt)+320*Math.sin(e*Pt/30))/3}function Ot(t,e){return e=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t)),(e+=2*(20*Math.sin(6*t*Pt)+20*Math.sin(2*t*Pt))/3)+2*(20*Math.sin(t*Pt)+40*Math.sin(t/3*Pt))/3+2*(150*Math.sin(t/12*Pt)+300*Math.sin(t/30*Pt))/3}function At(t,e){return e=+e,!(73.66<(t=+t)&&t<135.05&&3.86<e&&e<53.55)}function Dt(t,e){var n,i,r,o,s;return At(t,e)?[t,e]:(o=Rt(t-105,e-35),s=Ot(t-105,e-35),n=e/180*Pt,i=Math.sin(n),i=1-Tt*i*i,r=Math.sqrt(i),o=180*o/(Mt*(1-Tt)/(i*r)*Pt),[2*t-(t+(s=180*s/(Mt/r*Math.cos(n)*Pt))),2*e-(e+o)])}function Ft(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=ot(t),r=(t=ut(e)).type,o=(e=e.bbox,t.coordinates);if(e&&0==(t=i,e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]))return!1;"Polygon"===r&&(o=[o]);for(var s=!1,a=0;a<o.length&&!s;a++)if(kt(i,o[a][0],n.ignoreBoundary)){for(var u=!1,l=1;l<o[a].length&&!u;)kt(i,o[a][l],!n.ignoreBoundary)&&(u=!0),l++;u||(s=!0)}return s}function kt(t,e,n){for(var i=!1,r=0,o=(e=e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]?e.slice(0,e.length-1):e).length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var Bt=function(){function t(t,e){this.map=t,this.options=null!=e?e:{}}var e=t.prototype;return e.draw=function(t,e,n){var i;t&&e&&c(t)&&n&&(this.id=n,i=rt(t).bbox,this.destroy(),this.map.addLayer(function(t,e,n){function i(t){if("FeatureCollection"===E.type){for(var e=0;e<E.features.length;e++)if(Ft(t,E.features[e]))return!0;return!1}if("Feature"===E.type)return Ft(t,E.geometry)}var r,o=n.bbox,s=n.isGCJ,a=n.replaceUrl,u=null!=(r=n.isJudgement)&&r,l=n.filter,c=n.coordTransform,h=n.judgementBox,p=n.judgementPoint,f=null!=(r=n.maxZoom)?r:18,g=null!=(r=n.minZoom)?r:0,d=null==(r=n.judgeBound)||r,y=null==(r=n.isPrecision)||r,_=null!=(r=n.expand)?r:0,m=null==(r=n.minShow)||r,v=null==(r=n.maxShow)||r,x=null!=(r=n.textureType)?r:"NEAREST",E=null!=(r=n.json)?r:{},b=document.createElement("canvas"),I=0;return{id:t,type:"custom",onAdd:function(t,e){var n=this,i=(this.map=t,this.tileCache={},this.gridCache={},this.coordCache={},this.showTiles=[],t=e.createShader(e.VERTEX_SHADER),e.shaderSource(t,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),e.compileShader(t),e.createShader(e.FRAGMENT_SHADER));e.shaderSource(i,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),e.compileShader(i),this.program=e.createProgram(),e.attachShader(this.program,t),e.attachShader(this.program,i),e.linkProgram(this.program),this.map.on("move",(function(t){n.updateLayer(e)})),this.updateLayer(e)},updateLayer:function(t){var e=this.map.getZoom(),n=e;if(y&&(e+=1.4),n<g){if(e=g,!m)return void(this.showTiles=[])}else f<e&&n<f&&(e=f);f<e&&f<n&&!v?this.showTiles=[]:this.drawLayer(e,t)},drawLayer:function(t,e){for(var n=this,i=parseInt(t),r=(t=[(t=this.map.getBounds().toArray())[0][0],t[0][1],t[1][0],t[1][1]],Math.min(t[2],o[2])),s=Math.min(t[3],o[3]),a=Math.max(t[0],o[0]),u=(t=Math.max(t[1],o[1]),a=this.map.getTileByPosition([a,t],i),t=this.map.getTileByPosition([r,s],i),r=a[0]-_,t[0]+_),l=t[1]-_,c=a[1]+_,h=[],p=r;p<=u;p++)for(var f=l;f<=c;f++){var g={x:p,y:f,z:i};h.push(g),this.addGridCache(g,0,0),p===u&&this.addGridCache(g,1,0),f===c&&this.addGridCache(g,0,1),p===u&&f===c&&this.addGridCache(g,1,1)}s=this.map.getCenter();var d=this.map.getTileByPosition([s.lng,s.lat],i);h.sort((function(t,e){return n.tileDistance(t,d)-n.tileDistance(e,d)})),this.showTiles=[];for(var y=0,m=h;y<m.length;y++){var v,x=m[y];this.tileCache[this.createTileKey(x)]?this.showTiles.push(this.tileCache[this.createTileKey(x)]):(v=this.createTile(e,x),this.showTiles.push(v),this.tileCache[this.createTileKey(x)]=v)}},tileDistance:function(t,e){return Math.sqrt(Math.pow(t.x-e[0],2)+Math.pow(t.y-e[1],2))},addGridCache:function(t,e,n){var i,r=this.createTileKey(t.x+e,t.y+n,t.z);this.gridCache[r]||(n=(e=this.map.getPositionByTile([t.x+e,t.y+n,t.z]))[0],t=e[1],i=e[2],e=e[3],void 0!==t&&void 0!==e&&void 0!==i&&void 0!==n&&(s?(this.coordCache[t="gcj:"+n+","+e]||(i=Dt(n,e),this.coordCache[t]=[i[0],i[1]]),i=this.coordCache[t],this.gridCache[r]={lng:i[0],lat:i[1]}):c&&"function"==typeof c?(this.coordCache[t="custom:"+n+","+e]||(i=c(n,e),Array.isArray(i)&&2===i.length?this.coordCache[t]=[i[0],i[1]]:this.coordCache[t]="object"==typeof i?[i.lng,i.lat]:[n,e]),i=this.coordCache[t],this.gridCache[r]={lng:i[0],lat:i[1]}):this.gridCache[r]={lng:n,lat:e}))},createTileKey:function(t,e,n){return t instanceof Object?t.z+"/"+t.x+"/"+t.y:n+"/"+t+"/"+e},createTile:function(t,n){var r,o,s,c,h,f,g=this,y=Array.isArray(e)?(m=e.length,v=e[I],m<=++I&&(I=0),a&&"function"==typeof a?a(v,n):v.replace("{z}",n.z).replace("{x}",n.x).replace("{y}",n.y)):a&&"function"==typeof a?a(e,n):e.replace("{z}",n.z).replace("{x}",n.x).replace("{y}",n.y),_={xyz:n},m=this.gridCache[this.createTileKey(n)],v=this.gridCache[this.createTileKey(n.x+1,n.y,n.z)],x=this.gridCache[this.createTileKey(n.x,n.y+1,n.z)];return n=this.gridCache[this.createTileKey(n.x+1,n.y+1,n.z)],x&&v&&x&&n&&(x=this.getBufferData(x,n,v,m),r=m.lat,o=m.lng,v=n.lat,m=n.lng,s=(m-o)/256,c=(r-v)/256,h=!!d&&this.getAllIn(o,v,m,r),_.aPos=t.getAttribLocation(this.program,"a_pos"),_.aUv=t.getAttribLocation(this.program,"a_uv"),_.uSamplerLoc=t.getUniformLocation(this.program,"u_sampler"),_.texture=t.createTexture(),(f=new Image).src=y,f.crossOrigin="anonymous",f.onload=function(){b.width=f.width,b.height=f.height;var e=b.getContext("2d"),n=(e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high",e.drawImage(f,0,0),l&&"function"==typeof l);if((u||n)&&(!h||n)){for(var a,d,y,m=e.getImageData(0,0,b.width,b.height),v=m.data.length,x=0;x<v;x+=4)h||(a=(y=Math.floor(x/4))%256,y=Math.floor(y/256),d=i([a=o+a*s,y=r-y*c]),p&&"function"==typeof p&&(d=null==(a=p(a,y))||a),m.data[x+3]=d?255:0),n&&(y=l([m.data[x],m.data[x+1],m.data[x+2],m.data[x+3]]),Array.isArray(y))&&4===y.length&&(m.data[x]=y[0],m.data[x+1]=y[1],m.data[x+2]=y[2],m.data[x+3]=y[3]);e.putImageData(m,0,0)}t.bindTexture(t.TEXTURE_2D,_.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,b),t.generateMipmap(t.TEXTURE_2D),_.isLoad=!0,g.map.triggerRepaint()},_.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,_.buffer),t.bufferData(t.ARRAY_BUFFER,x,t.STATIC_DRAW)),_},getBufferData:function(t,e,n,i){var r=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(t.lng,t.lat))||0,o=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(e.lng,e.lat))||0,s=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(n.lng,n.lat))||0,a=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(i.lng,i.lat))||0;return t=mapboxgl.MercatorCoordinate.fromLngLat(t,r),r=mapboxgl.MercatorCoordinate.fromLngLat(e,o),e=mapboxgl.MercatorCoordinate.fromLngLat(n,s),o=mapboxgl.MercatorCoordinate.fromLngLat(i,a),new Float32Array([t.x,t.y,t.z,0,0,r.x,r.y,r.z,1,0,e.x,e.y,e.z,1,1,t.x,t.y,t.z,0,0,e.x,e.y,e.z,1,1,o.x,o.y,o.z,0,1])},getAllIn:function(t,e,n,r){var o;return h&&"function"==typeof h?null==(o=h(t,e,n,r))||o:[[t,r],[t,e],[n,e],[n,r],[(t+n)/2,r],[n,(e+r)/2],[(t+n)/2,e],[t,(e+r)/2],[(t+n)/2,(e+r)/2]].every(i)},render:function(t,e){t.useProgram(this.program),t.uniformMatrix4fv(t.getUniformLocation(this.program,"u_matrix"),!1,e);for(var n=function(t,e){var n,i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){var n;if(t)return"string"==typeof t?Gt(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gt(t,e):void 0}(t)))return i&&(t=i),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.showTiles);!(r=n()).done;){var i,r=r.value;r.isLoad&&(t.bindTexture(t.TEXTURE_2D,r.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),i=["NEAREST","LINEAR"].includes(x)?t[x]:t.NEAREST,t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i),t.bindBuffer(t.ARRAY_BUFFER,r.buffer),t.enableVertexAttribArray(r.aPos),t.enableVertexAttribArray(r.aUv),t.vertexAttribPointer(r.aPos,3,t.FLOAT,!1,20,0),t.vertexAttribPointer(r.aUv,2,t.FLOAT,!1,20,12),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.blendEquation(t.FUNC_ADD),t.drawArrays(t.TRIANGLES,0,6))}}}}(n,e,o({},this.options,{bbox:i,isGCJ:null!=(n=this.options.isGCJ)&&n,json:t}))))},e.destroy=function(){this.map.getLayer(this.id)&&this.map.removeLayer(this.id),this.map.getSource(this.id)&&this.map.removeSource(this.id)},t}();function Ut(t){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qt(t){return t=function(t,e){if("object"!==Ut(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return String(t);if("object"!==Ut(n=n.call(t,"string")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),"symbol"===Ut(t)?t:String(t)}function zt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,qt(i.key),i)}}function jt(t,e,n){e&&zt(t.prototype,e),n&&zt(t,n),Object.defineProperty(t,"prototype",{writable:!1})}var Vt=function(){function t(t,e){this.map=t,this._contextMenu=null,this._moveMenu=null,this._context=null,e=(t=(this._position=null)!=e?e:{}).move,t=void 0===(t=t.className)?"mapMenu":t,this._move=void 0!==e&&e,this._className=t}var e=t.prototype;return e.init=function(t,e){var n,i=this;this.map&&!this._context&&((n=document.createElement("div")).className=this._className,n.style.display="none",n.style.position="absolute",this.map.getCanvas().offsetParent.appendChild(n),t instanceof Element?n.appendChild(t):"string"==typeof t&&(n.innerHTML=t),this._context=n,this._contextMenu=function(t){var n;i._position=t.lngLat,e&&"function"==typeof e?(n=i.map.queryRenderedFeatures(t.point),"boolean"==typeof(n=void 0===(n=(null!=(n=e(o({},t,{features:n})))?n:{}).show)||n)&&(i.visible(n),i.updateXY(t.point))):(i.visible(!0),i.updateXY(t.point))},this.map.on("contextmenu",this._contextMenu),this._move)&&(this._moveMenu=function(t){var e;i._context&&"none"!==i._context.style.display&&i._position&&(e=i.map.project([i._position.lng,i._position.lat]),i.updateXY(e))},this.map.on("move",this._moveMenu),window.addEventListener("resize",this._moveMenu))},e.visible=function(t){this._context&&(this._context.style.display=t?"block":"none")},e.updateXY=function(t){var e,n,i,r,o;this._context&&t&&(e=isNaN(Number(t.x))?0:Number(t.x),t=isNaN(Number(t.y))?0:Number(t.y),this._move||(n=(i=this._context).offsetWidth,i=i.offsetHeight,(o=(r=this.map.getCanvas()).offsetWidth)<e+n&&(e=o-n),(o=r.offsetHeight)<t+i&&(t=o-i)),this._context.style.top=t+"px",this._context.style.left=e+"px")},e.destroy=function(){this.map&&(this.map.off("contextmenu",this._contextMenu),this._contextMenu=null,this._context&&(this._context.remove(),this._context=null),this._move)&&(this.map.off("move",this._moveMenu),window.removeEventListener("resize",this._moveMenu),this._moveMenu=null)},jt(t,[{key:"show",get:function(){var t;return null!=(t=this._context&&"none"!==this._context.style.display)&&t}}]),t}();const Xt=function(t,e,n){void 0===n&&(n={}),t=ot(t);var i=H((e=ot(e))[1]-t[1]),r=H(e[0]-t[0]);return t=H(t[1]),e=H(e[1]),i=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(r/2),2)*Math.cos(t)*Math.cos(e),V(2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)),n.units)};function Yt(t,e){return void 0===e&&(e={}),i=0,n=function(t,n){return n=n.geometry.coordinates,t+Xt(n[0],n[1],e)},tt(t,(function(t,e,r,o,s){i=n(i,t)})),i;var n,i}function Ht(t,e,n){var i,r;return!0===(n=void 0===n?{}:n).final?(Ht(e,t)+180)%360:(n=ot(t),t=ot(e),e=H(n[0]),i=H(t[0]),n=H(n[1]),t=H(t[1]),r=Math.sin(i-e)*Math.cos(t),n=Math.cos(n)*Math.sin(t)-Math.sin(n)*Math.cos(t)*Math.cos(i-e),Y(Math.atan2(r,n)))}const Wt=function(t,e){return lt(t,Xt(t,e)/2,Ht(t,e))};var Jt=6378137;function Kt(t){var e=0;if(t&&0<t.length){e+=Math.abs(Zt(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Zt(t[n]))}return e}function Zt(t){var e,n,i,r,o,s,a=0,u=t.length;if(2<u){for(s=0;s<u;s++)o=s===u-2?(i=u-2,r=u-1,0):s===u-1?(i=u-1,r=0,1):(r=(i=s)+1,s+2),e=t[i],n=t[r],a+=($t(t[o][0])-$t(e[0]))*Math.sin($t(n[1]));a=a*Jt*Jt/2}return a}function $t(t){return t*Math.PI/180}const Qt=function(t,e){void 0===e&&(e={});var n=0,i=0,r=0;return K(t,(function(t){n+=t[0],i+=t[1],r++}),!0),B([n/r,i/r],e.properties)};function te(t){return(t%=360)<0&&(t+=360),t}function ee(t){return(t%=360)<0&&(t+=360),t}const ne=function(t,e,n,i,r){if(!(a=r=r||{})||a.constructor!==Object)throw new Error("options is invalid");var o,s,a=r.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==i)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof r)throw new Error("options must be an object");return ee(n)===ee(i)?ct(t,e,r):(o=st(t),t=function(t,e,n,i,r){var o=(r=void 0===r?{}:r).steps||64,s=(n=te(n),i=te(i),Array.isArray(t)||"Feature"!==t.type?{}:t.properties);if(n===i)return q(ct(t,e,r).geometry.coordinates[0],s);for(var a=n,u=n<i?i:i+360,l=a,c=[],h=0;l<u;)c.push(lt(t,e,l,r).geometry.coordinates),l=a+360*++h/o;return u<l&&c.push(lt(t,e,u,r).geometry.coordinates),q(c,s)}(t,e,n,i,r),s=[[o]],K(t,(function(t){s[0].push(t)})),s[0].push(o),U(s,a))};var ie="zh_measure_",re=function(){function t(t,e,n){var i=this,r=(this._click=function(t){var e,n=t.originalEvent.target.ariaLabel;i.isOpen&&"measure"!==n&&(i.isDraw||(i.isDraw=!0,i.positions.push(i.currentPosition),i.texts.push(i.currentText)),e=t.lngLat.toArray(),n=function(){i.currentPosition.push(e),i._drawPoint(),i._drawLine(),i._measureDistance(e)},0<i.currentPosition.length?"line"===i.type||"polygon"===i.type?(t=i.currentPosition[i.currentPosition.length-1],e[0]!==t[0]||e[1]!==t[1]?n():"polygon"===i.type?2<i.currentPosition.length?(i._createTextRemove(i.index),t=[].concat(i.currentPosition,[i.currentPosition[0]]),i._updateLine(t,i.index),t=Qt(U([t])),i._measureArea(t.geometry.coordinates),i._callback()):1===i.currentPosition.length&&(i._removeMarker(i.index),i._removePoint(i.index),i._removeLine(i.index),i._callback()):(i._createTextRemove(i.index),1===i.currentPosition.length&&(i._removeMarker(i.index),i._removePoint(i.index),i._removeLine(i.index)),i._callback())):"sector"===i.type&&(t=i.currentPosition[i.currentPosition.length-1],e[0]===t[0]&&e[1]===t[1]||1!==i.currentPosition.length||n()):n())},this._move=function(t){i.isOpen&&(t=t.lngLat.toArray(),i.isDraw&&0<i.currentPosition.length&&("line"===i.type?i._drawMoveLine(t):"circle"===i.type?(i._drawCircle(t),i._drawMoveLine(t)):"polygon"===i.type?(1<i.currentPosition.length&&i._drawPolygon(t),i._drawMoveLine(t)):"rect"===i.type?(i._drawRect(t),i._drawMoveLine(t)):"sector"===i.type&&(1<i.currentPosition.length?i._drawSector(t):i._drawMoveLine(t))),i._drawMovePoint(t))},this._dblclick=function(t){if(i.isOpen&&i.isDraw&&("circle"===i.type&&(e=t.lngLat.toArray(),!(n=i.currentPosition[0])||n[0]===e[0]&&n[1]===e[1]?(i._removeMarker(i.index),i._removePoint(i.index),i._removeLine(i.index),i._removeCircle(i.index)):(i.currentPosition.push(e),i._drawPoint(),i._drawCircle(e,!1),i._drawLine(),n=Wt(B(e),B(i.currentPosition[0])),i._measureDistance(e),i._measureArea(n.geometry.coordinates),i._createTextRemove(i.index),i._callback())),!("polygon"===i.type&&0<i.currentPosition.length&&i.currentPosition.length<3))){if("rect"===i.type&&(e=t.lngLat.toArray(),!(n=i.currentPosition[0])||n[0]===e[0]&&n[1]===e[1]?(i._removeMarker(i.index),i._removePoint(i.index),i._removeLine(i.index),i._removeRect(i.index)):(i.currentPosition.push(e),i._drawPoint(),i._drawRect(e,!1),n=Wt(B(e),B(i.currentPosition[0])),i._measureDistance(e),i._measureArea(n.geometry.coordinates),i._createTextRemove(i.index),i._callback())),"sector"===i.type){var e=t.lngLat.toArray(),n=i.currentPosition[i.currentPosition.length-1];if(2!==i.currentPosition.length||e[0]===n[0]&&e[1]===n[1]){if(1!==i.currentPosition.length)return;i._removeMarker(i.index),i._removePoint(i.index),i._removeLine(i.index),i._removeSector(i.index)}else i._drawSector(e,!1),t=Qt(i.map.getSource(i.moveSectorName)._data),i._measureArea(t.geometry.coordinates),i._createTextRemove(i.index),i._callback()}null!=(n=i.moveLineLayers[i.index])&&n.destroy(),i.moveLineLayers.splice(i.index,1),i._removeMoveMarker(),i.isDraw=!1,i.currentPosition=[],i.currentText=[],i.index++}},this.map=t,t=null!=(t=(e=null!=(t=e)?t:{}).point)?t:{},null!=(r=e.pointMove)?r:{}),o=null!=(o=e.fixed)?o:[2,2],s=(this.calcAll=null==(u=e.calcAll)||u,"number"==typeof o?this.fixed=[o,o]:Array.isArray(o)&&o.every((function(t){return"number"==typeof t}))?this.fixed=o:this.fixed=[2,2],this.dash=null==(u=e.dash)||u,this.type=null!=(o=e.type)?o:"line",["line","circle","polygon","rect","sector"].includes(this.type)||(this.type="line"),this.units={line:["km","m"],circle:["km²","m²"],polygon:["km²","m²"],rect:["km²","m²"],sector:["km²","m²"]},e.units);if(s)for(var a in this.units)s[a]&&Array.isArray(s[a])&&s[a].every((function(t){return"string"==typeof t}))&&(this.units[a][0]=s[a][0],this.units[a][1]=s[a][1]);this.className=null!=(u=e.className)?u:"",this.pointMoveProps={color:null!=(o=r.color)?o:"#ffffff",radius:null!=(u=r.radius)?u:10,opacity:null!=(o=r.opacity)?o:.01,strokeWidth:null!=(u=r.strokeWidth)?u:2,strokeColor:null!=(o=r.strokeColor)?o:"#ffffff",strokeOpacity:null!=(u=r.strokeOpacity)?u:.01},this.pointProps={color:null!=(o=t.color)?o:"rgb(255,255,255)",radius:null!=(r=t.radius)?r:4,strokeWidth:null!=(u=t.strokeWidth)?u:2,strokeColor:null!=(o=t.strokeColor)?o:"#00ccff"};var u=null!=(r=e.line)?r:{};this.lineProps={color:null!=(t=u.color)?t:"#00ccff",width:null!=(o=u.width)?o:2,dasharray:null!=(r=u.dasharray)?r:[5,5]},o=null!=(t=e.fill)?t:{},this.fillProps={color:null!=(u=o.color)?u:"rgba(0,230,255,0.1)"},this._custom=n,this.isOpen=!1,this.moveMarker=null,this._init()}var e=t.prototype;return e._init=function(){var t;this.positions=[],this.currentPosition=[],this.index=null!=(t=null==(t=this.map[this._custom])||null==(t=t.measure)?void 0:t[this.type])?t:0,this.isDraw=!1,this.pointLayers=[],this.movepointLayers=[],this.lineLayers=[],this.moveLineLayers=[],this.moveCircleLayers=[],this.movePolygonLayers=[],this.moveRectLayers=[],this.moveSectorLayers=[],this.texts=[],this.currentText=[]},e.draw=function(t){t&&"function"==typeof t&&(this.callback=t),this.isOpen||(this.isOpen=!0,this.map.on("click",this._click),this.map.on("mousemove",this._move),this.map.on("dblclick",this._dblclick))},e._callback=function(){this.callback&&"function"==typeof this.callback&&this.callback()},e._drawPoint=function(){var t,e=this,n=z(this.currentPosition.map((function(t,n){return B(t,{pointIndex:n,lineIndex:e.index})})));this.pointLayer?this.map.getSource(this.pointName).setData(n):((t=this.map.MapCustom()).draw(n,this.pointName,{layerConfig:{type:"circle",paint:{"circle-color":this.pointProps.color,"circle-radius":this.pointProps.radius,"circle-stroke-width":this.pointProps.strokeWidth,"circle-stroke-color":this.pointProps.strokeColor}}}),this.pointLayers.push(t))},e._drawMovePoint=function(t){var e;t={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:t},properties:{pointIndex:0,lineIndex:this.index}}]},this.movePointLayer?this.map.getSource(this.movePointName).setData(t):((e=this.map.MapCustom()).draw(t,this.movePointName,{layerConfig:{type:"circle",paint:{"circle-opacity":this.pointMoveProps.opacity,"circle-color":this.pointMoveProps.color,"circle-radius":this.pointMoveProps.radius,"circle-stroke-width":this.pointMoveProps.strokeWidth,"circle-stroke-color":this.pointMoveProps.strokeColor,"circle-stroke-opacity":this.pointMoveProps.strokeOpacity}}}),this.movepointLayers.push(e))},e._drawLine=function(){var t,e=z([q(1<this.currentPosition.length?this.currentPosition:[this.currentPosition[0],this.currentPosition[0]],{lineIndex:this.index})]);this.lineLayer?(this.map.getSource(this.lineName).setData(e),this.map.moveLayer(this.lineName,this.pointName)):((t=this.map.MapLine()).draw(e,this.lineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width}},beforeId:this.pointName}),this.lineLayers.push(t))},e._drawMoveLine=function(t){var e=z([q([this.currentPosition[this.currentPosition.length-1],t],{lineIndex:this.index})]),n=("polygon"===this.type&&1<this.currentPosition.length&&(e=z([q([this.currentPosition[0],t,this.currentPosition[this.currentPosition.length-1]],{lineIndex:this.index})])),this.moveLineLayer?this.map.getSource(this.moveLineName).setData(e):((n=this.map.MapLine()).draw(e,this.moveLineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveLineLayers.push(n)),z([q([].concat(this.currentPosition,[t]))]));this._drawMoveMarker(this.calcAll?n:e,t)},e._drawMoveMarker=function(t,e){t=this._calcLength(t),this.moveMarker?(this.moveMarker.getElement().children[0].innerHTML=t,this.moveMarker.setLngLat(e)):(this.moveMarker=this._createMoveText(t),this.moveMarker.setLngLat(e).addTo(this.map))},e._removeMoveMarker=function(){this.moveMarker&&(this.moveMarker.remove(),this.moveMarker=null)},e._drawCircle=function(t,e){void 0===e&&(e=!0);var n,i=this.currentPosition[0],r=z([B(i,{circleIndex:this.index})]);t=Yt(z([q([i,t],{circleIndex:this.index})]),{units:"kilometers"}),this.moveCircleLayer?(n={steps:64,units:"kilometers",properties:{circleIndex:this.index}},i=z([ct(i,t,n)]),this.map.getSource(this.moveCircleName).setData(i),e||this.map.setPaintProperty(this.moveCircleLayer.lineName,"line-dasharray",[])):((n=this.map.MapCircle()).draw(r,this.moveCircleName,{endRadius:t,layerConfig:{paint:{"fill-color":this.fillProps.color}},lineConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveCircleLayers.push(n))},e._drawPolygon=function(t){var e;t=z([U([[].concat(this.currentPosition,[t,this.currentPosition[0]])],{polygonIndex:this.index})]),this.movePolygonLayer?this.map.getSource(this.movePolygonName).setData(t):((e=this.map.MapMoreCustom()).draw(t,{sourceConfig:{id:this.movePolygonName,type:"geojson",data:t},layerConfig:[{id:this.movePolygonName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.moveLineName}]}),this.movePolygonLayers.push(e))},e._drawRect=function(t,e){void 0===e&&(e=!0),t=z([it(nt(q([this.currentPosition[0],t])),{properties:{rectIndex:this.index}})]),this.moveRectLayer?(this.map.getSource(this.moveRectName).setData(t),e||this.map.setPaintProperty(this.moveRectName+"-line","line-dasharray",[])):((e=this.map.MapMoreCustom()).draw(t,{sourceConfig:{id:this.moveRectName,type:"geojson",data:t},layerConfig:[{id:this.moveRectName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveRectName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveRectLayers.push(e))},e._drawSector=function(t,e){void 0===e&&(e=!0);var n=Yt(q(this.currentPosition,{units:"kilometers"})),i=Ht(this.currentPosition[0],this.currentPosition[1]);t=Ht(this.currentPosition[0],t),n=z([ne(this.currentPosition[0],n,i,t,{units:"kilometers",properties:{sectorIndex:this.index}})]),this.moveSectorLayer?(this.map.getSource(this.moveSectorName).setData(n),e||this.map.setPaintProperty(this.moveSectorName+"-line","line-dasharray",[])):((i=this.map.MapMoreCustom()).draw(n,{sourceConfig:{id:this.moveSectorName,type:"geojson",data:n},layerConfig:[{id:this.moveSectorName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveSectorName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveSectorLayers.push(i))},e._removeRect=function(t){var e=this.moveRectLayers[t];e&&(e.destroy(),this.moveRectLayers[t]=null)},e._removeSector=function(t){var e=this.moveSectorLayers[t];e&&(e.destroy(),this.moveSectorLayers[t]=null)},e._createText=function(t,e,n){var i,r=this,o=(void 0===t&&(t="起点"),void 0===n&&(n=!0),document.createElement("div"));return((o.style.background="#ffffff",o.style.cursor="default",o.style.padding="0 5px",o.style.borderRadius="3px",o.style.display="flex",o.style.alignItems="center",o.className=this.className?this.className+" measure-box":"measure-box",o.ariaLabel="measure",i=document.createElement("span")).className="measure-text",i.innerHTML=t,i.ariaLabel="measure",o.appendChild(i),n&&((t=document.createElement("span")).className="measure-close",t.style.paddingLeft="5px",t.innerHTML="x",t.ariaLabel="measure",t.addEventListener("click",(function(t){r.isDraw||(t=t.target.parentNode._marker)&&r._removeGroup(t)})),o.appendChild(t)),i=new mapboxgl.Marker({element:o,offset:[10,0],anchor:"left"})).pointIndex=e,i.lineIndex=this.index,i.showBtn=n,this.currentText.push(i),o._marker=i},e._createMoveText=function(t){var e=document.createElement("div"),n=(e.style.background="#ffffff",e.style.cursor="default",e.style.padding="0 5px",e.style.borderRadius="3px",e.style.display="flex",e.style.alignItems="center",e.className=this.className?this.className+" measure-box":"measure-box",e.ariaLabel="measure",document.createElement("span"));return n.className="measure-text",n.innerHTML=t,n.ariaLabel="measure",e.appendChild(n),new mapboxgl.Marker({element:e,offset:[10,0],anchor:"left"})},e._createTextRemove=function(t){for(var e=this,n=document.createElement("div"),i=(n.className="measure-remove",n.style.width="15px",n.style.height="14px",n.style.marginLeft="5px",n.ariaLabel="measure",n.style.backgroundImage='url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z"/>%3C/svg>\')',n.style.backgroundSize="100% 100%",n.addEventListener("click",(function(t){e.isDraw||(t=t.target.parentNode._marker)&&e._removeGroupLine(t)})),this.texts[t]),r=null,o=i.length-1;0<=o;o--)if(i[o].showBtn){r=o;break}(null!==r?i[r]:i[i.length-1]).getElement().appendChild(n)},e._measureDistance=function(t){var e="起点",n=(1<this.currentPosition.length&&(n=z([q(this.currentPosition,{lineIndex:this.index})]),e=this._calcLength(n)),this._createText(e,this.currentPosition.length-1,"circle"!==this.type&&"rect"!==this.type&&"sector"!==this.type));return n.setLngLat(t).addTo(this.map),n},e._measureArea=function(t){var e,n,i;["circle","polygon","rect","sector"].includes(this.type)&&(n=null,"circle"===this.type?(i=Yt(z([q(this.currentPosition)]),{units:"kilometers"}),e={steps:64,units:"kilometers",properties:{circleIndex:this.index}},n=ct(this.currentPosition[0],i,e)):"polygon"===this.type?n=U([[].concat(this.currentPosition,[this.currentPosition[0]])]):"rect"===this.type?n=it(nt(q(this.currentPosition)),{properties:{rectIndex:this.index}}):"sector"===this.type&&(n=this.map.getSource(this.moveSectorName)._data.features[0]),null!==n)&&(i=this._calcArea(n),this._createText(i,this.currentPosition.length,!1).setLngLat(t).addTo(this.map))},e._calcLength=function(t){return 1e3<(t=Yt(t,{units:"meters"}))?Number((t/1e3).toFixed(this.fixed[0]))+this.units.line[0]:Number(t.toFixed(this.fixed[1]))+this.units.line[1]},e._calcArea=function(t){return t=function(t){return e=function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return Kt(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=Kt(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},n=0,$(t,(function(t,i,r,o,s){n=e(n,t)})),n;var e,n}(t),1e6<t?Number((t/1e6).toFixed(this.fixed[0]))+this.units[this.type][0]:Number(t.toFixed(this.fixed[1]))+this.units[this.type][1]},e._removeGroup=function(t){var e,n,i,r=t.lineIndex,o=t.pointIndex;t.remove(),this.texts[r].splice(o,1),this.positions[r].splice(o,1),t=this.positions[r],this._updateLine(t,r),this._updatePoint(t,r),this._updateText(t,r),"polygon"===this.type?(this._updatePolygon(t,r),i=[].concat(t,[t[0]]),this._updateLine(i,r),t.length<3?(this._removeMarker(r),this._removePoint(r),this._removeLine(r)):t.length===o&&this._createTextRemove(r),2<t.length&&(i=U([i]),e=Qt(i),0<(n=this.texts[r]).length)&&(n=n[n.length-1],i=this._calcArea(i),this._updateMarkerText(n,i),n.setLngLat(e.geometry.coordinates).addTo(this.map))):"line"===this.type&&(t.length<2?this._removeMarker(r):t.length===o&&this._createTextRemove(r))},e._removeGroupLine=function(t){t=t.lineIndex,this._removeMarker(t),this._removePoint(t),this._removeLine(t),"circle"===this.type?this._removeCircle(t):"polygon"===this.type?this._removePolygon(t):"rect"===this.type?this._removeRect(t):"sector"===this.type&&this._removeSector(t)},e._removeMarker=function(t){this.texts[t].forEach((function(t){t.remove()})),this.texts[t]=[]},e._updateLine=function(t,e){var n=ie+"_"+this.type+"_"+e+"_line";t.length<2?this._removeLine(e):(t=z([q(t,{lineIndex:e})]),this.map.getSource(n).setData(t))},e._updatePolygon=function(t,e){var n=ie+"_"+this.type+"_"+e+"_polygon_move";t.length<3?this._removePolygon(e):(e=z([U([[].concat(t,[t[0]])])]),this.map.getSource(n).setData(e))},e._removePolygon=function(t){var e=this.movePolygonLayers[t];e&&(e.destroy(),this.movePolygonLayers[t]=null)},e._removeLine=function(t){var e=this.lineLayers[t];e&&(e.destroy(),this.lineLayers[t]=null),this.currentPosition=[]},e._removeCircle=function(t){var e=this.moveCircleLayers[t];e&&(e.destroy(),this.moveCircleLayers[t]=null)},e._updatePoint=function(t,e){var n=ie+"_"+this.type+"_"+e+"_point";t.length<2?this._removePoint(e):(t=z(t.map((function(t,n){return B(t,{pointIndex:n,lineIndex:e})}))),this.map.getSource(n).setData(t))},e._removePoint=function(t){var e=this.pointLayers[t];e&&(e.destroy(),this.pointLayers[t]=null)},e._updateText=function(t,e){var n=this,i=this.texts[e];t.forEach((function(e,r){var o,s="起点";0!==r&&(o=z([q(t.slice(0,r+1))]),s=n._calcLength(o)),i[r]&&(i[r].pointIndex=r,n._updateMarkerText(i[r],s))}))},e._updateMarkerText=function(t,e){t.getElement().children[0].innerHTML=e},e.off=function(){this.isDraw||(this.map.off("click",this._click),this.map.off("mousemove",this._move),this.map.off("dblclick",this._dblclick))},e.remove=function(){this.isDraw||(this.pointLayers.forEach((function(t){null!=t&&t.destroy()})),this.movepointLayers.forEach((function(t){null!=t&&t.destroy()})),this.lineLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveLineLayers.forEach((function(t){null!=t&&t.destroy()})),this.texts.forEach((function(t){null!=t&&t.forEach((function(t){t.remove()}))})),this.moveCircleLayers.forEach((function(t){null!=t&&t.destroy()})),this.movePolygonLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveRectLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveSectorLayers.forEach((function(t){null!=t&&t.destroy()})),this._removeMoveMarker(),this._init())},e.visible=function(t){"boolean"!=typeof t||this.isDraw||(this.pointLayers.forEach((function(e){null!=e&&e.visible(t)})),this.movepointLayers.forEach((function(e){null!=e&&e.visible(t)})),this.lineLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveLineLayers.forEach((function(e){null!=e&&e.visible(t)})),this.texts.forEach((function(e){null!=e&&e.forEach((function(e){e.getElement().style.display=t?"flex":"none"}))})),this.moveCircleLayers.forEach((function(e){null!=e&&e.visible(t)})),this.movePolygonLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveRectLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveSectorLayers.forEach((function(e){null!=e&&e.visible(t)})))},e.destroy=function(){this.isOpen=!1,this.isDraw=!1,this.remove(),this.off()},jt(t,[{key:"pointName",get:function(){return ie+"_"+this.type+"_"+this.index+"_point"}},{key:"movePointName",get:function(){return ie+"_"+this.type+"_"+this.index+"_point_move"}},{key:"lineName",get:function(){return ie+"_"+this.type+"_"+this.index+"_line"}},{key:"moveLineName",get:function(){return ie+"_"+this.type+"_"+this.index+"_line_move"}},{key:"moveCircleName",get:function(){return ie+"_"+this.type+"_"+this.index+"_circle_move"}},{key:"movePolygonName",get:function(){return ie+"_"+this.type+"_"+this.index+"_polygon_move"}},{key:"moveRectName",get:function(){return ie+"_"+this.type+"_"+this.index+"_rect_move"}},{key:"moveSectorName",get:function(){return ie+"_"+this.type+"_"+this.index+"_sector_move"}},{key:"pointLayer",get:function(){return this.pointLayers[this.index]}},{key:"movePointLayer",get:function(){return this.movepointLayers[this.index]}},{key:"lineLayer",get:function(){return this.lineLayers[this.index]}},{key:"moveLineLayer",get:function(){return this.moveLineLayers[this.index]}},{key:"moveCircleLayer",get:function(){return this.moveCircleLayers[this.index]}},{key:"movePolygonLayer",get:function(){return this.movePolygonLayers[this.index]}},{key:"moveRectLayer",get:function(){return this.moveRectLayers[this.index]}},{key:"moveSectorLayer",get:function(){return this.moveSectorLayers[this.index]}}]),t}(),oe=["id"],se=["id","type","beforeId","source-layer"],ae=function(){function t(t,e){void 0===e&&(e={}),this.map=t,this.sourceName=[],this.layerName=[],this.type="symbol",this.custom=null!=(e=null==(t=e)?void 0:t.custom)&&e,this.isInit=!1,this.callback=null,this.mapEvent=null}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map)return this.callback=n,"vector"===t.type?(this.type=null!=(n=e.type)?n:"symbol",this._addSourceLayer(t,e),{source:this.sourceName,layer:this.layerName}):void 0},e.destroy=function(){this._clearSource(),this.mapEvent&&this.map.off("render",this.mapEvent)},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.layerName)&&e.filter((function(t){return!t.includes("__copy")})).forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._addSourceLayer=function(t,e){var n,i,s=this,a=(this.sourceName=[],this.layerName=[],i=null!=(i=e.sourceConfig)?i:{}).id,u=r(i,oe),c=a,h=(this.map.addSource(c,o({},t,u)),this.sourceName.push(c),(i=e.beforeId||null)&&this.map.getLayer(i),a=l(e.layerConfig),[]);Array.isArray(a)?h=a:"object"==typeof a&&h.push(a),0<h.length&&(t=h[0],i={id:c+"__copy",type:"circle",source:c,"source-layer":t["source-layer"],paint:{"circle-radius":1,"circle-opacity":0},interactive:!1},this.map.addLayer(i),this.layerName.push(c+"__copy"),n={sourceLayer:t["source-layer"]},this.mapEvent=function(t){var e,i=s.map.getSource(c);i&&i.loaded()&&s.map.isSourceLoaded(c)&&(i={type:"FeatureCollection",features:s.map.querySourceFeatures(c,n)},s.custom?s.callback&&"function"==typeof s.callback&&s.callback(i):(e=c+"__geojson",s.isInit?s.map.getSource(e)&&s.map.getSource(e).setData(i):(s.map.addSource(e,o({type:"geojson",data:i},u)),s.sourceName.push(e),h.forEach((function(t){var n=(t=l(t)).id,i=t.type,a=t.beforeId;t["source-layer"],t=r(t,se),a&&!s.map.getLayer(a)&&(a=null),s.map.addLayer(o({id:n,type:i},t,{source:e}),a),s.layerName.push(n)})),s.isInit=!0)))},this.map.on("render",this.mapEvent))},e._clearSource=function(){var t,e=this;null!=(t=this.layerName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getLayer(t))&&e.map.removeLayer(t)})),null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&e.map.removeSource(t)}))},t}(),ue=function(){function t(t){this.map=t}var e=t.prototype;return e.draw=function(t){var e,n,i,r,o,s,a,u,l;this.options=t,this.layer=(e=(t=this.options).id,n=t.url,i=t.crossOrigin,r=void 0===i?"":i,i=void 0===(i=t.position)?[]:i,t=t.altitude,o=void 0===t?0:t,s=i[0],a=i[1],u=i[2],l=i[3],{id:e,type:"custom",onAdd:function(t,e){var i=this,c=e.createShader(e.VERTEX_SHADER),h=(e.shaderSource(c,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),e.compileShader(c),e.createShader(e.FRAGMENT_SHADER)),p=(e.shaderSource(h,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),e.compileShader(h),this.program=e.createProgram(),e.attachShader(this.program,c),e.attachShader(this.program,h),e.linkProgram(this.program),this.aPos=e.getAttribLocation(this.program,"a_pos"),this.aUv=e.getAttribLocation(this.program,"a_uv"),this.uSamplerLoc=e.getUniformLocation(this.program,"u_sampler"),c=mapboxgl.MercatorCoordinate.fromLngLat({lng:s,lat:a},o),h=mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:a},o),mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:l},o)),f=mapboxgl.MercatorCoordinate.fromLngLat({lng:s,lat:l},o),g=new Image;g.crossOrigin=r,g.src=n,this.texture=e.createTexture(),g.onload=function(){e.bindTexture(e.TEXTURE_2D,i.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,g)},this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array([c.x,c.y,c.z,0,0,h.x,h.y,h.z,1,0,p.x,p.y,p.z,1,1,c.x,c.y,c.z,0,0,p.x,p.y,p.z,1,1,f.x,f.y,f.z,0,1]),e.STATIC_DRAW)},render:function(t,e){t.useProgram(this.program),t.uniformMatrix4fv(t.getUniformLocation(this.program,"u_matrix"),!1,e),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.enableVertexAttribArray(this.aPos),t.enableVertexAttribArray(this.aUv),t.vertexAttribPointer(this.aPos,3,t.FLOAT,!1,20,0),t.vertexAttribPointer(this.aUv,2,t.FLOAT,!1,20,12),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.TRIANGLES,0,6)}}),this.map.addLayer(this.layer)},e.visible=function(t){t?this.map.addLayer(this.layer):this.map.removeLayer(this.options.id)},e.destroy=function(){this.map.getLayer(this.options.id)&&this.map.removeLayer(this.options.id)},t}();function le(t,e,n={}){var i={type:"Feature"};return 0!==n.id&&!n.id||(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=e||{},i.geometry=t,i}function ce(t){return"Feature"===t.type?t.geometry:t}function he(t,e={}){var n,i=ce(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),i.type){case"Polygon":return[r,n={}]=[i,e],pe(o=(o=ce(r)).coordinates,n=n.properties||("Feature"===r.type?r.properties:{}));case"MultiPolygon":{var[r,o={}]=[i,e];const t=ce(r).coordinates,n=o.properties||("Feature"===r.type?r.properties:{}),s=[];return t.forEach((t=>{s.push(pe(t,n))})),function(t,e={}){var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}(s)}default:throw new Error("invalid poly")}}function pe(t,e){return 1<t.length?function(t,e,n={}){return le({type:"MultiLineString",coordinates:t},e,n)}(t,e):function(t,e,n={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return le({type:"LineString",coordinates:t},e,n)}(t[0],e)}Math.PI;var fe=t(675);function ge(){return new de}function de(){this.reset()}de.prototype={constructor:de,reset:function(){this.s=this.t=0},add:function(t){_e(ye,t,this.t),_e(this,ye.s,this.s),this.s?this.t+=ye.t:this.s=ye.t},valueOf:function(){return this.s}};var ye=new de;function _e(t,e,n){var i=t.s=e+n,r=i-e;t.t=e-(i-r)+(n-r)}var me=1e-6,ve=Math.PI,xe=ve/2,Ee=ve/4,be=2*ve,Ie=180/ve,we=ve/180,Ne=Math.abs,Le=Math.atan,Se=Math.atan2,Ce=Math.cos,Pe=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),Me=(Math.sign,Math.sqrt);function Te(t){return 1<t?0:t<-1?ve:Math.acos(t)}function Re(t){return 1<t?xe:t<-1?-xe:Math.asin(t)}function Oe(){}function Ae(t,e){t&&Fe.hasOwnProperty(t.type)&&Fe[t.type](t,e)}Math.tan;var De={Feature:function(t,e){Ae(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,r=n.length;++i<r;)Ae(n[i].geometry,e)}},Fe={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)t=n[i],e.point(t[0],t[1],t[2])},LineString:function(t,e){ke(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)ke(n[i],e,0)},Polygon:function(t,e){Ge(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,i=-1,r=n.length;++i<r;)Ge(n[i],e)},GeometryCollection:function(t,e){for(var n=t.geometries,i=-1,r=n.length;++i<r;)Ae(n[i],e)}};function ke(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function Ge(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)ke(t[n],e,1);e.polygonEnd()}function Be(t){return[Se(t[1],t[0]),Re(t[2])]}function Ue(t){var e=t[0],n=(t=t[1],Ce(t));return[n*Ce(e),n*Pe(e),Pe(t)]}function qe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ze(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function je(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ve(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Xe(t){var e=Me(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Ye(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,i){return(n=e.invert(n,i))&&t.invert(n[0],n[1])}),n}function He(t,e){return[ve<t?t-be:t<-ve?t+be:t,e]}function We(t,e,n){return(t%=be)?e||n?Ye(Ke(t),Ze(e,n)):Ke(t):e||n?Ze(e,n):He}function Je(t){return function(e,n){return[ve<(e+=t)?e-be:e<-ve?e+be:e,n]}}function Ke(t){var e=Je(t);return e.invert=Je(-t),e}function Ze(t,e){var n=Ce(t),i=Pe(t),r=Ce(e),o=Pe(e);function s(t,e){var s=Ce(e),a=Ce(t)*s;return t=Pe(t)*s,s=Pe(e),[Se(t*r-(e=s*n+a*i)*o,a*n-s*i),Re(e*r+t*o)]}return s.invert=function(t,e){var s=Ce(e),a=Ce(t)*s;return t=Pe(t)*s,s=Pe(e),[Se(t*r+s*o,a*n+(e=s*r-t*o)*i),Re(e*n-a*i)]},s}function $e(t,e){return(e=Ue(e))[0]-=t,Xe(e),t=Te(-e[1]),((-e[2]<0?-t:t)+be-me)%be}function Qe(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Oe,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function tn(t,e){return Ne(t[0]-e[0])<me&&Ne(t[1]-e[1])<me}function en(t,e,n,i){this.x=t,this.z=e,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function nn(t,e,n,i,r){var o,s,a=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,i=t[0],s=t[e];if(tn(i,s)){for(r.lineStart(),o=0;o<e;++o)r.point((i=t[o])[0],i[1]);r.lineEnd()}else a.push(n=new en(i,t,null,!0)),u.push(n.o=new en(i,null,n,!1)),a.push(n=new en(s,t,null,!1)),u.push(n.o=new en(s,null,n,!0))}})),a.length){for(u.sort(e),rn(a),rn(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var p=h,f=!0;p.v;)if((p=p.n)===h)return;l=p.z,r.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,s=l.length;o<s;++o)r.point((c=l[o])[0],c[1]);else i(p.x,p.n.x,1,r);p=p.n}else{if(f)for(l=p.p.z,o=l.length-1;0<=o;--o)r.point((c=l[o])[0],c[1]);else i(p.x,p.p.x,-1,r);p=p.p}}while(l=(p=p.o).z,f=!f,!p.v);r.lineEnd()}}}function rn(t){if(e=t.length){for(var e,n,i=0,r=t[0];++i<e;)r.n=n=t[i],n.p=r,r=n;r.n=n=t[0],n.p=r}}function on(t,e){return t<e?-1:e<t?1:e<=t?0:NaN}ge(),ge(),ge(),He.invert=He,1===(s=on).length&&(sn=s,s=function(t,e){return on(sn(t),e)});var sn,an=Array.prototype;function un(t){for(var e,n,i,r=t.length,o=-1,s=0;++o<r;)s+=t[o].length;for(n=new Array(s);0<=--r;)for(e=(i=t[r]).length;0<=--e;)n[--s]=i[e];return n}an.slice,an.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var ln=1e9,cn=-ln;function hn(t,e,n,i){function r(r,o){return t<=r&&r<=n&&e<=o&&o<=i}function o(r,o,a,l){var c=0,h=0;if(null==r||(c=s(r,a))!==(h=s(o,a))||u(r,o)<0^0<a)for(;l.point(0===c||3===c?t:n,1<c?i:e),(c=(c+a+4)%4)!==h;);else l.point(o[0],o[1])}function s(i,r){return Ne(i[0]-t)<me?0<r?0:3:Ne(i[0]-n)<me?0<r?2:1:Ne(i[1]-e)<me?0<r?1:0:0<r?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),i=s(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,l,c,h,p,f,g,d,y,_,m,v=s,x=Qe(),E={point:b,lineStart:function(){E.point=I,l&&l.push(c=[]),_=!0,y=!1,g=d=NaN},lineEnd:function(){u&&(I(h,p),f&&y&&x.rejoin(),u.push(x.result())),E.point=b,y&&v.lineEnd()},polygonStart:function(){v=x,u=[],l=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,r=l.length;n<r;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],p=h[0],f=h[1];u<c;++u)o=p,s=f,p=(h=a[u])[0],f=h[1],s<=i?i<f&&(f-s)*(t-o)<(p-o)*(i-s)&&++e:f<=i&&(p-o)*(i-s)<(f-s)*(t-o)&&--e;return e}(),n=m&&e,r=(u=un(u)).length;(n||r)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),r&&nn(u,a,e,o,s),s.polygonEnd()),v=s,u=l=c=null}};function b(t,e){r(t,e)&&v.point(t,e)}function I(o,s){var a,u,x=r(o,s);l&&c.push([o,s]),_?(h=o,p=s,_=!1,(f=x)&&(v.lineStart(),v.point(o,s))):x&&y?v.point(o,s):function(t,e,n,i,r,o){var s=t[0],a=t[1],u=0,l=1,c=e[0]-s,h=e[1]-a;if(n-=s,c||!(0<n)){if(n/=c,c<0){if(n<u)return;n<l&&(l=n)}else if(0<c){if(l<n)return;u<n&&(u=n)}if(n=r-s,c||!(n<0)){if(n/=c,c<0){if(l<n)return;u<n&&(u=n)}else if(0<c){if(n<u)return;n<l&&(l=n)}if(n=i-a,h||!(0<n)){if(n/=h,h<0){if(n<u)return;n<l&&(l=n)}else if(0<h){if(l<n)return;u<n&&(u=n)}if(n=o-a,h||!(n<0)){if(n/=h,h<0){if(l<n)return;u<n&&(u=n)}else if(0<h){if(n<u)return;n<l&&(l=n)}return 0<u&&(t[0]=s+u*c,t[1]=a+u*h),l<1&&(e[0]=s+l*c,e[1]=a+l*h),1}}}}}(a=[g=Math.max(cn,Math.min(ln,g)),d=Math.max(cn,Math.min(ln,d))],u=[o=Math.max(cn,Math.min(ln,o)),s=Math.max(cn,Math.min(ln,s))],t,e,n,i)?(y||(v.lineStart(),v.point(a[0],a[1])),v.point(u[0],u[1]),x||v.lineEnd(),m=!1):x&&(v.lineStart(),v.point(o,s),m=!1),g=o,d=s,y=x}return E}}var pn=ge();ge(),ge(),ge();var fn=1/0,gn=fn,dn=-fn,yn=dn;const _n={point:function(t,e){t<fn&&(fn=t),dn<t&&(dn=t),e<gn&&(gn=e),yn<e&&(yn=e)},lineStart:Oe,lineEnd:Oe,polygonStart:Oe,polygonEnd:Oe,result:function(){var t=[[fn,gn],[dn,yn]];return dn=yn=-(gn=fn=1/0),t}};function mn(t,e,n,i){return function(r,o){var s,a,u,l=e(o),c=r.invert(i[0],i[1]),h=Qe(),p=e(h),f=!1,g={point:d,lineStart:_,lineEnd:m,polygonStart:function(){g.point=v,g.lineStart=x,g.lineEnd=E,a=[],s=[]},polygonEnd:function(){g.point=d,g.lineStart=_,g.lineEnd=m,a=un(a);var t=function(t,e){var n=e[0],i=e[1],r=[Pe(n),-Ce(n),0],o=0,s=0;pn.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,h=l[c-1],p=h[0],f=h[1]/2+Ee,g=Pe(f),d=Ce(f),y=0;y<c;++y,p=m,g=x,d=v,h=_){var _=l[y],m=_[0],v=_[1]/2+Ee,x=Pe(v),E=(v=Ce(v),m-p),b=0<=E?1:-1,I=b*E,w=ve<I,N=g*x;pn.add(Se(N*b*Pe(I),d*v+N*Ce(I))),o+=w?E+b*be:E,w^n<=p^n<=m&&(Xe(N=ze(Ue(h),Ue(_))),Xe(I=ze(r,N)),(b=(w^0<=E?-1:1)*Re(I[2]))<i||i===b&&(N[0]||N[1]))&&(s+=w^0<=E?1:-1)}return(o<-me||o<me&&pn<-me)^1&s}(s,c);a.length?(f||(o.polygonStart(),f=!0),nn(a,xn,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(e,n){var i=r(e,n);t(e=i[0],n=i[1])&&o.point(e,n)}function y(t,e){t=r(t,e),l.point(t[0],t[1])}function _(){g.point=y,l.lineStart()}function m(){g.point=d,l.lineEnd()}function v(t,e){u.push([t,e]),t=r(t,e),p.point(t[0],t[1])}function x(){p.lineStart(),u=[]}function E(){v(u[0][0],u[0][1]),p.lineEnd();var t,e,n,i,r=p.clean(),l=h.result(),c=l.length;if(u.pop(),s.push(u),u=null,c)if(1&r){if(0<(e=(n=l[0]).length-1)){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t<e;++t)o.point((i=n[t])[0],i[1]);o.lineEnd()}}else 1<c&&2&r&&l.push(l.pop().concat(l.shift())),a.push(l.filter(vn))}return g}}function vn(t){return 1<t.length}function xn(t,e){return((t=t.x)[0]<0?t[1]-xe-me:xe-t[1])-((e=e.x)[0]<0?e[1]-xe-me:xe-e[1])}ge();const En=mn((function(){return 1}),(function(t){var e,n=NaN,i=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a,u,l,c,h,p=0<o?ve:-ve,f=Ne(o-n);Ne(f-ve)<me?(t.point(n,i=0<(i+s)/2?xe:-xe),t.point(r,i),t.lineEnd(),t.lineStart(),t.point(p,i),t.point(o,i),e=0):r!==p&&ve<=f&&(Ne(n-r)<me&&(n-=r*me),Ne(o-p)<me&&(o-=p*me),f=i,l=s,h=Pe((a=n)-(u=o)),i=Ne(h)>me?Le((Pe(f)*(c=Ce(l))*Pe(u)-Pe(l)*(u=Ce(f))*Pe(a))/(u*c*h)):(f+l)/2,t.point(r,i),t.lineEnd(),t.lineStart(),t.point(p,i),e=0),t.point(n=o,i=s),r=p},lineEnd:function(){t.lineEnd(),n=i=NaN},clean:function(){return 2-e}}}),(function(t,e,n,i){var r;null==t?(r=n*xe,i.point(-ve,r),i.point(0,r),i.point(ve,r),i.point(ve,0),i.point(ve,-r),i.point(0,-r),i.point(-ve,-r),i.point(-ve,0),i.point(-ve,r)):Ne(t[0]-e[0])>me?(r=n*(t=t[0]<e[0]?ve:-ve)/2,i.point(-t,r),i.point(0,r),i.point(t,r)):i.point(e[0],e[1])}),[-ve,-xe]);function bn(t,e){var n=Ce(t),i=0<n,r=Ne(n)>me;function o(t,e){return Ce(t)*Ce(e)>n}function s(t,e,i){var r,o,s,a,u,l,c,h=[1,0,0],p=ze(Ue(t),Ue(e)),f=qe(p,p),g=p[0],d=f-g*g;return d?(r=ze(h,p),je(h=Ve(h,n*f/d),Ve(p,-n*g/d)),(d=(p=qe(h,f=r))*p-(g=qe(f,f))*(qe(h,h)-1))<0?void 0:(je(d=Ve(f,(-p-(r=Me(d)))/g),h),d=Be(d),i?(o=t[0],s=e[0],a=t[1],e=e[1],s<o&&(c=o,o=s,s=c),!(l=Ne((u=s-o)-ve)<me)&&e<a&&(c=a,a=e,e=c),(l||u<me?l?0<a+e^d[1]<(Ne(d[0]-o)<me?a:e):a<=d[1]&&d[1]<=e:ve<u^(o<=d[0]&&d[0]<=s))?(je(c=Ve(f,(-p+r)/g),h),[d,Be(c)]):void 0):d)):!i&&t}function a(e,n){var r=i?t:ve-t,o=0;return e<-r?o|=1:r<e&&(o|=2),n<-r?o|=4:r<n&&(o|=8),o}return mn(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,g=[h,p],d=o(h,p);h=i?d?0:a(h,p):d?a(h+(h<0?ve:-ve),p):0,!e&&(l=u=d)&&t.lineStart(),d===u||(f=s(e,g))&&!tn(e,f)&&!tn(g,f)||(g[0]+=me,g[1]+=me,d=o(g[0],g[1])),d!==u?(c=0,d?(t.lineStart(),f=s(g,e),t.point(f[0],f[1])):(f=s(e,g),t.point(f[0],f[1]),t.lineEnd()),e=f):r&&e&&i^d&&(h&n||!(p=s(g,e,!0))||(c=0,i?(t.lineStart(),t.point(p[0][0],p[0][1]),t.point(p[1][0],p[1][1]),t.lineEnd()):(t.point(p[1][0],p[1][1]),t.lineEnd(),t.lineStart(),t.point(p[0][0],p[0][1])))),!d||e&&tn(e,g)||t.point(g[0],g[1]),e=g,u=d,n=h},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(n,i,r,o){!function(t,e,n,i,r,o){if(n){var s=Ce(e),a=Pe(e),u=i*n;null==r?(r=e+i*be,o=e-u/2):(r=$e(s,r),o=$e(s,o),(0<i?r<o:o<r)&&(r+=i*be));for(var l,c=r;0<i?o<c:c<o;c-=u)l=Be([s,-a*Ce(c),-a*Pe(c)]),t.point(l[0],l[1])}}(o,t,e,r,n,i)}),i?[0,-t]:[-ve,t-ve])}function In(t){return t}function wn(t){return function(e){var n,i=new Nn;for(n in t)i[n]=t[n];return i.stream=e,i}}function Nn(){}function Ln(t,e,n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent(),s=(t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),function(t,e){t&&De.hasOwnProperty(t.type)?De[t.type](t,e):Ae(t,e)}(n,t.stream(_n)),n=_n.result(),Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])));return i=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,e=+e[0][1]+(r-s*(n[1][1]+n[0][1]))/2,null!=o&&t.clipExtent(o),t.scale(150*s).translate([i,e])}Nn.prototype={constructor:Nn,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Sn=16,Cn=Ce(30*we);function Pn(t,e){return+e?(i=t,r=e,function(t){var e,n,r,s,a,u,l,c,h,p,f,g,d={point:y,lineStart:_,lineEnd:v,polygonStart:function(){t.polygonStart(),d.lineStart=x},polygonEnd:function(){t.polygonEnd(),d.lineStart=_}};function y(e,n){e=i(e,n),t.point(e[0],e[1])}function _(){c=NaN,d.point=m,t.lineStart()}function m(e,n){var r=Ue([e,n]);n=i(e,n),o(c,h,l,p,f,g,c=n[0],h=n[1],l=e,p=r[0],f=r[1],g=r[2],Sn,t),t.point(c,h)}function v(){d.point=y,t.lineEnd()}function x(){_(),d.point=E,d.lineEnd=b}function E(t,i){m(e=t,i),n=c,r=h,s=p,a=f,u=g,d.point=m}function b(){o(c,h,l,p,f,g,n,r,e,s,a,u,Sn,t),d.lineEnd=v,v()}return d}):(n=t,wn({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,i,r;function o(t,e,n,s,a,u,l,c,h,p,f,g,d,y){var _,m,v,x,E,b,I,w,N,L,S=l-t,C=c-e,P=S*S+C*C;4*r<P&&d--&&(v=u+g,I=Re(v/=x=Me((_=s+p)*_+(m=a+f)*m+v*v)),E=Ne(Ne(v)-1)<me||Ne(n-h)<me?(n+h)/2:Se(m,_),b=(I=i(E,I))[0],I=I[1],r<(L=C*(w=b-t)-S*(N=I-e))*L/P||.3<Ne((S*w+C*N)/P-.5)||s*p+a*f+u*g<Cn)&&(o(t,e,n,s,a,u,b,I,E,_/=x,m/=x,v,d,y),y.point(b,I),o(b,I,E,_,m,v,l,c,h,p,f,g,d,y))}}var Mn=wn({point:function(t,e){this.stream.point(t*we,e*we)}});function Tn(t){return function(e,n){var i=Ce(e),r=Ce(n);return[(i=t(i*r))*r*Pe(e),i*Pe(n)]}}function Rn(t){return function(e,n){var i=Me(e*e+n*n),r=t(i),o=Pe(r);return r=Ce(r),[Se(e*o,i*r),Re(i&&n*o/i)]}}var On=Tn((function(t){return Me(2/(1+t))}));On.invert=Rn((function(t){return 2*Re(t/2)}));var An=Tn((function(t){return(t=Te(t))&&t/Pe(t)}));function Dn(t,e,n,i){var r,o,s=t.properties||{},a="Feature"===t.type?t.geometry:t;return"GeometryCollection"===a.type?(r=[],$(t,(function(t){(t=Dn(t,e,n,i))&&r.push(t)})),z(r)):(t=function(t){return t=function(t,e){return void 0===e&&(e={}),B([((t=nt(t))[0]+t[2])/2,(t[1]+t[3])/2],e.properties,e)}(t).geometry.coordinates,t=[-t[0],-t[1]],function(t){return s=function(){return t},_=150,m=480,v=250,w=I=b=E=x=0,N=null,L=En,S=null,C=In,M=Pn(i,P=.5),e.stream=function(t){return d&&y===t?d:d=Mn(L(c,M(C(y=t))))},e.clipAngle=function(t){return arguments.length?(L=+t?bn(N=t*we,6*we):(N=null,En),o()):N*Ie},e.clipExtent=function(t){return arguments.length?(C=null==t?(S=p=f=g=null,In):hn(S=+t[0][0],p=+t[0][1],f=+t[1][0],g=+t[1][1]),o()):null==S?null:[[S,p],[f,g]]},e.scale=function(t){return arguments.length?(_=+t,r()):_},e.translate=function(t){return arguments.length?(m=+t[0],v=+t[1],r()):[m,v]},e.center=function(t){return arguments.length?(x=t[0]%360*we,E=t[1]%360*we,r()):[x*Ie,E*Ie]},e.rotate=function(t){return arguments.length?(b=t[0]%360*we,I=t[1]%360*we,w=2<t.length?t[2]%360*we:0,r()):[b*Ie,I*Ie,w*Ie]},e.precision=function(t){return arguments.length?(M=Pn(i,P=t*t),o()):Me(P)},e.fitExtent=function(t,n){return Ln(e,t,n)},e.fitSize=function(t,n){return Ln(e,[[0,0],t],n)},function(){return a=s.apply(this,arguments),e.invert=a.invert&&n,r()}();function e(t){return[(t=h(t[0]*we,t[1]*we))[0]*_+u,l-t[1]*_]}function n(t){return(t=h.invert((t[0]-u)/_,(l-t[1])/_))&&[t[0]*Ie,t[1]*Ie]}function i(t,e){return[(t=a(t,e))[0]*_+u,l-t[1]*_]}function r(){h=Ye(c=We(b,I,w),a);var t=a(x,E);return u=m-t[0]*_,l=v+t[1]*_,o()}function o(){return d=y=null,e}var s,a,u,l,c,h,p,f,g,d,y,_,m,v,x,E,b,I,w,N,L,S,C,P,M}(An).scale(79.4188).clipAngle(179.999).rotate(t).scale(F)}(a),a={type:a.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n(e):e.map((function(e){return t(e,n)}))}(a.coordinates,t)},a=(new fe.GeoJSONReader).read(a),o=V(X(e,n),"meters"),a=fe.BufferOp.bufferOp(a,o,i),function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((a=(new fe.GeoJSONWriter).write(a)).coordinates)?void 0:G({type:a.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n.invert(e):e.map((function(e){return t(e,n)}))}(a.coordinates,t)},s))}An.invert=Rn((function(t){return t})),Rn(Le),Rn(Re),Rn((function(t){return 2*Le(t)}));const Fn=function(t,e,n){var i=(n=n||{}).units||"kilometers",r=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return $(t,(function(t){(t=Dn(t,e,i,r))&&o.push(t)})),z(o);case"FeatureCollection":return Z(t,(function(t){(t=Dn(t,e,i,r))&&Z(t,(function(t){t&&o.push(t)}))})),z(o)}return Dn(t,e,i,r)},kn=function(t){var e;if(t)return e=[],Q(t,(function(t){var n=t,i=e,r=[],o=n.geometry;if(null!==o){switch(o.type){case"Polygon":r=st(o);break;case"LineString":r=[st(o)]}r.forEach((function(t){var e,r;e=n.properties,r=[],t.reduce((function(t,n){var i,o,s,a=q([t,n],e);return a.bbox=(i=n,o=t[0],t=t[1],[o<(s=i[0])?o:s,t<(i=i[1])?t:i,s<o?o:s,i<t?t:i]),r.push(a),n})),r.forEach((function(t){t.id=i.length,i.push(t)}))}))}})),z(e);throw new Error("geojson is required")};var Gn=t(787);function Bn(t,e){if(t=st(t),e=st(e),2!==t.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==e.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=t[0][0],i=t[0][1],r=t[1][0],o=(t=t[1][1],e[0][0]),s=e[0][1],a=e[1][0],u=((e=e[1][1])-s)*(r-n)-(a-o)*(t-i);return a=(a-o)*(i-s)-(e-s)*(n-o),e=(r-n)*(i-s)-(t-i)*(n-o),0!=u&&(s=e/u,0<=(o=a/u))&&o<=1&&0<=s&&s<=1?B([n+o*(r-n),i+o*(t-i)]):null}const Un=function(t,e){var n,i,r={},o=[];return"LineString"===t.type&&(t=G(t)),"LineString"===e.type&&(e=G(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length?(n=Bn(t,e))&&o.push(n):((i=Gn()).load(kn(e)),Z(kn(t),(function(t){Z(i.search(t),(function(e){var n;(e=Bn(t,e))&&(n=st(e).join(","),r[n]||(r[n]=!0,o.push(e)))}))}))),z(o)},qn=function(t,e,n){void 0===n&&(n={});var i=B([1/0,1/0],{dist:1/0}),r=0;return Q(t,(function(t){for(var o=st(t),s=0;s<o.length-1;s++){var a=B(o[s]),u=(a.properties.dist=Xt(e,a,n),B(o[s+1])),l=(u.properties.dist=Xt(e,u,n),Xt(a,u,n)),c=Math.max(a.properties.dist,u.properties.dist),h=Ht(a,u),p=lt(e,c,h+90,n);c=lt(e,c,h-90,n),h=Un(q([p.geometry.coordinates,c.geometry.coordinates]),q([a.geometry.coordinates,u.geometry.coordinates])),p=null,0<h.features.length&&((p=h.features[0]).properties.dist=Xt(e,p,n),p.properties.location=r+Xt(a,p,n)),a.properties.dist<i.properties.dist&&((i=a).properties.index=s,i.properties.location=r),u.properties.dist<i.properties.dist&&((i=u).properties.index=s+1,i.properties.location=r+l),p&&p.properties.dist<i.properties.dist&&((i=p).properties.index=s),r+=l}})),i},zn=function(t,e,n){return void 0===n&&(n={}),t=ot(t),(e=ot(e))[0]+=180<e[0]-t[0]?-360:180<t[0]-e[0]?360:0,W(function(t,e,n){n=n=void 0===n?F:Number(n);var i=t[1]*Math.PI/180,r=e[1]*Math.PI/180,o=r-i;return(e=Math.abs(e[0]-t[0])*Math.PI/180)>Math.PI&&(e-=2*Math.PI),t=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),r=1e-11<Math.abs(t)?o/t:Math.cos(i),Math.sqrt(o*o+r*r*e*e)*n}(t,e),"meters",n.units)};function jn(t,e){return t[0]*e[0]+t[1]*e[1]}function Vn(t,e,n){return("planar"===n.method?zn:Xt)(t,e,n)}const Xn=function(t,e,n){if((n=void 0===n?{}:n).method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=B(t):"Point"===t.type?t=G(t):at(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=q(e):"LineString"===e.type?e=G(e):at(e,"LineString","line");var i=1/0,r=t.geometry.coordinates;return tt(e,(function(t){var e=t.geometry.coordinates[0];t=t.geometry.coordinates[1],e=function(t,e,n,i){var r=[n[0]-e[0],n[1]-e[1]],o=jn([t[0]-e[0],t[1]-e[1]],r);if(o<=0)return Vn(t,e,{method:i.method,units:"degrees"});var s=jn(r,r);return s<=o?Vn(t,n,{method:i.method,units:"degrees"}):(n=o/s,Vn(t,o=[e[0]+n*r[0],e[1]+n*r[1]],{method:i.method,units:"degrees"}))}(r,e,t,n),e<i&&(i=e)})),W(i,"degrees",n.units)},Yn=function(t,e,n){void 0===n&&(n={});for(var i=ot(t),r=st(e),o=0;o<r.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===r.length-2&&(s="end"),0===o)&&o+1===r.length-1&&(s="both"),function(t,e,n,i,r){var o=n[0],s=n[1],a=t[0],u=(t=t[1],e[0]),l=u-a,c=(e=e[1])-t,h=(h=n[0]-a)*c-(n=n[1]-t)*l;if(null!==r){if(Math.abs(h)>r)return}else if(0!=h)return;return i?"start"===i?Math.abs(l)>=Math.abs(c)?0<l?a<o&&o<=u:u<=o&&o<a:0<c?t<s&&s<=e:e<=s&&s<t:"end"===i?Math.abs(l)>=Math.abs(c)?0<l?a<=o&&o<u:u<o&&o<=a:0<c?t<=s&&s<e:e<s&&s<=t:"both"===i?Math.abs(l)>=Math.abs(c)?0<l?a<o&&o<u:u<o&&o<a:0<c?t<s&&s<e:e<s&&s<t:void 0:Math.abs(l)>=Math.abs(c)?0<l?a<=o&&o<=u:u<=o&&o<=a:0<c?t<=s&&s<=e:e<=s&&s<=t}(r[o],r[o+1],i,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1};function Hn(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function Wn(t,e){return t[0]===e[0]&&t[1]===e[1]}const Jn=function(t,e){var n=ut(t),i=ut(e),r=n.type,o=i.type;switch(r){case"Point":switch(o){case"MultiPoint":var s,a=n,u=i,l=!1;for(s=0;s<u.coordinates.length;s++)if(Wn(u.coordinates[s],a.coordinates)){l=!0;break}return l;case"LineString":return Yn(n,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ft(n,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":for(var c=n,h=i,p=0;p<c.coordinates.length;p++){for(var f=!1,g=0;g<h.coordinates.length;g++)Wn(c.coordinates[p],h.coordinates[g])&&(f=!0);if(!f)return!1}return!0;case"LineString":for(var d=n,y=i,_=!1,m=0;m<d.coordinates.length;m++){if(!Yn(d.coordinates[m],y))return!1;_=_||Yn(d.coordinates[m],y,{ignoreEndVertices:!0})}return _;case"Polygon":case"MultiPolygon":for(var v=n,x=i,E=!0,b=!1,I=0;I<v.coordinates.length;I++){if(!(b=Ft(v.coordinates[1],x))){E=!1;break}b=Ft(v.coordinates[1],x,{ignoreBoundary:!0})}return E&&b;default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":for(var w=n,N=i,L=0;L<w.coordinates.length;L++)if(!Yn(w.coordinates[L],N))return!1;return!0;case"Polygon":case"MultiPolygon":var S=n,C=i;if(!Hn(nt(C),nt(S)))return!1;for(var P,M=!1,T=0;T<S.coordinates.length-1;T++){if(!Ft(S.coordinates[T],C))return!1;(M=M||Ft(S.coordinates[T],C,{ignoreBoundary:!0}))||(P=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(S.coordinates[T],S.coordinates[T+1]),M=Ft(P,C,{ignoreBoundary:!0}))}return M;default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":var R=n,O=i,A=nt(R);if(!Hn(nt(O),A))return!1;for(var D=0;D<R.coordinates[0].length;D++)if(!Ft(R.coordinates[0][D],O))return!1;return!0;default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+r+" geometry not supported")}},Kn=function(t,e,n){(n=void 0===n?{}:n).mask&&!n.units&&(n.units="kilometers");for(var i=[],r=t[0],o=t[1],s=t[2],a=t[3],u=e/Xt([r,o],[s,o],n)*(s-r),l=e/Xt([r,o],[r,a],n)*(a-o),c=(t=s-r,e=a-o,Math.floor(t/u)),h=(e-Math.floor(e/l)*l)/2,p=r+(t-c*u)/2;p<=s;){for(var f=o+h;f<=a;){var g=B([p,f],n.properties);(!n.mask||Jn(g,n.mask))&&i.push(g),f+=l}p+=u}return z(i)};var Zn=t(676);function $n(t){return j(t)}const Qn=function(t,e){var n=U(e&&e.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]);return("FeatureCollection"===t.type?$n(2===(e=t).features.length?Zn.union(e.features[0].geometry.coordinates,e.features[1].geometry.coordinates):Zn.union.apply(Zn,e.features.map((function(t){return t.geometry.coordinates})))):$n(Zn.union(t.geometry.coordinates))).geometry.coordinates.forEach((function(t){n.geometry.coordinates.push(t[0])})),n},ti=function(t,e,n){return void 0===n&&(n={}),t=ut(t),e=ut(e),0===(t=Zn.union(t.coordinates,e.coordinates)).length?null:1===t.length?U(t[0],n.properties):j(t,n.properties)};var ei=["padding","animate","maxZoom","essential"],ni=["url"],ii=["interactive"],ri=null,oi=null,si=function(t){return/^#([0-9a-fA-F]{3}){1,2}$/.test(t)},ai=["line-color","line-opacity"],ui=["fill-color","fill-opacity"],li=["background-color","background-opacity"],ci=["text-color","text-opacity"],hi="zh_custom",pi=function(t,e,n,i){if(n&&(si(n)||Array.isArray(n))){var r=t.getLayer(e);if(r){var o=[];switch(r.type){case"line":o=ai;break;case"fill":o=ui;break;case"background":o=li;break;case"symbol":o=ci}0<o.length&&(t.setPaintProperty(e,o[0],n),null!==i)&&t.setPaintProperty(e,o[1],i)}}},fi=function(t,e,n,i){if(e&&n&&"string"==typeof e&&t.getLayer(e)&&"object"==typeof n)for(var r in n)null!==n[r]&&void 0!==n[r]&&t[i](e,r,n[r])};function gi(t,e){if(t&&(void 0!==t[hi]&&null!==t[hi]||(t[hi]={}),e)&&"object"==typeof e){var n,i=l(e);for(n in i)t[hi][n]=i[n]}}function di(t,e){var n=[];return"string"==typeof e?n=e.split(".").filter(Boolean):Array.isArray(e)&&(n=e),0===n.length?null:n.reduce((function(t,e){return t[e]}),t[hi])}})(),i;function t(i){var r=n[i];return void 0!==r||(r=n[i]={exports:{}},e[i].call(r.exports,r,r.exports,t)),r.exports}var e,n,i}));
|