mirage2d 1.2.21 → 1.2.22

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.
@@ -466,7 +466,7 @@ var klt=function(){return"undefined"!=typeof window?window:"undefined"!=typeof g
466
466
  * By Jimmy Wärting, https://github.com/jimmywarting
467
467
  * License: MIT
468
468
  * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
469
- */klt.URL=klt.URL||klt.webkitURL||function(t,e){return(e=document.createElement("a")).href=t,e};var Rlt=klt.Blob,Ult=URL.createObjectURL,Dlt=URL.revokeObjectURL,Qlt=klt.Symbol&&klt.Symbol.toStringTag,Glt=!1,jlt=!1,Hlt=!!klt.ArrayBuffer,zlt=Nlt&&Nlt.prototype.append&&Nlt.prototype.getBlob;try{Glt=2===new Blob(["ä"]).size,jlt=2===new Blob([new Uint8Array([1,2])]).size}catch(FX){}function Vlt(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t}))}function Klt(t,e){e=e||{};var r=new Nlt;return Vlt(t).forEach((function(t){r.append(t)})),e.type?r.getBlob(e.type):r.getBlob()}function qlt(t,e){return new Rlt(Vlt(t),e||{})}if(klt.Blob&&(Klt.prototype=Blob.prototype,qlt.prototype=Blob.prototype),Qlt)try{File.prototype[Qlt]="File",Blob.prototype[Qlt]="Blob",FileReader.prototype[Qlt]="FileReader"}catch(FX){}function Wlt(){var t=!!klt.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,e=klt.XMLHttpRequest&&klt.XMLHttpRequest.prototype.send;t&&e&&(XMLHttpRequest.prototype.send=function(t){t instanceof Blob?(this.setRequestHeader("Content-Type",t.type),e.call(this,t)):e.call(this,t)});try{new File([],"")}catch(n){try{var r=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();klt.File=r}catch(i){r=function(t,e,r){var n=new Blob(t,r),i=r&&void 0!==r.lastModified?new Date(r.lastModified):new Date;return n.name=e,n.lastModifiedDate=i,n.lastModified=+i,n.toString=function(){return"[object File]"},Qlt&&(n[Qlt]="File"),n},klt.File=r}}}Glt?(Wlt(),klt.Blob=jlt?klt.Blob:qlt):zlt?(Wlt(),klt.Blob=Klt):function(){function t(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e.push(n):n<2048?e.push(192|n>>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}function e(t){var e,r,n,i,o,s;for(e="",n=t.length,r=0;r<n;)switch((i=t[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=String.fromCharCode(i);break;case 12:case 13:o=t[r++],e+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=t[r++],s=t[r++],e+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&s)<<0)}return e}function r(t){for(var e=new Array(t.byteLength),r=new Uint8Array(t),n=e.length;n--;)e[n]=r[n];return e}function n(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[],n=0;n<t.length;n+=3){var i=t[n],o=n+1<t.length,s=o?t[n+1]:0,a=n+2<t.length,l=a?t[n+2]:0,u=i>>2,h=(3&i)<<4|s>>4,c=(15&s)<<2|l>>6,A=63&l;a||(A=64,o||(c=64)),r.push(e[u],e[h],e[c],e[A])}return r.join("")}var i=Object.create||function(t){function e(){}return e.prototype=t,new e};if(Hlt)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function a(e,n){for(var i=0,o=(e=e||[]).length;i<o;i++){var l=e[i];l instanceof a?e[i]=l._buffer:"string"==typeof l?e[i]=t(l):Hlt&&(ArrayBuffer.prototype.isPrototypeOf(l)||s(l))?e[i]=r(l):Hlt&&(u=l)&&DataView.prototype.isPrototypeOf(u)?e[i]=r(l.buffer):e[i]=t(String(l))}var u;this._buffer=[].concat.apply([],e),this.size=this._buffer.length,this.type=n&&n.type||""}function l(t,e,r){r=r||{};var n=a.call(this,t,r)||this;return n.name=e,n.lastModifiedDate=r.lastModified?new Date(r.lastModified):new Date,n.lastModified=+n.lastModifiedDate,n}if(a.prototype.slice=function(t,e,r){return new a([this._buffer.slice(t||0,e||this._buffer.length)],{type:r})},a.prototype.toString=function(){return"[object Blob]"},l.prototype=i(a.prototype),l.prototype.constructor=l,Object.setPrototypeOf)Object.setPrototypeOf(l,a);else try{l.__proto__=a}catch(FX){}function u(){if(!(this instanceof u))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var t=document.createDocumentFragment();this.addEventListener=t.addEventListener,this.dispatchEvent=function(e){var r=this["on"+e.type];"function"==typeof r&&r(e),t.dispatchEvent(e)},this.removeEventListener=t.removeEventListener}function h(t,e,r){if(!(e instanceof a))throw new TypeError("Failed to execute '"+r+"' on 'FileReader': parameter 1 is not of type 'Blob'.");t.result="",setTimeout((function(){this.readyState=u.LOADING,t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend"))}))}l.prototype.toString=function(){return"[object File]"},u.EMPTY=0,u.LOADING=1,u.DONE=2,u.prototype.error=null,u.prototype.onabort=null,u.prototype.onerror=null,u.prototype.onload=null,u.prototype.onloadend=null,u.prototype.onloadstart=null,u.prototype.onprogress=null,u.prototype.readAsDataURL=function(t){h(this,t,"readAsDataURL"),this.result="data:"+t.type+";base64,"+n(t._buffer)},u.prototype.readAsText=function(t){h(this,t,"readAsText"),this.result=e(t._buffer)},u.prototype.readAsArrayBuffer=function(t){h(this,t,"readAsText"),this.result=t._buffer.slice()},u.prototype.abort=function(){},URL.createObjectURL=function(t){return t instanceof a?"data:"+t.type+";base64,"+n(t._buffer):Ult.call(URL,t)},URL.revokeObjectURL=function(t){Dlt&&Dlt.call(URL,t)};var c=klt.XMLHttpRequest&&klt.XMLHttpRequest.prototype.send;c&&(XMLHttpRequest.prototype.send=function(t){t instanceof a?(this.setRequestHeader("Content-Type",t.type),c.call(this,e(t._buffer))):c.call(this,t)}),klt.FileReader=u,klt.File=l,klt.Blob=a}();var Xlt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===klt.btoa&&(klt.btoa=function(t){var e,r,n,i,o,s=0,a=0,l="",u=[];if(!t)return t;do{e=(o=t.charCodeAt(s++)<<16|t.charCodeAt(s++)<<8|t.charCodeAt(s++))>>18&63,r=o>>12&63,n=o>>6&63,i=63&o,u[a++]=Xlt.charAt(e)+Xlt.charAt(r)+Xlt.charAt(n)+Xlt.charAt(i)}while(s<t.length);l=u.join("");var h=t.length%3;return(h?l.slice(0,h-3):l)+"===".slice(h||3)}),void 0===klt.atob&&(klt.atob=function(t){var e,r,n,i,o,s,a=0,l=0,u=[];if(!t)return t;t+="";do{e=(s=Xlt.indexOf(t.charAt(a++))<<18|Xlt.indexOf(t.charAt(a++))<<12|(i=Xlt.indexOf(t.charAt(a++)))<<6|(o=Xlt.indexOf(t.charAt(a++))))>>16&255,r=s>>8&255,n=255&s,u[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,r):String.fromCharCode(e,r,n)}while(a<t.length);return u.join("")});class Ylt extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.setAttribute("id","mouse-position"),n.innerHTML="",n.style.float="right",n.style.left=" 0px",n.style.right="0px",n.style.bottom="0px",n.style.marginRight="60px";let i=document.createElement("div");i.setAttribute("id","locationbar"),i.style.position="absolute",i.style.zIndex="991",i.style.padding=" 3px 10px",i.style.fontSize=" 13px",i.style.color="#e9e9e9",i.style.textShadow="2px 2px 2px #000",i.style.backgroundColor="rgba(0,0,0,.4)",i.style.minHeight="26px",i.style.left=" 0px",i.style.right="0px",i.style.bottom="0px",i.appendChild(n),super({element:i,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}updateMousePosition(t){this._mouseposition.innerHTML=t}}class Zlt extends Bl{constructor(t,r,n,i){const o=t||{};let s=n.find((t=>t.name===r));const a=new Image;a.src=s.icon,a.className="mirage-mapswitch-image";const l=document.createElement("div");l.className="mirage-mapswitch-button-itemLabel",l.innerHTML=r;const u=document.createElement("div");u.className="mirage-mapswitch-button mirage-mapswitch-toolbar-button",u.appendChild(a),u.appendChild(l);const h=document.createElement("div");h.className="mirage-mapswitch-box";const c=document.createElement("div");c.className="mirage-mapswitch-baseLayerPicker-dropDown",c.style.maxHeight="300px",n.forEach((t=>{const e=new Image;e.src=t.icon,e.className="mirage-mapswitch-baseLayerPicker-itemIcon";const r=document.createElement("div");r.className="mirage-mapswitch-baseLayerPicker-itemLabel",r.innerHTML=t.name;const n=document.createElement("div");n.className="mirage-mapswitch-baseLayerPicker-item mirage-mapswitch-baseLayerPicker-selectedItem",n.appendChild(e),n.appendChild(r),n.addEventListener("click",(t=>{this._isshow=!1,c.className="mirage-mapswitch-baseLayerPicker-dropDown",a.src=t.currentTarget.children[0].src,l.innerHTML=t.currentTarget.innerText,i(t.currentTarget.innerText)}),!1),c.appendChild(n)})),h.appendChild(u),h.appendChild(c),super({element:h,target:o.target}),e(this,"_isshow"),e(this,"baseLayerList"),e(this,"mianImage"),e(this,"mianLabel"),this.mianImage=a,this.mianLabel=l,this.baseLayerList=n,this._isshow=!1,u.addEventListener("click",this.showSwitch.bind(this),!1)}changeBaseLayer(t){this.baseLayerList.forEach((e=>{if(e.name===t)return this.mianImage.src=e.icon,void(this.mianLabel.innerHTML=e.name)}))}showSwitch(t){this._isshow=!this._isshow;let e=document.getElementsByClassName("mirage-mapswitch-baseLayerPicker-dropDown");this._isshow?e[0].className="mirage-mapswitch-baseLayerPicker-dropDown mirage-mapswitch-baseLayerPicker-dropDown-visible":e[0].className="mirage-mapswitch-baseLayerPicker-dropDown"}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}var Jlt=function(t){t=t||{};var e=document.createElement("button"),r=document.createElement("div");r.className=(t.className||"ol-swipe")+" ol-unselectable ol-control",r.appendChild(e),r.addEventListener("mousedown",this.move.bind(this)),r.addEventListener("touchstart",this.move.bind(this)),Bl.call(this,{element:r}),this.precomposeRight_=this.precomposeRight.bind(this),this.precomposeLeft_=this.precomposeLeft.bind(this),this.postcompose_=this.postcompose.bind(this),this.layers=[],t.layers&&this.addLayer(t.layers,!1),t.rightLayers&&this.addLayer(t.rightLayers,!0),this.on("propertychange",function(t){if(this.getMap())try{this.getMap().renderSync()}catch(e){}"horizontal"===this.get("orientation")?(this.element.style.top=100*this.get("position")+"%",this.element.style.left=""):("vertical"!==this.get("orientation")&&this.set("orientation","vertical"),this.element.style.left=100*this.get("position")+"%",this.element.style.top=""),"orientation"===t.key&&(this.element.classList.remove("horizontal","vertical"),this.element.classList.add(this.get("orientation"))),this.isMoving||this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}))}.bind(this)),this.set("position",t.position||.5),this.set("orientation",t.orientation||"vertical")};qm(Jlt,Bl),Jlt.prototype.setMap=function(t){var e,r;if(this.getMap()){for(e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.un(["precompose","prerender"],this.precomposeRight_):r.layer.un(["precompose","prerender"],this.precomposeLeft_),r.layer.un(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(FX){}}if(Bl.prototype.setMap.call(this,t),t){for(this._listener=[],e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.on(["precompose","prerender"],this.precomposeRight_):r.layer.on(["precompose","prerender"],this.precomposeLeft_),r.layer.on(["postcompose","postrender"],this.postcompose_);try{t.renderSync()}catch(FX){}}},Jlt.prototype.isLayer_=function(t){for(var e=0;e<this.layers.length;e++)if(this.layers[e].layer===t)return e;return-1},Jlt.prototype.addLayer=function(t,e){t instanceof Array||(t=[t]);for(var r=0;r<t.length;r++){var n=t[r];if(this.isLayer_(n)<0&&(this.layers.push({layer:n,right:e}),this.getMap())){e?n.on(["precompose","prerender"],this.precomposeRight_):n.on(["precompose","prerender"],this.precomposeLeft_),n.on(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(FX){}}}},Jlt.prototype.removeLayers=function(){var t=[];this.layers.forEach((function(e){t.push(e.layer)})),this.removeLayer(t)},Jlt.prototype.removeLayer=function(t){t instanceof Array||(t=[t]);for(var e=0;e<t.length;e++){var r=this.isLayer_(t[e]);r>=0&&this.getMap()&&(this.layers[r].right?t[e].un(["precompose","prerender"],this.precomposeRight_):t[e].un(["precompose","prerender"],this.precomposeLeft_),t[e].un(["postcompose","postrender"],this.postcompose_),this.layers.splice(r,1))}if(this.getMap())try{this.getMap().renderSync()}catch(FX){}},Jlt.prototype.getRectangle=function(){var t;return"vertical"===this.get("orientation")?[0,0,(t=this.getMap().getSize())[0]*this.get("position"),t[1]]:[0,0,(t=this.getMap().getSize())[0],t[1]*this.get("position")]},Jlt.prototype.move=function(t){var e,r=this;switch(this._movefn||(this._movefn=this.move.bind(this)),t.type){case"touchcancel":case"touchend":case"mouseup":r.isMoving=!1,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.removeEventListener(t,r._movefn)})),this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}));break;case"mousedown":case"touchstart":r.isMoving=!0,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.addEventListener(t,r._movefn)}));case"mousemove":case"touchmove":if(r.isMoving)if("vertical"===r.get("orientation")){var n=t.pageX||t.touches&&t.touches.length&&t.touches[0].pageX||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageX;if(!n)break;n-=r.getMap().getTargetElement().getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft;var i=(e=r.getMap().getSize()[0])-Math.min(Math.max(0,e-n),e);e=i/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[i,r.getMap().getSize()[1]],position:[e,0]})}else{var o=t.pageY||t.touches&&t.touches.length&&t.touches[0].pageY||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageY;if(!o)break;o-=r.getMap().getTargetElement().getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop;var s=(e=r.getMap().getSize()[1])-Math.min(Math.max(0,e-o),e);e=s/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[r.getMap().getSize()[0],s],position:[0,e]})}}},Jlt.prototype._transformPt=function(t,e){var r=t.inversePixelTransform,n=e[0],i=e[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e},Jlt.prototype._drawRect=function(t,e){var r=t.inversePixelTransform;if(r){var n=[[e[0][0],e[0][1]],[e[0][0],e[1][1]],[e[1][0],e[1][1]],[e[1][0],e[0][1]],[e[0][0],e[0][1]]];if(t.context.save(),t.target.getImageRatio){var i=-Math.atan2(t.frameState.pixelToCoordinateTransform[1],t.frameState.pixelToCoordinateTransform[0]);t.context.translate(t.frameState.size[0]/2,t.frameState.size[1]/2),t.context.rotate(i),t.context.translate(-t.frameState.size[0]/2,-t.frameState.size[1]/2)}n.forEach((function(e,n){e=[e[0]*r[0]-e[1]*r[1]+r[4],-e[0]*r[2]+e[1]*r[3]+r[5]],n?t.context.lineTo(e[0],e[1]):t.context.moveTo(e[0],e[1])})),t.context.restore()}else{var o=t.frameState.pixelRatio;t.context.rect(e[0][0]*o,e[0][1]*o,e[1][0]*o,e[1][1]*o)}},Jlt.prototype.precomposeLeft=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(r=Math.round(a*this.get("position")),n=l):(r=a,n=Math.round(l*this.get("position")),o[1]+=l-n),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[1]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),u[1]]:h[1]=[u[0],.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Jlt.prototype.precomposeRight=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(n=l,r=Math.round(a*(1-this.get("position"))),o[0]+=a-r):(r=a,n=Math.round(l*(1-this.get("position")))),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[0]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),0]:h[0]=[0,.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Jlt.prototype.postcompose=function(t){if(t.context instanceof WebGLRenderingContext){if("postrender"===t.type){var e=t.context;e.disable(e.SCISSOR_TEST)}}else t.target.getClassName&&"ol-layer"!==t.target.getClassName()&&t.target.get("declutter")?setTimeout((function(){t.context.restore()}),0):t.context.restore()};class $lt{constructor(){e(this,"events",new Map)}on(t,e,r){return this.events.has(t)||this.events.set(t,[]),(this.events.get(t)||[]).push({handler:e,once:r}),()=>{this.off(t,e)}}once(t,e){return this.on(t,e,!0)}fire(t,...e){let r=0;for(;r<(this.events.get(t)||[]).length;){const n=this.events.get(t)||[],{handler:i,once:o}=n[r];o&&n.splice(r--,1),r++,i(...e)}}off(t,e){t&&(e?this.events.set(t,(this.events.get(t)||[]).filter((t=>t.handler!==e))):this.events.set(t,[]))}}class tut extends $lt{constructor(){super(),e(this,"_swipe"),this._swipe=new Jlt}show(t,e,r="vertical"){this.fire("show",{swipe:this._swipe,leftlayerID:t,rightlayerID:e}),this._swipe.set("orientation",r)}hide(){this.fire("hide",this._swipe)}}class eut extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.style.zIndex="999",n.style.width="200px",n.className="huitudiv",n.setAttribute("id","huitutext1"),n.style.position="absolute",n.style.zIndex="991",n.style.padding=" 3px 10px",n.style.fontSize=" 25px",n.style.color="#000",n.style.textShadow="2px 2px 2px #fff",n.style.backgroundColor="rgba(0,0,0,.4)",n.style.minHeight="26px",n.style.right="100px",n.style.bottom="50px",n.innerHTML="",super({element:n,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}getElement(){return this._mouseposition}hide(){this.element.style.display="none"}updateHtml(t){this._mouseposition.innerHTML=t}updateElementStyle(t,e){this._mouseposition.style[t]=e}}const rut=Object.freeze(Object.defineProperty({__proto__:null,Locationbar:Ylt,baseLayerSwitch:Zlt,drawTextControl:eut,swipeControl:tut},Symbol.toStringTag,{value:"Module"}));var nut=function(t){t||(t={});var e=this;this.selection_=new V,this.handles_=new V,this.overlayLayer_=new ta({source:new pa({features:this.handles_,useSpatialIndex:!1,wrapX:!1}),name:"Transform overlay",displayInLayerSwitcher:!1,style:function(t){return e.style[(t.get("handle")||"default")+(t.get("constraint")||"")+(t.get("option")||"")]}}),ou.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_}),this.features_=t.features,"function"==typeof t.filter&&(this._filter=t.filter),this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null,this._handleEvent=t.condition||function(){return!0},this.addFn_=t.addCondition||function(){return!1},this.setPointRadius(t.pointRadius),this.set("translateFeature",!1!==t.translateFeature),this.set("translate",!1!==t.translate),this.set("translateBBox",!0===t.translateBBox),this.set("stretch",!1!==t.stretch),this.set("scale",!1!==t.scale),this.set("rotate",!1!==t.rotate),this.set("keepAspectRatio",t.keepAspectRatio||function(t){return t.originalEvent.shiftKey}),this.set("modifyCenter",t.modifyCenter||function(t){return t.originalEvent.metaKey||t.originalEvent.ctrlKey}),this.set("noFlip",t.noFlip||!1),this.set("selection",!1!==t.selection),this.set("hitTolerance",t.hitTolerance||0),this.set("enableRotatedTransform",t.enableRotatedTransform||!1),this.set("keepRectangle",t.keepRectangle||!1),this.on("propertychange",(function(){this.drawSketch_()})),this.setDefaultStyle()};function iut(t,e){var r=(t[0]*e[0]+t[1]*e[1])/(e[0]*e[0]+e[1]*e[1]);return[e[0]*r,e[1]*r]}function out(t,e){return[e[0]-t[0],e[1]-t[1]]}function sut(t,e){return[t[0]+e[0],t[1]+e[1]]}qm(nut,ou),nut.prototype.Cursors={default:"auto",select:"pointer",translate:"move",rotate:"move",rotate0:"move",scale:"nesw-resize",scale1:"nwse-resize",scale2:"nesw-resize",scale3:"nwse-resize",scalev:"ew-resize",scaleh1:"ns-resize",scalev2:"ew-resize",scaleh3:"ns-resize"},nut.prototype.setMap=function(t){var e=this.getMap();if(e){var r=e.getTargetElement();e.removeLayer(this.overlayLayer_),this.previousCursor_&&r&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}ou.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),null===t&&this.select(null),null!==t&&(this.isTouch=/touch/.test(t.getViewport().className),this.setDefaultStyle())},nut.prototype.setActive=function(t){this.select(null),this.overlayLayer_.setVisible(t),ou.prototype.setActive.call(this,t)},nut.prototype.setDefaultStyle=function(t){var e=(t=t||{}).pointStroke||new Rn({color:[255,0,0,1],width:1}),r=t.stroke||new Rn({color:[255,0,0,1],width:1,lineDash:[4,4]}),n=t.fill||new Fn({color:[255,0,0,.01]}),i=t.pointFill||new Fn({color:[255,255,255,.8]}),o=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,displacement:this.isTouch?[24,-24]:[12,-12],points:15});o.setDisplacement||(o.getAnchor()[0]=this.isTouch?-10:-5);var s=new Ri({fill:i,stroke:e,radius:this.isTouch?16:8,points:4,angle:Math.PI/4}),a=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,points:4,angle:Math.PI/4});function l(t,e,r){return[new Vi({image:t,stroke:e,fill:r})]}this.style={default:l(s,r,n),translate:l(s,e,i),rotate:l(o,e,i),rotate0:l(s,e,i),scale:l(s,e,i),scale1:l(s,e,i),scale2:l(s,e,i),scale3:l(s,e,i),scalev:l(a,e,i),scaleh1:l(a,e,i),scalev2:l(a,e,i),scaleh3:l(a,e,i)},this.drawSketch_()},nut.prototype.setStyle=function(t,e){if(e){this.style[t]=e instanceof Array?e:[e];for(var r=0;r<this.style[t].length;r++){var n=this.style[t][r].getImage();n&&("rotate"==t&&(n.getAnchor()[0]=-5),this.isTouch&&n.setScale(1.8));var i=this.style[t][r].getText();i&&("rotate"==t&&i.setOffsetX(this.isTouch?14:7),this.isTouch&&i.setScale(1.8))}this.drawSketch_()}},nut.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t,(function(t,r){var n=!1;if(!r){if(t===e.bbox_)return!!e.get("translateBBox")&&{feature:t,handle:"translate",constraint:"",option:""};if(e.handles_.forEach((function(e){e===t&&(n=!0)})),n)return{feature:t,handle:t.get("handle"),constraint:t.get("constraint"),option:t.get("option")}}if(!e.get("selection"))return e.selection_.getArray().some((function(e){return t===e}))?{feature:t}:null;if(e._filter)return e._filter(t,r)?{feature:t}:null;if(e.layers_){for(var i=0;i<e.layers_.length;i++)if(e.layers_[i]===r)return{feature:t};return null}return e.features_?(e.features_.forEach((function(e){e===t&&(n=!0)})),n?{feature:t}:null):{feature:t}}),{hitTolerance:this.get("hitTolerance")})||{}},nut.prototype.getGeometryRotateToZero_=function(t,e){var r=t.getGeometry(),n=this.getMap().getView().getRotation();if(0===n||!this.get("enableRotatedTransform"))return e?r.clone():r;var i=r.clone();return i.rotate(-1*n,this.getMap().getView().getCenter()),i},nut.prototype._isRectangle=function(t){return!(!this.get("keepRectangle")||"Polygon"!==t.getType())&&5===t.getCoordinates()[0].length},nut.prototype.drawSketch_=function(t){var e,r,n,i=this.selection_.item(0)&&this._isRectangle(this.selection_.item(0).getGeometry());if(this.overlayLayer_.getSource().clear(),this.selection_.getLength()){var o,s=this.getMap().getView().getRotation(),a=this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent();i&&(o=this.getGeometryRotateToZero_(this.selection_.item(0)).getCoordinates()[0].slice(0,4)).unshift(o[3]),a=Et(a,0),this.selection_.forEach(function(t){var e=this.getGeometryRotateToZero_(t).getExtent();Rt(a,e)}.bind(this));var l=1===this.selection_.getLength()?this._pointRadius(this.selection_.item(0)):0;if(!l||l instanceof Array||(l=[l,l]),!0===t)this.ispt_||(this.overlayLayer_.getSource().addFeature(new X({geometry:new on(this.center_),handle:"rotate0"})),n=Cn(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n),this.overlayLayer_.getSource().addFeature(r));else{if(this.ispt_){var u=this.getMap().getPixelFromCoordinate([a[0],a[1]]);if(u){var h=l&&l[0]||10,c=l&&l[1]||10;a=Ct([this.getMap().getCoordinateFromPixel([u[0]-h,u[1]-c]),this.getMap().getCoordinateFromPixel([u[0]+h,u[1]+c])])}}n=i?new xn([o]):Cn(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n);var A=[],f=n.getCoordinates()[0];if(!this.ispt_||l){if(A.push(r),!this.iscircle_&&!this.ispt_&&this.get("stretch")&&this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on([(f[e][0]+f[e+1][0])/2,(f[e][1]+f[e+1][1])/2]),handle:"scale",constraint:e%2?"h":"v",option:e}),A.push(r);if(this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on(f[e]),handle:"scale",option:e}),A.push(r);this.get("translate")&&!this.get("translateFeature")&&(r=new X({geometry:new on([(f[0][0]+f[2][0])/2,(f[0][1]+f[2][1])/2]),handle:"translate"}),A.push(r))}!this.iscircle_&&this.get("rotate")&&(r=new X({geometry:new on(f[3]),handle:"rotate"}),A.push(r)),this.overlayLayer_.getSource().addFeatures(A)}}},nut.prototype.select=function(t,e){if(!t)return this.selection_.clear(),void this.drawSketch_();if(t.getGeometry&&t.getGeometry()){if(e)this.selection_.push(t);else{var r=this.selection_.getArray().indexOf(t);this.selection_.removeAt(r)}this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:t,features:this.selection_})}},nut.prototype.setSelection=function(t){this.selection_.clear(),t.forEach(function(t){this.selection_.push(t)}.bind(this)),this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",features:this.selection_})},nut.prototype.watchFeatures_=function(){this._featureListeners&&this._featureListeners.forEach((function(t){k(t)})),this._featureListeners=[],this.selection_.forEach(function(t){this._featureListeners.push(t.on("change",function(){this.isUpdating_||this.drawSketch_()}.bind(this)))}.bind(this))},nut.prototype.handleDownEvent_=function(t){if(this._handleEvent(t,this.selection_)){var e=this.getFeatureAtPixel_(t.pixel),r=e.feature;if(this.selection_.getLength()&&this.selection_.getArray().indexOf(r)>=0&&(this.ispt_&&this.get("translate")||this.get("translateFeature"))&&(e.handle="translate"),e.handle){this.mode_=e.handle,this.opt_=e.option,this.constraint_=e.constraint;var n=this.getMap().getView().getRotation();this.coordinate_=t.coordinate,this.pixel_=t.pixel,this.geoms_=[],this.rotatedGeoms_=[];for(var i,o=[1/0,1/0,-1/0,-1/0],s=[1/0,1/0,-1/0,-1/0],a=0;i=this.selection_.item(a);a++)if(this.geoms_.push(i.getGeometry().clone()),o=Rt(o,i.getGeometry().getExtent()),this.get("enableRotatedTransform")&&0!==n){var l=this.getGeometryRotateToZero_(i,!0);this.rotatedGeoms_.push(l),s=Rt(s,l.getExtent())}if(this.extent_=Cn(o).getCoordinates()[0],this.get("enableRotatedTransform")&&0!==n&&(this.rotatedExtent_=Cn(s).getCoordinates()[0]),"rotate"===this.mode_){this.center_=this.getCenter()||Vt(o);var u=t.map.getTargetElement();u.style.cursor=this.Cursors.rotate0,this.previousCursor_=u.style.cursor}else this.center_=Vt(o);return this.angle_=Math.atan2(this.center_[1]-t.coordinate[1],this.center_[0]-t.coordinate[0]),this.dispatchEvent({type:this.mode_+"start",feature:this.selection_.item(0),features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!0}if(this.get("selection")){if(r){this.addFn_(t)||this.selection_.clear();var h=this.selection_.getArray().indexOf(r);h<0?this.selection_.push(r):this.selection_.removeAt(h)}else this.selection_.clear();return this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:r,features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!1}}},nut.prototype.getFeatures=function(){return this.selection_},nut.prototype.getCenter=function(){return this.get("center")},nut.prototype.setCenter=function(t){return this.set("center",t)},nut.prototype.handleDragEvent_=function(t){if(this._handleEvent(t,this.features_)){var e,r,n,i,o=this.getMap().getView().getRotation(),s=[this.coordinate_[0],this.coordinate_[1]],a=[t.coordinate[0],t.coordinate[1]];switch(this.isUpdating_=!0,this.mode_){case"rotate":var l=Math.atan2(this.center_[1]-a[1],this.center_[0]-a[0]);if(!this.ispt)for(e=0;n=this.selection_.item(e);e++)(i=this.geoms_[e].clone()).rotate(l-this.angle_,this.center_),"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),n.setGeometry(i);this.drawSketch_(!0),this.dispatchEvent({type:"rotating",feature:this.selection_.item(0),features:this.selection_,angle:l-this.angle_,pixel:t.pixel,coordinate:t.coordinate});break;case"translate":var u=a[0]-s[0],h=a[1]-s[1];for(e=0;n=this.selection_.item(e);e++)n.getGeometry().translate(u,h);this.handles_.forEach((function(t){t.getGeometry().translate(u,h)})),this.coordinate_=t.coordinate,this.dispatchEvent({type:"translating",feature:this.selection_.item(0),features:this.selection_,delta:[u,h],pixel:t.pixel,coordinate:t.coordinate});break;case"scale":var c=this.center_;if(this.get("modifyCenter")(t)){var A=this.extent_;this.get("enableRotatedTransform")&&0!==o&&(A=this.rotatedExtent_),c=A[(Number(this.opt_)+2)%4]}var f=1==this.geoms_.length&&this._isRectangle(this.geoms_[0]),p=this.constraint_,d=this.opt_,g=this.coordinate_,y=t.coordinate;if(this.get("enableRotatedTransform")&&0!==o){var m=new on(this.coordinate_);m.rotate(-1*o,c),g=m.getCoordinates();var v=new on(t.coordinate);v.rotate(-1*o,c),y=v.getCoordinates()}var _=(y[0]-c[0])/(g[0]-c[0]),w=(y[1]-c[1])/(g[1]-c[1]),b=[y[0]-g[0],y[1]-g[1]];if(this.get("enableRotatedTransform")&&0!==o){var x=new on(c);x.rotate(-1*o,this.getMap().getView().getCenter()),c=x.getCoordinates()}for(this.get("noFlip")&&(_<0&&(_=-_),w<0&&(w=-w)),this.constraint_?"h"==this.constraint_?_=1:w=1:this.get("keepAspectRatio")(t)&&(_=w=Math.min(_,w)),e=0;n=this.selection_.item(e);e++)(i=0!==o&&this.get("enableRotatedTransform")?this.rotatedGeoms_[e].clone():this.geoms_[e].clone()).applyTransform((function(t,e,n){if(n<2)return e;if(f){var o=[[6],[0,8],[2],[4]],s=[t[0],t[1]],a=[t[2],t[3]],l=[t[4],t[5]],u=[t[6],t[7]],h=[t[8],t[9]];if(p){var A=d%2==0?out(s,a):out(u,s),g=iut(b,A),m=[...o[d],...o[d+1<o.length?d+1:0]];for(r=0;r<t.length;r+=n)e[r]=m.includes(r)?t[r]+g[0]:t[r],e[r+1]=m.includes(r)?t[r+1]+g[1]:t[r+1]}else{var v,x;switch(d){case 0:v=iut(b=out(u,y),out(l,u)),x=iut(b,out(s,u)),[e[0],e[1]]=sut(s,v),[e[4],e[5]]=sut(l,x),[e[6],e[7]]=sut(u,b),[e[8],e[9]]=sut(h,v);break;case 1:v=iut(b=out(s,y),out(u,s)),x=iut(b,out(a,s)),[e[0],e[1]]=sut(s,b),[e[2],e[3]]=sut(a,v),[e[6],e[7]]=sut(u,x),[e[8],e[9]]=sut(h,b);break;case 2:v=iut(b=out(a,y),out(s,a)),x=iut(b,out(l,a)),[e[0],e[1]]=sut(s,x),[e[2],e[3]]=sut(a,b),[e[4],e[5]]=sut(l,v),[e[8],e[9]]=sut(h,x);break;case 3:v=iut(b=out(l,y),out(a,l)),x=iut(b,out(u,l)),[e[2],e[3]]=sut(a,x),[e[4],e[5]]=sut(l,b),[e[6],e[7]]=sut(u,v)}}}else for(r=0;r<t.length;r+=n)1!=_&&(e[r]=c[0]+(t[r]-c[0])*_),1!=w&&(e[r+1]=c[1]+(t[r+1]-c[1])*w);return"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),e})),this.get("enableRotatedTransform")&&0!==o&&i.rotate(o,this.getMap().getView().getCenter()),n.setGeometry(i);this.drawSketch_(),this.dispatchEvent({type:"scaling",feature:this.selection_.item(0),features:this.selection_,scale:[_,w],pixel:t.pixel,coordinate:t.coordinate})}this.isUpdating_=!1}},nut.prototype.handleMoveEvent_=function(t){if(this._handleEvent(t,this.features_)&&!this.mode_){var e=this.getFeatureAtPixel_(t.pixel),r=t.map.getTargetElement();if(e.feature){var n=e.handle?this.Cursors[(e.handle||"default")+(e.constraint||"")+(e.option||"")]:this.Cursors.select;void 0===this.previousCursor_&&(this.previousCursor_=r.style.cursor),r.style.cursor=n}else void 0!==this.previousCursor_&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}},nut.prototype.handleUpEvent_=function(t){return"rotate"===this.mode_&&(t.map.getTargetElement().style.cursor=this.Cursors.default,this.previousCursor_=void 0),this.dispatchEvent({type:this.mode_+"end",feature:this.selection_.item(0),features:this.selection_,oldgeom:this.geoms_[0],oldgeoms:this.geoms_}),this.drawSketch_(),this.mode_=null,!1},nut.prototype.getFeatures=function(){return this.selection_},nut.prototype.setPointRadius=function(t){this._pointRadius="function"==typeof t?t:function(){return t}};class aut{constructor(t){e(this,"transformInteraction"),this.transformInteraction=new nut({enableRotatedTransform:!1,hitTolerance:2,translateFeature:!0,scale:!0,rotate:!0,keepAspectRatio:!1,keepRectangle:!1,translate:!0,stretch:!0,pointRadius:function(t){let e=t.get("radius")||10;return[e,e]}}),this.transformInteraction.setActive(!1),this.transformInteraction.on(["select"],(t=>{s&&t.features&&t.features.getLength()&&this.transformInteraction.setCenter(t.features.getArray()[0].getGeometry().getFirstCoordinate())}));let r=0,n=10,i=[1,1],o=[0,0],s=!1;this.transformInteraction.on(["rotatestart","translatestart","scalestart"],(function(t){r=t.feature.get("angle")||0,n=t.feature.get("radius")||10,i=t.feature.get("Scale")||[1,1],o=[0,0]})),this.transformInteraction.on("rotating",(t=>{t.feature.set("angle",r-t.angle),t.feature.dispatchEvent({type:"onRotating",data:r-t.angle})})),this.transformInteraction.on("translating",(t=>{o[0]+=t.delta[0],o[1]+=t.delta[1],t.feature.dispatchEvent({type:"onMoveing",data:Vt(t.features.getArray()[0].getGeometry().getExtent())})})),this.transformInteraction.on("scaling",(t=>{if(1===t.features.getLength()){let e=t.features.item(0);e.set("radius",n*Math.abs(t.scale[0])),e.set("Scale",[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]),t.feature.dispatchEvent({type:"onScaling",data:[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]})}})),this.transformInteraction.on(["rotateend","translateend","scaleend"],(t=>{}))}setHandleStyle(t=!0){if(t){let t=new Ri({fill:new Fn({color:[255,255,255,.01]}),stroke:new Rn({width:1,color:[0,0,0,.01]}),radius:8,points:10});this.transformInteraction.setStyle("rotate",new Vi({text:new Wi({text:"",font:"16px Fontawesome",textAlign:"left",fill:new Fn({color:"red"})}),image:t})),this.transformInteraction.setStyle("rotate0",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})})),this.transformInteraction.setStyle("translate",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})}))}else this.transformInteraction.setDefaultStyle();this.transformInteraction.set("translate",this.transformInteraction.get("translate"))}appendTo(t){t.addInteraction(this.transformInteraction)}setActive(t){this.transformInteraction.setActive(t)}}var lut,uut=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)},hut=function(t,e){return t[0]==e[0]&&t[1]==e[1]};!function(){function t(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][0]>e&&t[n-1][0]<e||t[n][0]<e&&t[n-1][0]>e)&&(r=[e,(e-t[n][0])/(t[n-1][0]-t[n][0])*(t[n-1][1]-t[n][1])+t[n][1]],t.splice(n,0,r))}function e(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][1]>e&&t[n-1][1]<e||t[n][1]<e&&t[n-1][1]>e)&&(r=[(e-t[n][1])/(t[n-1][1]-t[n][1])*(t[n-1][0]-t[n][0])+t[n][0],e],t.splice(n,0,r))}lut=function(r,n){var i="Polygon"===n.getType();if(!i&&"MultiPolygon"!==n.getType())return null;var o=n.getCoordinates();return i&&(o=[o]),o.forEach((function(n){n.forEach((function(n){t(n,r[0]),t(n,r[2]),e(n,r[1]),e(n,r[3])}))})),o.forEach((function(t){t.forEach((function(t){t.forEach((function(t){t[0]<r[0]?t[0]=r[0]:t[0]>r[2]&&(t[0]=r[2]),t[1]<r[1]?t[1]=r[1]:t[1]>r[3]&&(t[1]=r[3])}))}))})),i?new xn(o[0]):new ah(o)}}();var cut=function(t,e,r,n){var i=[];!1!==n&&i.push(t);var o=uut(t,e);if(o){var s=Math.round(o/r);if(s>1)for(var a=(e[0]-t[0])/s,l=(e[1]-t[1])/s,u=1;u<s;u++)i.push([t[0]+a*u,t[1]+l*u])}return i.push(e),i};Nn.prototype.sampleAt=function(t){for(var e=this.getCoordinates(),r=[],n=1;n<e.length;n++)r=r.concat(cut(e[n-1],e[n],t,1===n));return new Nn(r)},th.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(cut(e[i-1],e[i],t,1===i));r.push(n)})),new th(r)},xn.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(cut(e[i-1],e[i],t,1===i));r.push(n)})),new xn(r)},ah.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){var n=[];r.push(n),e.forEach((function(e){for(var r=[],i=1;i<e.length;i++)r=r.concat(cut(e[i-1],e[i],t,1===i));n.push(r)}))})),new ah(r)},Zu.prototype.intersection=function(t,e){if(t.sampleAt){var r=Et(this.getCenter().concat(this.getCenter()),this.getRadius());t=(t=lut(r,t)).simplify(e);var n=this.getCenter(),i=this.getRadius(),o=t.sampleAt(e).getCoordinates();switch(t.getType()){case"Polygon":o=[o];case"MultiPolygon":var s=!1,a=[];return o.forEach((function(t){var e=[];a.push(e),t.forEach((function(t){var r=[];e.push(r),t.forEach((function(t){var e=uut(n,t);e>i?(s=!0,r.push([n[0]+i/e*(t[0]-n[0]),n[1]+i/e*(t[1]-n[1])])):r.push(t)}))}))})),s?"Polygon"===t.getType()?new xn(a[0]):new ah(a):t}}return t},Nn.prototype.splitAt=function(t,e){var r;if(!t)return[this];if(e||(e=1e-10),t.length&&t[0].length){var n=[this];for(r=0;r<t.length;r++){for(var i=[],o=0;o<n.length;o++){var s=n[o].splitAt(t[r],e);i=i.concat(s)}n=i}return n}if(hut(t,this.getFirstCoordinate())||hut(t,this.getLastCoordinate()))return[this];var a=this.getCoordinates(),l=[a[0]],u=[];for(r=0;r<a.length-1;r++)if(!hut(a[r],a[r+1])){if(hut(t,a[r+1]))l.push(a[r+1]),u.push(new Nn(l)),l=[];else if(!hut(t,a[r])){var h,c,A=!1;a[r][0]==a[r+1][0]?(h=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=a[r][0]==t[0]&&0<h&&h<=1):a[r][1]==a[r+1][1]?(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),A=a[r][1]==t[1]&&0<h&&h<=1):(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),c=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=Math.abs(h-c)<=e&&0<h&&h<=1),A&&(l.push(t),u.push(new Nn(l)),l=[t])}l.push(a[r+1])}return l.length>1&&u.push(new Nn(l)),u.length?u:[this]};var Aut=function(t){t||(t={}),tu.call(this,{handleEvent:function(t){switch(t.type){case"singleclick":return this.handleDownEvent(t);case"pointermove":return this.handleMoveEvent(t);default:return!0}}}),this.snapDistance_=t.snapDistance||25,this.tolerance_=t.tolerance||1e-10,this.cursor_=t.cursor,this.setSources(t.sources),t.features&&this.sources_.push(new pa({features:t.features})),this.filterSplit_=t.filter||function(){return!0};var e=[255,255,255,1],r=[0,153,255,1],n=new Fn({color:"rgba(255,255,255,0.4)"}),i=new Rn({color:"#3399CC",width:1.25}),o=[new Vi({image:new Di({fill:n,stroke:i,radius:5}),fill:n,stroke:i})],s=[new Vi({stroke:new Rn({color:e,width:5})}),new Vi({image:new Di({radius:6,fill:new Fn({color:r}),stroke:new Rn({color:e,width:1.5})}),stroke:new Rn({color:r,width:3})})];t.sketchStyle&&(o=t.sketchStyle instanceof Array?t.sketchStyle:[t.sketchStyle]),t.featureStyle&&(s=t.featureStyle instanceof Array?t.featureStyle:[t.featureStyle]),this.overlayLayer_=new ta({source:new pa({useSpatialIndex:!1}),name:"Split overlay",displayInLayerSwitcher:!1,style:function(t){return t._sketch_?o:s}})};qm(Aut,tu),Aut.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),tu.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t)},Aut.prototype.getSources=function(){if(!this.sources_&&this.getMap()){var t=[],e=function(r){r.forEach((function(r){r.getVisible()&&(r.getSource&&r.getSource()instanceof pa?t.unshift(r.getSource()):r.getLayers&&e(r.getLayers()))}))};return e(this.getMap().getLayers()),t}return this.sources_||[]},Aut.prototype.setSources=function(t){this.sources_=!!t&&(t instanceof Array?t||!1:[t])},Aut.prototype.getClosestFeature=function(t){var e,r,n,i,o=this.snapDistance_+1;if(this.getSources().forEach((function(s){var a=s.getClosestFeatureToCoordinate(t.coordinate);if(a&&a.getGeometry().splitAt){var l=a.getGeometry().getClosestPoint(t.coordinate),u=new Nn([t.coordinate,l]),h=u.getLength()/t.frameState.viewState.resolution;h<o&&(e=s,o=h,r=a,i=u,n=l)}})),o>this.snapDistance_)return!1;var s=this.getNearestCoord(n,r.getGeometry().getCoordinates()),a=this.getMap().getPixelFromCoordinate(s);return uut(t.pixel,a)<this.snapDistance_&&(n=s),{source:e,feature:r,coord:n,link:i}},Aut.prototype.getNearestCoord=function(t,e){for(var r,n,i=Number.MAX_VALUE,o=0;o<e.length;o++)(r=uut(t,e[o]))<i&&(i=r,n=e[o]);return n},Aut.prototype.handleDownEvent=function(t){var e=this.getClosestFeature(t);if(e){var r=this;r.overlayLayer_.getSource().clear();var n,i=e.feature.getGeometry().splitAt(e.coord,this.tolerance_);if(i.length>1){var o=[];for(n=0;n<i.length;n++){var s=e.feature.clone();s.setGeometry(i[n]),o.push(s)}for(r.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.removeFeature(e.feature),n=0;n<o.length;n++)e.source.addFeature(o[n]);r.dispatchEvent({type:"aftersplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"aftersplit",original:e.feature,features:o})}}return!1},Aut.prototype.handleMoveEvent=function(t){var e=t.map;this.overlayLayer_.getSource().clear();var r,n,i=this.getClosestFeature(t);i&&this.filterSplit_(i.feature)?(this.overlayLayer_.getSource().addFeature(i.feature),(r=new X(new on(i.coord)))._sketch_=!0,this.overlayLayer_.getSource().addFeature(r),(n=new X(i.link))._sketch_=!0,this.overlayLayer_.getSource().addFeature(n),this.dispatchEvent({type:"pointermove",coordinate:t.coordinate,frameState:t.frameState,originalEvent:t.originalEvent,map:t.map,pixel:t.pixel,feature:i.feature,linkGeometry:i.link})):this.dispatchEvent(t);var o=e.getTargetElement();this.cursor_&&(i?o.style.cursor!=this.cursor_&&(this.previousCursor_=o.style.cursor,o.style.cursor=this.cursor_):void 0!==this.previousCursor_&&(o.style.cursor=this.previousCursor_,this.previousCursor_=void 0))};class fut extends xU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.layerSource=new sU(e),this.layer=new Zc({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}class put extends Bl{constructor(t){const e=t||{},r=new Image;r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAUCAYAAADFlsDIAAAEsElEQVRYhe1XTWhjVRT+7lgmpSlIGN25kNSVP3WRLkQE0UlbXMgQnERwGFBHU6j4t0qNohGcTuJGWqQ6KeKAdhbNhOB0oZg6MChDF30gFZxVA65kKhhsFHRQr5z6nXLz+vJeZtBdDjySd95555z7ne+cex8GMpD/RYw4bYwXVwBcAfAjgIuZrfk/B3AflEPUfAfgfQB1AJ83xouH/wvn1trUTbyTjLgSNxPTWpsVv37bIHvGz/r1yqxhABsA7qf+3K8jh587uVH660YX6wRMA1gFMGaMaVtr8wCCFlI1xnh8R2zKANphvo0xY06cAoCkcwmYOT5OGmOqtNsGUNF76s7S34wvd8mj4MaBMiuzNf87gJcd/dMAmktHy3dGgfLSSmno7cbs8wGPJGBNgAp5PRsAoABX6XHVQnwl+K4UZ53glQlmpJBleQK1x0C9pw5D6iSzNX+5MV78BsBDVD0C4Grl2Hsf7cZj5zrxmLe4fMqq/fRC/Z4jIzvHgGtSlS8ALOsz0j2tFZbWcSvq2KV7LLpX+yb9CmNMBd0safO3aq0V0JrW2q532GJlxtI8qo7/pD8PWcMQuuVFAJsAbqFW2vMFXr8988rKD53RmN2Nx+4Art9Km+sA3vX5KZBV65wx29baHCseJZpopNB3mXYpBzRZeIqATRpjWsoOirJX51LN1555tnBXe3aBldma/7YxXnwTwOmAROMA7g7Ql97KLG07gVJMYoKLkcBeFFDOYiqOOk3wqgG26wTBozpLEPQ+TwZ1LRj/sq4lPnW4O3NNmZXw3beFsX5mgZV6GMBU2OIoHzqVVTnL3yaDyjUZ5oSghs2WfIBO2q1F9qQZJ8nCeCzWKtswLH6CbPQCNhddg8zKmQNgZbbm/26MF2XWfA3gvh4BOgBel+PG4omS9T2rOMN2D4AoVnHOjLHSQcC40tI55UjZYVRTW94Yk5MBTwbuW7M4abZuUtuQemnfnGO7qb5Nr4w+eaB0eyc+fKkzGrt3Nx5DJx5rd+LD33dGYxdl4H/52uM7YSsihTe1rQIWeGA71y3b14quiM+s7+hQ5qJbVNVoM8McFJACWaMtnee9p7PJyVnmnMedVHxNwD+zXDm5Ufpp6WhZ2nENwIMALgF48sI7x/s9e+mg1R2pxlkRJX3vhmw/WfSEy2JhCAuRJIjaWjXOur0BrzuoChkohVrlb8E5s+2f4ANl9qu5nwE8CuBjAE8AOH/8jQuRp3tWRI4Lc1S1nZ0nTATYOa04f9POf4/PVeQ+F1AEj4NdzlxjZIbOOC8sAXbAuhbbHSGhYIkUPnv1j9PnZ58VsgF4TBxNnVnrubWz2gJWi9VtMtG8z07bw51nypQUW7MFZ7fis/1Dosy6oHko4HFm9cNkN6ck2ZZlV0isgn5iRYKlsrh86lMeHWThV6YX6nf1ME2R7vvV1d2Q7bHqgFgj9bVtCnw35yStAMzR1/qNnMx7gJJivCyLKvGbnFciE5xjk7TZDvpW7EumzqxNTy/ULz+1/EE/x4ugRPP+4AEfufqpEfShm+j3o9h53vUh7c8h6EPbZ5vouRtGyfRC/dCRkZ3MbSPXflk8UernZD6QgQzkoAD4BzP8qid//qPeAAAAAElFTkSuQmCC",r.style.float="right",r.style.left=" 0px",r.style.right="0px",r.style.bottom="0px";let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="991",n.style.backgroundColor="rgba(0,0,0,0)",n.style.minHeight="26px",n.style.right="0px",n.style.bottom="0px",n.style.width="75px",n.appendChild(r),super({element:n,target:e.target})}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}class dut extends Bl{constructor(t){const e=t||{},r=new Image;r.src="data:image/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABN0lEQVRYhe2XMU4DMRBF3xAgFKFCIgU0UVKloOUMHIWr0HIZxAWQOEAKDoBIlC4RSEAYZGU3mjUssddB2/hXY+/6z5+xPSOT0TbE+l9MxzFyRiLcOw5VroG70IXH/cnG3k9IwBEwKOyTpiR7CQI+jf3WhoCdIAuIOoQi4fOqOxRQ57gOoc6DBVhY8lJYOefGMc4bCfgtG76QGEQdQs/Bi7Hn8a7X8DMwArrAasu6L1UGImhRii+A54Az1QE+gKdyopLQ5WzsoupHBKA+RwBWvdPJRqi/BTHOfwQQiI79rZIyVa6AnkvxFi4X+ZkIt8X4RpUHG1DNjXDf32sjiGzHByJrMlUugccK8R9X0rbjlFI8NPZ5U5LcjP5NQGhVzFuQBaQIsCX1sClJyrvAdbVFYb8m8GS0COAbJ6tDDD0OOScAAAAASUVORK5CYII=",r.style.top="0px",r.style.left="0px";let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="999",n.style.backgroundColor="rgba(0,0,0,0)",n.style.minHeight="26px",n.style.top="50%",n.style.left="50%",n.style.width="76px",n.style.transform="translate(-16px, -16px)",n.appendChild(r),n.style.display="none",super({element:n,target:e.target})}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}class gut extends xU{constructor(t,e){super(t,e),this.layertype="WmsTileLayer",this.layerSource=new uU(e),this.layer=new qf({extent:[-20037725.11268234,-19994619.55417086,20037725.11268234,19994619.55417086],source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}function yut(t){const e=t.frameState,r=pt(t.inversePixelTransform.slice(),e.coordinateToPixelTransform);return new bs(t.context,e.pixelRatio,e.extent,r,e.viewState.rotation)}window.ol&&(ol.util?ol.util.VERSION||(ol.util.VERSION=ol.VERSION||"6.1.0"):ol.util={VERSION:ol.VERSION||"5.3.0"});var mut=a.split(".");mut=100*parseInt(mut[0])+parseInt(mut[1]);var vut=function(t,e){var r=t.frameState.pixelRatio;if(mut>605&&1!==r&&e.getImage()instanceof Us){var n=(e=e.clone()).getImage();n.setScale(n.getScale()*r);var i=n.getAnchor();if(n.setDisplacement){var o=n.getDisplacement();o&&(o[0]-=i[0]/r,o[1]+=i[1]/r,n.setAnchor([0,0]))}else i&&(i[0]/=r,i[1]/=r)}return e},_ut=function(t){var e=t||{};ta.call(this,e),this.oldcluster=new pa,this.clusters=[],this.animation={start:!1},this.set("animationDuration","number"==typeof e.animationDuration?e.animationDuration:700),this.set("animationMethod",e.animationMethod||va),this.getSource().on("change",this.saveCluster.bind(this)),this.on(["precompose","prerender"],this.animate.bind(this)),this.on(["postcompose","postrender"],this.postanimate.bind(this))};qm(_ut,ta),_ut.prototype.saveCluster=function(){if(this.oldcluster){if(this.oldcluster.clear(),!this.get("animationDuration"))return;var t=this.getSource().getFeatures();t.length&&t[0].get("features")&&(this.oldcluster.addFeatures(this.clusters),this.clusters=t.slice(0),this.sourceChanged=!0)}},_ut.prototype.getClusterForFeature=function(t,e){for(var r,n=0;r=e[n];n++){var i=r.get("features");if(i&&i.length)for(var o,s=0;o=i[s];s++)if(t===o)return r}return!1},_ut.prototype.stopAnimation=function(){this.animation.start=!1,this.animation.cA=[],this.animation.cB=[]},_ut.prototype.animate=function(t){var e=this.get("animationDuration");if(e){var r,n,i=t.frameState.viewState.resolution,o=this.animation,s=t.frameState.time;if(o.resolution!=i&&this.sourceChanged){var a=t.frameState.extent;for(o.resolution<i?(a=Et(a,100*i),o.cA=this.oldcluster.getFeaturesInExtent(a),o.cB=this.getSource().getFeaturesInExtent(a),o.revers=!1):(a=Et(a,100*i),o.cA=this.getSource().getFeaturesInExtent(a),o.cB=this.oldcluster.getFeaturesInExtent(a),o.revers=!0),o.clusters=[],r=0;n=o.cA[r];r++){var l=n.get("features");if(l&&l.length){var u=this.getClusterForFeature(l[0],o.cB);u&&o.clusters.push({f:n,pt:u.getGeometry().getCoordinates()})}}if(o.resolution=i,this.sourceChanged=!1,!o.clusters.length||o.clusters.length>1e3)return void this.stopAnimation();s=o.start=(new Date).getTime()}if(o.start){var h=t.vectorContext||yut(t),c=(s-o.start)/e;c>1&&(this.stopAnimation(),c=1),c=this.get("animationMethod")(c);var A=this.getStyle(),f="function"==typeof A?A:A.length?function(){return A}:function(){return[A]};for(t.context.save(),t.context.globalAlpha=this.getOpacity(),r=0;u=o.clusters[r];r++){var p=u.f.getGeometry().getCoordinates(),d=p[0]-u.pt[0],g=p[1]-u.pt[1];o.revers?(p[0]=u.pt[0]+c*d,p[1]=u.pt[1]+c*g):(p[0]=p[0]-c*d,p[1]=p[1]-c*g);var y=f(u.f,i,!0);if(y.length||(y=[y]),1!==u.f.get("features").length||d||g){var m=new on(p);l=new X(m)}else l=u.f.get("features")[0];for(var v,_=0;v=y[_];_++)if(v.getText()&&/\n/.test(v.getText().getText())){var w,b=v.getText().getOffsetX(),x=v.getText().getOffsetY(),C=v.getText().getRotation()||0,E=1.2*Number((v.getText().getFont()||"10px").match(/\d+/)),S=v.getText().getText().split("\n"),B=S.length-1,I=v.clone();S.forEach((function(e,r){switch(1==r&&(I.setImage(),I.setFill(),I.setStroke()),v.getText().getTextBaseline()){case"alphabetic":case"ideographic":case"bottom":w=B;break;case"hanging":case"top":w=0;break;default:w=B/2}I.getText().setOffsetX(b-Math.sin(C)*E*(r-w)),I.getText().setOffsetY(x+Math.cos(C)*E*(r-w)),I.getText().setText(e),h.drawFeature(l,vut(t,I))}))}else h.drawFeature(l,vut(t,v))}t.context.restore(),t.frameState.animate=!0,t.context.save(),t.context.beginPath(),t.context.rect(0,0,0,0),t.context.clip(),this.clip_=!0}}},_ut.prototype.postanimate=function(t){this.clip_&&(t.context.restore(),this.clip_=!1)};var wut,but=function(t){t=t||{},this.pointRadius=t.pointRadius||12,this.circleMaxObjects=t.circleMaxObjects||10,this.maxObjects=t.maxObjects||60,this.spiral=!1!==t.spiral,this.animate=t.animate,this.animationDuration=t.animationDuration||500,this.selectCluster_=!1!==t.selectCluster,this._autoClose=!1!==t.autoClose;var e=this.overlayLayer_=new ta({source:new pa({features:new V,wrapX:t.wrapX,useSpatialIndex:!0}),name:"Cluster overlay",updateWhileAnimating:!0,updateWhileInteracting:!0,displayInLayerSwitcher:!1,style:t.featureStyle});if(t.layers)if("function"==typeof t.layers){var r=t.layers;t.layers=function(t){return t===e||r(t)}}else t.layers.push&&t.layers.push(this.overlayLayer_);if(t.filter){var n=t.filter;t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))&&n(t,e)}}else t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))};this.filter_=t.filter,this._autoClose||t.toggleCondition||(t.toggleCondition=pu),Th.call(this,t),this.on("select",this.selectCluster.bind(this))};qm(but,Th),but.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),this._listener&&k(this._listener),this._listener=null,Th.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),t&&t.getView()&&(this._listener=t.getView().on("change:resolution",this.clear.bind(this)))},but.prototype.clear=function(){this.getFeatures().clear(),this.overlayLayer_.getSource().clear()},but.prototype.getLayer=function(){return this.overlayLayer_},but.prototype.selectCluster=function(t){if(t instanceof X&&(t={selected:[t]}),t.selected.length){var e=t.selected[0];if(!e.get("selectclusterfeature")){var r=this.overlayLayer_.getSource();this._autoClose&&r.clear();var n=e.get("features");if(n&&1!=n.length){this.selectCluster_||this.getFeatures().clear();var i,o,s,a,l,u,h,c=e.getGeometry().getCoordinates(),A=this.getMap().getView().getResolution(),f=[];if(!this.spiral||n.length<=this.circleMaxObjects)for(a=Math.min(n.length,this.circleMaxObjects),i=A*this.pointRadius*(.5+a/4),s=0;s<a;s++)o=2*Math.PI*s/a,2!=a&&4!=a||(o+=Math.PI/4),l=[c[0]+i*Math.sin(o),c[1]+i*Math.cos(o)],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h);else{o=0;var p=2*this.pointRadius;for(a=Math.min(this.maxObjects,n.length),s=0;s<a;s++){o+=(p+.1)/(i=p/2+p*o/(2*Math.PI));var d=A*i*Math.sin(o),g=A*i*Math.cos(o);l=[c[0]+d,c[1]+g],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h)}}e.set("selectcluserfeatures",f),this.animate?this.animateCluster_(c,f):r.addFeatures(f)}}}else this._autoClose?this.clear():t.deselected.forEach((t=>{var e=t.get("selectcluserfeatures");e&&e.forEach((t=>{this.overlayLayer_.getSource().removeFeature(t)}))}))},but.prototype.animateCluster_=function(t,e){if(this.listenerKey_&&k(this.listenerKey_),e.length){var r=this.overlayLayer_.getStyle(),n="function"==typeof r?r:r.length?function(){return r}:function(){return[r]},i=this.animationDuration||500,o=(new Date).getTime();this.listenerKey_=this.overlayLayer_.on(["postcompose","postrender"],function(r){for(var s,a=r.vectorContext||yut(r),l=r.frameState.pixelRatio,u=this.getMap().getView().getResolution(),h=va((r.frameState.time-o)/i),c=0;s=e[c];c++)if(s.get("features")){var A=s.getGeometry().getCoordinates();A[0]=t[0]+h*(A[0]-t[0]),A[1]=t[1]+h*(A[1]-t[1]);for(var f=new on(A),p=n(s,u),d=0;d<p.length;d++){var g,y=!Qh.prototype.getFeaturesAtPixel&&p[d].getImage();y&&(g=y.getScale(),y.setScale(l)),a.setStyle?(a.setStyle(p[d]),a.drawGeometry(f)):(a.setImageStyle(y),a.drawPointGeometry(f)),y&&y.setScale(g)}}if(h>1)return k(this.listenerKey_),this.overlayLayer_.getSource().addFeatures(e),void this.overlayLayer_.changed();r.frameState.animate=!0}.bind(this));var s=new X(new on(this.getMap().getView().getCenter()));s.setStyle(new Vi({image:new Di({})})),this.overlayLayer_.getSource().addFeature(s)}},but.prototype.getClusterExtent=function(t){if(!t.get("features"))return null;var e=[1/0,1/0,-1/0,-1/0];return t.get("features").forEach((function(t){e=Rt(e,t.getGeometry().getExtent())})),e[0]===e[2]&&e[1]===e[3]?null:e},function(){var t=function(t,e,r){return(t[0]-r[0])*(e[1]-r[1])-(t[1]-r[1])*(e[0]-r[0])<=0};wut=function(e){var r;e.sort((function(t,e){return t[0]==e[0]?t[1]-e[1]:t[0]-e[0]}));var n=[];for(r=0;r<e.length;r++){for(;n.length>=2&&t(n[n.length-2],n[n.length-1],e[r]);)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&t(i[i.length-2],i[i.length-1],e[r]);)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)};var e=function(t){var r,n,i=[];switch(t.getType()){case"Point":i.push(t.getCoordinates());break;case"LineString":case"LinearRing":case"MultiPoint":i=t.getCoordinates();break;case"MultiLineString":for(n=t.getLineStrings(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"Polygon":i=e(t.getLinearRing(0));break;case"MultiPolygon":for(n=t.getPolygons(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"GeometryCollection":for(n=t.getGeometries(),r=0;r<n.length;r++)i.concat(e(n[r]))}return i};Mr.prototype.convexHull=function(){return wut(e(this))}}();const xut=wut;var Cut=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eut={Point:function(t){return void 0!==t.m&&void 0!==t.z?new on([t.x,t.y,t.z,t.m],Y.XYZM):void 0!==t.z?new on([t.x,t.y,t.z],Y.XYZ):void 0!==t.m?new on([t.x,t.y,t.m],Y.XYM):new on([t.x,t.y])},LineString:function(t){var e=Tut(t);return new Nn(t.paths[0],e)},Polygon:function(t){var e=Tut(t);return new xn(t.rings,e)},MultiPoint:function(t){var e=Tut(t);return new nh(t.points,e)},MultiLineString:function(t){var e=Tut(t);return new th(t.paths,e)},MultiPolygon:function(t){var e=Tut(t);return new ah(t.rings,e)}},Sut={Point:function(t,e){var r,n=t.getCoordinates(),i=t.getLayout();return i===Y.XYZ?r={x:n[0],y:n[1],z:n[2]}:i===Y.XYM?r={x:n[0],y:n[1],m:n[2]}:i===Y.XYZM?r={x:n[0],y:n[1],z:n[2],m:n[3]}:i===Y.XY?r={x:n[0],y:n[1]}:K(!1,34),r},LineString:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},Polygon:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},MultiPoint:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},MultiLineString:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},MultiPolygon:function(t,e){for(var r=Put(t),n=t.getCoordinates(!1),i=[],o=0;o<n.length;o++)for(var s=n[o].length-1;s>=0;s--)i.push(n[o][s]);return{hasZ:r.hasZ,hasM:r.hasM,rings:i}}},But=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).geometryName_=n.geometryName,r}return Cut(e,t),e.prototype.readFeatureFromObject=function(t,e,r){var n=t,i=Iut(n.geometry,e),o=new X;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(i),n.attributes){o.setProperties(n.attributes,!0);var s=n.attributes[r];void 0!==s&&o.setId(s)}return o},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){for(var n=[],i=t.features,o=0,s=i.length;o<s;++o)n.push(this.readFeatureFromObject(i[o],r,t.objectIdFieldName));return n}return[this.readFeatureFromObject(t,r)]},e.prototype.readGeometryFromObject=function(t,e){return Iut(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?ir("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return Fut(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={};if(!t.hasProperties())return r.attributes={},r;var n=t.getProperties(),i=t.getGeometry();if(i){r.geometry=Fut(i,e);var o=e&&(e.dataProjection||e.featureProjection);o&&(r.geometry.spatialReference={wkid:Number(ir(o).getCode().split(":").pop())}),delete n[t.getGeometryName()]}return E(n)?r.attributes={}:r.attributes=n,r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{features:r}},e}(Of);function Iut(t,e){var r,n,i;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)i="Point";else if(t.points)i="MultiPoint";else if(t.paths)i=1===t.paths.length?"LineString":"MultiLineString";else if(t.rings){var o=t,s=Tut(o),a=function(t,e){var r,n,i=[],o=[],s=[];for(r=0,n=t.length;r<n;++r)i.length=0,zr(i,0,t[r],e.length),gn(i,0,i.length,e.length)?o.push([t[r]]):s.push(t[r]);for(;s.length;){var a=s.shift(),l=!1;for(r=o.length-1;r>=0;r--){var u=o[r][0];if(Tt(new rn(u).getExtent(),new rn(a).getExtent())){o[r].push(a),l=!0;break}}l||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(i="Polygon",t=b({},t,((r={}).rings=a[0],r))):(i="MultiPolygon",t=b({},t,((n={}).rings=a,n)))}return $c((0,Eut[i])(t),!1,e)}function Tut(t){var e=Y.XY;return!0===t.hasZ&&!0===t.hasM?e=Y.XYZM:!0===t.hasZ?e=Y.XYZ:!0===t.hasM&&(e=Y.XYM),e}function Put(t){var e=t.getLayout();return{hasZ:e===Y.XYZ||e===Y.XYZM,hasM:e===Y.XYM||e===Y.XYZM}}function Fut(t,e){return(0,Sut[t.getType()])($c(t,!0,e),e)}const Lut=But;var Mut="http://www.w3.org/2001/XMLSchema-instance";function Out(t,e){return $ut().createElementNS(t,e)}function kut(t,e){return Nut(t,e,[]).join("")}function Nut(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)Nut(n,e,r)}return r}function Rut(t){return"documentElement"in t}function Uut(t){return(new DOMParser).parseFromString(t,"application/xml")}function Dut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&y(n[n.length-1],i)}}function Qut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function Gut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function jut(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function Hut(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function zut(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,s=r;return void 0===s&&(s=i),Out(void 0!==e?e:o.namespaceURI,s)}}var Vut=zut();function Kut(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function qut(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function Wut(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var s=o[i.localName];void 0!==s&&s.call(n,i,r)}}}function Xut(t,e,r,n,i){return n.push(t),Wut(e,r,n,i),n.pop()}function Yut(t,e,r,n,i,o,s){return i.push(t),function(t,e,r,n,i,o){for(var s,a,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(s=r[u])&&void 0!==(a=e.call(void 0!==o?o:this,s,n,void 0!==i?i[u]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,n)}(e,r,n,i,o,s),i.pop()}var Zut=void 0,Jut=void 0;function $ut(){return void 0===Jut&&"undefined"!=typeof document&&(Jut=document.implementation.createDocument("","",null)),Jut}var tht=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const eht=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===Zut&&"undefined"!=typeof XMLSerializer&&(Zut=new XMLSerializer),Zut),e}return tht(e,t),e.prototype.getType=function(){return"xml"},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=Uut(t);return this.readFeatureFromDocument(r,e)}return Rut(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=Uut(t);return this.readFeaturesFromDocument(r,e)}return Rut(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&y(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return n()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=Uut(t);return this.readGeometryFromDocument(r,e)}return Rut(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Uut(t);return this.readProjectionFromDocument(e)}return Rut(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Jc);function rht(t){var e,r=kut(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function nht(t){var e,r=kut(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function iht(t){return kut(t,!1).trim()}function oht(t,e){aht(t,e?"1":"0")}function sht(t,e){var r=e.toPrecision();t.appendChild($ut().createTextNode(r))}function aht(t,e){t.appendChild($ut().createTextNode(e))}var lht,uht,hht,cht,Aht,fht,pht,dht,ght,yht=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mht=["http://www.google.com/kml/ext/2.2"],vht=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],_ht={fraction:xs.FRACTION,pixels:xs.PIXELS,insetPixels:xs.PIXELS},wht=qut(vht,{ExtendedData:dct,Region:gct,MultiGeometry:jut(sct,"geometry"),LineString:jut(nct,"geometry"),LinearRing:jut(ict,"geometry"),Point:jut(act,"geometry"),Polygon:jut(uct,"geometry"),Style:jut(cct),StyleMap:function(t,e){var r=Hht.call(this,t,e);if(r){var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:K(!1,38)}},address:jut(iht),description:jut(iht),name:jut(iht),open:jut(rht),phoneNumber:jut(iht),styleUrl:jut(Qht),visibility:jut(rht)},qut(mht,{MultiTrack:jut((function(t,e){var r=Xut([],Yht,t,e);if(r)return new th(r)}),"geometry"),Track:jut(Jht,"geometry")})),bht=qut(vht,{ExtendedData:dct,Region:gct,Link:function(t,e){Wut(xht,t,e)},address:jut(iht),description:jut(iht),name:jut(iht),open:jut(rht),phoneNumber:jut(iht),visibility:jut(rht)}),xht=qut(vht,{href:jut(Dht)}),Cht=qut(vht,{LatLonAltBox:function(t,e){var r=Xut({},vct,t,e);if(r){var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)}},Lod:function(t,e){var r=Xut({},_ct,t,e);if(r){var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}}),Eht=qut(vht,["Document","Placemark"]),Sht=qut(vht,{Document:Hut((function(t,e,r){Yut({node:t},Ect,Sct,e,r,void 0,this)})),Placemark:Hut(Yct)}),Bht=null,Iht=null,Tht=null,Pht=null,Fht=null,Lht=null;function Mht(t){return 32/Math.min(t[0],t[1])}function Oht(t){return t}var kht=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Lht||(Bht=new Fn({color:lht=[255,255,255,1]}),uht=[20,2],hht=xs.PIXELS,cht=xs.PIXELS,Aht=[64,64],fht="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Iht=new Us({anchor:uht,anchorOrigin:Cs.BOTTOM_LEFT,anchorXUnits:hht,anchorYUnits:cht,crossOrigin:"anonymous",rotation:0,scale:Mht(Aht),size:Aht,src:fht}),pht="NO_IMAGE",Tht=new Rn({color:lht,width:1}),dht=new Rn({color:[51,51,51,1],width:2}),Pht=new Wi({font:"bold 16px Helvetica",fill:Bht,stroke:dht,scale:.8}),Fht=new Vi({fill:Bht,image:Iht,text:Pht,stroke:Tht,zIndex:0}),Lht=[Fht]),r.dataProjection=ir("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Lht,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:Oht,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return yht(e,t),e.prototype.readDocumentOrFolder_=function(t,e){return Xut([],qut(vht,{Document:Dut(this.readDocumentOrFolder_,this),Folder:Dut(this.readDocumentOrFolder_,this),Placemark:Qut(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this)||void 0},e.prototype.readPlacemark_=function(t,e){var r,n,i,o,s,a=Xut({geometry:null},wht,t,e,this);if(a){var l=new X,u=t.getAttribute("id");null!==u&&l.setId(u);var h=e[0],c=a.geometry;if(c&&$c(c,!1,h),l.setGeometry(c),delete a.geometry,this.extractStyles_){var A=(r=a.Style,n=a.styleUrl,i=this.defaultStyle_,o=this.sharedStyles_,s=this.showPointNames_,function(t,e){var a=s,l="",u=[];if(a){var h=t.getGeometry();if(h)if(h instanceof SA)a=(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e}))).length>0;else{var c=h.getType();a="Point"===c||"MultiPoint"===c}}a&&(l=t.get("name"),(a=a&&!!l)&&l.search(/&[^&]+;/)>-1&&(ght||(ght=document.createElement("textarea")),ght.innerHTML=l,l=ght.value));var A=i;if(r?A=r:n&&(A=Nht(n,i,o)),a){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var s=i.getScaleArray(),a=i.getAnchor();r[0]=s[0]*(o[0]-a[0]),r[1]=s[1]*(o[1]/2-a[1]),n="left"}}var l=t.getText();return l?((l=l.clone()).setFont(l.getFont()||Pht.getFont()),l.setScale(l.getScale()||Pht.getScale()),l.setFill(l.getFill()||Pht.getFill()),l.setStroke(l.getStroke()||dht)):l=Pht.clone(),l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new Vi({image:i,text:l})}(A[0],l);return u.length>0?(f.setGeometry(new SA(u)),[f,new Vi({geometry:A[0].getGeometry(),image:null,fill:A[0].getFill(),stroke:A[0].getStroke(),text:null})].concat(A.slice(1))):f}return A});l.setStyle(A)}return delete a.Style,l.setProperties(a,!0),l}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=cct.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Hht.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){return p(vht,t.namespaceURI)&&this.readPlacemark_(t,[this.getReadOptions(t,e)])||null},e.prototype.readFeaturesFromNode=function(t,e){if(!p(vht,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&y(r,s)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Uut(t);return this.readNameFromDocument(e)}return Rut(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(p(vht,e.namespaceURI)&&"name"==e.localName)return iht(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(p(vht,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=Uut(t);y(e,this.readNetworkLinksFromDocument(r))}else Rut(t)?y(e,this.readNetworkLinksFromDocument(t)):y(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(vht,r.namespaceURI)&&"NetworkLink"==r.localName){var n=Xut({},bht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(vht,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Uut(t);y(e,this.readRegionFromDocument(r))}else Rut(t)?y(e,this.readRegionFromDocument(t)):y(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(vht,r.namespaceURI)&&"Region"==r.localName){var n=Xut({},Cht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(vht,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Out(vht[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",mht[0]),r.setAttributeNS(n,"xmlns:xsi",Mut),r.setAttributeNS(Mut,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=Eht[r.namespaceURI],a=Kut(o,s);return Yut(i,Sht,Vut,a,[e],s,this),r},e}(eht);function Nht(t,e,r){return Array.isArray(t)?t:"string"==typeof t?Nht(r[t],e,r):e}function Rht(t){var e=kut(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function Uht(t){var e=kut(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=n[3]?parseFloat(n[3]):0;r.push(o,s,a),e=e.substr(n[0].length)}if(""===e)return r}function Dht(t){var e=kut(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Qht(t){var e=kut(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Ght(t){return nht(t)}var jht=qut(vht,{Pair:function(t,e){var r=Xut({},yct,t,e,this);if(r){var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}}});function Hht(t,e){return Xut(void 0,jht,t,e,this)}var zht=qut(vht,{Icon:jut((function(t,e){return Xut({},$ht,t,e)||null})),color:jut(Rht),heading:jut(nht),hotSpot:jut((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Cs.BOTTOM_LEFT:Cs.TOP_LEFT:"insetPixels"!==n?Cs.BOTTOM_RIGHT:Cs.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:_ht[r],y:parseFloat(t.getAttribute("y")),yunits:_ht[n],origin:e}})),scale:jut(Ght)}),Vht=qut(vht,{color:jut(Rht),scale:jut(Ght)}),Kht=qut(vht,{color:jut(Rht),width:jut(nht)}),qht=qut(vht,{color:jut(Rht),fill:jut(rht),outline:jut(rht)}),Wht=qut(vht,{coordinates:Gut(Uht)});function Xht(t,e){return Xut(null,Wht,t,e)}var Yht=qut(mht,{Track:Qut(Jht)}),Zht=qut(vht,{when:function(t,e){var r=e[e.length-1].whens,n=kut(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},qut(mht,{coord:function(t,e){var r=e[e.length-1].coordinates,n=kut(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);r.push([o,s,a])}else r.push([])}}));function Jht(t,e){var r=Xut({coordinates:[],whens:[]},Zht,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,s=0,a=Math.min(i.length,o.length);s<a;++s)3==i[s].length&&n.push(i[s][0],i[s][1],i[s][2],o[s]);return new Nn(n,Y.XYZM)}}var $ht=qut(vht,{href:jut(Dht)},qut(mht,{x:jut(nht),y:jut(nht),w:jut(nht),h:jut(nht)})),tct=qut(vht,{coordinates:Gut(Uht)});function ect(t,e){return Xut(null,tct,t,e)}var rct=qut(vht,{extrude:jut(rht),tessellate:jut(rht),altitudeMode:jut(iht)});function nct(t,e){var r=Xut({},rct,t,e),n=ect(t,e);if(n){var i=new Nn(n,Y.XYZ);return i.setProperties(r,!0),i}}function ict(t,e){var r=Xut({},rct,t,e),n=ect(t,e);if(n){var i=new xn(n,Y.XYZ,[n.length]);return i.setProperties(r,!0),i}}var oct=qut(vht,{LineString:Qut(nct),LinearRing:Qut(ict),MultiGeometry:Qut(sct),Point:Qut(act),Polygon:Qut(uct)});function sct(t,e){var r,n=Xut([],oct,t,e);if(!n)return null;if(0===n.length)return new SA(n);for(var i=!0,o=n[0].getType(),s=1,a=n.length;s<a;++s)if(n[s].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if("Point"==o){var h=n[0];for(l=h.getLayout(),u=h.getFlatCoordinates(),s=1,a=n.length;s<a;++s)y(u,n[s].getFlatCoordinates());Act(r=new nh(u,l),n)}else"LineString"==o?Act(r=new th(n),n):"Polygon"==o?Act(r=new ah(n),n):"GeometryCollection"==o?r=new SA(n):K(!1,37)}else r=new SA(n);return r}function act(t,e){var r=Xut({},rct,t,e),n=ect(t,e);if(n){var i=new on(n,Y.XYZ);return i.setProperties(r,!0),i}}var lct=qut(vht,{innerBoundaryIs:function(t,e){var r=Xut([],wct,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=Xut(void 0,bct,t,e);r&&(e[e.length-1][0]=r)}});function uct(t,e){var r=Xut({},rct,t,e),n=Xut([null],lct,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],s=1,a=n.length;s<a;++s)y(i,n[s]),o.push(i.length);var l=new xn(i,Y.XYZ,o);return l.setProperties(r,!0),l}}var hct=qut(vht,{IconStyle:function(t,e){var r=Xut({},zht,t,e);if(r){var n,i,o,s,a=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?n=h:u&&(n=fht);var c,A=Cs.BOTTOM_LEFT,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,s=f.yunits,A=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(/pushpin/.test(n)?(i=uht,o=hht,s=cht):/arrow-reverse/.test(n)?(i=[54,42],o=hht,s=cht):/paddle/.test(n)&&(i=[32,1],o=hht,s=cht));var p,d=l.x,g=l.y;void 0!==d&&void 0!==g&&(c=[d,g]);var y,m=l.w,v=l.h;void 0!==m&&void 0!==v&&(p=[m,v]);var _=r.heading;void 0!==_&&(y=Ae(_));var w=r.scale,b=r.color;if(u){n==fht&&(p=Aht);var x=new Us({anchor:i,anchorOrigin:A,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Cs.BOTTOM_LEFT,rotation:y,scale:w,size:p,src:this.iconUrlFunction_(n),color:b}),C=x.getScaleArray()[0],E=x.getSize();if(null===E){var S=x.getImageState();if(S===Un.IDLE||S===Un.LOADING){var B=function(){var t=x.getImageState();if(t!==Un.IDLE&&t!==Un.LOADING){var e=x.getSize();if(e&&2==e.length){var r=Mht(e);x.setScale(C*r)}x.unlistenImageChange(B)}};x.listenImageChange(B),S===Un.IDLE&&x.load()}}else if(2==E.length){var I=Mht(E);x.setScale(C*I)}a.imageStyle=x}else a.imageStyle=pht}},LabelStyle:function(t,e){var r=Xut({},Vht,t,e);if(r){var n=e[e.length-1],i=new Wi({fill:new Fn({color:"color"in r?r.color:lht}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=Xut({},Kht,t,e);if(r){var n=e[e.length-1],i=new Rn({color:"color"in r?r.color:lht,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=Xut({},qht,t,e);if(r){var n=e[e.length-1],i=new Fn({color:"color"in r?r.color:lht});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var s=r.outline;void 0!==s&&(n.outline=s)}}});function cct(t,e){var r=Xut({},hct,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:Bht,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=pht&&(n=r.imageStyle):n=Iht;var s="textStyle"in r?r.textStyle:Pht,a="strokeStyle"in r?r.strokeStyle:Tht,l=r.outline;return void 0===l||l?[new Vi({fill:i,image:n,stroke:a,text:s,zIndex:void 0})]:[new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e}))):"Polygon"!==r&&"MultiPolygon"!==r?e:void 0},fill:i,image:n,stroke:a,text:s,zIndex:void 0}),new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e}))):"Polygon"===r||"MultiPolygon"===r?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function Act(t,e){var r,n,i,o=e.length,s=new Array(e.length),a=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];s[u]=h.get("extrude"),a[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==s[u],n=n||void 0!==a[u],i=i||l[u]}r&&t.set("extrude",s),n&&t.set("tessellate",a),i&&t.set("altitudeMode",l)}var fct=qut(vht,{displayName:jut(iht),value:jut(iht)}),pct=qut(vht,{Data:function(t,e){var r=t.getAttribute("name");Wut(fct,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){Wut(mct,t,e)}});function dct(t,e){Wut(pct,t,e)}function gct(t,e){Wut(Cht,t,e)}var yct=qut(vht,{Style:jut(cct),key:jut(iht),styleUrl:jut(Qht)}),mct=qut(vht,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=iht(t);e[e.length-1][r]=n}}}),vct=qut(vht,{altitudeMode:jut(iht),minAltitude:jut(nht),maxAltitude:jut(nht),north:jut(nht),south:jut(nht),east:jut(nht),west:jut(nht)}),_ct=qut(vht,{minLodPixels:jut(nht),maxLodPixels:jut(nht),minFadeExtent:jut(nht),maxFadeExtent:jut(nht)}),wct=qut(vht,{LinearRing:Qut(Xht)}),bct=qut(vht,{LinearRing:Gut(Xht)});function xct(t,e){for(var r=Zn(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}aht(t,n.join(""))}var Cct=qut(vht,{Data:Hut((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&Yut(n,Cct,Vut,[i.displayName],r,["displayName"]),null!==i&&i.value&&Yut(n,Cct,Vut,[i.value],r,["value"])):Yut(n,Cct,Vut,[i],r,["value"])})),value:Hut((function(t,e){aht(t,e)})),displayName:Hut((function(t,e){!function(t,e){t.appendChild($ut().createCDATASection(e))}(t,e)}))}),Ect=qut(vht,{Placemark:Hut(Yct)}),Sct=function(t,e,r){return Out(e[e.length-1].node.namespaceURI,"Placemark")},Bct=zut("Data"),Ict=qut(vht,["href"],qut(mht,["x","y","w","h"])),Tct=qut(vht,{href:Hut(aht)},qut(mht,{x:Hut(sht),y:Hut(sht),w:Hut(sht),h:Hut(sht)})),Pct=function(t,e,r){return Out(mht[0],"gx:"+r)},Fct=qut(vht,["scale","heading","Icon","color","hotSpot"]),Lct=qut(vht,{Icon:Hut((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=Ict[i.namespaceURI],s=Kut(e,o);Yut(n,Tct,Vut,s,r,o),s=Kut(e,o=Ict[mht[0]]),Yut(n,Tct,Pct,s,r,o)})),color:Hut(xct),heading:Hut(sht),hotSpot:Hut((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:Hut(sAt)}),Mct=qut(vht,["color","scale"]),Oct=qut(vht,{color:Hut(xct),scale:Hut(sAt)}),kct=qut(vht,["color","width"]),Nct=qut(vht,{color:Hut(xct),width:Hut(sht)}),Rct={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Uct=function(t,e,r){if(t)return Out(e[e.length-1].node.namespaceURI,Rct[t.getType()])},Dct=zut("Point"),Qct=zut("LineString"),Gct=zut("LinearRing"),jct=zut("Polygon"),Hct=qut(vht,{LineString:Hut($ct),Point:Hut($ct),Polygon:Hut(iAt),GeometryCollection:Hut(zct)});function zct(t,e,r){var n,i={node:t},o=e.getType(),s=[];"GeometryCollection"===o?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();"MultiPoint"===e?s=s.concat(t.getPoints()):"MultiLineString"===e?s=s.concat(t.getLineStrings()):"MultiPolygon"===e?s=s.concat(t.getPolygons()):"Point"===e||"LineString"===e||"Polygon"===e?s.push(t):K(!1,39)})),n=Uct):"MultiPoint"===o?(s=e.getPoints(),n=Dct):"MultiLineString"===o?(s=e.getLineStrings(),n=Qct):"MultiPolygon"===o?(s=e.getPolygons(),n=jct):K(!1,39),Yut(i,Hct,n,s,r)}var Vct=qut(vht,{LinearRing:Hut($ct)});function Kct(t,e,r){Yut({node:t},Vct,Gct,[e],r)}var qct=qut(vht,{ExtendedData:Hut((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,s=i.length,a=0;a<s;a++)Yut(n,Cct,Bct,[{name:i[a],value:o[a]}],r)})),MultiGeometry:Hut(zct),LineString:Hut($ct),LinearRing:Hut($ct),Point:Hut($ct),Polygon:Hut(iAt),Style:Hut((function(t,e,r){var n,i={node:t},o={};if(e.pointStyles.length){var s=e.pointStyles[0].getText();s&&(o.LabelStyle=s);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(o.IconStyle=a)}e.lineStyles.length&&(n=e.lineStyles[0].getStroke())&&(o.LineStyle=n),e.polyStyles.length&&((n=e.polyStyles[0].getStroke())&&!o.LineStyle&&(o.LineStyle=n),o.PolyStyle=e.polyStyles[0]);var l=r[r.length-1].node,u=aAt[l.namespaceURI],h=Kut(o,u);Yut(i,lAt,Vut,h,r,u)})),address:Hut(aht),description:Hut(aht),name:Hut(aht),open:Hut(oht),phoneNumber:Hut(aht),styleUrl:Hut(aht),visibility:Hut(oht)}),Wct=qut(vht,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Xct=zut("ExtendedData");function Yct(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),a=e.getStyleFunction();if(a){var l=a(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e})).length:"Point"===n||"MultiPoint"===n}}))),this.writeStyles_){var c=u,A=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"LineString"===e||"MultiLineString"===e})).length:"LineString"===n||"MultiLineString"===n}})),A=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e})).length:"Polygon"===n||"MultiPolygon"===n}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:A}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var p=r[r.length-1].node,d=Wct[p.namespaceURI],g=Kut(i,d);if(Yut(n,qct,Vut,g,r,d),s.length>0){var y=Kut(i,s);Yut(n,qct,Xct,[{names:s,values:y}],r)}var m=r[0],v=e.getGeometry();v&&(v=$c(v,!0,m)),Yut(n,qct,Uct,[v],r)}var Zct=qut(vht,["extrude","tessellate","altitudeMode","coordinates"]),Jct=qut(vht,{extrude:Hut(oht),tessellate:Hut(oht),altitudeMode:Hut(aht),coordinates:Hut((function(t,e,r){var n,i=r[r.length-1],o=i.layout,s=i.stride;o==Y.XY||o==Y.XYM?n=2:o==Y.XYZ||o==Y.XYZM?n=3:K(!1,34);var a=e.length,l="";if(a>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=s;h<a;h+=s)for(l+=" "+e[h],u=1;u<n;++u)l+=","+e[h+u]}aht(t,l)}))});function $ct(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var s=r[r.length-1].node,a=Zct[s.namespaceURI],l=Kut(o,a);Yut(i,Jct,Vut,l,r,a)}var tAt=qut(vht,["color","fill","outline"]),eAt=qut(vht,{outerBoundaryIs:Hut(Kct),innerBoundaryIs:Hut(Kct)}),rAt=zut("innerBoundaryIs"),nAt=zut("outerBoundaryIs");function iAt(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};Yut(o,eAt,rAt,n,r),Yut(o,eAt,nAt,[i],r)}var oAt=qut(vht,{color:Hut(xct),fill:Hut(oht),outline:Hut(oht)});function sAt(t,e){sht(t,Math.round(1e6*e)/1e6)}var aAt=qut(vht,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),lAt=qut(vht,{IconStyle:Hut((function(t,e,r){var n={node:t},i={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),l={href:o};if(s){l.w=s[0],l.h=s[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&a&&0!==h[0]&&h[1]!==s[1]&&(l.x=h[0],l.y=a[1]-(h[1]+s[1])),u&&(u[0]!==s[0]/2||u[1]!==s[1]/2)){var c={x:u[0],xunits:xs.PIXELS,y:s[1]-u[1],yunits:xs.PIXELS};i.hotSpot=c}}i.Icon=l;var A=e.getScaleArray()[0],f=s;null===f&&(f=Aht),2==f.length&&(A/=Mht(f)),1!==A&&(i.scale=A);var p=e.getRotation();0!==p&&(i.heading=p);var d=e.getColor();d&&(i.color=d);var g=r[r.length-1].node,y=Fct[g.namespaceURI],m=Kut(i,y);Yut(n,Lct,Vut,m,r,y)})),LabelStyle:Hut((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var s=e.getScale();s&&1!==s&&(i.scale=s);var a=r[r.length-1].node,l=Mct[a.namespaceURI],u=Kut(i,l);Yut(n,Oct,Vut,u,r,l)})),LineStyle:Hut((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,s=kct[o.namespaceURI],a=Kut(i,s);Yut(n,Nct,Vut,a,r,s)})),PolyStyle:Hut((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),s={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},a=r[r.length-1].node,l=tAt[a.namespaceURI],u=Kut(s,l);Yut(n,oAt,Vut,u,r,l)}))});const uAt=kht;var hAt=function(t){t=t||{},this.duration_="number"==typeof t.duration?t.duration>=0?t.duration:0:1e3,this.fade_="function"==typeof t.fade?t.fade:null,this.repeat_=Number(t.repeat);var e="function"==typeof t.easing?t.easing:wa;t.revers?this.easing_=function(t){return 1-e(t)}:this.easing_=e,this.hiddenStyle=t.hiddenStyle,D.call(this)};qm(hAt,D),hAt.hiddenStyle=new Vi({image:new Di({}),stroke:new Rn({color:"transparent"})}),hAt.prototype.drawGeom_=function(t,e,r){this.fade_&&(t.context.globalAlpha=this.fade_(1-t.elapsed));for(var n=t.style,i=0;i<n.length;i++)try{var o=t.vectorContext||yut(t),s=vut(t,n[i]);o.setStyle(s),s.getZIndex()<0?o.drawGeometry(r||e):o.drawGeometry(e)}catch(a){}},hAt.prototype.animate=function(){return!1},Qh.prototype.animateFeature=function(t,e){var r=this._featureAnimationLayer;r||(r=this._featureAnimationLayer=new ta({source:new pa})).setMap(this),r.getSource().addFeature(t);var n=e.on("animationend",(function(e){e.feature===t&&(r.getSource().removeFeature(t),k(n))}));r.animateFeature(t,e)},Zi.prototype.animateFeature=function(t,e,r){var n,i=this,o=t.getStyle(),s=o||(this.getStyleFunction?this.getStyleFunction()(t):null);s||(s=[]),s instanceof Array||(s=[s]);var a={vectorContext:null,frameState:null,start:0,time:0,elapsed:0,extent:!1,feature:t,geom:t.getGeometry(),typeGeom:t.getGeometry().getType(),bbox:t.getGeometry().getExtent(),coord:Vt(t.getGeometry().getExtent()),style:s};e instanceof Array||(e=[e]);for(var l=e.length-1;l>=0;l--)0===e[l].duration_&&e.splice(l,1);var u=0,h=0,c=r&&this.getFilters?this.getFilters():[];function A(r){a.type=r.type;try{a.vectorContext=r.vectorContext||yut(r)}catch(o){}if(a.frameState=r.frameState,a.inversePixelTransform=r.inversePixelTransform,a.extent||(a.extent=r.frameState.extent,a.start=r.frameState.time,a.context=r.context),a.time=r.frameState.time-a.start,a.elapsed=a.time/e[h].duration_,a.elapsed>1&&(a.elapsed=1),r.context.save(),c.forEach((function(t){t.get("active")&&t.precompose(r)})),this.getOpacity&&(r.context.globalAlpha=this.getOpacity()),e[h].animate(a)){var n={type:"animating",step:h,start:a.start,time:a.time,elapsed:a.elapsed,rotation:a.rotation||0,geom:a.geom,coordinate:a.coord,feature:t};e[h].dispatchEvent(n),i.dispatchEvent(n)}else++u<e[h].repeat_?a.extent=!1:h<e.length-1?(e[h].dispatchEvent({type:"animationend",feature:t}),h++,u=0,a.extent=!1):f();c.forEach((function(t){t.get("active")&&t.postcompose(r)})),r.context.restore(),r.frameState.animate=!0}function f(r){k(n),n=null,t.setStyle(o);var s={type:"animationend",feature:t};if(r)for(var a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);e[h].dispatchEvent(s),i.dispatchEvent(s)}function p(r){if(e.length&&!n){if(n=i.on(["postcompose","postrender"],A.bind(i)),i.renderSync)try{i.renderSync()}catch(FX){}else i.changed();t.setStyle(e[h].hiddenStyle||hAt.hiddenStyle);var o={type:"animationstart",feature:t};if(r)for(var s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);e[h].dispatchEvent(o),i.dispatchEvent(o)}}return p(),{start:p,stop:f,isPlaying:function(){return!!n}}};var cAt=function(t){t=t||{},hAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||3)};qm(cAt,hAt),cAt.prototype.animate=function(t){var e=t.geom.clone(),r=Math.abs(Math.sin(this.bounce_*t.elapsed))*this.amplitude_*(1-this.easing_(t.elapsed))*t.frameState.viewState.resolution;return e.translate(0,r),this.drawGeom_(t,e,t.geom),t.time<=this.duration_};var AAt=function(t){hAt.call(this,t),this.set("nb",t.nb||10)};qm(AAt,hAt),AAt.prototype.animate=function(t){return Math.round(this.easing_(t.elapsed)*this.get("nb"))%2||this.drawGeom_(t,t.geom),t.time<=this.duration_};var fAt=function(t){t=t||{},this.speed_=t.speed||0,hAt.call(this,t),this.side_=t.side||"top"};qm(fAt,hAt),fAt.prototype.animate=function(t){if(!t.time){var e=t.frameState.viewState.rotation,r=t.frameState.size[1]*t.frameState.viewState.resolution;"top"!=this.side_&&(r*=-1),this.dx=-Math.sin(e)*r,this.dy=Math.cos(e)*r,this.speed_&&(this.duration_=r/this.speed_/t.frameState.viewState.resolution)}var n=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*(1-this.easing_(t.elapsed))),this.drawGeom_(t,n,t.geom),t.time<=this.duration_};var pAt=function(t){t=t||{},this.speed_=t.speed||0,hAt.call(this,t)};qm(pAt,hAt),pAt.prototype.animate=function(t){return t.context.globalAlpha=this.easing_(t.elapsed),this.drawGeom_(t,t.geom),t.time<=this.duration_};var dAt=function(t){switch(t=t||{},hAt.call(this,t),this.speed_=t.speed||0,this.path_=t.path,t.rotate){case!0:case 0:this.rotate_=0;break;default:this.rotate_=t.rotate||!1}this.path_&&this.path_.getGeometry&&(this.path_=this.path_.getGeometry()),this.path_&&this.path_.getLineString&&(this.path_=this.path_.getLineString()),this.path_.getLength?(this.dist_=this.path_.getLength(),this.path_&&this.path_.getCoordinates&&(this.path_=this.path_.getCoordinates())):this.dist_=0,this.speed_>0&&(this.duration_=this.dist_/this.speed_)};qm(dAt,hAt),dAt.prototype.animate=function(t){if(!t.time&&!this.dist_)return!1;var e,r,n,i,o,s,a=this.dist_*this.easing_(t.elapsed),l=0;r=this.path_[0];for(var u=1;u<this.path_.length;u++){if(e=r,i=(r=this.path_[u])[0]-e[0],o=r[1]-e[1],(s=Math.sqrt(i*i+o*o))&&l+s>=a){n=(a-l)/s,r=[e[0]+(r[0]-e[0])*n,e[1]+(r[1]-e[1])*n];break}l+=s}var h=t.style;if(t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]),!1!==this.rotate_){var c=[],A=this.rotate_-t.rotation+t.frameState.viewState.rotation;t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]);for(var f=0;n=t.style[f];f++)n.getImage()&&n.getImage().setRotation(A),c.push(n);t.style=c}return t.geom.setCoordinates(r),this.drawGeom_(t,t.geom),t.style=h,t.time<=this.duration_};var gAt=function(t){t=t||{},hAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||6),this.horizontal_=t.horizontal};qm(gAt,hAt),gAt.prototype.animate=function(t){var e=t.geom.clone(),r=t.geom.clone(),n=this.easing_(t.elapsed);return n=Math.sin(this.bounce_*n)*this.amplitude_*(1-n)*t.frameState.viewState.resolution,this.horizontal_?(e.translate(n,0),r.translate(n,0)):e.translate(0,n),this.drawGeom_(t,e,r),t.time<=this.duration_};var yAt=function(t){hAt.call(this,t)};qm(yAt,hAt),yAt.prototype.animate=function(t){return this.drawGeom_(t,t.geom),t.time<=this.duration_};var mAt=function(t){t=t||{},this.speed_=t.speed||0,hAt.call(this,t),this.side_=t.side||"left"};qm(mAt,hAt),mAt.prototype.animate=function(t){t.time||("left"==this.side_?this.dx=t.extent[0]-t.bbox[2]:this.dx=t.extent[2]-t.bbox[0],this.speed_&&(this.duration_=Math.abs(this.dx)/this.speed_/t.frameState.viewState.resolution));var e=t.geom.clone();return e.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,e),t.time<=this.duration_};var vAt=function(t){hAt.call(this,t)};qm(vAt,hAt),vAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){t.context.save();var r=t.frameState.pixelRatio;t.context.globalAlpha=e,t.context.scale(e,1/e);var n=t.frameState.coordinateToPixelTransform,i=(1/e-1)*r*(n[0]*t.coord[0]+n[1]*t.coord[1]+n[4]),o=(e-1)*r*(n[2]*t.coord[0]+n[3]*t.coord[1]+n[5]);t.context.translate(i,o),this.drawGeom_(t,t.geom),t.context.restore()}return t.time<=this.duration_};var _At=function(t){t=t||{},hAt.call(this,t),this.speed_=t.speed||0,this.side_=t.side||"left"};qm(_At,hAt),_At.prototype.animate=function(t){var e,r;!t.time&&this.speed_&&("left"==this.side_?(e=this.dx=t.extent[0]-t.bbox[2],r=this.dy=t.extent[3]-t.bbox[1]):(e=this.dx=t.extent[2]-t.bbox[0],r=this.dy=t.extent[3]-t.bbox[1]),this.duration_=Math.sqrt(e*e+r*r)/this.speed_/t.frameState.viewState.resolution);var n=t.geom.clone(),i=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*Math.cos(Math.PI/2*this.easing_(t.elapsed))),i.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,n,i),t.time<=this.duration_};var wAt=function(t){t=t||{},hAt.call(this,t),this.set("zoomout",t.zoomOut)};qm(wAt,hAt),qm((function(t){(t=t||{}).zoomOut=!0,wAt.call(this,t)}),wAt),wAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){this.get("zoomout")&&(e=1/e);var r,n,i=t.style,o=[];for(r=0;r<i.length;r++)(n=i[r].getImage())&&(o[r]=n.getScale(),"postrender"===t.type?n.setScale(o[r]*e/t.frameState.pixelRatio):n.setScale(o[r]*e));for(this.drawGeom_(t,t.geom),r=0;r<i.length;r++)(n=i[r].getImage())&&n.setScale(o[r])}return t.time<=this.duration_};class bAt extends GO{constructor(t,r){super(t,r),e(this,"animList"),this.animList=[],this.layertype="GraphicLayer",this.layer=new ta({source:this._source,zIndex:this.option.zIndex,declutter:this.option.declutter}),this.layer.set("layerid",t),this.layer.on("sourceready",(t=>{this.trigger(Cm.onLoadEnd,t)})),this._source.on("addfeature",(t=>{t.feature.get("loadAnimation")&&setTimeout((()=>{this.animateFeature(t.feature,t.feature.get("loadAnimation"))}),1),t.feature.get("pulseAnimate")&&setTimeout((()=>{this.pulseAnimate(t.feature,t.feature.get("pulseAnimate"))}),1)})),this._source.on("removefeature",(t=>{t.feature.get("pulseAnimate")&&this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&e.anim.stop({user:!0})}))})),this.layer.on(this.EventType.featureType.onFeatureContextmenu,(t=>{this._setFeatureContextmenu(t.data.feature,t.data.contextmenu)})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}pathAnimate(t,e,r){let n={rotate:!0,speed:1,revers:!0,repeat:1/0,easing:wa};r=Object.assign({},n,r);let i=new dAt({path:e,rotate:r.rotate,speed:r.speed,repeat:r.repeat,revers:r.revers});return this.trigger(Cm.onPathAnimateStart,{data:t}),i.on("animationend",(t=>{this.trigger(Cm.onPathAnimateEnd,{data:t.feature})})),i.on("animating",(t=>{this.trigger(Cm.onPathAnimateRunning,{data:t})})),this.layer.animateFeature(t,i)}pulseAnimate(t,e){let r={fade:va,duration:2e3,revers:!1,repeat:1/0,easing:va,radius:30,fillcolor:"rgba(255,0,0,0.2)",strokecolor:"red",strokewidth:1};e=Object.assign({},r,e);let n=new lv({graphicType:"PointGraphic",lnglat:t.getGeometry().getCoordinates(),style:{image:{radius:e.radius,scale:1,fill:{color:e.fillcolor},stroke:{color:e.strokecolor,width:e.strokewidth}},zIndex:990},attribute:{uuid:t.get("uuid")}}),i=new wAt(e);this.animList.push({uuid:t.get("uuid"),anim:this.layer.animateFeature(n,i)}),i.on("animationend",(t=>{this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&this.animList.splice(r,1)}))}))}animateFeatures(t,e){t.forEach(((t,r)=>{this.animateFeature(t,e)}))}animateFeature(t,e){let r,n={duration:3e3,animateType:km.Bounce,repeat:1,speed:.8,revers:!1,zoomOut:!1,side:!1};switch((e=Object.assign({},n,e)).animateType){case km.Blink:r=new AAt(e);break;case km.Drop:r=new fAt(e);break;case km.Fade:r=new pAt(e);break;case km.Path:r=new dAt(e);break;case km.Shake:r=new gAt(e);break;case km.Show:r=new yAt(e);break;case km.Slide:r=new mAt(e);break;case km.Teleport:r=new vAt(e);break;case km.Throw:r=new _At(e);break;case km.Zoom:r=new wAt(e);break;case km.ZoomOut:e.zoomOut=!0,r=new wAt(e);break;default:r=new cAt(e)}this.layer.animateFeature(t,r)}}var xAt=function(t){(t=t||{}).displacement||(t.displacement=[t.offsetX||0,-t.offsetY||0]),this.sanchor_="anchored"===t.kind?8:0,this._shadow=Number(t.shadow)||0,t.stroke||(t.stroke=new Rn({width:0,color:"#000"}));var e=t.stroke.getWidth();if(e<0&&(e=0),"folio"==t.kind&&(e+=6),t.stroke.setWidth(e),Ri.call(this,{radius:t.radius+e+this.sanchor_/2+this._shadow/2,points:0,displacement:[t.displacement[0]||0,(t.displacement[1]||0)+this.sanchor_],fill:Ri.prototype.render?new Fn({color:[0,0,0,0]}):null}),!this.getHitDetectionImage){var r=Ri.prototype.getImage.call(this);if(!this.hitDetectionCanvas_)for(var n in this)if(this[n]&&this[n].getContext&&this[n]!==r){this.hitDetectionCanvas_=this[n];break}this.hitDetectionCanvas_=document.createElement("canvas"),this.hitDetectionCanvas_.width=r.width,this.hitDetectionCanvas_.height=r.height;var i=this.hitDetectionCanvas_;this.getHitDetectionImage=function(){return i}}this._stroke=t.stroke,this._fill=t.fill,this._crop=t.crop,this._crossOrigin=t.crossOrigin,this._kind=t.kind||"default",this._radius=t.radius,this._src=t.src,this._offset=[t.offsetX?t.offsetX:0,t.offsetY?t.offsetY:0],this._onload=t.onload,"number"==typeof t.opacity&&this.setOpacity(t.opacity),"number"==typeof t.rotation&&this.setRotation(t.rotation),this.getImage()};qm(xAt,Ri),xAt.prototype.setOffset=function(t){this._offset=[t[0]||0,t[1]||0],this.getImage()},xAt.prototype.clone=function(){var t=new xAt({stroke:this._stroke,fill:this._fill,shadow:this._shadow,crop:this._crop,crossOrigin:this._crossOrigin,kind:this._kind,radius:this._radius,src:this._src,offsetX:this._offset[0],offsetY:this._offset[1],opacity:this.getOpacity(),rotation:this.getRotation()});return t.getImage(),t},CanvasRenderingContext2D.prototype.roundRect=function(t,e,r,n,i){return i?(r<2*i&&(i=r/2),n<2*i&&(i=n/2),this.beginPath(),this.moveTo(t+i,e),this.arcTo(t+r,e,t+r,e+n,i),this.arcTo(t+r,e+n,t,e+n,i),this.arcTo(t,e+n,t,e,i),this.arcTo(t,e,t+r,e,i),this.closePath()):this.rect(t,e,r,n),this},xAt.prototype.drawBack_=function(t,e,r,n){var i=this._shadow,o=t.canvas;t.beginPath(),t.fillStyle=e,t.clearRect(0,0,o.width,o.height);var s=o.width/n,a=o.height/n;switch(this._kind){case"square":t.rect(0,0,s-i,a-i);break;case"circle":t.arc(this._radius+r,this._radius+r,this._radius+r,0,2*Math.PI,!1);break;case"folio":r-=6,t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=1;var l=s-i-12,u=Math.atan(6/l);t.save(),t.rotate(-u),t.translate(-6,2),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.save(),t.translate(6,-1),t.rotate(u),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.beginPath(),t.rect(6,6,l,l),t.stroke();break;case"anchored":t.roundRect(this.sanchor_/2,0,s-this.sanchor_-i,a-this.sanchor_-i,r),t.moveTo(s/2-this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2+this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2-i/2,a-i);break;default:t.roundRect(0,0,s-i,a-i,r)}t.closePath()},xAt.prototype.getImage=function(t){t=t||1;var e,r=Ri.prototype.getImage.call(this,t);if(this._gethit)return r;var n=0;this._stroke&&(e=Kn(this._stroke.getColor()),n=this._stroke.getWidth()),this._gethit=!0;var i=this.getHitDetectionImage().getContext("2d");i.save(),i.setTransform(1,0,0,1,0,0),this.drawBack_(i,"#000",n,1),i.fill(),i.restore(),this._gethit=!1,(i=r.getContext("2d")).save(),i.setTransform(t,0,0,t,0,0),this.drawBack_(i,e,n,t),this._shadow&&(i.shadowColor="rgba(0,0,0,0.5)",i.shadowBlur=t*this._shadow/2,i.shadowOffsetX=t*this._shadow/2,i.shadowOffsetY=t*this._shadow/2),i.fill(),i.restore();var o=this,s=this.img_=new Image;if(this._crossOrigin&&(s.crossOrigin=this._crossOrigin),s.src=this._src,s.width?o.drawImage_(r,s,t):s.onload=function(){o.drawImage_(r,s,t),o._onload&&o._onload()},!this.getDisplacement){var a=this.getAnchor();a[0]=(r.width/t-this._shadow)/2-this._offset[0],this.sanchor_?a[1]=r.height/t-this._shadow-this._offset[1]:a[1]=(r.height/t-this._shadow)/2-this._offset[1]}return r},xAt.prototype.getPhoto=function(){return this.img_},xAt.prototype.drawImage_=function(t,e,r){var n=t.getContext("2d"),i=0;this._stroke&&(i=this._stroke.getWidth());var o,s,a,l,u,h,c,A,f,p=2*this._radius;n.save(),Ri.prototype.render&&n.setTransform(r,0,0,r,0,0),"circle"==this._kind&&(n.beginPath(),n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.clip()),this._crop?(A=f=(o=Math.min(e.width/p,e.height/p))*p,h=(e.width-A)/2,c=(e.height-f)/2,s=a=0,l=u=p+1):(h=c=0,s=(p-(l=(o=Math.min(p/e.width,p/e.height))*(A=e.width)))/2,a=(p-(u=o*(f=e.height)))/2),s+=i+this.sanchor_/2,a+=i,n.drawImage(e,h,c,A,f,s,a,l,u),"circle"==this._kind&&i&&(n.beginPath(),n.strokeStyle=Kn(this._stroke.getColor()),n.lineWidth=i/4,n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.stroke()),n.restore()};var CAt=function(t){(t=t||{}).loader=this._loader,t.strategy=aa,pa.call(this,t),this.set("time",t.time||new Date),this.set("step",t.step||1)};qm(CAt,pa),function(){function t(t){var e=Math.PI/180,r=t-2451545,n=280.46+.9856474*r,i=357.528+.9856003*r;return i%=360,{lambda:(n%=360)+1.915*Math.sin(i*e)+.02*Math.sin(2*i*e),R:1.00014-.01671*Math.cos(i*e)-.0014*Math.cos(2*i*e)}}function e(t){var e=(t-2451545)/36525;return 23.43929111-e*(46.836769/3600-e*(1831e-7/3600+e*(5.565e-7-e*(1.6e-10-4.34e-8*e/3600))))}function r(t,e){var r=180/Math.PI,n=Math.PI/180,i=Math.atan(Math.cos(e*n)*Math.tan(t*n))*r,o=Math.asin(Math.sin(e*n)*Math.sin(t*n))*r;return{alpha:i+=90*Math.floor(t/90)-90*Math.floor(i/90),delta:o}}CAt.prototype._loader=function(t,e,r){var n=this.getCoordinates(this.get("time")),i=new xn([n]);i.transform("EPSG:4326",r),this.addFeature(new X(i))},CAt.prototype.setTime=function(t){this.set("time",t),this.refresh()},CAt.prototype.getSunPosition=function(n){var i=(n?new Date(n):new Date)/864e5+2440587.5,o=(18.697374558+24.06570982441908*(i-2451545))%24,s=t(i),a=e(i),l=r(s.lambda,a);return[l.alpha-15*o,l.delta]},CAt.getNightLat=function(n,i){var o=180/Math.PI,s=Math.PI/180,a=(i?new Date(i):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=t(a),h=e(a),c=r(u.lambda,h),A=15*l+n-c.alpha;return Math.atan(-Math.cos(A*s)/Math.tan(c.delta*s))*o},CAt.prototype.getCoordinates=function(n,i){for(var o=180/Math.PI,s=Math.PI/180,a=(n?new Date(n):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=[],h=t(a),c=e(a),A=r(h.lambda,c),f=this.get("step")||1,p=-180;p<=180;p+=f){var d=p,g=15*l+d-A.alpha,y=Math.atan(-Math.cos(g*s)/Math.tan(A.delta*s))*o;u.push([d,y])}switch(i){case"line":break;case"day":A.delta*=-1;default:y=A.delta<0?90:-90;for(var m=180;m>=-180;m-=f)u.push([m,y]);u.push(u[0])}if("daynight"===i){var v=[];u.forEach((function(t){v.push(t.slice())})),v[0][1]=-v[0][1],v[v.length-1][1]=-v[0][1],v[v.length-1][1]=-v[0][1],u=[u,v]}return u}}();var EAt=function(t){t=t||{},this.source=t.source,this.nodes=new pa,this.maxIteration=t.maxIteration||2e4,this.stepIteration=t.stepIteration||2e3,this.astar=!0,this.candidat=[],D.call(this),this.set("epsilon",t.epsilon||1e-6)};qm(EAt,D),EAt.prototype.weight=function(){return 1},EAt.prototype.direction=function(){return 2},EAt.prototype.getLength=function(t){return t.getGeometry&&(t=t.getGeometry()),t.getLength()},EAt.prototype.getNodeSource=function(){return this.nodes},EAt.prototype.getEdges=function(t){var e=Et(Ct([t]),this.get("epsilon")),r=[];return this.source.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r},EAt.prototype.getNode=function(t){var e=Et(Ct([t]),this.get("epsilon")),r=[];return this.nodes.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r[0]},EAt.prototype.addNode=function(t,e,r,n,i){if(this.wdist&&e>this.wdist)return!1;var o=this.getNode(t),s=e+this.getLength(new Nn([this.end,t]))*this.weight();if(this.astar&&this.wdist&&s>this.wdist)return!1;if(o){if(o!==this.arrival&&o.get("wdist")<=e)return o;o.set("dist",r),o.set("wdist",e),o.set("dtotal",s),o.set("from",n),o.set("prev",i),o===this.arrival&&(this.wdist=e),this.candidat.push(o)}else o=new X({geometry:new on(t),from:n,prev:i,dist:r||0,wdist:e,dtotal:s}),e<0?o.set("wdist",!1):this.candidat.push(o),this.nodes.addFeature(o);return o},EAt.prototype.closestCoordinate=function(t){var e=this.source.getClosestFeatureToCoordinate(t),r=e.getGeometry().getFirstCoordinate(),n=e.getGeometry().getLastCoordinate();return uut(t,r)<uut(t,n)?r:n},EAt.prototype.path=function(t,e){if(this.running)return!1;if(t=this.closestCoordinate(t),this.end=this.closestCoordinate(e),t[0]===this.end[0]&&t[1]===this.end[1])return this.dispatchEvent({type:"finish",route:[],wDistance:-1,distance:this.wdist}),!1;var r=this;return this.nodes.clear(),this.candidat=[],this.wdist=0,this.running=!0,this.addNode(t,0),this.arrival=this.addNode(this.end,-1),this.nb=0,this.dispatchEvent({type:"start"}),setTimeout((function(){r._resume()})),[t,this.end]},EAt.prototype.resume=function(){this.running||this.candidat.length&&(this.running=!0,this.nb=0,this._resume())},EAt.prototype.pause=function(){this.running&&(this.nb=-1)},EAt.prototype.getBestWay=function(){for(var t,e,r=-1,n=0;e=this.candidat[n];n++)e.get("wdist")>r&&(t=e,r=e.get("wdist"));return this.getRoute(t)},EAt.prototype._resume=function(){if(this.running){for(;this.candidat.length;){this.candidat.sort((function(t,e){return t.get("dtotal")<e.get("dtotal")?1:t.get("dtotal")===e.get("dtotal")?0:-1}));for(var t,e=this.candidat.pop(),r=e.getGeometry().getCoordinates(),n=this.getEdges(r),i=0;t=n[i];i++){if(e.get("from")!==t){var o=this.getLength(t),s=e.get("wdist")+o*this.weight(t);o=e.get("dist")+o;var a=t.getGeometry().getFirstCoordinate(),l=t.getGeometry().getLastCoordinate(),u=this.direction(t);0!==u&&(r[0]===a[0]&&r[1]===a[1]&&-1!==u&&this.addNode(l,s,o,t,e),r[0]===l[0]&&r[0]===l[0]&&1!==u&&this.addNode(a,s,o,t,e))}if(-1===this.nb||this.nb++>this.maxIteration)return this.running=!1,void this.dispatchEvent({type:"pause",overflow:-1!==this.nb});if(!(this.nb%this.stepIteration)){var h=this;return window.setTimeout((function(){h._resume()}),5),void this.dispatchEvent({type:"calculating"})}}}this.nodes.clear(),this.running=!1,this.dispatchEvent({type:"finish",route:this.getRoute(this.arrival),wDistance:this.wdist,distance:this.arrival.get("dist")})}},EAt.prototype.getRoute=function(t){for(var e=[];t;)e.unshift(t.get("from")),t=t.get("prev");return e.shift(),e};var SAt=a_,BAt=function(t,e){return[Math.round(t[0]/e)*e,Math.round(t[1]/e)*e]},IAt=eA(Z_),TAt=BAt;function PAt(t,e,r){return"FeatureCollection"===t.type?t.features.reduce((function(t,r){return PAt(r,e,t)}),r):e(r,t)}function FAt(t){return"LineString"===t.geometry.type}var LAt={compactNode:MAt,compactGraph:function(t,e,r,n){var i=(n=n||{}).progress,o=Object.keys(t).reduce((function(e,r,o,s){var a=t[r],l=Object.keys(a),u=l.length;return!(void 0!==n.compact&&!n.compact)&&(1===u?!t[l[0]][r]:2===u&&l.filter((function(e){return t[e][r]})).length===u)||(e[r]=a),o%1e3==0&&i&&i("compact:ends",o,s.length),e}),{});return Object.keys(o).reduce((function(s,a,l,u){var h=MAt(a,t,o,e,r,!1,n);return s.graph[a]=h.edges,s.coordinates[a]=h.coordinates,n.edgeDataReduceFn&&(s.reducedEdges[a]=h.reducedEdges),l%1e3==0&&i&&i("compact:nodes",l,u.length),s}),{graph:{},coordinates:{},reducedEdges:{}})}};function MAt(t,e,r,n,i,o,s){s=s||{};var a=e[t];return Object.keys(a).reduce((function(a,l){var u=function(t,e,r,n,i,o,s,a){var l=r[t][e],u=r[e][t],h=[],c=[],A=a.edgeDataSeed;for(a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][t]));!n[e];){var f=r[e];if(!f)break;var p=Object.keys(f).filter((function(e){return e!==t}))[0];if(l+=f[p],s){if(u+=r[p][e],c.indexOf(e)>=0){n[e]=r[e];break}c.push(e)}a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][p])),h.push(i[e]),t=e,e=p}return{vertex:e,weight:l,reverseWeight:u,coordinates:h,reducedEdge:A}}(t,l,e,r,n,i,o,s),h=u.weight,c=u.reverseWeight;if(u.vertex!==t&&((!a.edges[u.vertex]||a.edges[u.vertex]>h)&&(a.edges[u.vertex]=h,a.coordinates[u.vertex]=[n[t]].concat(u.coordinates),a.reducedEdges[u.vertex]=u.reducedEdge),o&&!isNaN(c)&&(!a.incomingEdges[u.vertex]||a.incomingEdges[u.vertex]>c))){a.incomingEdges[u.vertex]=c;var A=[n[t]].concat(u.coordinates);A.reverse(),a.incomingCoordinates[u.vertex]=A}return a}),{edges:{},incomingEdges:{},coordinates:{},incomingCoordinates:{},reducedEdges:{}})}var OAt=function(t,e){var r=(e=e||{}).keyFn||function(t){return t.join(",")},n=e.precision||1e-5,i=function(t,e){var r=[];return"FeatureCollection"===t.type&&(r=r.concat(t.features.filter(e))),{type:"FeatureCollection",features:r}}(t,FAt),o=IAt(i).features.reduce((function(t,i,o,s){var a=TAt(i.geometry.coordinates,n);return t[r(a)]=i.geometry.coordinates,o%1e3==0&&e.progress&&e.progress("topo:vertices",o,s.length),t}),{}),s=PAt(i,(function(t,i,o,s){return i.geometry.coordinates.forEach((function(e,o,s){if(o>0){var a=r(TAt(s[o-1],n)),l=r(TAt(e,n));t.push([a,l,i.properties])}})),o%1e3==0&&e.progress&&e.progress("topo:edges",o,s.length),t}),[]);return{vertices:o,edges:s}},kAt=LAt,NAt=eA(c_).default,{point:RAt}=ew,UAt=function(t,e){var r,n=(e=e||{}).weightFn||function(t,e){return NAt(RAt(t),RAt(e))};"FeatureCollection"===t.type?r=OAt(t,e):t.edges&&(r=t),t=r.edges.reduce((function(t,i,o,s){var a=i[0],l=i[1],u=i[2],h=n(r.vertices[a],r.vertices[l],u),c=function(r){t.vertices[r]||(t.vertices[r]={},e.edgeDataReduceFn&&(t.edgeData[r]={}))},A=function(r,n,i){t.vertices[r][n]=i,e.edgeDataReduceFn&&(t.edgeData[r][n]=e.edgeDataReduceFn(e.edgeDataSeed,u))};return h&&(c(a),c(l),h instanceof Object?(h.forward&&A(a,l,h.forward),h.backward&&A(l,a,h.backward)):(A(a,l,h),A(l,a,h))),o%1e3==0&&e.progress&&e.progress("edgeweights",o,s.length),t}),{edgeData:{},vertices:{}});var i=kAt.compactGraph(t.vertices,r.vertices,t.edgeData,e);return{vertices:t.vertices,edgeData:t.edgeData,sourceVertices:r.vertices,compactedVertices:i.graph,compactedCoordinates:i.coordinates,compactedEdges:e.edgeDataReduceFn?i.reducedEdges:null}},DAt=LAt,QAt=BAt,GAt=jAt;function jAt(t,e){if(e=e||{},t.compactedVertices||(t=UAt(t,e)),this._graph=t,this._keyFn=e.keyFn||function(t){return t.join(",")},this._precision=e.precision||1e-5,this._options=e,0===Object.keys(this._graph.compactedVertices).filter((function(t){return"edgeData"!==t})).length)throw new Error("Compacted graph contains no forks (topology has no intersections).")}jAt.prototype={findPath:function(t,e){var r=this._keyFn(QAt(t.geometry.coordinates,this._precision)),n=this._keyFn(QAt(e.geometry.coordinates,this._precision));if(!this._graph.vertices[r]||!this._graph.vertices[n])return null;this._createPhantom(r),this._createPhantom(n);var i=function(t,e,r){var n={};n[e]=0;for(var i=new SAt([[0,[e],e]],(function(t,e){return t[0]-e[0]}));i.length;){var o=i.pop(),s=o[0],a=o[2];if(a===r)return o.slice(0,2);var l=t[a];Object.keys(l).forEach((function(t){var e=s+l[t];if(!(t in n)||e<n[t]){n[t]=e;var r=[e,o[1].concat([t]),t];i.push(r)}}))}return null}(this._graph.compactedVertices,r,n);if(i){var o=i[0];return{path:(i=i[1]).reduce(function(t,e,r,n){return r>0&&(t=t.concat(this._graph.compactedCoordinates[n[r-1]][e])),t}.bind(this),[]).concat([this._graph.sourceVertices[n]]),weight:o,edgeDatas:this._graph.compactedEdges?i.reduce(function(t,e,r,n){return r>0&&t.push({reducedEdge:this._graph.compactedEdges[n[r-1]][e]}),t}.bind(this),[]):void 0}}return null},serialize:function(){return this._graph},_createPhantom:function(t){if(this._graph.compactedVertices[t])return null;var e=DAt.compactNode(t,this._graph.vertices,this._graph.compactedVertices,this._graph.sourceVertices,this._graph.edgeData,!0,this._options);return this._graph.compactedVertices[t]=e.edges,this._graph.compactedCoordinates[t]=e.coordinates,this._graph.compactedEdges&&(this._graph.compactedEdges[t]=e.reducedEdges),Object.keys(e.incomingEdges).forEach(function(r){this._graph.compactedVertices[r][t]=e.incomingEdges[r],this._graph.compactedCoordinates[r][t]=[this._graph.sourceVertices[r]].concat(e.incomingCoordinates[r].slice(0,-1)),this._graph.compactedEdges&&(this._graph.compactedEdges[r][t]=e.reducedEdges[r])}.bind(this)),t},_removePhantom:function(t){t&&(Object.keys(this._graph.compactedVertices[t]).forEach(function(e){delete this._graph.compactedVertices[e][t]}.bind(this)),Object.keys(this._graph.compactedCoordinates[t]).forEach(function(e){delete this._graph.compactedCoordinates[e][t]}.bind(this)),this._graph.compactedEdges&&Object.keys(this._graph.compactedEdges[t]).forEach(function(e){delete this._graph.compactedEdges[e][t]}.bind(this)),delete this._graph.compactedVertices[t],delete this._graph.compactedCoordinates[t],this._graph.compactedEdges&&delete this._graph.compactedEdges[t])}};var HAt=function(t){t||(t={}),null==t.typing&&(t.typing=300);var e=document.createElement("DIV"),r=(t.className||"")+" ol-scale";t.target||(r+=" ol-unselectable ol-control"),this._input=document.createElement("INPUT"),this._input.value="-",e.setAttribute("class",r),!1===t.editable&&(this._input.readOnly=!0),e.appendChild(this._input),Bl.call(this,{element:e,target:t.target}),this._input.addEventListener("change",this.setScale.bind(this)),this.set("ppi",t.ppi||96)};qm(HAt,Bl),HAt.prototype.setMap=function(t){this._listener&&k(this._listener),this._listener=null,Bl.prototype.setMap.call(this,t),t&&(this._listener=t.on("moveend",this.getScale.bind(this)))},HAt.prototype.getScale=function(){var t=this.getMap();if(t){var e=function(t,e){var r=t.getView(),n=r.getProjection(),i=r.getCenter(),o=t.getPixelFromCoordinate(i);o[1]+=1;var s=t.getCoordinateFromPixel(o);return We(dr(i,n,"EPSG:4326"),dr(s,n,"EPSG:4326"))*((e||96)/.0254)}(t,this.get("ppi"));return this._input.value=this.formatScale(e),e}},HAt.prototype.formatScale=function(t){return"1 / "+(t=t>100?100*Math.round(t/100):Math.round(t)).toLocaleString()},HAt.prototype.setScale=function(t){var e=this.getMap();e&&t&&(t.target&&(t=t.target.value),function(t,e,r){if(t&&e){var n=e;if("string"==typeof e&&((n=e.split("/")[1])||(n=e),n=n.replace(/[^\d]/g,""),n=parseInt(n)),!n)return;var i=t.getView(),o=i.getProjection(),s=i.getCenter(),a=t.getPixelFromCoordinate(s);a[1]+=1;var l=t.getCoordinateFromPixel(a),u=We(dr(s,o,"EPSG:4326"),dr(l,o,"EPSG:4326"));u*=(r||96)/.0254,i.setResolution(i.getResolution()*n/u)}}(e,t,this.get("ppi"))),this.getScale()};var zAt=function(t){Zc.call(this,t)};qm(zAt,Zc),zAt.prototype.getExtent=function(){return this.getSource().getExtent()};var VAt=function(t){var e={attributions:t.attributions,logo:t.logo,projection:t.projection};this._image=t.image?t.image:new Image,this._image.crossOrigin=t.crossOrigin;var r=this;this._image.onload=function(){r.setCrop(r.crop),r.changed()},t.image||(this._image.src=t.url),e.canvasFunction=this.calculateImage,tU.call(this,e),this.center=t.imageCenter,this.setScale(t.imageScale),this.rotate=t.imageRotate?t.imageRotate:0,this.crop=t.imageCrop,this.mask=t.imageMask,this.setCrop(this.crop),this.on("change",function(){this.set("extent",this.calculateExtent())}.bind(this))};qm(VAt,tU),VAt.prototype.calculateImage=function(t,e,r,n){if(this.center){var i=document.createElement("canvas");i.width=n[0],i.height=n[1];var o=i.getContext("2d");if(!this._imageSize)return i;if(this.mask){o.beginPath();var s=f(this.mask[0]);o.moveTo(s[0],s[1]);for(var a=1;a<this.mask.length;a++)s=f(this.mask[a]),o.lineTo(s[0],s[1]);o.clip()}var l=f(this.center),u=(this._image.naturalWidth/2-this.crop[0])*this.scale[0]/e*r,h=(this._image.naturalHeight/2-this.crop[1])*this.scale[1]/e*r,c=this._imageSize[0]*this.scale[0]/e*r,A=this._imageSize[1]*this.scale[1]/e*r;return o.translate(l[0],l[1]),this.rotate&&o.rotate(this.rotate),o.drawImage(this._image,this.crop[0],this.crop[1],this._imageSize[0],this._imageSize[1],-u,-h,c,A),i}function f(e){return[(e[0]-t[0])/(t[2]-t[0])*n[0],(e[1]-t[3])/(t[1]-t[3])*n[1]]}},VAt.prototype.getCenter=function(){return this.center},VAt.prototype.setCenter=function(t){this.center=t,this.changed()},VAt.prototype.getScale=function(){return this.scale},VAt.prototype.setScale=function(t){switch(typeof t){case"number":t=[t,t];break;case"object":if(2!=t.length)return;break;default:return}this.scale=t,this.changed()},VAt.prototype.getRotation=function(){return this.rotate},VAt.prototype.setRotation=function(t){this.rotate=t,this.changed()},VAt.prototype.getGeoImage=function(){return this._image},VAt.prototype.getCrop=function(){return this.crop},VAt.prototype.setMask=function(t){this.mask=t,this.changed()},VAt.prototype.getMask=function(){return this.mask},VAt.prototype.setCrop=function(t){if(this._image.naturalWidth){if(t){switch(typeof t){case"number":t=[t,t,this._image.naturalWidth-t,this._image.naturalHeight-t];break;case"object":if(4!=t.length)return;break;default:return}t=Ct([[t[0],t[1]],[t[2],t[3]]]),this.crop=[Math.max(0,t[0]),Math.max(0,t[1]),Math.min(this._image.naturalWidth,t[2]),Math.min(this._image.naturalHeight,t[3])]}else this.crop=[0,0,this._image.naturalWidth,this._image.naturalHeight];this.crop[2]<=this.crop[0]&&(this.crop[2]=this.crop[0]+1),this.crop[3]<=this.crop[1]&&(this.crop[3]=this.crop[1]+1),this._imageSize=[this.crop[2]-this.crop[0],this.crop[3]-this.crop[1]],this.changed()}else this.crop=t},VAt.prototype.getExtent=function(t){var e=this.get("extent");if(e||(e=this.calculateExtent()),t)for(var r=0;r<t.length;r++)t[r]=e[r];return e},VAt.prototype.calculateExtent=function(t){var e;if(!1!==t&&this.getMask())e=new xn([this.getMask()]);else{var r=this.getCenter(),n=this.getScale(),i=this.getGeoImage().width*n[0],o=this.getGeoImage().height*n[1];(e=Cn(Ct([[r[0]-i/2,r[1]-o/2],[r[0]+i/2,r[1]+o/2]]))).rotate(-this.getRotation(),r)}return e.getExtent()};const KAt=Object.freeze(Object.defineProperty({__proto__:null,ArcGisFeatureServiceLayer:class extends bAt{constructor(t,r){super(t,r),e(this,"queryParams"),e(this,"isLoading"),e(this,"defaultExtent"),this.layertype="ArcGisFeatureServiceLayer",this.isLoading=!1,this.queryParams={f:"json",where:"1=1",outFields:"*",returnGeometry:"true",spatialRel:"esriSpatialRelIntersects",geometryType:"esriGeometryEnvelope",inSR:"102100",outSR:"102100",extent:null,extentWkid:"102100",onlyField:"OBJECTID",autoShowFeature:!1},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t={}){try{this.isLoading=!0;let e,r=this,n=this.option.url+"/query/",i=new Lut,o=Object.assign({},this.queryParams,t),s="";if(o.feature){let t=o.feature.getGeometry(),e=t.getType();if("Polygon"===e||"MultiPolygon"===e){let r=t;"Polygon"===e?r.getLinearRing(0):r.getLinearRings(),s=`{"rings":${JSON.stringify(r.getCoordinates())},"spatialReference":{"wkid":102100}}`}o.geometryType="esriGeometryPolygon",delete o.feature,delete o.extent,delete o.extentWkid}else o.extent&&("4326"===o.extentWkid&&(o.extent=gr(o.extent,"EPSG:4326","EPSG:3857")),delete o.extent,delete o.extentWkid,o.geometryType="esriGeometryEnvelope",s=`{"xmin":${o.extent[0]},"ymin":${o.extent[1]},"xmax":${o.extent[2]},"ymax":${o.extent[3]},"spatialReference":{"wkid":102100}}`);""!==s?e=Object.assign({},o,{geometry:s}):this.defaultExtent&&(o.geometryType="esriGeometryEnvelope",e=Object.assign({},o,{geometry:`{"xmin":${this.defaultExtent[0]},"ymin":${this.defaultExtent[1]},"xmax":${this.defaultExtent[2]},"ymax":${this.defaultExtent[3]},"spatialReference":{"wkid":102100}}`}));let a=!1;fetch(`${n}?${new URLSearchParams(e)}`).then((t=>t.json())).then((t=>{const e=i.readFeatures(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(o.onlyField)===e.get(o.onlyField)}))||t.push(e)})),r.addFeatures("arcgisFeature",t),r.trigger(Cm.onFeaturesLoad,e)}})).catch((t=>{a||(a=!0)})).finally((()=>{this.isLoading=!1}))}catch(FX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},ArcGisMapServerLayer:EU,ArcGisTileXyzLayer:CU,ClusterImageLayer:class extends GO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.styleCache={},this.layertype="ClusterImageLayer",this.option={distance:40,imageFieldName:"主照片地址",animationDuration:600,maxResolution:40},this.option=Object.assign({},this.option,r),this._source=new pa,this.clusterSource=new KO({distance:this.option.distance,source:this._source}),this.layer=new _ut({source:this.clusterSource,animationDuration:this.option.animationDuration,maxResolution:this.option.maxResolution,renderOrder:function(t,e){return e.getGeometry().getExtent()[1]-t.getGeometry().getExtent()[1]},style:(t,e)=>this.getFeatureStyle(t,e,"")}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype),this.selectCluster=new Th({layers:[this.layer],condition:pu,style:(t,e)=>this.getFeatureStyle(t,e,"sel")}),this.selectCluster.setActive(!0),this.selectCluster.getFeatures().on(["add"],(t=>{let e=t.target.getArray()[0].get("features");e&&this.trigger(Cm.onFeatureSelected,e)})),this.selectCluster.getFeatures().on(["remove"],(function(t){}))}addFeaturesMN(t,e){var r,n,i,o;let s=t.getView().calculateExtent(t.getSize()),a=[];for(let l=0;l<e;++l)a[l]=new X(new on([s[0]+(s[2]-s[0])*Math.random(),s[1]+(s[3]-s[1])*Math.random()])),a[l].set("id",l),a[l].set("name","123123"),a[l].set("classname",l),a[l].set("thumbnail","");null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.clear(),null==(o=null==(i=this.clusterSource)?void 0:i.getSource())||o.addFeatures(a)}getFeatureStyle(t,e,r){let n,i=t.get("features")[0].get("uuid"),o=t.get("features")[0],s=t.get("features").length,a=o.get(this.option.imageFieldName);if(a=a.replace("_sss","_s"),n||(this.styleCache[i]=n=new Vi({image:new xAt({src:a,radius:20,crop:!0,kind:s>1?"folio":"square",shadow:!0,onload:function(){try{t.changed()}catch{}},stroke:new Rn({width:2,color:"sel"===r?"rgba(0, 255, 0,1)":"#fff"})})})),s>1){let t=new Vi({image:new Ri({points:12,radius:9,fill:new Fn({color:"rgba(0, 255, 0,0.3)"})}),text:new Wi({text:s.toString(),font:"bold 12px helvetica,sans-serif",fill:new Fn({color:"#000"})})}),e=t.getImage().getAnchor();return e[0]-=20,e[1]+=20,[n,t]}return[n]}appendTo(t){var e,r;this._map=t,this.selectCluster&&(null==(e=this._map)||e.addInteraction(this.selectCluster)),this.layer&&(null==(r=this._map)||r.addLayer(this.layer))}},ClusterLayer:class extends GO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.option={convexhull:!0,animatesel:!0,haslink:!0,distance:40,popupInfo:"",popupOption:{offset:[0,0]},levelColor:[{maxnum:5e3,strokecolor:"rgba(192,0,0,0.5)",strokewidth:15,fillcolor:"rgba(192,0,0,1)"},{maxnum:1e3,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(255,165,0,1)"},{maxnum:500,strokecolor:"rgba(255,128,0,0.5)",strokewidth:15,fillcolor:"rgba(255,128,0,1)"},{maxnum:100,strokecolor:"rgba(0,191,255,0.5)",strokewidth:15,fillcolor:"rgba(0,191,255,1)"},{maxnum:50,strokecolor:"rgba(139,0,139,0.5)",strokewidth:15,fillcolor:"rgba(139,0,139,1)"},{maxnum:2,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(\t255,165,0,1)"}]},this.option=Object.assign({},this.option,r),this.styleCache={},this.layertype="ClusterLayer",this.clusterSource=new KO({distance:this.option.distance,source:this._source}),this.layer=new _ut({zIndex:this.option.zIndex,source:this.clusterSource,style:this.getStyle.bind(this)}),this.layer.set("layerid",t);let n=new Di({radius:5,stroke:new Rn({color:"rgba(0,255,255,1)",width:1}),fill:new Fn({color:"rgba(0,255,255,0.3)"})}),i=new Vi({image:n}),o=new Vi({image:n,stroke:new Rn({color:"#fff",width:1})});this.selectCluster=new but({layers:[this.layer],condition:pu,pointRadius:7,animate:this.option.animatesel,featureStyle:()=>[this.option.haslink?o:i],style:(t,e)=>{let r=t.get("features");if(r){if(r.length>1){let n=[this.getStyle(t,e)];if(this.option.convexhull&&xut){let t=[];for(let n=0;n<r.length;n++)t.push(r[n].getGeometry().getFirstCoordinate());let e=xut(t);n.push(new Vi({stroke:new Rn({color:"rgba(0,0,192,0.5)",width:2}),fill:new Fn({color:"rgba(0,0,192,0.3)"}),geometry:new xn([e]),zIndex:100}))}return n}return[new Vi({image:new Di({radius:5,stroke:new Rn({color:"rgba(255,0,0,0.5)",width:10}),fill:new Fn({color:"rgba(255,0,0,1)"})}),text:new Wi({text:r[0].getProperties().name,font:"13px Microsoft YaHei",offsetY:-15,fill:new Fn({color:"#8B4513"}),stroke:new Rn({color:"#fff",width:2})})})]}}}),this.selectCluster.getFeatures().on(["add"],(t=>{t.target.getArray()[0].get("features")})),this.selectCluster.getFeatures().on(["remove"],(function(t){})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}appendTo(t){var e;this._map=t,this._map.addInteraction(this.selectCluster),this.layer&&(null==(e=this._map)||e.addLayer(this.layer))}showTitle(t,e){new Promise(((r,n)=>{this._source.getFeatures().forEach((r=>{let n=r.getProperties();if(t===n.dataType)try{r.getStyle().getText().setText(e?r.get("name"):"")}catch(FX){}})),this.layer.changed()}))}addFeaturesMN(t,e){var r,n;let i=t.getView().calculateExtent(t.getSize()),o=[];for(let s=0;s<e;++s)o[s]=new X(new on([i[0]+(i[2]-i[0])*Math.random(),i[1]+(i[3]-i[1])*Math.random()])),o[s].set("id",s),o[s].set("name","123123"),o[s].set("classname",s);null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.addFeatures(o)}getStyle(t,e){let r=t.get("features").length,n=this.styleCache[r];return 1===r?n=this.styleCache[r]=t.get("features")[0].getStyle():n||(this.option.levelColor.sort((function(t,e){return t.maxnum-e.maxnum})),this.option.levelColor.forEach((t=>{let e=Math.max(8,Math.min(.75*r,20));r>=t.maxnum&&(n=this.styleCache[r]=new Vi({image:new Di({radius:e,stroke:new Rn({color:t.strokecolor,width:t.strokewidth,lineCap:"butt"}),fill:new Fn({color:t.fillcolor})}),text:new Wi({text:r.toString(),fill:new Fn({color:"#fff"})})}))}))),n}},DayNightLayer:class extends GO{constructor(t,e){super(t,e),this.layertype="DayNightLayer",this._source=new CAt({}),this.layer=new ta({source:this._source,zIndex:500,style:new Vi({image:new Di({radius:5,fill:new Fn({color:"red"})}),fill:new Fn({color:[0,0,50,.5]})})}),this.layer.set("layerid",t),this._source.on("addfeature",(t=>{}))}setDataTime(t){this._source.setTime(t)}},DivLayer:class extends Im{constructor(t,r){super(t,r),e(this,"DivGraphicList"),this.layertype="DivLayer",this.layerid=t,this.DivGraphicList=[],this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.layerid===t&&this.DivGraphicList.length>0&&this.removeAll()}))}getDivList(){return this.DivGraphicList}addDiv(t){this.DivGraphicList.push(t),this._map.addOverlay(t)}removeDiv(t){this._map.removeOverlay(t),this.DivGraphicList.forEach(((e,r,n)=>{if(e===t)return this.DivGraphicList.slice(r,1),void this.trigger(Cm.onFeatureDeleted,{value:e})}))}removeAll(){this.DivGraphicList.forEach((t=>{this._map.removeOverlay(t),this.trigger(Cm.onFeatureDeleted,{element:t})})),this.DivGraphicList=[]}appendTo(t){this._map=t}},GeoImageLayer:class extends xU{constructor(t,r){super(t,r),e(this,"GraphicLayer"),e(this,"graphic");let n={imageCenter:[0,0],imageScale:[1,1],imageRotate:0,imageMask:null,ImageExtentWKID:Lm.EPSG3857,opacity:1,hashEdit:!1};this.option=Object.assign({},n,this.option),this.GraphicLayer=null,this.graphic=null,this.option.ImageExtentWKID===Lm.EPSG4326&&(this.option.imageCenter=hr(this.option.imageCenter)),this.layertype="GeoImageLayer",this.layerSource=new VAt({url:this.option.url,imageMask:this.option.imageMask,imageCenter:this.option.imageCenter,imageScale:this.option.imageScale,imageRotate:Number(this.option.imageRotate*Math.PI/180)}),this.layer=new zAt({source:this.layerSource,opacity:this.option.opacity}),this.layer.set("layerid",t),this.layerSource.on("imageloadend",(t=>{this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.trigger(this.EventType.LayerEventType.tileloadend,t)})),this.layerSource.on("change",(t=>{this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent())})),this.layerSource.on("tileloaderror",(function(){})),this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.GraphicLayer&&this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}))}getAttribute(){return this.option}startEdit(t){this.option.hashEdit=!0,this.GraphicLayer=t,this.graphic?this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic):this.setExtent()}endEdit(){this.option.hashEdit=!1,this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}setExtent(){this.graphic||(this.graphic=new cv({graphicType:"PolygonGraphic",style:{stroke:{color:"rgba(255, 0, 0,0)",width:0},fill:{color:"rgba(255, 0, 0,0)"},zIndex:800},attribute:{name:this.layerid+"_graphic",movestate:!1,editallows:!1}}),this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic),this.graphic.set("Scale",this.option.imageScale),this.graphic.on("onRotating",(t=>{this.option.imageRotate=t.data,this.layerSource.setRotation(t.data)})),this.graphic.on("onScaling",(t=>{this.option.imageScale=[t.data,t.data],this.layerSource.setScale(t.data)})),this.graphic.on("onMoveing",(t=>{this.option.imageCenter=t.data,this.layerSource.setCenter(t.data)})))}setScale(t){this.graphic.set("Scale",t),this.layerSource.setScale(t)}computeAutoScale(t){let e=jt(t)/jt(this.layerSource.getExtent());this.graphic.set("Scale",[e,e]),this.layerSource.setScale([e,e])}getGraphic(){return this.graphic}},GraphicImageLayer:jO,GraphicLayer:bAt,HeatmapLayer:class extends GO{constructor(t,e){super(t,e),this.layertype="HeatmapLayer",this._source=new pa({wrapX:!1}),this.option={blur:25,radius:8,gradient:["#00f","#0ff","#0f0","#ff0","#f00"]},this.option=Object.assign({},this.option,e),this.layer=new jc({source:this._source,zIndex:this.option.zIndex,gradient:this.option.gradient,blur:this.option.blur,radius:this.option.radius}),this.layer.set("layerid",t)}setBlur(t){this.layer.setBlur(parseInt(t,10))}setRadius(t){this.layer.setRadius(parseInt(t,10))}},ImageCanvasLayer:class extends Im{constructor(t,r){if(super(t,r),e(this,"scale"),e(this,"ppi"),e(this,"layerOption"),e(this,"drawText"),this.option={},this.layerOption={line1Style:"rgba(255,0,0, 0.1)",line1Width:.5,line5Style:"rgba(255,0,0, 0.3)",line5Width:1,line10Style:"rgba(255,0,0, 0.5)",line10Width:2,lineRectStyle:"rgba(255, 0, 0, 1)",lineRectWidth:5},this.layerOption=Object.assign({},this.layerOption,r),this.layertype="ImageCanvasLayer",this.layer=new Zc({zIndex:r.zIndex}),!document.getElementById("hutia")){let t=document.createElement("div");t.setAttribute("id","hutia"),t.style.width="1cm",document.body.appendChild(t)}this.layer.setSource(new tU({canvasFunction:(t,e,r,n,i)=>{let o=document.createElement("canvas");this.trigger(Cm.onScaleChange,{Scale:Math.round(this.scale.getScale())});let s=this._map.getSize(),a=new Array(2);a[0]=n[0]-s[0],a[1]=n[1]-s[1],o.width=n[0],o.height=n[1],a[0]=0,a[1]=0;const l=this.ppi/2.54/10;let u=a[0]/2,h=a[1]/2,c=o.width-a[0],A=o.height-a[1],f=o.getContext("2d");f.clearRect(u,h,c,A);let p=0;for(let d=h;d<o.height-h;d+=l)f.beginPath(),f.moveTo(u,d),f.lineTo(o.width-u,d),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;p=0;for(let d=u;d<o.width-u;d+=l)f.beginPath(),f.moveTo(d,h),f.lineTo(d,o.height-h),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;return f.lineWidth=this.layerOption.lineRectWidth,f.strokeStyle=this.layerOption.lineRectStyle,f.strokeRect(u,h,c,A),o}})),this.layer.set("layerid",t),this.layer.on(Cm.onClick,(t=>{t.feature&&this.trigger(Cm.onClick,t.feature.getProperties())}))}setScale(t){this.scale.setScale(t)}setText(t){this.drawText.updateHtml(t)}setElementStyle(t,e){this.drawText.updateElementStyle(t,e)}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0);let r=document.getElementById("hutia").offsetWidth,n=screen.width/r,i=screen.height/r,o=Math.round(Math.sqrt(n*n+i*i)/2.54);this.ppi=Math.sqrt(window.screen.width*window.screen.width+window.screen.height*window.screen.height)/o,this.ppi=Math.round(this.ppi),this.scale=new HAt({}),this.scale.set("ppi",this.ppi),this.scale.set("Visible",!1),this._map.addControl(this.scale),this.drawText=new eut({}),this._map.addControl(this.drawText),this._map.getView().on("change",(t=>{this.layer.getSource().changed()})),document.querySelector(".ol-scale").style.display="none"}setMouseLock(t=!1){let e,r;this._map.getInteractions().forEach((function(n){n instanceof bu&&(e=n),n instanceof ju&&(r=n),e&&e.setActive(t),r&&r.setActive(t)}))}},PathLayer:class extends Im{constructor(t,r){super(t,r),e(this,"autoPointSize"),e(this,"result"),e(this,"resultlayer"),e(this,"resultSource"),e(this,"nodesLayer"),e(this,"dijkstra"),e(this,"pathDatalayer"),e(this,"animating"),e(this,"distance"),e(this,"lastTime"),e(this,"pathLine"),e(this,"position"),e(this,"geoMarker"),e(this,"styles"),e(this,"vueThis"),e(this,"pathLineFeature"),e(this,"lastAngle"),e(this,"pathIndex"),e(this,"pathNodeInfo"),e(this,"geoMarkerCircle"),e(this,"moveNodeInfo"),e(this,"FeatureMoveProgressInfo"),e(this,"oldPathLineFeature"),e(this,"routeFeatures"),e(this,"_source"),e(this,"multiLinePathData"),e(this,"timer"),e(this,"fun",(t=>{this.vueThis.moveFeature(t)})),this.option=$m.merge({roadNetworkData:"",pathDefaultStyle:{color:"rgba(255, 255, 255, 0.1)",width:1},pathStyle:{color:"#089519",width:10,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACISURBVDhP3Yy9CYAwFIQzg+ASTuFmuokjuIaFpb2Vc8S7vEswKFE78YOD5H6e+zne+xqq9H0Hhj0U6WU/gwPbZTw7gmJn/UvKR1iwXmKRjlwfYWB5gsNGKh+hYX4ijBUzLx/BZzUvkI0j9JRFNkUhHM3zE3QaR5hBM4tgkG3AaPW85U338zi3A+g3FErF6/qjAAAAAElFTkSuQmCC"},trackPathStyle:{color:"rgba(180,205,205, 1)",width:10},geoMarkerStyle:{url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAlCAYAAABGWhk4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABYgAAAWIBXyfQUwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAYGSURBVEiJlZdvaFvXFcB/7+mPI8lvjmxHil0vKkuq1bCuYbVsQrDxFup9aSAezA5pExpGRh26hdF0FOIv+9CyrLCh7dvABARmyIWB6Qad69Ik1PH8h67E0C6anbqTI8myZUeWZE1/nu4+6D7n2VZpcuCgq/vu/d37zjvn3HMVIQS1RFEUxWiaFECYFPE1AGtN6iNRAYv8VWVfRaouf2tKTbDcrQG1AXbZRgKLprGVWrtW93ZIqCJBdsAB1Mfj8d/H4/F3gXrZZyymmMz2SIQQu1RCrYATaAKeDoVC54WUUCh0HnhaPnPKscpejmJ+C5MJrMABQAMOpjY2xgpW13cB6sq5e02NjQPAQyAD/A8oA7tMstcUe8Gu8fHxM41ud/u1Ww/Ua7ceqI1ud/v4+PgZwCXHWOWc3ebYYwKLHOwGfG1tbV2ZbG51IZnT1bdnhfr2rFhI5vRMNrfa1tbWBfjk2AOGvQ2eecfm3dYBznA4fKHe5fS8MbmiVgRUBLwxuaLWu5yecDh8Qdq4rtauVZNtjY9mBxx9fX0tL3QEXv3wyy0xcT+9s/rE/TQffrklXugIvNrX19fCIw+xYvIQ1QRVzeBgMPia3W5zvPlRdJ8rvflRVLHbbY5gMPjaHrBqwC01TOC6evVq++DZs78JLaTUqWiWn//Aw7s/ahOXjh/icL1d+WI9j9OmKj9sb3t2e3t74s6dOymgxKNo3Oe3h4BjiURiUgghbi5vGe4r1lOp5fVUatn4bzxLJBKTwDE5d8evDTvbqEaUd2xsbNCYXNb10szMzGh/f//LwIvAi/39/S/PzMyMlnW9ZIwbGxsbBLySYTO+3S7ww4dbt4QQIrm29unQ0NArQC/QA3RL7QF6h4aGXkmurX0qhBDp9NYne8H7XGx+fv58Op22njp16pb8KCpAIBCoB5ibm8vKb1gBihMTEz1ut7sQCAT+AuSoJqiyERRGYLiohrHW0NDQEA6Hf+L3+497PJ5jLpfLC5DL5VaTyeRiJBL5bHBw8K/pdDpNNbS3gG2qIa4jd+sAGoEjwPeHh4cvbm5uLgqTFPWKKOoVc5fY3NxcHB4evgg8J+c2SpZVka9bJ+1z8ObNmxd7enp+pSiK9at0kd9Nx5mN5VhIbgPwnMdJZ6uLX59owddgRwhRvn379h96e3tvUE1MWaBgkVAHoF2/fr3r3Llzv1UUxfrnf63R/94iUytZYtkSugBdQCxbYi6eY+SzdZqcVjpaXKrP5+tyOp1zk5OTCaqZTleAbwGa3+9vnZ+ff0/TNN+f5lb55cR/9wZcTflj3xF+EfCSyWS+6ujo+GkkEokBmZ0UOTo6ekHTNN/iZoG3Pl55LCjAWx+vsLhZQNM03+jo6AXpBNad/NDa2noc4J2pGNulrz0j98l2qcI7UzEAJMNugC2A1e12Pwvwzwe5x4YaYsyRDCtgUQF1YGCg2eFwNGeKOvdS+ScG30vlyRR1HA5H88DAQDOgqoCIRqMFIYSos6jY1P0H7jeJTVWos6gIIUQ0Gi0AQgUq09PTW7lcbsVuUXje63xi8PNeJ3aLQi6XW5ment4CKirV8CttbGz8G6DniPbEYGOOZJQAXaXq0MVIJDIFcO1kC09p9seGPqXZuXayBQDJ2ElCGtVwbkwkEiNer7frH/fTvBT+D+VK7YLREKuq8LfBZ/jxdxpYXV2dOXz48M+ADSBrLvjUeDx+9/Tp02f8zc66l545yJ2VLMntck3o9w45+PtZP93f1iiVSpnLly8PLSwsJKhmuAJUE7OL6tFydGRk5FI+n08KIUShrIvQ3XXx+gfL4sSNz8WJG5+L1z9YFqG766JQ1oUQQuTz+eTIyMgl4KhkuCRzp/jTAA9wtLu7++TS0tL74htkaWnp/e7u7pMS6pEMO2CpdfQfoJrtXMFgsKOzs7OztbW1vampyQ+QSqUisVjsi9nZ2dkrV67MUz018lQTfBFZxylCiFr1sI1qOq1jd80A1SOpLCEFqSVMx78QQuxUmya4sYBFAo22+aqgSy2b2hVMFWetMtasxkK17iDGlWHnTmIuY/8P3C0FYo4OztIAAAAASUVORK5CYII="},navigationOption:{defaultZoom:15,turnToZoom:17,speed:1,tracking:!0,trackingDirection:!0,showNode:!0,showStartEndNode:!0,showPathLine:!0,scale:1,pointDistance:.5}},r,!0),this.layertype="PathLayer",this._source=new pa({wrapX:!1,url:this.option.roadNetworkData,format:new Df}),this._source.on("featuresloadend",(t=>{let e=[];t.features.forEach((t=>{let r=t.getGeometry();e.push(r.getCoordinates())})),this.multiLinePathData=new X({geometry:new th(e)})}));let n=[];this.pathDatalayer=new ta({source:this._source,zIndex:900,style:new Vi({stroke:new Rn({width:this.option.pathDefaultStyle.width,color:this.option.pathDefaultStyle.color}),fill:new Fn({color:this.option.pathDefaultStyle.color})})}),this.vueThis=this,this.styles={route:new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]})}),icon:new Vi({image:new Us({anchor:[.5,1],src:"data/icon.png"})}),geoMarker:new Vi({zIndex:999,image:new Us({src:this.option.geoMarkerStyle.url,rotation:0,rotateWithView:!1})})},this.resultSource=new pa,this.resultlayer=new ta({source:this.resultSource,zIndex:200,updateWhileAnimating:!0,updateWhileInteracting:!0}),this.position=new on([0,0]),this.geoMarker=new X({geometry:this.position}),this.geoMarker.setStyle(this.styles.geoMarker),this.resultSource.addFeature(this.geoMarker),this.resultlayer.on("change",(t=>{})),this.dijkstra=new EAt({source:this._source}),this.dijkstra.on("start",(t=>{this.resultSource.clear()})),this.dijkstra.on("finish",(t=>{if(this.resultSource.clear(),!t.route.length)return void this.trigger(Cm.onPathComputerComplete,{pathLine:null,distance:0});if(this.routeFeatures=t.route,this.pathNodeInfo=NO.lineMerger(t.route,this.option.navigationOption.pointDistance),this.pathLineFeature=this.pathNodeInfo.line,this.pathLine=this.pathLineFeature.getGeometry(),this.option.navigationOption.totalDistance=Ye(this.pathLine)*this.option.navigationOption.scale,this.option.navigationOption.showNode){let t=0;this.pathLine.forEachSegment(((e,r)=>{let n=new X({geometry:new on(e)});n.setStyle(new Vi({image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:t.toString(),font:"12px sans-serif",fill:new Fn({color:"white"})})})),t++,this.resultSource.addFeature(n)}))}this.position.setCoordinates(this.pathLine.getFirstCoordinate()),this.setNavigationMarker(this.pathLine.getFirstCoordinate(),0),this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom)),this.geoMarkerCircle=new X({geometry:new Zu(this.pathLine.getFirstCoordinate(),50)}),this.oldPathLineFeature=new X({geometry:new Nn([this.pathLine.getFirstCoordinate()])}),this.oldPathLineFeature.setStyle(new Vi({stroke:new Rn({color:this.option.trackPathStyle.color,width:this.option.trackPathStyle.width})})),this.pathLineFeature.setStyle(this.styleFunc.bind(this)),this.geoMarkerCircle.setStyle(new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]}),fill:new Fn({color:"rgba(255, 255, 255, 0.1)"})})),this.option.navigationOption.showPathLine&&(this.resultSource.addFeature(this.geoMarker),this.resultSource.addFeature(this.oldPathLineFeature),this.resultSource.addFeature(this.pathLineFeature));let e=Ye(this.pathLineFeature.getGeometry());this.trigger(Cm.onPathComputerComplete,{pathLine:this.pathLineFeature,distance:e})})),this.dijkstra.on("pause",(t=>{t.overflow&&this.dijkstra.resume()})),this.dijkstra.on("calculating",(t=>{let e=this.dijkstra.getBestWay();this.resultSource.clear(),this.resultSource.addFeatures(e)})),this.nodesLayer=new ta({source:this.dijkstra.getNodeSource(),style:new Vi({image:new Di({radius:5,fill:new Fn({color:[255,0,0,.1]})})})}),n.push(this.nodesLayer),n.push(this.resultlayer),n.push(this.pathDatalayer),this.layer=new Da({layers:n}),this.layer.set("layerid",t),this.animating=!1,this.distance=0,this.lastTime}styleFunc(t,e){let r=[];r.push(new Vi({stroke:new Rn({color:this.option.pathStyle.color,width:this.option.pathStyle.width})}));const n=t.get("geometry");if("linestring"===n.getType().toLowerCase()){const t=n.getCoordinates(),i=n.getLength(),o=80*e,s=Math.ceil(i/o);for(let e=1;e<s;e++){const t=e/s,i=n.getCoordinateAt(t),o=n.getCoordinateAt(t+.05*t),a=o[0]-i[0],l=o[1]-i[1],u=Math.atan2(l,a);r.push(new Vi({geometry:new on(i),image:new Us({scale:.8,rotateWithView:!0,rotation:-u,src:this.option.pathStyle.imageUrl})}))}this.option.navigationOption.showStartEndNode&&(r.push(new Vi({geometry:new on(t[0]),image:new Di({radius:12,fill:new Fn({color:"green"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"起",font:"12px sans-serif",fill:new Fn({color:"white"})})})),r.push(new Vi({geometry:new on(t[t.length-1]),image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"终",font:"12px sans-serif",fill:new Fn({color:"white"})})})))}return r}moveFeature(t){this.resultlayer.changed();const e=t.frameState.time,r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,this.trigger(Cm.onFeatureMoveProgress,{progress:this.distance,distance:this.distance,elapsedTime:r}),this.distance>=1)this.stopAnimation();else{const e=this.pathLine.getCoordinateAt(this.distance);let n,i=(this.distance+this.option.navigationOption.speed*r/1e6)%2;n=i>=1?this.pathLine.getLastCoordinate():this.pathLine.getCoordinateAt(i);let o=this.setAngle(e,n);this.position.setCoordinates(e),this.option.navigationOption.tracking?(this._map.getView().setCenter(e),this._map.getView().setRotation(o.viewAngle)):this.styles.geoMarker.getImage().setRotation(o.markAngle);const s=function(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");var e=t.inversePixelTransform[0],r=t.frameState,n=pt(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),i=Ks(r.viewState.resolution,e);return new bs(t.context,e,r.extent,n,r.viewState.rotation,i,void 0)}(t);s.setStyle(this.styles.geoMarker),s.drawGeometry(this.position),this._map.render()}}setAngle(t,e){let r=e[1]-t[1],n=e[0]-t[0],i=1,o=Math.atan(r/n);r<=0&&n>=0?(i=2,o=-o):n>=0&&r>=0?(o=-o,i=1):n<=0&&r>=0?(o=Math.PI-o,i=4):n<=0&&r<=0&&(o=Math.PI-o,i=3);let s=Math.atan2(1,0);return{viewAngle:-s-o,markAngle:s+o,Angle:s-Math.atan2(r,n),xx:i}}startAnimation(t=!0,e=!0,r=10){this.lastAngle=0,this.distance=0,this.animating=!0,this.lastTime=Date.now(),this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(15),this.resultlayer.addEventListener("postrender",this.fun)}pauseAnimation(){this.resultlayer.removeEventListener("postrender",this.fun)}resumeAnimation(){this.resultlayer.addEventListener("postrender",this.fun)}stopAnimation(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),this.resultlayer.removeEventListener("postrender",this.fun)}startAnimation2(t){clearInterval(this.timer),t&&(this.option.navigationOption=Object.assign({},this.option.navigationOption,t)),this.distance=0,this.animating=!0,this.lastTime=Date.now(),this.pathNodeInfo.nodeData.length>3?this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[2]}:this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[1]},this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom),this._map.getView().setRotation(this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)).viewAngle)),this.oldPathLineFeature.getGeometry().setCoordinates([this.pathLine.getFirstCoordinate()]),this.pathIndex=0,this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.pathIndex/this.pathNodeInfo.coordinates.length,remainingDistance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*(this.pathIndex/this.pathNodeInfo.coordinates.length),nextNodeDistance:this.moveNodeInfo.currentNode.distance*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:this.ComputDirection()},this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),1)}stopAnimation2(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),clearInterval(this.timer)}pauseAnimation2(){clearInterval(this.timer)}resumeAnimation2(){this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),100)}moveFeature3(t){const e=(new Date).getTime(),r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,t>=this.pathNodeInfo.coordinates.length)this.stopAnimation2();else{const e=hr(this.pathNodeInfo.coordinates[t]);this.oldPathLineFeature.getGeometry().appendCoordinate(e),this.oldPathLineFeature.getGeometry().changed();let r=Ye(new Nn([e,hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale;if(this.position.setCoordinates(e),this.geoMarker.getGeometry().setCoordinates(e),this.geoMarkerCircle.getGeometry().setCenter(e),this.FeatureMoveProgressInfo.nodeNum=this.moveNodeInfo.currentNode.coordIndex,this.FeatureMoveProgressInfo.nextNodeDistance=r,this.FeatureMoveProgressInfo.progress=t/this.pathNodeInfo.coordinates.length,this.FeatureMoveProgressInfo.remainingDistance=this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.FeatureMoveProgressInfo.progress,r<=1*this.option.navigationOption.speed){let t=this.moveNodeInfo.currentNode.coordIndex+1;if(t<this.pathNodeInfo.nodeData.length-1){this.moveNodeInfo.currentNode=this.pathNodeInfo.nodeData[t],this.moveNodeInfo.nextNode=this.pathNodeInfo.nodeData[t+1],t<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[t+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):this.FeatureMoveProgressInfo.angle="直行";let e=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(e.viewAngle):this.styles.geoMarker.getImage().setRotation(e.markAngle)}}this.trigger(Cm.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.option.navigationOption.tracking&&this._map.getView().setCenter(e)}}moveFeature2(){const t=(new Date).getTime(),e=t-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*e/1e6)%2,this.lastTime=t,this.distance>=1)this.stopAnimation2();else{const t=this.pathLine.getCoordinateAt(this.distance);let r,n=Ye(new Nn([t,hr(this.moveNodeInfo.nextNode.coords)]));if(this.position.setCoordinates(t),this.geoMarker.getGeometry().setCoordinates(t),this.geoMarkerCircle.getGeometry().setCenter(t),n<100){let t=NO.movePointContain(this.geoMarkerCircle,this.pathNodeInfo.nodeData);if(-1!==t.coordIndex&&t.coordIndex!==this.moveNodeInfo.currentNode.coordIndex&&t.coordIndex<=this.moveNodeInfo.currentNode.coordIndex+2){this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[t.coordIndex],nextNode:this.pathNodeInfo.nodeData[t.coordIndex+1],threeNode:this.pathNodeInfo.nodeData[t.coordIndex+2]};let n=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),i=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),o=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),s=(i[0]-n[0])*(o[1]-i[1])-(i[1]-n[1])*(o[0]-i[0]),a=this.setAngle(hr(this.moveNodeInfo.nextNode.coords),hr(this.moveNodeInfo.threeNode.coords));this.trigger(Cm.onFeatureMoveProgress,{nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.distance,distance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.distance,elapsedTime:e,nextNodeDistance:this.moveNodeInfo.currentNode.distance,nextNodeDirection:a.markAngle,angle:s>0?"右":"左",xx:a.xx}),r=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)),this.option.navigationOption.tracking?this._map.getView().setRotation(r.viewAngle):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}this.option.navigationOption.tracking?this._map.getView().setCenter(t):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}ComputDirection(){let t=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),e=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),r=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),n=(e[0]-t[0])*(r[1]-e[1])-(e[1]-t[1])*(r[0]-e[0]);return 0===n?"直行":n>0?"右":"左"}getNearestPointOnPathNetWork(t){let e;return e=t instanceof X?t:new X({geometry:new on(t)}),NO.nearestPointOnLine(e,this.multiLinePathData)}addNavigationMarker(){this.resultSource.addFeature(this.geoMarker)}setNavigationMarker(t,e=0){let r;r=t instanceof X?t:new X({geometry:new on(t)}),this.position.setCoordinates(r.getGeometry().getCoordinates());let n=NO.nearestPointOnLine(r,this.multiLinePathData);this.geoMarker.setGeometry(n.getGeometry()),this.styles.geoMarker.getImage().setRotation(e),this.pathLineFeature&&this.resultSource.hasFeature(this.pathLineFeature)&&this.updateNavigationMarker(n)}updateNavigationMarker(t){let e=new X({geometry:new on(this.pathLine.getFirstCoordinate())});new X({geometry:new on(this.pathLine.getLastCoordinate())});let r=NO.lineSlice(e,t,this.pathLineFeature);this.pathIndex=t.get("index"),this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[this.pathIndex],nextNode:this.pathNodeInfo.nodeData[this.pathIndex+1]};let n=Ye(r.getGeometry())*this.option.navigationOption.scale;this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:n/this.option.navigationOption.totalDistance,remainingDistance:this.option.navigationOption.totalDistance-n,nextNodeDistance:Ye(new Nn([t.getGeometry().getCoordinates(),hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:""},this.pathIndex<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+1],this.FeatureMoveProgressInfo.angle="直行"),this.trigger(Cm.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.oldPathLineFeature.setGeometry(r.getGeometry()),this.oldPathLineFeature.getGeometry().changed();let i=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(i.viewAngle):this.styles.geoMarker.getImage().setRotation(i.markAngle),this.option.navigationOption.tracking&&this._map.getView().setCenter(t.getGeometry().getCoordinates())}getPathLine(){return this.pathLine}computerPath(t,e){let r,n;r=t instanceof X?t.getGeometry().getCoordinates():t,n=e instanceof X?e.getGeometry().getCoordinates():e,clearInterval(this.timer),this.resultSource.clear(),this.dijkstra.path(r,n)}computerPath2(t,e){let r=this.getFile("../public/tempData/铁路_简版.json","text/json"),n=this.formatJsonTo4326Json(JSON.parse(r)),i=new GAt(n,{weightFn:function(t,e,r){let n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)}}),o=NO.featureTo4326(t),s=NO.featureTo4326(e);i.findPath(o,s)}addGeoJsonUrl(t,e){let r=this.getFile(e,"text/json"),n=this.formatJsonTo3857(JSON.parse(r));this.addFeatures(t,n)}addGeoJson(t,e){this.addFeatures(t,this.formatJsonTo3857(e))}convertGeoJsontoFeatures(t){return this.formatJsonTo3857(t)}addFeatures(t,e){var r;null==(r=this._map)||r.getView().getZoom(),e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector),QO.getFeaturesDefaultStyle(e,25,this.autoPointSize);let r=QO.getStyle(e.getGeometry().getType(),e.get("style"));e.setStyle(r)})),this._source.addFeatures(e)}addFeature(t,e){e.set("classname",t),this._source.addFeature(e)}getFeaturesByClassName(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("classname")===t&&e.push(r)})),e}getFeatures(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("name")===t&&e.push(r)})),e}getFeature(t){let e=null;return this._source.getFeatures().forEach((r=>{r.get("name")!==t||(e=r)})),e}removeFeatures(t){this._source.getFeatures().forEach((e=>{e.get("classname")===t&&this._source.removeFeature(e)}))}removeNavigationPath(){this.resultSource.forEachFeature((t=>{t!==this.geoMarker&&this.resultSource.removeFeature(t)}))}removeNavigationMarker(){this.resultSource.removeFeature(this.geoMarker)}removeNavigationAll(){this.resultSource.clear()}pathToGeoJSON(){return(new Df).writeFeaturesObject(this.routeFeatures,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0)}},PbfLayer:class extends Im{constructor(t,r){super(t,r),e(this,"_source"),e(this,"isLoading"),e(this,"queryParams"),this.layertype="PbfLayer",this.layerid=t,this.isLoading=!1,new AbortController,this._source=new Pf({format:new RA,url:r.url,tileUrlFunction:this.tileUrlFunction});const n=new Vi({fill:new Fn({color:"#eeeeee"}),stroke:new Rn({color:"#eeeeee",width:1})});this.queryParams={onlyField:"OBJECTID"},this._source.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this._source.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this._source.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)})),this.layer=new af({zIndex:r.zIndex,source:this._source,style:t=>(r.featureStyle&&r.featureStyle.forEach((e=>{if(t.get(e.propertiesName)===e.propertiesValue)return n.getFill().setColor(e.fillColor),n.getStroke().setColor(e.strokeColor),void n.getStroke().setWidth(e.strokeWidth)})),n)}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype)}tileUrlFunction(t,e){return"http://192.168.28.252:8018/pbf/{z}/{x}/{y}.pbf".replace("{z}",String(2*t[0]-1)).replace("{x}",String(t[1])).replace("{y}",String(t[2]))}appendTo(t){t.addLayer(this.layer),this.isAdded=!0}},TifLayer:class extends xU{constructor(t,e){super(t,e),this.layertype="GeoTIFFLayer",this.layerSource=new HR({sources:[{url:this.option.url}]}),this.layer=new qp({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this.layerSource.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this.layerSource.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)}))}padLeft(t,e,r){let n=t.toString(r||10);return(new Array(e).join("0")+n).slice(-e)}},TileTencentLayer:iD,TileXyzLayer:nD,WfsLayer:class extends bAt{constructor(t,r){super(t,r),e(this,"geoserverData"),e(this,"queryParams"),e(this,"defaultExtent"),e(this,"isLoading"),this.layertype="WfsLayer",this.option.url,this.layer.set("layerid",t),this.queryParams={service:"WFS",request:"GetFeature",version:"1.0.0",outputFormat:"application/json",maxFeatures:"1000",typeName:"data:name",bbox:"",filter:"",queryField:"",querykeyword:"",autoShowFeature:!0},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t){try{this.isLoading=!0;let e,r=this,n=this.option.url,i=Object.assign({},this.queryParams,t);if(i.feature){let t=i.feature.getGeometry(),e=(t.getType(),(new Df).writeGeometryObject(t,{featureProjection:"EPSG:3857",dataProjection:"EPSG:4326"}).coordinates[0].map((function(t){return t.join(",")})).join(" ")),r="";""!==i.querykeyword?r=`\n <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">\n <PropertyName>${i.queryField}</PropertyName>\n <Literal>*${i.querykeyword}*</Literal>\n </PropertyIsLike>`:(delete i.queryField,delete i.querykeyword),i.filter=`<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">\n <And>\n ${r}\n <Intersects>\n <PropertyName>the_geom</PropertyName>\n <gml:Polygon>\n <gml:outerBoundaryIs>\n <gml:LinearRing>\n <gml:coordinates>${e}</gml:coordinates>\n </gml:LinearRing>\n </gml:outerBoundaryIs>\n </gml:Polygon>\n </Intersects>\n </And>\n </Filter>`,delete i.feature,delete i.extent,delete i.extentWkid}else i.extent?("4326"===i.extentWkid&&(i.extent=gr(i.extent,"EPSG:4326","EPSG:3857")),i.bbox=i.extent.join(",")+",EPSG:3857",delete i.extent,delete i.extentWkid,delete i.filter):(delete i.filter,delete i.extent,delete i.extentWkid);""===i.bbox&&this.defaultExtent&&(i.bbox=this.defaultExtent.join(",")+",EPSG:3857"),""!==i.filter&&delete i.bbox,e=Object.assign({},i);let o=!1;fetch(`${n}?${new URLSearchParams(e)}`,{method:"GET",headers:{"content-type":"application/json"}}).then((t=>t.json())).then((t=>{const e=NO.formatJsonTo3857(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(i.onlyField)===e.get(i.onlyField)}))||t.push(e)})),r.addFeatures("wfsFeature",t),r.trigger(Cm.onFeaturesLoad,e)}})).catch((t=>{o||(o=!0)})).finally((()=>{this.isLoading=!1}))}catch(FX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},WmsLayer:fut,WmsTileLayer:gut,WmtsLayer:class extends xU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.option=Object.assign({},{opacity:.7,attributions:"",layer:"",matrixSet:"GoogleMapsCompatible",format:"image/png"},e);const r=ir("EPSG:3857"),n=r.getExtent(),i=$t(n)/256,o=new Array(19),s=new Array(19);for(let a=0;a<19;++a)o[a]=i/Math.pow(2,a),s[a]=a;this.layerSource=new pU({attributions:this.option.attributions,url:this.option.url,layer:this.option.layer,matrixSet:this.option.matrixSet,format:this.option.format,projection:r,tileGrid:new cU({origin:Zt(n),resolutions:o,matrixIds:s}),style:"default",wrapX:!0}),this.layer=new qf({zIndex:this.option.zIndex,opacity:this.option.opacity,source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}},XWebGLPointsLayer:class extends Im{constructor(t,e){super(t,e),this.layertype="XWebGLPointsLayer",this._source=new pa({wrapX:!1}),this.Layer=new Hp({source:this._source,style:{symbol:{symbolType:"circle",size:["interpolate",["exponential",2.5],["zoom"],2,1,12,8,16,12],color:"#ffed02",offset:[0,0],opacity:.95}},disableHitDetection:!1,colorCallback:function(t,e,r){},attributes:[{name:"color",callback:function(t){}},{name:"size",callback:function(t){}},{name:"GraphicColor",callback:function(t){}}]}),this.Layer.on(Cm.onClick,(t=>{t.feature&&this.trigger(Cm.onClick,t.feature.getProperties())}))}appendTo(t){var e;this._map=t,null==(e=this._map)||e.addLayer(this.Layer)}addGeoJson(t,e){let r=this.formatJsonTo3857(e);this.addFeatures(t,r)}addFeatures(t,e){var r;let n=null==(r=this._map)?void 0:r.getView().getZoom();e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector);let r=QO.getFeaturesDefaultStyle(e,n,!1);e.setStyle(r)})),this._source.addFeatures(e)}},imageLayer:UD,kmlLayer:class extends GO{constructor(t,r){super(t,r),e(this,"styleOptions"),this.option={},Object.assign(this.option,r),this.layertype="KmlLayer",this._source=new pa({url:r.url,format:new uAt({extractStyles:!1})}),this.styleOptions={Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:-10,fillcolor:"rgba(0, 153, 255,1)",strokecolor:"rgba(255, 255, 255,1)",strokewidth:1,radius:10,scale:1,text:""},this.layer=new ta({source:this._source,zIndex:r.zIndex,style:(t,e)=>{let r=QO.getStyle(t.getGeometry().getType(),this.styleOptions);if(this.styleOptions.text){let e=this.replaceField(this.styleOptions.text);e!==this.styleOptions.text&&r.getText().setText(t.getProperties()[e])}return r}}),this.layer.set("layerid",t),this.layer.on(Cm.onClick,(t=>{t.feature&&this.trigger(Cm.onClick,t.feature.getProperties())}))}setSymbol(t){this.styleOptions=Object.assign({},this.styleOptions,t)}}},Symbol.toStringTag,{value:"Module"})),qAt=Object.freeze(Object.defineProperty({__proto__:null,getJSON:function(t){const e=new XMLHttpRequest;return e.open("get",t,!1),e.setRequestHeader("content-type","application/json"),e.send(),JSON.parse(e.response)}},Symbol.toStringTag,{value:"Module"}));class WAt{constructor(t){e(this,"option"),this.option={key:"50da1a3686015849769f4a414bfdfb8f"},this.option=Object.assign({},this.option,t)}}const XAt=Object.freeze(Object.defineProperty({__proto__:null,GaodePOI:class extends WAt{constructor(t){super(t)}query(t){let e=new ov,r={serverUrl:"",queryType:1,keywords:"",location:"",radius:"3000",city:"西安市",city_limit:!0,polygon:"",extensions:"base",offset:20,page:1,success:null,error:null};r=Object.assign({},r,t);let n=[{type:"周边搜索",url:r.serverUrl+"/v3/place/around",parameters:{key:this.option.key,keywords:r.keywords,location:r.location,radius:r.radius,offset:r.offset,page:r.page}},{type:"关键字搜索",url:r.serverUrl+"/v3/place/text",parameters:{key:this.option.key,keywords:r.keywords,city:t.city,city_limit:t.city_limit,offset:r.offset,page:r.page}},{type:"多边形区域搜索",url:r.serverUrl+"/v3/place/polygon",parameters:{key:this.option.key,keywords:t.keywords,polygon:t.polygon,offset:r.offset,page:r.page}}];r.keywords=r.keywords.replace("","|"),rv(n[r.queryType].url+tv(n[r.queryType].parameters)).then((function(r){r.pois.forEach((t=>{let r=t.location.split(","),n=e.gcj02ToWgs84(parseFloat(r[1]),parseFloat(r[0]));t.lnglat=[n.lontitude,n.latitude]})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}queryUrl(){}},GaodeRoute:class extends WAt{constructor(t){super(t)}query(t){let e=new ov,r=[{type:"驾车",url:t.serverUrl+"/v3/direction/driving"},{type:"步行",url:t.serverUrl+"/v3/direction/walking"},{type:"公交",url:t.serverUrl+"/v3/direction/transit/integrated"}];t.params.key=this.option.key,rv(r[t.queryType].url+tv(t.params)).then((function(r){r.route.paths.forEach((t=>{t.points=[],t.steps.forEach((r=>{r.polyline.split(";").forEach((r=>{let n=r.split(","),i=e.gcj02ToWgs84(parseFloat(n[1]),parseFloat(n[0]));t.points.push([i.lontitude,i.latitude])}))}))})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}}},Symbol.toStringTag,{value:"Module"}));function YAt(t,e){let r=t.length-e,n=0;do{for(let r=e;r>0;r--)t[n+e]+=t[n],n++;r-=e}while(r>0)}function ZAt(t,e,r){let n=0,i=t.length;const o=i/r;for(;i>e;){for(let r=e;r>0;--r)t[n+e]+=t[n],++n;i-=e}const s=t.slice();for(let a=0;a<o;++a)for(let e=0;e<r;++e)t[r*a+e]=s[(r-e-1)*o+a]}class JAt{async decode(t,e){const r=await this.decodeBlock(e),n=t.Predictor||1;if(1!==n){const e=!t.StripOffsets;return function(t,e,r,n,i,o){if(!e||1===e)return t;for(let l=0;l<i.length;++l){if(i[l]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[l]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const s=i[0]/8,a=2===o?1:i.length;for(let l=0;l<n&&!(l*a*r*s>=t.byteLength);++l){let n;if(2===e){switch(i[0]){case 8:n=new Uint8Array(t,l*a*r*s,a*r*s);break;case 16:n=new Uint16Array(t,l*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(t,l*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}YAt(n,a)}else 3===e&&(n=new Uint8Array(t,l*a*r*s,a*r*s),ZAt(n,a,s))}return t}(r,n,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return r}}const $At=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{decodeBlock(t){return t}}},Symbol.toStringTag,{value:"Module"})),tft=9,eft=257;function rft(t,e){for(let r=e.length-1;r>=0;r--)t.push(e[r]);return t}const nft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{decodeBlock(t){return function(t){const e=new Uint16Array(4093),r=new Uint8Array(4093);for(let p=0;p<=257;p++)e[p]=4096,r[p]=p;let n=258,i=tft,o=0;function s(){n=258,i=tft}function a(t){const e=function(t,e,r){const n=e%8,i=Math.floor(e/8),o=8-n,s=e+r-8*(i+1);let a=8*(i+2)-(e+r);const l=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return eft;let u=t[i]&2**(8-n)-1;u<<=r-o;let h=u;if(i+1<t.length){let e=t[i+1]>>>a;e<<=Math.max(0,r-l),h+=e}if(s>8&&i+2<t.length){const n=8*(i+3)-(e+r);h+=t[i+2]>>>n}return h}(t,o,i);return o+=i,e}function l(t,i){return r[n]=i,e[n]=t,n++,n-1}function u(t){const n=[];for(let i=t;4096!==i;i=e[i])n.push(r[i]);return n}const h=[];s();const c=new Uint8Array(t);let A,f=a(c);for(;f!==eft;){if(256===f){for(s(),f=a(c);256===f;)f=a(c);if(f===eft)break;if(f>256)throw new Error(`corrupted code at scanline ${f}`);rft(h,u(f)),A=f}else if(f<n){const t=u(f);rft(h,t),l(A,t[t.length-1]),A=f}else{const t=u(A);if(!t)throw new Error(`Bogus entry. Not in dictionary, ${A} / ${n}, position: ${o}`);rft(h,t),h.push(t[t.length-1]),l(A,t[t.length-1]),A=f}n+1>=2**i&&(12===i?A=void 0:i++),f=a(c)}return new Uint8Array(h)}(t).buffer}}},Symbol.toStringTag,{value:"Module"})),ift=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),oft=4017,sft=799,aft=3406,lft=2276,uft=1567,hft=3784,cft=5793,Aft=2896;function fft(t,e){let r=0;const n=[];let i=16;for(;i>0&&!t[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<t[a];i++){for(s=n.pop(),s.children[s.index]=e[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function pft(t,e,r,n,i,o,s,a,l){const{mcusPerLine:u,progressive:h}=r,c=e;let A=e,f=0,p=0;function d(){if(p>0)return p--,f>>p&1;if(f=t[A++],255===f){const e=t[A++];if(e)throw new Error(`unexpected marker: ${(f<<8|e).toString(16)}`)}return p=7,f>>>7}function g(t){let e,r=t;for(;null!==(e=d());){if(r=r[e],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(t){let e=t,r=0;for(;e>0;){const t=d();if(null===t)return;r=r<<1|t,--e}return r}function m(t){const e=y(t);return e>=1<<t-1?e:e+(-1<<t)+1}let v,_=0,w=0;function b(t,e,r,n,i){const o=r%u,s=(r/u|0)*t.v+n,a=o*t.h+i;e(t,t.blocks[s][a])}function x(t,e,r){const n=r/t.blocksPerLine|0,i=r%t.blocksPerLine;e(t,t.blocks[n][i])}const C=n.length;let E,S,B,I,T,P;P=h?0===o?0===a?function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r)<<l;t.pred+=n,e[0]=t.pred}:function(t,e){e[0]|=d()<<l}:0===a?function(t,e){if(_>0)return void _--;let r=o;const n=s;for(;r<=n;){const n=g(t.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){_=y(o)+(1<<o)-1;break}r+=16}else r+=o,e[ift[r]]=m(i)*(1<<l),r++}}:function(t,e){let r=o;const n=s;let i=0;for(;r<=n;){const n=ift[r],o=e[n]<0?-1:1;switch(w){case 0:{const e=g(t.huffmanTableAC),r=15&e;if(i=e>>4,0===r)i<15?(_=y(i)+(1<<i),w=4):(i=16,w=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=m(r),w=i?2:3}continue}case 1:case 2:e[n]?e[n]+=(d()<<l)*o:(i--,0===i&&(w=2===w?3:0));break;case 3:e[n]?e[n]+=(d()<<l)*o:(e[n]=v<<l,w=0);break;case 4:e[n]&&(e[n]+=(d()<<l)*o)}r++}4===w&&(_--,0===_&&(w=0))}:function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r);t.pred+=n,e[0]=t.pred;let i=1;for(;i<64;){const r=g(t.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else i+=o,e[ift[i]]=m(n),i++}};let F,L,M=0;L=1===C?n[0].blocksPerLine*n[0].blocksPerColumn:u*r.mcusPerColumn;const O=i||L;for(;M<L;){for(S=0;S<C;S++)n[S].pred=0;if(_=0,1===C)for(E=n[0],T=0;T<O;T++)x(E,P,M),M++;else for(T=0;T<O;T++){for(S=0;S<C;S++){E=n[S];const{h:t,v:e}=E;for(B=0;B<e;B++)for(I=0;I<t;I++)b(E,P,M,B,I)}if(M++,M===L)break}if(p=0,F=t[A]<<8|t[A+1],F<65280)throw new Error("marker was not found");if(!(F>=65488&&F<=65495))break;A+=2}return A-c}function dft(t,e){const r=[],{blocksPerLine:n,blocksPerColumn:i}=e,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function l(t,r,n){const i=e.quantizationTable;let o,s,a,l,u,h,c,A,f;const p=n;let d;for(d=0;d<64;d++)p[d]=t[d]*i[d];for(d=0;d<8;++d){const t=8*d;0!==p[1+t]||0!==p[2+t]||0!==p[3+t]||0!==p[4+t]||0!==p[5+t]||0!==p[6+t]||0!==p[7+t]?(o=cft*p[0+t]+128>>8,s=cft*p[4+t]+128>>8,a=p[2+t],l=p[6+t],u=Aft*(p[1+t]-p[7+t])+128>>8,A=Aft*(p[1+t]+p[7+t])+128>>8,h=p[3+t]<<4,c=p[5+t]<<4,f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*hft+l*uft+128>>8,a=a*uft-l*hft+128>>8,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*lft+A*aft+2048>>12,u=u*aft-A*lft+2048>>12,A=f,f=h*sft+c*oft+2048>>12,h=h*oft-c*sft+2048>>12,c=f,p[0+t]=o+A,p[7+t]=o-A,p[1+t]=s+c,p[6+t]=s-c,p[2+t]=a+h,p[5+t]=a-h,p[3+t]=l+u,p[4+t]=l-u):(f=cft*p[0+t]+512>>10,p[0+t]=f,p[1+t]=f,p[2+t]=f,p[3+t]=f,p[4+t]=f,p[5+t]=f,p[6+t]=f,p[7+t]=f)}for(d=0;d<8;++d){const t=d;0!==p[8+t]||0!==p[16+t]||0!==p[24+t]||0!==p[32+t]||0!==p[40+t]||0!==p[48+t]||0!==p[56+t]?(o=cft*p[0+t]+2048>>12,s=cft*p[32+t]+2048>>12,a=p[16+t],l=p[48+t],u=Aft*(p[8+t]-p[56+t])+2048>>12,A=Aft*(p[8+t]+p[56+t])+2048>>12,h=p[24+t],c=p[40+t],f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*hft+l*uft+2048>>12,a=a*uft-l*hft+2048>>12,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*lft+A*aft+2048>>12,u=u*aft-A*lft+2048>>12,A=f,f=h*sft+c*oft+2048>>12,h=h*oft-c*sft+2048>>12,c=f,p[0+t]=o+A,p[56+t]=o-A,p[8+t]=s+c,p[48+t]=s-c,p[16+t]=a+h,p[40+t]=a-h,p[24+t]=l+u,p[32+t]=l-u):(f=cft*n[d+0]+8192>>14,p[0+t]=f,p[8+t]=f,p[16+t]=f,p[24+t]=f,p[32+t]=f,p[40+t]=f,p[48+t]=f,p[56+t]=f)}for(d=0;d<64;++d){const t=128+(p[d]+8>>4);r[d]=t<0?0:t>255?255:t}}for(let u=0;u<i;u++){const t=u<<3;for(let e=0;e<8;e++)r.push(new Uint8Array(o));for(let i=0;i<n;i++){l(e.blocks[u][i],a,s);let n=0;const o=i<<3;for(let e=0;e<8;e++){const i=r[t+e];for(let t=0;t<8;t++)i[o+t]=a[n++]}}}return r}class gft{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(t){let e=0;function r(){const r=t[e]<<8|t[e+1];return e+=2,r}function n(){const n=r(),i=t.subarray(e,e+n-2);return e+=i.length,i}function i(t){let e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(e=t.components[r],n<e.h&&(n=e.h),i<e.v&&(i=e.v));const o=Math.ceil(t.samplesPerLine/8/n),s=Math.ceil(t.scanLines/8/i);for(r in t.components)if(t.components.hasOwnProperty(r)){e=t.components[r];const a=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/n),l=Math.ceil(Math.ceil(t.scanLines/8)*e.v/i),u=o*e.h,h=s*e.v,c=[];for(let t=0;t<h;t++){const t=[];for(let e=0;e<u;e++)t.push(new Int32Array(64));c.push(t)}e.blocksPerLine=a,e.blocksPerColumn=l,e.blocks=c}t.maxH=n,t.maxV=i,t.mcusPerLine=o,t.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const t=n();65504===o&&74===t[0]&&70===t[1]&&73===t[2]&&70===t[3]&&0===t[4]&&(this.jfif={version:{major:t[5],minor:t[6]},densityUnits:t[7],xDensity:t[8]<<8|t[9],yDensity:t[10]<<8|t[11],thumbWidth:t[12],thumbHeight:t[13],thumbData:t.subarray(14,14+3*t[12]*t[13])}),65518===o&&65===t[0]&&100===t[1]&&111===t[2]&&98===t[3]&&101===t[4]&&0===t[5]&&(this.adobe={version:t[6],flags0:t[7]<<8|t[8],flags1:t[9]<<8|t[10],transformCode:t[11]});break}case 65499:{const n=r()+e-2;for(;e<n;){const n=t[e++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++)i[ift[r]]=t[e++];else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let t=0;t<64;t++)i[ift[t]]=r()}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=t[e++];let a;for(let r=0;r<s;r++){a=t[e];const r=t[e+1]>>4,i=15&t[e+1],o=t[e+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},e+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=t[e++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,e++)i[r]=t[e],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,e++)s[r]=t[e];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=fft(i,s):this.huffmanTablesAC[15&n]=fft(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=t[e++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[t[e++]],n=t[e++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=t[e++],a=t[e++],l=t[e++],u=pft(t,e,o,i,this.resetInterval,s,a,l>>4,15&l);e+=u;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error(`unknown JPEG marker ${o.toString(16)}`)}o=r()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length;for(let u=0;u<this.frames.length;u++){const t=this.frames[u].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const e=t[0],{components:r,componentsOrder:n}=e,i=[],o=e.samplesPerLine,s=e.scanLines;for(let u=0;u<n.length;u++){const t=r[n[u]];i.push({lines:dft(0,t),scaleX:t.h/e.maxH,scaleY:t.v/e.maxV})}const a=new Uint8Array(o*s*i.length);let l=0;for(let u=0;u<s;++u)for(let t=0;t<o;++t)for(let e=0;e<i.length;++e){const r=i[e];a[l]=r.lines[0|u*r.scaleY][0|t*r.scaleX],++l}return a}}const yft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{constructor(t){super(),this.reader=new gft,t.JPEGTables&&this.reader.parse(t.JPEGTables)}decodeBlock(t){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(t)),this.reader.getResult().buffer}}},Symbol.toStringTag,{value:"Module"}));
469
+ */klt.URL=klt.URL||klt.webkitURL||function(t,e){return(e=document.createElement("a")).href=t,e};var Rlt=klt.Blob,Ult=URL.createObjectURL,Dlt=URL.revokeObjectURL,Qlt=klt.Symbol&&klt.Symbol.toStringTag,Glt=!1,jlt=!1,Hlt=!!klt.ArrayBuffer,zlt=Nlt&&Nlt.prototype.append&&Nlt.prototype.getBlob;try{Glt=2===new Blob(["ä"]).size,jlt=2===new Blob([new Uint8Array([1,2])]).size}catch(FX){}function Vlt(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t}))}function Klt(t,e){e=e||{};var r=new Nlt;return Vlt(t).forEach((function(t){r.append(t)})),e.type?r.getBlob(e.type):r.getBlob()}function qlt(t,e){return new Rlt(Vlt(t),e||{})}if(klt.Blob&&(Klt.prototype=Blob.prototype,qlt.prototype=Blob.prototype),Qlt)try{File.prototype[Qlt]="File",Blob.prototype[Qlt]="Blob",FileReader.prototype[Qlt]="FileReader"}catch(FX){}function Wlt(){var t=!!klt.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,e=klt.XMLHttpRequest&&klt.XMLHttpRequest.prototype.send;t&&e&&(XMLHttpRequest.prototype.send=function(t){t instanceof Blob?(this.setRequestHeader("Content-Type",t.type),e.call(this,t)):e.call(this,t)});try{new File([],"")}catch(n){try{var r=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();klt.File=r}catch(i){r=function(t,e,r){var n=new Blob(t,r),i=r&&void 0!==r.lastModified?new Date(r.lastModified):new Date;return n.name=e,n.lastModifiedDate=i,n.lastModified=+i,n.toString=function(){return"[object File]"},Qlt&&(n[Qlt]="File"),n},klt.File=r}}}Glt?(Wlt(),klt.Blob=jlt?klt.Blob:qlt):zlt?(Wlt(),klt.Blob=Klt):function(){function t(t){for(var e=[],r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e.push(n):n<2048?e.push(192|n>>6,128|63&n):n<55296||n>=57344?e.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&t.charCodeAt(r)),e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return e}function e(t){var e,r,n,i,o,s;for(e="",n=t.length,r=0;r<n;)switch((i=t[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=String.fromCharCode(i);break;case 12:case 13:o=t[r++],e+=String.fromCharCode((31&i)<<6|63&o);break;case 14:o=t[r++],s=t[r++],e+=String.fromCharCode((15&i)<<12|(63&o)<<6|(63&s)<<0)}return e}function r(t){for(var e=new Array(t.byteLength),r=new Uint8Array(t),n=e.length;n--;)e[n]=r[n];return e}function n(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[],n=0;n<t.length;n+=3){var i=t[n],o=n+1<t.length,s=o?t[n+1]:0,a=n+2<t.length,l=a?t[n+2]:0,u=i>>2,h=(3&i)<<4|s>>4,c=(15&s)<<2|l>>6,A=63&l;a||(A=64,o||(c=64)),r.push(e[u],e[h],e[c],e[A])}return r.join("")}var i=Object.create||function(t){function e(){}return e.prototype=t,new e};if(Hlt)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&o.indexOf(Object.prototype.toString.call(t))>-1};function a(e,n){for(var i=0,o=(e=e||[]).length;i<o;i++){var l=e[i];l instanceof a?e[i]=l._buffer:"string"==typeof l?e[i]=t(l):Hlt&&(ArrayBuffer.prototype.isPrototypeOf(l)||s(l))?e[i]=r(l):Hlt&&(u=l)&&DataView.prototype.isPrototypeOf(u)?e[i]=r(l.buffer):e[i]=t(String(l))}var u;this._buffer=[].concat.apply([],e),this.size=this._buffer.length,this.type=n&&n.type||""}function l(t,e,r){r=r||{};var n=a.call(this,t,r)||this;return n.name=e,n.lastModifiedDate=r.lastModified?new Date(r.lastModified):new Date,n.lastModified=+n.lastModifiedDate,n}if(a.prototype.slice=function(t,e,r){return new a([this._buffer.slice(t||0,e||this._buffer.length)],{type:r})},a.prototype.toString=function(){return"[object Blob]"},l.prototype=i(a.prototype),l.prototype.constructor=l,Object.setPrototypeOf)Object.setPrototypeOf(l,a);else try{l.__proto__=a}catch(FX){}function u(){if(!(this instanceof u))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var t=document.createDocumentFragment();this.addEventListener=t.addEventListener,this.dispatchEvent=function(e){var r=this["on"+e.type];"function"==typeof r&&r(e),t.dispatchEvent(e)},this.removeEventListener=t.removeEventListener}function h(t,e,r){if(!(e instanceof a))throw new TypeError("Failed to execute '"+r+"' on 'FileReader': parameter 1 is not of type 'Blob'.");t.result="",setTimeout((function(){this.readyState=u.LOADING,t.dispatchEvent(new Event("load")),t.dispatchEvent(new Event("loadend"))}))}l.prototype.toString=function(){return"[object File]"},u.EMPTY=0,u.LOADING=1,u.DONE=2,u.prototype.error=null,u.prototype.onabort=null,u.prototype.onerror=null,u.prototype.onload=null,u.prototype.onloadend=null,u.prototype.onloadstart=null,u.prototype.onprogress=null,u.prototype.readAsDataURL=function(t){h(this,t,"readAsDataURL"),this.result="data:"+t.type+";base64,"+n(t._buffer)},u.prototype.readAsText=function(t){h(this,t,"readAsText"),this.result=e(t._buffer)},u.prototype.readAsArrayBuffer=function(t){h(this,t,"readAsText"),this.result=t._buffer.slice()},u.prototype.abort=function(){},URL.createObjectURL=function(t){return t instanceof a?"data:"+t.type+";base64,"+n(t._buffer):Ult.call(URL,t)},URL.revokeObjectURL=function(t){Dlt&&Dlt.call(URL,t)};var c=klt.XMLHttpRequest&&klt.XMLHttpRequest.prototype.send;c&&(XMLHttpRequest.prototype.send=function(t){t instanceof a?(this.setRequestHeader("Content-Type",t.type),c.call(this,e(t._buffer))):c.call(this,t)}),klt.FileReader=u,klt.File=l,klt.Blob=a}();var Xlt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===klt.btoa&&(klt.btoa=function(t){var e,r,n,i,o,s=0,a=0,l="",u=[];if(!t)return t;do{e=(o=t.charCodeAt(s++)<<16|t.charCodeAt(s++)<<8|t.charCodeAt(s++))>>18&63,r=o>>12&63,n=o>>6&63,i=63&o,u[a++]=Xlt.charAt(e)+Xlt.charAt(r)+Xlt.charAt(n)+Xlt.charAt(i)}while(s<t.length);l=u.join("");var h=t.length%3;return(h?l.slice(0,h-3):l)+"===".slice(h||3)}),void 0===klt.atob&&(klt.atob=function(t){var e,r,n,i,o,s,a=0,l=0,u=[];if(!t)return t;t+="";do{e=(s=Xlt.indexOf(t.charAt(a++))<<18|Xlt.indexOf(t.charAt(a++))<<12|(i=Xlt.indexOf(t.charAt(a++)))<<6|(o=Xlt.indexOf(t.charAt(a++))))>>16&255,r=s>>8&255,n=255&s,u[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,r):String.fromCharCode(e,r,n)}while(a<t.length);return u.join("")});class Ylt extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.setAttribute("id","mouse-position"),n.innerHTML="",n.style.float="right",n.style.left=" 0px",n.style.right="0px",n.style.bottom="0px",n.style.marginRight="60px";let i=document.createElement("div");i.setAttribute("id","locationbar"),i.style.position="absolute",i.style.zIndex="991",i.style.padding=" 3px 10px",i.style.fontSize=" 13px",i.style.color="#e9e9e9",i.style.textShadow="2px 2px 2px #000",i.style.backgroundColor="rgba(0,0,0,.4)",i.style.minHeight="26px",i.style.left=" 0px",i.style.right="0px",i.style.bottom="0px",i.appendChild(n),super({element:i,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}updateMousePosition(t){this._mouseposition.innerHTML=t}}class Zlt extends Bl{constructor(t,r,n,i){const o=t||{};let s=n.find((t=>t.name===r));const a=new Image;a.src=s.icon,a.className="mirage-mapswitch-image";const l=document.createElement("div");l.className="mirage-mapswitch-button-itemLabel",l.innerHTML=r;const u=document.createElement("div");u.className="mirage-mapswitch-button mirage-mapswitch-toolbar-button",u.appendChild(a),u.appendChild(l);const h=document.createElement("div");h.className="mirage-mapswitch-box";const c=document.createElement("div");c.className="mirage-mapswitch-baseLayerPicker-dropDown",c.style.maxHeight="300px",n.forEach((t=>{const e=new Image;e.src=t.icon,e.className="mirage-mapswitch-baseLayerPicker-itemIcon";const r=document.createElement("div");r.className="mirage-mapswitch-baseLayerPicker-itemLabel",r.innerHTML=t.name;const n=document.createElement("div");n.className="mirage-mapswitch-baseLayerPicker-item mirage-mapswitch-baseLayerPicker-selectedItem",n.appendChild(e),n.appendChild(r),n.addEventListener("click",(t=>{this._isshow=!1,c.className="mirage-mapswitch-baseLayerPicker-dropDown",a.src=t.currentTarget.children[0].src,l.innerHTML=t.currentTarget.innerText,i(t.currentTarget.innerText)}),!1),c.appendChild(n)})),h.appendChild(u),h.appendChild(c),super({element:h,target:o.target}),e(this,"_isshow"),e(this,"baseLayerList"),e(this,"mianImage"),e(this,"mianLabel"),this.mianImage=a,this.mianLabel=l,this.baseLayerList=n,this._isshow=!1,u.addEventListener("click",this.showSwitch.bind(this),!1)}changeBaseLayer(t){this.baseLayerList.forEach((e=>{if(e.name===t)return this.mianImage.src=e.icon,void(this.mianLabel.innerHTML=e.name)}))}showSwitch(t){this._isshow=!this._isshow;let e=document.getElementsByClassName("mirage-mapswitch-baseLayerPicker-dropDown");this._isshow?e[0].className="mirage-mapswitch-baseLayerPicker-dropDown mirage-mapswitch-baseLayerPicker-dropDown-visible":e[0].className="mirage-mapswitch-baseLayerPicker-dropDown"}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}var Jlt=function(t){t=t||{};var e=document.createElement("button"),r=document.createElement("div");r.className=(t.className||"ol-swipe")+" ol-unselectable ol-control",r.appendChild(e),r.addEventListener("mousedown",this.move.bind(this)),r.addEventListener("touchstart",this.move.bind(this)),Bl.call(this,{element:r}),this.precomposeRight_=this.precomposeRight.bind(this),this.precomposeLeft_=this.precomposeLeft.bind(this),this.postcompose_=this.postcompose.bind(this),this.layers=[],t.layers&&this.addLayer(t.layers,!1),t.rightLayers&&this.addLayer(t.rightLayers,!0),this.on("propertychange",function(t){if(this.getMap())try{this.getMap().renderSync()}catch(e){}"horizontal"===this.get("orientation")?(this.element.style.top=100*this.get("position")+"%",this.element.style.left=""):("vertical"!==this.get("orientation")&&this.set("orientation","vertical"),this.element.style.left=100*this.get("position")+"%",this.element.style.top=""),"orientation"===t.key&&(this.element.classList.remove("horizontal","vertical"),this.element.classList.add(this.get("orientation"))),this.isMoving||this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}))}.bind(this)),this.set("position",t.position||.5),this.set("orientation",t.orientation||"vertical")};qm(Jlt,Bl),Jlt.prototype.setMap=function(t){var e,r;if(this.getMap()){for(e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.un(["precompose","prerender"],this.precomposeRight_):r.layer.un(["precompose","prerender"],this.precomposeLeft_),r.layer.un(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(FX){}}if(Bl.prototype.setMap.call(this,t),t){for(this._listener=[],e=0;e<this.layers.length;e++)(r=this.layers[e]).right?r.layer.on(["precompose","prerender"],this.precomposeRight_):r.layer.on(["precompose","prerender"],this.precomposeLeft_),r.layer.on(["postcompose","postrender"],this.postcompose_);try{t.renderSync()}catch(FX){}}},Jlt.prototype.isLayer_=function(t){for(var e=0;e<this.layers.length;e++)if(this.layers[e].layer===t)return e;return-1},Jlt.prototype.addLayer=function(t,e){t instanceof Array||(t=[t]);for(var r=0;r<t.length;r++){var n=t[r];if(this.isLayer_(n)<0&&(this.layers.push({layer:n,right:e}),this.getMap())){e?n.on(["precompose","prerender"],this.precomposeRight_):n.on(["precompose","prerender"],this.precomposeLeft_),n.on(["postcompose","postrender"],this.postcompose_);try{this.getMap().renderSync()}catch(FX){}}}},Jlt.prototype.removeLayers=function(){var t=[];this.layers.forEach((function(e){t.push(e.layer)})),this.removeLayer(t)},Jlt.prototype.removeLayer=function(t){t instanceof Array||(t=[t]);for(var e=0;e<t.length;e++){var r=this.isLayer_(t[e]);r>=0&&this.getMap()&&(this.layers[r].right?t[e].un(["precompose","prerender"],this.precomposeRight_):t[e].un(["precompose","prerender"],this.precomposeLeft_),t[e].un(["postcompose","postrender"],this.postcompose_),this.layers.splice(r,1))}if(this.getMap())try{this.getMap().renderSync()}catch(FX){}},Jlt.prototype.getRectangle=function(){var t;return"vertical"===this.get("orientation")?[0,0,(t=this.getMap().getSize())[0]*this.get("position"),t[1]]:[0,0,(t=this.getMap().getSize())[0],t[1]*this.get("position")]},Jlt.prototype.move=function(t){var e,r=this;switch(this._movefn||(this._movefn=this.move.bind(this)),t.type){case"touchcancel":case"touchend":case"mouseup":r.isMoving=!1,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.removeEventListener(t,r._movefn)})),this.layers.forEach((function(t){t.layer.getImageRatio&&t.layer.changed()}));break;case"mousedown":case"touchstart":r.isMoving=!0,["mouseup","mousemove","touchend","touchcancel","touchmove"].forEach((function(t){document.addEventListener(t,r._movefn)}));case"mousemove":case"touchmove":if(r.isMoving)if("vertical"===r.get("orientation")){var n=t.pageX||t.touches&&t.touches.length&&t.touches[0].pageX||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageX;if(!n)break;n-=r.getMap().getTargetElement().getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft;var i=(e=r.getMap().getSize()[0])-Math.min(Math.max(0,e-n),e);e=i/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[i,r.getMap().getSize()[1]],position:[e,0]})}else{var o=t.pageY||t.touches&&t.touches.length&&t.touches[0].pageY||t.changedTouches&&t.changedTouches.length&&t.changedTouches[0].pageY;if(!o)break;o-=r.getMap().getTargetElement().getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop;var s=(e=r.getMap().getSize()[1])-Math.min(Math.max(0,e-o),e);e=s/e,r.set("position",e),r.dispatchEvent({type:"moving",size:[r.getMap().getSize()[0],s],position:[0,e]})}}},Jlt.prototype._transformPt=function(t,e){var r=t.inversePixelTransform,n=e[0],i=e[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e},Jlt.prototype._drawRect=function(t,e){var r=t.inversePixelTransform;if(r){var n=[[e[0][0],e[0][1]],[e[0][0],e[1][1]],[e[1][0],e[1][1]],[e[1][0],e[0][1]],[e[0][0],e[0][1]]];if(t.context.save(),t.target.getImageRatio){var i=-Math.atan2(t.frameState.pixelToCoordinateTransform[1],t.frameState.pixelToCoordinateTransform[0]);t.context.translate(t.frameState.size[0]/2,t.frameState.size[1]/2),t.context.rotate(i),t.context.translate(-t.frameState.size[0]/2,-t.frameState.size[1]/2)}n.forEach((function(e,n){e=[e[0]*r[0]-e[1]*r[1]+r[4],-e[0]*r[2]+e[1]*r[3]+r[5]],n?t.context.lineTo(e[0],e[1]):t.context.moveTo(e[0],e[1])})),t.context.restore()}else{var o=t.frameState.pixelRatio;t.context.rect(e[0][0]*o,e[0][1]*o,e[1][0]*o,e[1][1]*o)}},Jlt.prototype.precomposeLeft=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(r=Math.round(a*this.get("position")),n=l):(r=a,n=Math.round(l*this.get("position")),o[1]+=l-n),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[1]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),u[1]]:h[1]=[u[0],.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Jlt.prototype.precomposeRight=function(t){var e=t.context;if(e instanceof WebGLRenderingContext){if("prerender"===t.type){e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.SCISSOR_TEST);var r,n,i=this.getMap().getSize(),o=this._transformPt(t,[0,i[1]]),s=this._transformPt(t,[i[0],0]),a=s[0]-o[0],l=s[1]-o[1];"vertical"===this.get("orientation")?(n=l,r=Math.round(a*(1-this.get("position"))),o[0]+=a-r):(r=a,n=Math.round(l*(1-this.get("position")))),e.scissor(o[0],o[1],r,n)}}else{var u=t.frameState.size;e.save(),e.beginPath();var h=[[0,0],[u[0],u[1]]];"vertical"===this.get("orientation")?h[0]=[.5*u[0]+this.getMap().getSize()[0]*(this.get("position")-.5),0]:h[0]=[0,.5*u[1]+this.getMap().getSize()[1]*(this.get("position")-.5)],this._drawRect(t,h),e.clip()}},Jlt.prototype.postcompose=function(t){if(t.context instanceof WebGLRenderingContext){if("postrender"===t.type){var e=t.context;e.disable(e.SCISSOR_TEST)}}else t.target.getClassName&&"ol-layer"!==t.target.getClassName()&&t.target.get("declutter")?setTimeout((function(){t.context.restore()}),0):t.context.restore()};class $lt{constructor(){e(this,"events",new Map)}on(t,e,r){return this.events.has(t)||this.events.set(t,[]),(this.events.get(t)||[]).push({handler:e,once:r}),()=>{this.off(t,e)}}once(t,e){return this.on(t,e,!0)}fire(t,...e){let r=0;for(;r<(this.events.get(t)||[]).length;){const n=this.events.get(t)||[],{handler:i,once:o}=n[r];o&&n.splice(r--,1),r++,i(...e)}}off(t,e){t&&(e?this.events.set(t,(this.events.get(t)||[]).filter((t=>t.handler!==e))):this.events.set(t,[]))}}class tut extends $lt{constructor(){super(),e(this,"_swipe"),this._swipe=new Jlt}show(t,e,r="vertical"){this.fire("show",{swipe:this._swipe,leftlayerID:t,rightlayerID:e}),this._swipe.set("orientation",r)}hide(){this.fire("hide",this._swipe)}}class eut extends Bl{constructor(t){const r=t||{};let n=document.createElement("div");n.style.zIndex="999",n.style.width="200px",n.className="huitudiv",n.setAttribute("id","huitutext1"),n.style.position="absolute",n.style.zIndex="991",n.style.padding=" 3px 10px",n.style.fontSize=" 25px",n.style.color="#000",n.style.textShadow="2px 2px 2px #fff",n.style.backgroundColor="rgba(0,0,0,.4)",n.style.minHeight="26px",n.style.right="100px",n.style.bottom="50px",n.innerHTML="",super({element:n,target:r.target}),e(this,"_mouseposition"),this._mouseposition=n}show(){this.element.style.display="block"}getElement(){return this._mouseposition}hide(){this.element.style.display="none"}updateHtml(t){this._mouseposition.innerHTML=t}updateElementStyle(t,e){this._mouseposition.style[t]=e}}const rut=Object.freeze(Object.defineProperty({__proto__:null,Locationbar:Ylt,baseLayerSwitch:Zlt,drawTextControl:eut,swipeControl:tut},Symbol.toStringTag,{value:"Module"}));var nut=function(t){t||(t={});var e=this;this.selection_=new V,this.handles_=new V,this.overlayLayer_=new ta({source:new pa({features:this.handles_,useSpatialIndex:!1,wrapX:!1}),name:"Transform overlay",displayInLayerSwitcher:!1,style:function(t){return e.style[(t.get("handle")||"default")+(t.get("constraint")||"")+(t.get("option")||"")]}}),ou.call(this,{handleDownEvent:this.handleDownEvent_,handleDragEvent:this.handleDragEvent_,handleMoveEvent:this.handleMoveEvent_,handleUpEvent:this.handleUpEvent_}),this.features_=t.features,"function"==typeof t.filter&&(this._filter=t.filter),this.layers_=t.layers?t.layers instanceof Array?t.layers:[t.layers]:null,this._handleEvent=t.condition||function(){return!0},this.addFn_=t.addCondition||function(){return!1},this.setPointRadius(t.pointRadius),this.set("translateFeature",!1!==t.translateFeature),this.set("translate",!1!==t.translate),this.set("translateBBox",!0===t.translateBBox),this.set("stretch",!1!==t.stretch),this.set("scale",!1!==t.scale),this.set("rotate",!1!==t.rotate),this.set("keepAspectRatio",t.keepAspectRatio||function(t){return t.originalEvent.shiftKey}),this.set("modifyCenter",t.modifyCenter||function(t){return t.originalEvent.metaKey||t.originalEvent.ctrlKey}),this.set("noFlip",t.noFlip||!1),this.set("selection",!1!==t.selection),this.set("hitTolerance",t.hitTolerance||0),this.set("enableRotatedTransform",t.enableRotatedTransform||!1),this.set("keepRectangle",t.keepRectangle||!1),this.on("propertychange",(function(){this.drawSketch_()})),this.setDefaultStyle()};function iut(t,e){var r=(t[0]*e[0]+t[1]*e[1])/(e[0]*e[0]+e[1]*e[1]);return[e[0]*r,e[1]*r]}function out(t,e){return[e[0]-t[0],e[1]-t[1]]}function sut(t,e){return[t[0]+e[0],t[1]+e[1]]}qm(nut,ou),nut.prototype.Cursors={default:"auto",select:"pointer",translate:"move",rotate:"move",rotate0:"move",scale:"nesw-resize",scale1:"nwse-resize",scale2:"nesw-resize",scale3:"nwse-resize",scalev:"ew-resize",scaleh1:"ns-resize",scalev2:"ew-resize",scaleh3:"ns-resize"},nut.prototype.setMap=function(t){var e=this.getMap();if(e){var r=e.getTargetElement();e.removeLayer(this.overlayLayer_),this.previousCursor_&&r&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}ou.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),null===t&&this.select(null),null!==t&&(this.isTouch=/touch/.test(t.getViewport().className),this.setDefaultStyle())},nut.prototype.setActive=function(t){this.select(null),this.overlayLayer_.setVisible(t),ou.prototype.setActive.call(this,t)},nut.prototype.setDefaultStyle=function(t){var e=(t=t||{}).pointStroke||new Rn({color:[255,0,0,1],width:1}),r=t.stroke||new Rn({color:[255,0,0,1],width:1,lineDash:[4,4]}),n=t.fill||new Fn({color:[255,0,0,.01]}),i=t.pointFill||new Fn({color:[255,255,255,.8]}),o=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,displacement:this.isTouch?[24,-24]:[12,-12],points:15});o.setDisplacement||(o.getAnchor()[0]=this.isTouch?-10:-5);var s=new Ri({fill:i,stroke:e,radius:this.isTouch?16:8,points:4,angle:Math.PI/4}),a=new Ri({fill:i,stroke:e,radius:this.isTouch?12:6,points:4,angle:Math.PI/4});function l(t,e,r){return[new Vi({image:t,stroke:e,fill:r})]}this.style={default:l(s,r,n),translate:l(s,e,i),rotate:l(o,e,i),rotate0:l(s,e,i),scale:l(s,e,i),scale1:l(s,e,i),scale2:l(s,e,i),scale3:l(s,e,i),scalev:l(a,e,i),scaleh1:l(a,e,i),scalev2:l(a,e,i),scaleh3:l(a,e,i)},this.drawSketch_()},nut.prototype.setStyle=function(t,e){if(e){this.style[t]=e instanceof Array?e:[e];for(var r=0;r<this.style[t].length;r++){var n=this.style[t][r].getImage();n&&("rotate"==t&&(n.getAnchor()[0]=-5),this.isTouch&&n.setScale(1.8));var i=this.style[t][r].getText();i&&("rotate"==t&&i.setOffsetX(this.isTouch?14:7),this.isTouch&&i.setScale(1.8))}this.drawSketch_()}},nut.prototype.getFeatureAtPixel_=function(t){var e=this;return this.getMap().forEachFeatureAtPixel(t,(function(t,r){var n=!1;if(!r){if(t===e.bbox_)return!!e.get("translateBBox")&&{feature:t,handle:"translate",constraint:"",option:""};if(e.handles_.forEach((function(e){e===t&&(n=!0)})),n)return{feature:t,handle:t.get("handle"),constraint:t.get("constraint"),option:t.get("option")}}if(!e.get("selection"))return e.selection_.getArray().some((function(e){return t===e}))?{feature:t}:null;if(e._filter)return e._filter(t,r)?{feature:t}:null;if(e.layers_){for(var i=0;i<e.layers_.length;i++)if(e.layers_[i]===r)return{feature:t};return null}return e.features_?(e.features_.forEach((function(e){e===t&&(n=!0)})),n?{feature:t}:null):{feature:t}}),{hitTolerance:this.get("hitTolerance")})||{}},nut.prototype.getGeometryRotateToZero_=function(t,e){var r=t.getGeometry(),n=this.getMap().getView().getRotation();if(0===n||!this.get("enableRotatedTransform"))return e?r.clone():r;var i=r.clone();return i.rotate(-1*n,this.getMap().getView().getCenter()),i},nut.prototype._isRectangle=function(t){return!(!this.get("keepRectangle")||"Polygon"!==t.getType())&&5===t.getCoordinates()[0].length},nut.prototype.drawSketch_=function(t){var e,r,n,i=this.selection_.item(0)&&this._isRectangle(this.selection_.item(0).getGeometry());if(this.overlayLayer_.getSource().clear(),this.selection_.getLength()){var o,s=this.getMap().getView().getRotation(),a=this.getGeometryRotateToZero_(this.selection_.item(0)).getExtent();i&&(o=this.getGeometryRotateToZero_(this.selection_.item(0)).getCoordinates()[0].slice(0,4)).unshift(o[3]),a=Et(a,0),this.selection_.forEach(function(t){var e=this.getGeometryRotateToZero_(t).getExtent();Rt(a,e)}.bind(this));var l=1===this.selection_.getLength()?this._pointRadius(this.selection_.item(0)):0;if(!l||l instanceof Array||(l=[l,l]),!0===t)this.ispt_||(this.overlayLayer_.getSource().addFeature(new X({geometry:new on(this.center_),handle:"rotate0"})),n=Cn(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n),this.overlayLayer_.getSource().addFeature(r));else{if(this.ispt_){var u=this.getMap().getPixelFromCoordinate([a[0],a[1]]);if(u){var h=l&&l[0]||10,c=l&&l[1]||10;a=Ct([this.getMap().getCoordinateFromPixel([u[0]-h,u[1]-c]),this.getMap().getCoordinateFromPixel([u[0]+h,u[1]+c])])}}n=i?new xn([o]):Cn(a),this.get("enableRotatedTransform")&&0!==s&&n.rotate(s,this.getMap().getView().getCenter()),r=this.bbox_=new X(n);var A=[],f=n.getCoordinates()[0];if(!this.ispt_||l){if(A.push(r),!this.iscircle_&&!this.ispt_&&this.get("stretch")&&this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on([(f[e][0]+f[e+1][0])/2,(f[e][1]+f[e+1][1])/2]),handle:"scale",constraint:e%2?"h":"v",option:e}),A.push(r);if(this.get("scale"))for(e=0;e<f.length-1;e++)r=new X({geometry:new on(f[e]),handle:"scale",option:e}),A.push(r);this.get("translate")&&!this.get("translateFeature")&&(r=new X({geometry:new on([(f[0][0]+f[2][0])/2,(f[0][1]+f[2][1])/2]),handle:"translate"}),A.push(r))}!this.iscircle_&&this.get("rotate")&&(r=new X({geometry:new on(f[3]),handle:"rotate"}),A.push(r)),this.overlayLayer_.getSource().addFeatures(A)}}},nut.prototype.select=function(t,e){if(!t)return this.selection_.clear(),void this.drawSketch_();if(t.getGeometry&&t.getGeometry()){if(e)this.selection_.push(t);else{var r=this.selection_.getArray().indexOf(t);this.selection_.removeAt(r)}this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:t,features:this.selection_})}},nut.prototype.setSelection=function(t){this.selection_.clear(),t.forEach(function(t){this.selection_.push(t)}.bind(this)),this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",features:this.selection_})},nut.prototype.watchFeatures_=function(){this._featureListeners&&this._featureListeners.forEach((function(t){k(t)})),this._featureListeners=[],this.selection_.forEach(function(t){this._featureListeners.push(t.on("change",function(){this.isUpdating_||this.drawSketch_()}.bind(this)))}.bind(this))},nut.prototype.handleDownEvent_=function(t){if(this._handleEvent(t,this.selection_)){var e=this.getFeatureAtPixel_(t.pixel),r=e.feature;if(this.selection_.getLength()&&this.selection_.getArray().indexOf(r)>=0&&(this.ispt_&&this.get("translate")||this.get("translateFeature"))&&(e.handle="translate"),e.handle){this.mode_=e.handle,this.opt_=e.option,this.constraint_=e.constraint;var n=this.getMap().getView().getRotation();this.coordinate_=t.coordinate,this.pixel_=t.pixel,this.geoms_=[],this.rotatedGeoms_=[];for(var i,o=[1/0,1/0,-1/0,-1/0],s=[1/0,1/0,-1/0,-1/0],a=0;i=this.selection_.item(a);a++)if(this.geoms_.push(i.getGeometry().clone()),o=Rt(o,i.getGeometry().getExtent()),this.get("enableRotatedTransform")&&0!==n){var l=this.getGeometryRotateToZero_(i,!0);this.rotatedGeoms_.push(l),s=Rt(s,l.getExtent())}if(this.extent_=Cn(o).getCoordinates()[0],this.get("enableRotatedTransform")&&0!==n&&(this.rotatedExtent_=Cn(s).getCoordinates()[0]),"rotate"===this.mode_){this.center_=this.getCenter()||Vt(o);var u=t.map.getTargetElement();u.style.cursor=this.Cursors.rotate0,this.previousCursor_=u.style.cursor}else this.center_=Vt(o);return this.angle_=Math.atan2(this.center_[1]-t.coordinate[1],this.center_[0]-t.coordinate[0]),this.dispatchEvent({type:this.mode_+"start",feature:this.selection_.item(0),features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!0}if(this.get("selection")){if(r){this.addFn_(t)||this.selection_.clear();var h=this.selection_.getArray().indexOf(r);h<0?this.selection_.push(r):this.selection_.removeAt(h)}else this.selection_.clear();return this.ispt_=1===this.selection_.getLength()&&"Point"==this.selection_.item(0).getGeometry().getType(),this.iscircle_=1===this.selection_.getLength()&&"Circle"==this.selection_.item(0).getGeometry().getType(),this.drawSketch_(),this.watchFeatures_(),this.dispatchEvent({type:"select",feature:r,features:this.selection_,pixel:t.pixel,coordinate:t.coordinate}),!1}}},nut.prototype.getFeatures=function(){return this.selection_},nut.prototype.getCenter=function(){return this.get("center")},nut.prototype.setCenter=function(t){return this.set("center",t)},nut.prototype.handleDragEvent_=function(t){if(this._handleEvent(t,this.features_)){var e,r,n,i,o=this.getMap().getView().getRotation(),s=[this.coordinate_[0],this.coordinate_[1]],a=[t.coordinate[0],t.coordinate[1]];switch(this.isUpdating_=!0,this.mode_){case"rotate":var l=Math.atan2(this.center_[1]-a[1],this.center_[0]-a[0]);if(!this.ispt)for(e=0;n=this.selection_.item(e);e++)(i=this.geoms_[e].clone()).rotate(l-this.angle_,this.center_),"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),n.setGeometry(i);this.drawSketch_(!0),this.dispatchEvent({type:"rotating",feature:this.selection_.item(0),features:this.selection_,angle:l-this.angle_,pixel:t.pixel,coordinate:t.coordinate});break;case"translate":var u=a[0]-s[0],h=a[1]-s[1];for(e=0;n=this.selection_.item(e);e++)n.getGeometry().translate(u,h);this.handles_.forEach((function(t){t.getGeometry().translate(u,h)})),this.coordinate_=t.coordinate,this.dispatchEvent({type:"translating",feature:this.selection_.item(0),features:this.selection_,delta:[u,h],pixel:t.pixel,coordinate:t.coordinate});break;case"scale":var c=this.center_;if(this.get("modifyCenter")(t)){var A=this.extent_;this.get("enableRotatedTransform")&&0!==o&&(A=this.rotatedExtent_),c=A[(Number(this.opt_)+2)%4]}var f=1==this.geoms_.length&&this._isRectangle(this.geoms_[0]),p=this.constraint_,d=this.opt_,g=this.coordinate_,y=t.coordinate;if(this.get("enableRotatedTransform")&&0!==o){var m=new on(this.coordinate_);m.rotate(-1*o,c),g=m.getCoordinates();var v=new on(t.coordinate);v.rotate(-1*o,c),y=v.getCoordinates()}var _=(y[0]-c[0])/(g[0]-c[0]),w=(y[1]-c[1])/(g[1]-c[1]),b=[y[0]-g[0],y[1]-g[1]];if(this.get("enableRotatedTransform")&&0!==o){var x=new on(c);x.rotate(-1*o,this.getMap().getView().getCenter()),c=x.getCoordinates()}for(this.get("noFlip")&&(_<0&&(_=-_),w<0&&(w=-w)),this.constraint_?"h"==this.constraint_?_=1:w=1:this.get("keepAspectRatio")(t)&&(_=w=Math.min(_,w)),e=0;n=this.selection_.item(e);e++)(i=0!==o&&this.get("enableRotatedTransform")?this.rotatedGeoms_[e].clone():this.geoms_[e].clone()).applyTransform((function(t,e,n){if(n<2)return e;if(f){var o=[[6],[0,8],[2],[4]],s=[t[0],t[1]],a=[t[2],t[3]],l=[t[4],t[5]],u=[t[6],t[7]],h=[t[8],t[9]];if(p){var A=d%2==0?out(s,a):out(u,s),g=iut(b,A),m=[...o[d],...o[d+1<o.length?d+1:0]];for(r=0;r<t.length;r+=n)e[r]=m.includes(r)?t[r]+g[0]:t[r],e[r+1]=m.includes(r)?t[r+1]+g[1]:t[r+1]}else{var v,x;switch(d){case 0:v=iut(b=out(u,y),out(l,u)),x=iut(b,out(s,u)),[e[0],e[1]]=sut(s,v),[e[4],e[5]]=sut(l,x),[e[6],e[7]]=sut(u,b),[e[8],e[9]]=sut(h,v);break;case 1:v=iut(b=out(s,y),out(u,s)),x=iut(b,out(a,s)),[e[0],e[1]]=sut(s,b),[e[2],e[3]]=sut(a,v),[e[6],e[7]]=sut(u,x),[e[8],e[9]]=sut(h,b);break;case 2:v=iut(b=out(a,y),out(s,a)),x=iut(b,out(l,a)),[e[0],e[1]]=sut(s,x),[e[2],e[3]]=sut(a,b),[e[4],e[5]]=sut(l,v),[e[8],e[9]]=sut(h,x);break;case 3:v=iut(b=out(l,y),out(a,l)),x=iut(b,out(u,l)),[e[2],e[3]]=sut(a,x),[e[4],e[5]]=sut(l,b),[e[6],e[7]]=sut(u,v)}}}else for(r=0;r<t.length;r+=n)1!=_&&(e[r]=c[0]+(t[r]-c[0])*_),1!=w&&(e[r+1]=c[1]+(t[r+1]-c[1])*w);return"Circle"==i.getType()&&i.setCenterAndRadius(i.getCenter(),i.getRadius()),e})),this.get("enableRotatedTransform")&&0!==o&&i.rotate(o,this.getMap().getView().getCenter()),n.setGeometry(i);this.drawSketch_(),this.dispatchEvent({type:"scaling",feature:this.selection_.item(0),features:this.selection_,scale:[_,w],pixel:t.pixel,coordinate:t.coordinate})}this.isUpdating_=!1}},nut.prototype.handleMoveEvent_=function(t){if(this._handleEvent(t,this.features_)&&!this.mode_){var e=this.getFeatureAtPixel_(t.pixel),r=t.map.getTargetElement();if(e.feature){var n=e.handle?this.Cursors[(e.handle||"default")+(e.constraint||"")+(e.option||"")]:this.Cursors.select;void 0===this.previousCursor_&&(this.previousCursor_=r.style.cursor),r.style.cursor=n}else void 0!==this.previousCursor_&&(r.style.cursor=this.previousCursor_),this.previousCursor_=void 0}},nut.prototype.handleUpEvent_=function(t){return"rotate"===this.mode_&&(t.map.getTargetElement().style.cursor=this.Cursors.default,this.previousCursor_=void 0),this.dispatchEvent({type:this.mode_+"end",feature:this.selection_.item(0),features:this.selection_,oldgeom:this.geoms_[0],oldgeoms:this.geoms_}),this.drawSketch_(),this.mode_=null,!1},nut.prototype.getFeatures=function(){return this.selection_},nut.prototype.setPointRadius=function(t){this._pointRadius="function"==typeof t?t:function(){return t}};class aut{constructor(t){e(this,"transformInteraction"),this.transformInteraction=new nut({enableRotatedTransform:!1,hitTolerance:2,translateFeature:!0,scale:!0,rotate:!0,keepAspectRatio:!1,keepRectangle:!1,translate:!0,stretch:!0,pointRadius:function(t){let e=t.get("radius")||10;return[e,e]}}),this.transformInteraction.setActive(!1),this.transformInteraction.on(["select"],(t=>{s&&t.features&&t.features.getLength()&&this.transformInteraction.setCenter(t.features.getArray()[0].getGeometry().getFirstCoordinate())}));let r=0,n=10,i=[1,1],o=[0,0],s=!1;this.transformInteraction.on(["rotatestart","translatestart","scalestart"],(function(t){r=t.feature.get("angle")||0,n=t.feature.get("radius")||10,i=t.feature.get("Scale")||[1,1],o=[0,0]})),this.transformInteraction.on("rotating",(t=>{t.feature.set("angle",r-t.angle),t.feature.dispatchEvent({type:"onRotating",data:r-t.angle})})),this.transformInteraction.on("translating",(t=>{o[0]+=t.delta[0],o[1]+=t.delta[1],t.feature.dispatchEvent({type:"onMoveing",data:Vt(t.features.getArray()[0].getGeometry().getExtent())})})),this.transformInteraction.on("scaling",(t=>{if(1===t.features.getLength()){let e=t.features.item(0);e.set("radius",n*Math.abs(t.scale[0])),e.set("Scale",[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]),t.feature.dispatchEvent({type:"onScaling",data:[i[0]*Math.abs(t.scale[0]),i[1]*Math.abs(t.scale[1])]})}})),this.transformInteraction.on(["rotateend","translateend","scaleend"],(t=>{}))}setHandleStyle(t=!0){if(t){let t=new Ri({fill:new Fn({color:[255,255,255,.01]}),stroke:new Rn({width:1,color:[0,0,0,.01]}),radius:8,points:10});this.transformInteraction.setStyle("rotate",new Vi({text:new Wi({text:"",font:"16px Fontawesome",textAlign:"left",fill:new Fn({color:"red"})}),image:t})),this.transformInteraction.setStyle("rotate0",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})})),this.transformInteraction.setStyle("translate",new Vi({text:new Wi({text:"",font:"20px Fontawesome",fill:new Fn({color:[255,255,255,.8]}),stroke:new Rn({width:2,color:"red"})})}))}else this.transformInteraction.setDefaultStyle();this.transformInteraction.set("translate",this.transformInteraction.get("translate"))}appendTo(t){t.addInteraction(this.transformInteraction)}setActive(t){this.transformInteraction.setActive(t)}}var lut,uut=function(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)},hut=function(t,e){return t[0]==e[0]&&t[1]==e[1]};!function(){function t(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][0]>e&&t[n-1][0]<e||t[n][0]<e&&t[n-1][0]>e)&&(r=[e,(e-t[n][0])/(t[n-1][0]-t[n][0])*(t[n-1][1]-t[n][1])+t[n][1]],t.splice(n,0,r))}function e(t,e){var r;for(let n=t.length-1;n>0;n--)(t[n][1]>e&&t[n-1][1]<e||t[n][1]<e&&t[n-1][1]>e)&&(r=[(e-t[n][1])/(t[n-1][1]-t[n][1])*(t[n-1][0]-t[n][0])+t[n][0],e],t.splice(n,0,r))}lut=function(r,n){var i="Polygon"===n.getType();if(!i&&"MultiPolygon"!==n.getType())return null;var o=n.getCoordinates();return i&&(o=[o]),o.forEach((function(n){n.forEach((function(n){t(n,r[0]),t(n,r[2]),e(n,r[1]),e(n,r[3])}))})),o.forEach((function(t){t.forEach((function(t){t.forEach((function(t){t[0]<r[0]?t[0]=r[0]:t[0]>r[2]&&(t[0]=r[2]),t[1]<r[1]?t[1]=r[1]:t[1]>r[3]&&(t[1]=r[3])}))}))})),i?new xn(o[0]):new ah(o)}}();var cut=function(t,e,r,n){var i=[];!1!==n&&i.push(t);var o=uut(t,e);if(o){var s=Math.round(o/r);if(s>1)for(var a=(e[0]-t[0])/s,l=(e[1]-t[1])/s,u=1;u<s;u++)i.push([t[0]+a*u,t[1]+l*u])}return i.push(e),i};Nn.prototype.sampleAt=function(t){for(var e=this.getCoordinates(),r=[],n=1;n<e.length;n++)r=r.concat(cut(e[n-1],e[n],t,1===n));return new Nn(r)},th.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(cut(e[i-1],e[i],t,1===i));r.push(n)})),new th(r)},xn.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){for(var n=[],i=1;i<e.length;i++)n=n.concat(cut(e[i-1],e[i],t,1===i));r.push(n)})),new xn(r)},ah.prototype.sampleAt=function(t){var e=this.getCoordinates(),r=[];return e.forEach((function(e){var n=[];r.push(n),e.forEach((function(e){for(var r=[],i=1;i<e.length;i++)r=r.concat(cut(e[i-1],e[i],t,1===i));n.push(r)}))})),new ah(r)},Zu.prototype.intersection=function(t,e){if(t.sampleAt){var r=Et(this.getCenter().concat(this.getCenter()),this.getRadius());t=(t=lut(r,t)).simplify(e);var n=this.getCenter(),i=this.getRadius(),o=t.sampleAt(e).getCoordinates();switch(t.getType()){case"Polygon":o=[o];case"MultiPolygon":var s=!1,a=[];return o.forEach((function(t){var e=[];a.push(e),t.forEach((function(t){var r=[];e.push(r),t.forEach((function(t){var e=uut(n,t);e>i?(s=!0,r.push([n[0]+i/e*(t[0]-n[0]),n[1]+i/e*(t[1]-n[1])])):r.push(t)}))}))})),s?"Polygon"===t.getType()?new xn(a[0]):new ah(a):t}}return t},Nn.prototype.splitAt=function(t,e){var r;if(!t)return[this];if(e||(e=1e-10),t.length&&t[0].length){var n=[this];for(r=0;r<t.length;r++){for(var i=[],o=0;o<n.length;o++){var s=n[o].splitAt(t[r],e);i=i.concat(s)}n=i}return n}if(hut(t,this.getFirstCoordinate())||hut(t,this.getLastCoordinate()))return[this];var a=this.getCoordinates(),l=[a[0]],u=[];for(r=0;r<a.length-1;r++)if(!hut(a[r],a[r+1])){if(hut(t,a[r+1]))l.push(a[r+1]),u.push(new Nn(l)),l=[];else if(!hut(t,a[r])){var h,c,A=!1;a[r][0]==a[r+1][0]?(h=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=a[r][0]==t[0]&&0<h&&h<=1):a[r][1]==a[r+1][1]?(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),A=a[r][1]==t[1]&&0<h&&h<=1):(h=(a[r][0]-t[0])/(a[r][0]-a[r+1][0]),c=(a[r][1]-t[1])/(a[r][1]-a[r+1][1]),A=Math.abs(h-c)<=e&&0<h&&h<=1),A&&(l.push(t),u.push(new Nn(l)),l=[t])}l.push(a[r+1])}return l.length>1&&u.push(new Nn(l)),u.length?u:[this]};var Aut=function(t){t||(t={}),tu.call(this,{handleEvent:function(t){switch(t.type){case"singleclick":return this.handleDownEvent(t);case"pointermove":return this.handleMoveEvent(t);default:return!0}}}),this.snapDistance_=t.snapDistance||25,this.tolerance_=t.tolerance||1e-10,this.cursor_=t.cursor,this.setSources(t.sources),t.features&&this.sources_.push(new pa({features:t.features})),this.filterSplit_=t.filter||function(){return!0};var e=[255,255,255,1],r=[0,153,255,1],n=new Fn({color:"rgba(255,255,255,0.4)"}),i=new Rn({color:"#3399CC",width:1.25}),o=[new Vi({image:new Di({fill:n,stroke:i,radius:5}),fill:n,stroke:i})],s=[new Vi({stroke:new Rn({color:e,width:5})}),new Vi({image:new Di({radius:6,fill:new Fn({color:r}),stroke:new Rn({color:e,width:1.5})}),stroke:new Rn({color:r,width:3})})];t.sketchStyle&&(o=t.sketchStyle instanceof Array?t.sketchStyle:[t.sketchStyle]),t.featureStyle&&(s=t.featureStyle instanceof Array?t.featureStyle:[t.featureStyle]),this.overlayLayer_=new ta({source:new pa({useSpatialIndex:!1}),name:"Split overlay",displayInLayerSwitcher:!1,style:function(t){return t._sketch_?o:s}})};qm(Aut,tu),Aut.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),tu.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t)},Aut.prototype.getSources=function(){if(!this.sources_&&this.getMap()){var t=[],e=function(r){r.forEach((function(r){r.getVisible()&&(r.getSource&&r.getSource()instanceof pa?t.unshift(r.getSource()):r.getLayers&&e(r.getLayers()))}))};return e(this.getMap().getLayers()),t}return this.sources_||[]},Aut.prototype.setSources=function(t){this.sources_=!!t&&(t instanceof Array?t||!1:[t])},Aut.prototype.getClosestFeature=function(t){var e,r,n,i,o=this.snapDistance_+1;if(this.getSources().forEach((function(s){var a=s.getClosestFeatureToCoordinate(t.coordinate);if(a&&a.getGeometry().splitAt){var l=a.getGeometry().getClosestPoint(t.coordinate),u=new Nn([t.coordinate,l]),h=u.getLength()/t.frameState.viewState.resolution;h<o&&(e=s,o=h,r=a,i=u,n=l)}})),o>this.snapDistance_)return!1;var s=this.getNearestCoord(n,r.getGeometry().getCoordinates()),a=this.getMap().getPixelFromCoordinate(s);return uut(t.pixel,a)<this.snapDistance_&&(n=s),{source:e,feature:r,coord:n,link:i}},Aut.prototype.getNearestCoord=function(t,e){for(var r,n,i=Number.MAX_VALUE,o=0;o<e.length;o++)(r=uut(t,e[o]))<i&&(i=r,n=e[o]);return n},Aut.prototype.handleDownEvent=function(t){var e=this.getClosestFeature(t);if(e){var r=this;r.overlayLayer_.getSource().clear();var n,i=e.feature.getGeometry().splitAt(e.coord,this.tolerance_);if(i.length>1){var o=[];for(n=0;n<i.length;n++){var s=e.feature.clone();s.setGeometry(i[n]),o.push(s)}for(r.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"beforesplit",original:e.feature,features:o}),e.source.removeFeature(e.feature),n=0;n<o.length;n++)e.source.addFeature(o[n]);r.dispatchEvent({type:"aftersplit",original:e.feature,features:o}),e.source.dispatchEvent({type:"aftersplit",original:e.feature,features:o})}}return!1},Aut.prototype.handleMoveEvent=function(t){var e=t.map;this.overlayLayer_.getSource().clear();var r,n,i=this.getClosestFeature(t);i&&this.filterSplit_(i.feature)?(this.overlayLayer_.getSource().addFeature(i.feature),(r=new X(new on(i.coord)))._sketch_=!0,this.overlayLayer_.getSource().addFeature(r),(n=new X(i.link))._sketch_=!0,this.overlayLayer_.getSource().addFeature(n),this.dispatchEvent({type:"pointermove",coordinate:t.coordinate,frameState:t.frameState,originalEvent:t.originalEvent,map:t.map,pixel:t.pixel,feature:i.feature,linkGeometry:i.link})):this.dispatchEvent(t);var o=e.getTargetElement();this.cursor_&&(i?o.style.cursor!=this.cursor_&&(this.previousCursor_=o.style.cursor,o.style.cursor=this.cursor_):void 0!==this.previousCursor_&&(o.style.cursor=this.previousCursor_,this.previousCursor_=void 0))};class fut extends xU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.layerSource=new sU(e),this.layer=new Zc({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}class put extends Bl{constructor(t){const e=t||{},r=new Image;r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAAAUCAYAAADFlsDIAAAEsElEQVRYhe1XTWhjVRT+7lgmpSlIGN25kNSVP3WRLkQE0UlbXMgQnERwGFBHU6j4t0qNohGcTuJGWqQ6KeKAdhbNhOB0oZg6MChDF30gFZxVA65kKhhsFHRQr5z6nXLz+vJeZtBdDjySd95555z7ne+cex8GMpD/RYw4bYwXVwBcAfAjgIuZrfk/B3AflEPUfAfgfQB1AJ83xouH/wvn1trUTbyTjLgSNxPTWpsVv37bIHvGz/r1yqxhABsA7qf+3K8jh587uVH660YX6wRMA1gFMGaMaVtr8wCCFlI1xnh8R2zKANphvo0xY06cAoCkcwmYOT5OGmOqtNsGUNF76s7S34wvd8mj4MaBMiuzNf87gJcd/dMAmktHy3dGgfLSSmno7cbs8wGPJGBNgAp5PRsAoABX6XHVQnwl+K4UZ53glQlmpJBleQK1x0C9pw5D6iSzNX+5MV78BsBDVD0C4Grl2Hsf7cZj5zrxmLe4fMqq/fRC/Z4jIzvHgGtSlS8ALOsz0j2tFZbWcSvq2KV7LLpX+yb9CmNMBd0safO3aq0V0JrW2q532GJlxtI8qo7/pD8PWcMQuuVFAJsAbqFW2vMFXr8988rKD53RmN2Nx+4Art9Km+sA3vX5KZBV65wx29baHCseJZpopNB3mXYpBzRZeIqATRpjWsoOirJX51LN1555tnBXe3aBldma/7YxXnwTwOmAROMA7g7Ql97KLG07gVJMYoKLkcBeFFDOYiqOOk3wqgG26wTBozpLEPQ+TwZ1LRj/sq4lPnW4O3NNmZXw3beFsX5mgZV6GMBU2OIoHzqVVTnL3yaDyjUZ5oSghs2WfIBO2q1F9qQZJ8nCeCzWKtswLH6CbPQCNhddg8zKmQNgZbbm/26MF2XWfA3gvh4BOgBel+PG4omS9T2rOMN2D4AoVnHOjLHSQcC40tI55UjZYVRTW94Yk5MBTwbuW7M4abZuUtuQemnfnGO7qb5Nr4w+eaB0eyc+fKkzGrt3Nx5DJx5rd+LD33dGYxdl4H/52uM7YSsihTe1rQIWeGA71y3b14quiM+s7+hQ5qJbVNVoM8McFJACWaMtnee9p7PJyVnmnMedVHxNwD+zXDm5Ufpp6WhZ2nENwIMALgF48sI7x/s9e+mg1R2pxlkRJX3vhmw/WfSEy2JhCAuRJIjaWjXOur0BrzuoChkohVrlb8E5s+2f4ANl9qu5nwE8CuBjAE8AOH/8jQuRp3tWRI4Lc1S1nZ0nTATYOa04f9POf4/PVeQ+F1AEj4NdzlxjZIbOOC8sAXbAuhbbHSGhYIkUPnv1j9PnZ58VsgF4TBxNnVnrubWz2gJWi9VtMtG8z07bw51nypQUW7MFZ7fis/1Dosy6oHko4HFm9cNkN6ck2ZZlV0isgn5iRYKlsrh86lMeHWThV6YX6nf1ME2R7vvV1d2Q7bHqgFgj9bVtCnw35yStAMzR1/qNnMx7gJJivCyLKvGbnFciE5xjk7TZDvpW7EumzqxNTy/ULz+1/EE/x4ugRPP+4AEfufqpEfShm+j3o9h53vUh7c8h6EPbZ5vouRtGyfRC/dCRkZ3MbSPXflk8UernZD6QgQzkoAD4BzP8qid//qPeAAAAAElFTkSuQmCC",r.style.float="right",r.style.left=" 0px",r.style.right="0px",r.style.bottom="0px";let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="991",n.style.backgroundColor="rgba(0,0,0,0)",n.style.minHeight="26px",n.style.right="0px",n.style.bottom="0px",n.style.width="75px",n.appendChild(r),super({element:n,target:e.target})}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}class dut extends Bl{constructor(t){const e=t||{},r=new Image;r.src="data:image/image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABN0lEQVRYhe2XMU4DMRBF3xAgFKFCIgU0UVKloOUMHIWr0HIZxAWQOEAKDoBIlC4RSEAYZGU3mjUssddB2/hXY+/6z5+xPSOT0TbE+l9MxzFyRiLcOw5VroG70IXH/cnG3k9IwBEwKOyTpiR7CQI+jf3WhoCdIAuIOoQi4fOqOxRQ57gOoc6DBVhY8lJYOefGMc4bCfgtG76QGEQdQs/Bi7Hn8a7X8DMwArrAasu6L1UGImhRii+A54Az1QE+gKdyopLQ5WzsoupHBKA+RwBWvdPJRqi/BTHOfwQQiI79rZIyVa6AnkvxFi4X+ZkIt8X4RpUHG1DNjXDf32sjiGzHByJrMlUugccK8R9X0rbjlFI8NPZ5U5LcjP5NQGhVzFuQBaQIsCX1sClJyrvAdbVFYb8m8GS0COAbJ6tDDD0OOScAAAAASUVORK5CYII=",r.width=32,r.height=32,r.style.top="0px",r.style.left="0px";let n=document.createElement("div");n.style.position="absolute",n.style.zIndex="999",n.style.backgroundColor="rgba(0,0,0,0)",n.style.top="50%",n.style.left="50%",n.style.transform="translate(-16px, -16px)",n.appendChild(r),n.style.display="none",super({element:n,target:e.target})}show(t={width:32,height:32,offsetX:-16,offsetY:-16}){this.element.style.display="block",this.element.children[0].width=t.width,this.element.children[0].height=t.height,this.element.style.transform="translate("+t.offsetX+"px, "+t.offsetY+"px)"}hide(){this.element.style.display="none"}}class gut extends xU{constructor(t,e){super(t,e),this.layertype="WmsTileLayer",this.layerSource=new uU(e),this.layer=new qf({extent:[-20037725.11268234,-19994619.55417086,20037725.11268234,19994619.55417086],source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}}function yut(t){const e=t.frameState,r=pt(t.inversePixelTransform.slice(),e.coordinateToPixelTransform);return new bs(t.context,e.pixelRatio,e.extent,r,e.viewState.rotation)}window.ol&&(ol.util?ol.util.VERSION||(ol.util.VERSION=ol.VERSION||"6.1.0"):ol.util={VERSION:ol.VERSION||"5.3.0"});var mut=a.split(".");mut=100*parseInt(mut[0])+parseInt(mut[1]);var vut=function(t,e){var r=t.frameState.pixelRatio;if(mut>605&&1!==r&&e.getImage()instanceof Us){var n=(e=e.clone()).getImage();n.setScale(n.getScale()*r);var i=n.getAnchor();if(n.setDisplacement){var o=n.getDisplacement();o&&(o[0]-=i[0]/r,o[1]+=i[1]/r,n.setAnchor([0,0]))}else i&&(i[0]/=r,i[1]/=r)}return e},_ut=function(t){var e=t||{};ta.call(this,e),this.oldcluster=new pa,this.clusters=[],this.animation={start:!1},this.set("animationDuration","number"==typeof e.animationDuration?e.animationDuration:700),this.set("animationMethod",e.animationMethod||va),this.getSource().on("change",this.saveCluster.bind(this)),this.on(["precompose","prerender"],this.animate.bind(this)),this.on(["postcompose","postrender"],this.postanimate.bind(this))};qm(_ut,ta),_ut.prototype.saveCluster=function(){if(this.oldcluster){if(this.oldcluster.clear(),!this.get("animationDuration"))return;var t=this.getSource().getFeatures();t.length&&t[0].get("features")&&(this.oldcluster.addFeatures(this.clusters),this.clusters=t.slice(0),this.sourceChanged=!0)}},_ut.prototype.getClusterForFeature=function(t,e){for(var r,n=0;r=e[n];n++){var i=r.get("features");if(i&&i.length)for(var o,s=0;o=i[s];s++)if(t===o)return r}return!1},_ut.prototype.stopAnimation=function(){this.animation.start=!1,this.animation.cA=[],this.animation.cB=[]},_ut.prototype.animate=function(t){var e=this.get("animationDuration");if(e){var r,n,i=t.frameState.viewState.resolution,o=this.animation,s=t.frameState.time;if(o.resolution!=i&&this.sourceChanged){var a=t.frameState.extent;for(o.resolution<i?(a=Et(a,100*i),o.cA=this.oldcluster.getFeaturesInExtent(a),o.cB=this.getSource().getFeaturesInExtent(a),o.revers=!1):(a=Et(a,100*i),o.cA=this.getSource().getFeaturesInExtent(a),o.cB=this.oldcluster.getFeaturesInExtent(a),o.revers=!0),o.clusters=[],r=0;n=o.cA[r];r++){var l=n.get("features");if(l&&l.length){var u=this.getClusterForFeature(l[0],o.cB);u&&o.clusters.push({f:n,pt:u.getGeometry().getCoordinates()})}}if(o.resolution=i,this.sourceChanged=!1,!o.clusters.length||o.clusters.length>1e3)return void this.stopAnimation();s=o.start=(new Date).getTime()}if(o.start){var h=t.vectorContext||yut(t),c=(s-o.start)/e;c>1&&(this.stopAnimation(),c=1),c=this.get("animationMethod")(c);var A=this.getStyle(),f="function"==typeof A?A:A.length?function(){return A}:function(){return[A]};for(t.context.save(),t.context.globalAlpha=this.getOpacity(),r=0;u=o.clusters[r];r++){var p=u.f.getGeometry().getCoordinates(),d=p[0]-u.pt[0],g=p[1]-u.pt[1];o.revers?(p[0]=u.pt[0]+c*d,p[1]=u.pt[1]+c*g):(p[0]=p[0]-c*d,p[1]=p[1]-c*g);var y=f(u.f,i,!0);if(y.length||(y=[y]),1!==u.f.get("features").length||d||g){var m=new on(p);l=new X(m)}else l=u.f.get("features")[0];for(var v,_=0;v=y[_];_++)if(v.getText()&&/\n/.test(v.getText().getText())){var w,b=v.getText().getOffsetX(),x=v.getText().getOffsetY(),C=v.getText().getRotation()||0,E=1.2*Number((v.getText().getFont()||"10px").match(/\d+/)),S=v.getText().getText().split("\n"),B=S.length-1,I=v.clone();S.forEach((function(e,r){switch(1==r&&(I.setImage(),I.setFill(),I.setStroke()),v.getText().getTextBaseline()){case"alphabetic":case"ideographic":case"bottom":w=B;break;case"hanging":case"top":w=0;break;default:w=B/2}I.getText().setOffsetX(b-Math.sin(C)*E*(r-w)),I.getText().setOffsetY(x+Math.cos(C)*E*(r-w)),I.getText().setText(e),h.drawFeature(l,vut(t,I))}))}else h.drawFeature(l,vut(t,v))}t.context.restore(),t.frameState.animate=!0,t.context.save(),t.context.beginPath(),t.context.rect(0,0,0,0),t.context.clip(),this.clip_=!0}}},_ut.prototype.postanimate=function(t){this.clip_&&(t.context.restore(),this.clip_=!1)};var wut,but=function(t){t=t||{},this.pointRadius=t.pointRadius||12,this.circleMaxObjects=t.circleMaxObjects||10,this.maxObjects=t.maxObjects||60,this.spiral=!1!==t.spiral,this.animate=t.animate,this.animationDuration=t.animationDuration||500,this.selectCluster_=!1!==t.selectCluster,this._autoClose=!1!==t.autoClose;var e=this.overlayLayer_=new ta({source:new pa({features:new V,wrapX:t.wrapX,useSpatialIndex:!0}),name:"Cluster overlay",updateWhileAnimating:!0,updateWhileInteracting:!0,displayInLayerSwitcher:!1,style:t.featureStyle});if(t.layers)if("function"==typeof t.layers){var r=t.layers;t.layers=function(t){return t===e||r(t)}}else t.layers.push&&t.layers.push(this.overlayLayer_);if(t.filter){var n=t.filter;t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))&&n(t,e)}}else t.filter=function(t,e){return!(!e&&t.get("selectclusterlink"))};this.filter_=t.filter,this._autoClose||t.toggleCondition||(t.toggleCondition=pu),Th.call(this,t),this.on("select",this.selectCluster.bind(this))};qm(but,Th),but.prototype.setMap=function(t){this.getMap()&&this.getMap().removeLayer(this.overlayLayer_),this._listener&&k(this._listener),this._listener=null,Th.prototype.setMap.call(this,t),this.overlayLayer_.setMap(t),t&&t.getView()&&(this._listener=t.getView().on("change:resolution",this.clear.bind(this)))},but.prototype.clear=function(){this.getFeatures().clear(),this.overlayLayer_.getSource().clear()},but.prototype.getLayer=function(){return this.overlayLayer_},but.prototype.selectCluster=function(t){if(t instanceof X&&(t={selected:[t]}),t.selected.length){var e=t.selected[0];if(!e.get("selectclusterfeature")){var r=this.overlayLayer_.getSource();this._autoClose&&r.clear();var n=e.get("features");if(n&&1!=n.length){this.selectCluster_||this.getFeatures().clear();var i,o,s,a,l,u,h,c=e.getGeometry().getCoordinates(),A=this.getMap().getView().getResolution(),f=[];if(!this.spiral||n.length<=this.circleMaxObjects)for(a=Math.min(n.length,this.circleMaxObjects),i=A*this.pointRadius*(.5+a/4),s=0;s<a;s++)o=2*Math.PI*s/a,2!=a&&4!=a||(o+=Math.PI/4),l=[c[0]+i*Math.sin(o),c[1]+i*Math.cos(o)],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h);else{o=0;var p=2*this.pointRadius;for(a=Math.min(this.maxObjects,n.length),s=0;s<a;s++){o+=(p+.1)/(i=p/2+p*o/(2*Math.PI));var d=A*i*Math.sin(o),g=A*i*Math.cos(o);l=[c[0]+d,c[1]+g],(u=new X({selectclusterfeature:!0,features:[n[s]],geometry:new on(l)})).setStyle(n[s].getStyle()),f.push(u),h=new X({selectclusterlink:!0,geometry:new Nn([c,l])}),f.push(h)}}e.set("selectcluserfeatures",f),this.animate?this.animateCluster_(c,f):r.addFeatures(f)}}}else this._autoClose?this.clear():t.deselected.forEach((t=>{var e=t.get("selectcluserfeatures");e&&e.forEach((t=>{this.overlayLayer_.getSource().removeFeature(t)}))}))},but.prototype.animateCluster_=function(t,e){if(this.listenerKey_&&k(this.listenerKey_),e.length){var r=this.overlayLayer_.getStyle(),n="function"==typeof r?r:r.length?function(){return r}:function(){return[r]},i=this.animationDuration||500,o=(new Date).getTime();this.listenerKey_=this.overlayLayer_.on(["postcompose","postrender"],function(r){for(var s,a=r.vectorContext||yut(r),l=r.frameState.pixelRatio,u=this.getMap().getView().getResolution(),h=va((r.frameState.time-o)/i),c=0;s=e[c];c++)if(s.get("features")){var A=s.getGeometry().getCoordinates();A[0]=t[0]+h*(A[0]-t[0]),A[1]=t[1]+h*(A[1]-t[1]);for(var f=new on(A),p=n(s,u),d=0;d<p.length;d++){var g,y=!Qh.prototype.getFeaturesAtPixel&&p[d].getImage();y&&(g=y.getScale(),y.setScale(l)),a.setStyle?(a.setStyle(p[d]),a.drawGeometry(f)):(a.setImageStyle(y),a.drawPointGeometry(f)),y&&y.setScale(g)}}if(h>1)return k(this.listenerKey_),this.overlayLayer_.getSource().addFeatures(e),void this.overlayLayer_.changed();r.frameState.animate=!0}.bind(this));var s=new X(new on(this.getMap().getView().getCenter()));s.setStyle(new Vi({image:new Di({})})),this.overlayLayer_.getSource().addFeature(s)}},but.prototype.getClusterExtent=function(t){if(!t.get("features"))return null;var e=[1/0,1/0,-1/0,-1/0];return t.get("features").forEach((function(t){e=Rt(e,t.getGeometry().getExtent())})),e[0]===e[2]&&e[1]===e[3]?null:e},function(){var t=function(t,e,r){return(t[0]-r[0])*(e[1]-r[1])-(t[1]-r[1])*(e[0]-r[0])<=0};wut=function(e){var r;e.sort((function(t,e){return t[0]==e[0]?t[1]-e[1]:t[0]-e[0]}));var n=[];for(r=0;r<e.length;r++){for(;n.length>=2&&t(n[n.length-2],n[n.length-1],e[r]);)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&t(i[i.length-2],i[i.length-1],e[r]);)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)};var e=function(t){var r,n,i=[];switch(t.getType()){case"Point":i.push(t.getCoordinates());break;case"LineString":case"LinearRing":case"MultiPoint":i=t.getCoordinates();break;case"MultiLineString":for(n=t.getLineStrings(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"Polygon":i=e(t.getLinearRing(0));break;case"MultiPolygon":for(n=t.getPolygons(),r=0;r<n.length;r++)i.concat(e(n[r]));break;case"GeometryCollection":for(n=t.getGeometries(),r=0;r<n.length;r++)i.concat(e(n[r]))}return i};Mr.prototype.convexHull=function(){return wut(e(this))}}();const xut=wut;var Cut=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eut={Point:function(t){return void 0!==t.m&&void 0!==t.z?new on([t.x,t.y,t.z,t.m],Y.XYZM):void 0!==t.z?new on([t.x,t.y,t.z],Y.XYZ):void 0!==t.m?new on([t.x,t.y,t.m],Y.XYM):new on([t.x,t.y])},LineString:function(t){var e=Tut(t);return new Nn(t.paths[0],e)},Polygon:function(t){var e=Tut(t);return new xn(t.rings,e)},MultiPoint:function(t){var e=Tut(t);return new nh(t.points,e)},MultiLineString:function(t){var e=Tut(t);return new th(t.paths,e)},MultiPolygon:function(t){var e=Tut(t);return new ah(t.rings,e)}},Sut={Point:function(t,e){var r,n=t.getCoordinates(),i=t.getLayout();return i===Y.XYZ?r={x:n[0],y:n[1],z:n[2]}:i===Y.XYM?r={x:n[0],y:n[1],m:n[2]}:i===Y.XYZM?r={x:n[0],y:n[1],z:n[2],m:n[3]}:i===Y.XY?r={x:n[0],y:n[1]}:K(!1,34),r},LineString:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},Polygon:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},MultiPoint:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},MultiLineString:function(t,e){var r=Put(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},MultiPolygon:function(t,e){for(var r=Put(t),n=t.getCoordinates(!1),i=[],o=0;o<n.length;o++)for(var s=n[o].length-1;s>=0;s--)i.push(n[o][s]);return{hasZ:r.hasZ,hasM:r.hasM,rings:i}}},But=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).geometryName_=n.geometryName,r}return Cut(e,t),e.prototype.readFeatureFromObject=function(t,e,r){var n=t,i=Iut(n.geometry,e),o=new X;if(this.geometryName_&&o.setGeometryName(this.geometryName_),o.setGeometry(i),n.attributes){o.setProperties(n.attributes,!0);var s=n.attributes[r];void 0!==s&&o.setId(s)}return o},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){for(var n=[],i=t.features,o=0,s=i.length;o<s;++o)n.push(this.readFeatureFromObject(i[o],r,t.objectIdFieldName));return n}return[this.readFeatureFromObject(t,r)]},e.prototype.readGeometryFromObject=function(t,e){return Iut(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?ir("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return Fut(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={};if(!t.hasProperties())return r.attributes={},r;var n=t.getProperties(),i=t.getGeometry();if(i){r.geometry=Fut(i,e);var o=e&&(e.dataProjection||e.featureProjection);o&&(r.geometry.spatialReference={wkid:Number(ir(o).getCode().split(":").pop())}),delete n[t.getGeometryName()]}return E(n)?r.attributes={}:r.attributes=n,r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{features:r}},e}(Of);function Iut(t,e){var r,n,i;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)i="Point";else if(t.points)i="MultiPoint";else if(t.paths)i=1===t.paths.length?"LineString":"MultiLineString";else if(t.rings){var o=t,s=Tut(o),a=function(t,e){var r,n,i=[],o=[],s=[];for(r=0,n=t.length;r<n;++r)i.length=0,zr(i,0,t[r],e.length),gn(i,0,i.length,e.length)?o.push([t[r]]):s.push(t[r]);for(;s.length;){var a=s.shift(),l=!1;for(r=o.length-1;r>=0;r--){var u=o[r][0];if(Tt(new rn(u).getExtent(),new rn(a).getExtent())){o[r].push(a),l=!0;break}}l||o.push([a.reverse()])}return o}(o.rings,s);1===a.length?(i="Polygon",t=b({},t,((r={}).rings=a[0],r))):(i="MultiPolygon",t=b({},t,((n={}).rings=a,n)))}return $c((0,Eut[i])(t),!1,e)}function Tut(t){var e=Y.XY;return!0===t.hasZ&&!0===t.hasM?e=Y.XYZM:!0===t.hasZ?e=Y.XYZ:!0===t.hasM&&(e=Y.XYM),e}function Put(t){var e=t.getLayout();return{hasZ:e===Y.XYZ||e===Y.XYZM,hasM:e===Y.XYM||e===Y.XYZM}}function Fut(t,e){return(0,Sut[t.getType()])($c(t,!0,e),e)}const Lut=But;var Mut="http://www.w3.org/2001/XMLSchema-instance";function Out(t,e){return $ut().createElementNS(t,e)}function kut(t,e){return Nut(t,e,[]).join("")}function Nut(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)Nut(n,e,r)}return r}function Rut(t){return"documentElement"in t}function Uut(t){return(new DOMParser).parseFromString(t,"application/xml")}function Dut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&y(n[n.length-1],i)}}function Qut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function Gut(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function jut(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function Hut(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function zut(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,s=r;return void 0===s&&(s=i),Out(void 0!==e?e:o.namespaceURI,s)}}var Vut=zut();function Kut(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function qut(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function Wut(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var s=o[i.localName];void 0!==s&&s.call(n,i,r)}}}function Xut(t,e,r,n,i){return n.push(t),Wut(e,r,n,i),n.pop()}function Yut(t,e,r,n,i,o,s){return i.push(t),function(t,e,r,n,i,o){for(var s,a,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(s=r[u])&&void 0!==(a=e.call(void 0!==o?o:this,s,n,void 0!==i?i[u]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,n)}(e,r,n,i,o,s),i.pop()}var Zut=void 0,Jut=void 0;function $ut(){return void 0===Jut&&"undefined"!=typeof document&&(Jut=document.implementation.createDocument("","",null)),Jut}var tht=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const eht=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===Zut&&"undefined"!=typeof XMLSerializer&&(Zut=new XMLSerializer),Zut),e}return tht(e,t),e.prototype.getType=function(){return"xml"},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=Uut(t);return this.readFeatureFromDocument(r,e)}return Rut(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=Uut(t);return this.readFeaturesFromDocument(r,e)}return Rut(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&y(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return n()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=Uut(t);return this.readGeometryFromDocument(r,e)}return Rut(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Uut(t);return this.readProjectionFromDocument(e)}return Rut(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Jc);function rht(t){var e,r=kut(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function nht(t){var e,r=kut(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function iht(t){return kut(t,!1).trim()}function oht(t,e){aht(t,e?"1":"0")}function sht(t,e){var r=e.toPrecision();t.appendChild($ut().createTextNode(r))}function aht(t,e){t.appendChild($ut().createTextNode(e))}var lht,uht,hht,cht,Aht,fht,pht,dht,ght,yht=globalThis&&globalThis.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),mht=["http://www.google.com/kml/ext/2.2"],vht=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],_ht={fraction:xs.FRACTION,pixels:xs.PIXELS,insetPixels:xs.PIXELS},wht=qut(vht,{ExtendedData:dct,Region:gct,MultiGeometry:jut(sct,"geometry"),LineString:jut(nct,"geometry"),LinearRing:jut(ict,"geometry"),Point:jut(act,"geometry"),Polygon:jut(uct,"geometry"),Style:jut(cct),StyleMap:function(t,e){var r=Hht.call(this,t,e);if(r){var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:K(!1,38)}},address:jut(iht),description:jut(iht),name:jut(iht),open:jut(rht),phoneNumber:jut(iht),styleUrl:jut(Qht),visibility:jut(rht)},qut(mht,{MultiTrack:jut((function(t,e){var r=Xut([],Yht,t,e);if(r)return new th(r)}),"geometry"),Track:jut(Jht,"geometry")})),bht=qut(vht,{ExtendedData:dct,Region:gct,Link:function(t,e){Wut(xht,t,e)},address:jut(iht),description:jut(iht),name:jut(iht),open:jut(rht),phoneNumber:jut(iht),visibility:jut(rht)}),xht=qut(vht,{href:jut(Dht)}),Cht=qut(vht,{LatLonAltBox:function(t,e){var r=Xut({},vct,t,e);if(r){var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)}},Lod:function(t,e){var r=Xut({},_ct,t,e);if(r){var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}}),Eht=qut(vht,["Document","Placemark"]),Sht=qut(vht,{Document:Hut((function(t,e,r){Yut({node:t},Ect,Sct,e,r,void 0,this)})),Placemark:Hut(Yct)}),Bht=null,Iht=null,Tht=null,Pht=null,Fht=null,Lht=null;function Mht(t){return 32/Math.min(t[0],t[1])}function Oht(t){return t}var kht=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Lht||(Bht=new Fn({color:lht=[255,255,255,1]}),uht=[20,2],hht=xs.PIXELS,cht=xs.PIXELS,Aht=[64,64],fht="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Iht=new Us({anchor:uht,anchorOrigin:Cs.BOTTOM_LEFT,anchorXUnits:hht,anchorYUnits:cht,crossOrigin:"anonymous",rotation:0,scale:Mht(Aht),size:Aht,src:fht}),pht="NO_IMAGE",Tht=new Rn({color:lht,width:1}),dht=new Rn({color:[51,51,51,1],width:2}),Pht=new Wi({font:"bold 16px Helvetica",fill:Bht,stroke:dht,scale:.8}),Fht=new Vi({fill:Bht,image:Iht,text:Pht,stroke:Tht,zIndex:0}),Lht=[Fht]),r.dataProjection=ir("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Lht,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:Oht,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return yht(e,t),e.prototype.readDocumentOrFolder_=function(t,e){return Xut([],qut(vht,{Document:Dut(this.readDocumentOrFolder_,this),Folder:Dut(this.readDocumentOrFolder_,this),Placemark:Qut(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this)||void 0},e.prototype.readPlacemark_=function(t,e){var r,n,i,o,s,a=Xut({geometry:null},wht,t,e,this);if(a){var l=new X,u=t.getAttribute("id");null!==u&&l.setId(u);var h=e[0],c=a.geometry;if(c&&$c(c,!1,h),l.setGeometry(c),delete a.geometry,this.extractStyles_){var A=(r=a.Style,n=a.styleUrl,i=this.defaultStyle_,o=this.sharedStyles_,s=this.showPointNames_,function(t,e){var a=s,l="",u=[];if(a){var h=t.getGeometry();if(h)if(h instanceof SA)a=(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e}))).length>0;else{var c=h.getType();a="Point"===c||"MultiPoint"===c}}a&&(l=t.get("name"),(a=a&&!!l)&&l.search(/&[^&]+;/)>-1&&(ght||(ght=document.createElement("textarea")),ght.innerHTML=l,l=ght.value));var A=i;if(r?A=r:n&&(A=Nht(n,i,o)),a){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var s=i.getScaleArray(),a=i.getAnchor();r[0]=s[0]*(o[0]-a[0]),r[1]=s[1]*(o[1]/2-a[1]),n="left"}}var l=t.getText();return l?((l=l.clone()).setFont(l.getFont()||Pht.getFont()),l.setScale(l.getScale()||Pht.getScale()),l.setFill(l.getFill()||Pht.getFill()),l.setStroke(l.getStroke()||dht)):l=Pht.clone(),l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new Vi({image:i,text:l})}(A[0],l);return u.length>0?(f.setGeometry(new SA(u)),[f,new Vi({geometry:A[0].getGeometry(),image:null,fill:A[0].getFill(),stroke:A[0].getStroke(),text:null})].concat(A.slice(1))):f}return A});l.setStyle(A)}return delete a.Style,l.setProperties(a,!0),l}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=cct.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Hht.call(this,t,e);if(n){var i,o=t.baseURI;o&&"about:blank"!=o||(o=window.location.href),i=o?new URL("#"+r,o).href:"#"+r,this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){return p(vht,t.namespaceURI)&&this.readPlacemark_(t,[this.getReadOptions(t,e)])||null},e.prototype.readFeaturesFromNode=function(t,e){if(!p(vht,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&y(r,s)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Uut(t);return this.readNameFromDocument(e)}return Rut(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(p(vht,e.namespaceURI)&&"name"==e.localName)return iht(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(p(vht,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=Uut(t);y(e,this.readNetworkLinksFromDocument(r))}else Rut(t)?y(e,this.readNetworkLinksFromDocument(t)):y(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(vht,r.namespaceURI)&&"NetworkLink"==r.localName){var n=Xut({},bht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(vht,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Uut(t);y(e,this.readRegionFromDocument(r))}else Rut(t)?y(e,this.readRegionFromDocument(t)):y(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&y(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(p(vht,r.namespaceURI)&&"Region"==r.localName){var n=Xut({},Cht,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!p(vht,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||y(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Out(vht[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",mht[0]),r.setAttributeNS(n,"xmlns:xsi",Mut),r.setAttributeNS(Mut,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=Eht[r.namespaceURI],a=Kut(o,s);return Yut(i,Sht,Vut,a,[e],s,this),r},e}(eht);function Nht(t,e,r){return Array.isArray(t)?t:"string"==typeof t?Nht(r[t],e,r):e}function Rht(t){var e=kut(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function Uht(t){var e=kut(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),s=parseFloat(n[2]),a=n[3]?parseFloat(n[3]):0;r.push(o,s,a),e=e.substr(n[0].length)}if(""===e)return r}function Dht(t){var e=kut(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Qht(t){var e=kut(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Ght(t){return nht(t)}var jht=qut(vht,{Pair:function(t,e){var r=Xut({},yct,t,e,this);if(r){var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}}});function Hht(t,e){return Xut(void 0,jht,t,e,this)}var zht=qut(vht,{Icon:jut((function(t,e){return Xut({},$ht,t,e)||null})),color:jut(Rht),heading:jut(nht),hotSpot:jut((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Cs.BOTTOM_LEFT:Cs.TOP_LEFT:"insetPixels"!==n?Cs.BOTTOM_RIGHT:Cs.TOP_RIGHT,{x:parseFloat(t.getAttribute("x")),xunits:_ht[r],y:parseFloat(t.getAttribute("y")),yunits:_ht[n],origin:e}})),scale:jut(Ght)}),Vht=qut(vht,{color:jut(Rht),scale:jut(Ght)}),Kht=qut(vht,{color:jut(Rht),width:jut(nht)}),qht=qut(vht,{color:jut(Rht),fill:jut(rht),outline:jut(rht)}),Wht=qut(vht,{coordinates:Gut(Uht)});function Xht(t,e){return Xut(null,Wht,t,e)}var Yht=qut(mht,{Track:Qut(Jht)}),Zht=qut(vht,{when:function(t,e){var r=e[e.length-1].whens,n=kut(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},qut(mht,{coord:function(t,e){var r=e[e.length-1].coordinates,n=kut(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);r.push([o,s,a])}else r.push([])}}));function Jht(t,e){var r=Xut({coordinates:[],whens:[]},Zht,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,s=0,a=Math.min(i.length,o.length);s<a;++s)3==i[s].length&&n.push(i[s][0],i[s][1],i[s][2],o[s]);return new Nn(n,Y.XYZM)}}var $ht=qut(vht,{href:jut(Dht)},qut(mht,{x:jut(nht),y:jut(nht),w:jut(nht),h:jut(nht)})),tct=qut(vht,{coordinates:Gut(Uht)});function ect(t,e){return Xut(null,tct,t,e)}var rct=qut(vht,{extrude:jut(rht),tessellate:jut(rht),altitudeMode:jut(iht)});function nct(t,e){var r=Xut({},rct,t,e),n=ect(t,e);if(n){var i=new Nn(n,Y.XYZ);return i.setProperties(r,!0),i}}function ict(t,e){var r=Xut({},rct,t,e),n=ect(t,e);if(n){var i=new xn(n,Y.XYZ,[n.length]);return i.setProperties(r,!0),i}}var oct=qut(vht,{LineString:Qut(nct),LinearRing:Qut(ict),MultiGeometry:Qut(sct),Point:Qut(act),Polygon:Qut(uct)});function sct(t,e){var r,n=Xut([],oct,t,e);if(!n)return null;if(0===n.length)return new SA(n);for(var i=!0,o=n[0].getType(),s=1,a=n.length;s<a;++s)if(n[s].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if("Point"==o){var h=n[0];for(l=h.getLayout(),u=h.getFlatCoordinates(),s=1,a=n.length;s<a;++s)y(u,n[s].getFlatCoordinates());Act(r=new nh(u,l),n)}else"LineString"==o?Act(r=new th(n),n):"Polygon"==o?Act(r=new ah(n),n):"GeometryCollection"==o?r=new SA(n):K(!1,37)}else r=new SA(n);return r}function act(t,e){var r=Xut({},rct,t,e),n=ect(t,e);if(n){var i=new on(n,Y.XYZ);return i.setProperties(r,!0),i}}var lct=qut(vht,{innerBoundaryIs:function(t,e){var r=Xut([],wct,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=Xut(void 0,bct,t,e);r&&(e[e.length-1][0]=r)}});function uct(t,e){var r=Xut({},rct,t,e),n=Xut([null],lct,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],s=1,a=n.length;s<a;++s)y(i,n[s]),o.push(i.length);var l=new xn(i,Y.XYZ,o);return l.setProperties(r,!0),l}}var hct=qut(vht,{IconStyle:function(t,e){var r=Xut({},zht,t,e);if(r){var n,i,o,s,a=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?n=h:u&&(n=fht);var c,A=Cs.BOTTOM_LEFT,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,s=f.yunits,A=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(/pushpin/.test(n)?(i=uht,o=hht,s=cht):/arrow-reverse/.test(n)?(i=[54,42],o=hht,s=cht):/paddle/.test(n)&&(i=[32,1],o=hht,s=cht));var p,d=l.x,g=l.y;void 0!==d&&void 0!==g&&(c=[d,g]);var y,m=l.w,v=l.h;void 0!==m&&void 0!==v&&(p=[m,v]);var _=r.heading;void 0!==_&&(y=Ae(_));var w=r.scale,b=r.color;if(u){n==fht&&(p=Aht);var x=new Us({anchor:i,anchorOrigin:A,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Cs.BOTTOM_LEFT,rotation:y,scale:w,size:p,src:this.iconUrlFunction_(n),color:b}),C=x.getScaleArray()[0],E=x.getSize();if(null===E){var S=x.getImageState();if(S===Un.IDLE||S===Un.LOADING){var B=function(){var t=x.getImageState();if(t!==Un.IDLE&&t!==Un.LOADING){var e=x.getSize();if(e&&2==e.length){var r=Mht(e);x.setScale(C*r)}x.unlistenImageChange(B)}};x.listenImageChange(B),S===Un.IDLE&&x.load()}}else if(2==E.length){var I=Mht(E);x.setScale(C*I)}a.imageStyle=x}else a.imageStyle=pht}},LabelStyle:function(t,e){var r=Xut({},Vht,t,e);if(r){var n=e[e.length-1],i=new Wi({fill:new Fn({color:"color"in r?r.color:lht}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=Xut({},Kht,t,e);if(r){var n=e[e.length-1],i=new Rn({color:"color"in r?r.color:lht,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=Xut({},qht,t,e);if(r){var n=e[e.length-1],i=new Fn({color:"color"in r?r.color:lht});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var s=r.outline;void 0!==s&&(n.outline=s)}}});function cct(t,e){var r=Xut({},hct,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:Bht,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=pht&&(n=r.imageStyle):n=Iht;var s="textStyle"in r?r.textStyle:Pht,a="strokeStyle"in r?r.strokeStyle:Tht,l=r.outline;return void 0===l||l?[new Vi({fill:i,image:n,stroke:a,text:s,zIndex:void 0})]:[new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e}))):"Polygon"!==r&&"MultiPolygon"!==r?e:void 0},fill:i,image:n,stroke:a,text:s,zIndex:void 0}),new Vi({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new SA(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e}))):"Polygon"===r||"MultiPolygon"===r?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function Act(t,e){var r,n,i,o=e.length,s=new Array(e.length),a=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];s[u]=h.get("extrude"),a[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==s[u],n=n||void 0!==a[u],i=i||l[u]}r&&t.set("extrude",s),n&&t.set("tessellate",a),i&&t.set("altitudeMode",l)}var fct=qut(vht,{displayName:jut(iht),value:jut(iht)}),pct=qut(vht,{Data:function(t,e){var r=t.getAttribute("name");Wut(fct,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){Wut(mct,t,e)}});function dct(t,e){Wut(pct,t,e)}function gct(t,e){Wut(Cht,t,e)}var yct=qut(vht,{Style:jut(cct),key:jut(iht),styleUrl:jut(Qht)}),mct=qut(vht,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=iht(t);e[e.length-1][r]=n}}}),vct=qut(vht,{altitudeMode:jut(iht),minAltitude:jut(nht),maxAltitude:jut(nht),north:jut(nht),south:jut(nht),east:jut(nht),west:jut(nht)}),_ct=qut(vht,{minLodPixels:jut(nht),maxLodPixels:jut(nht),minFadeExtent:jut(nht),maxFadeExtent:jut(nht)}),wct=qut(vht,{LinearRing:Qut(Xht)}),bct=qut(vht,{LinearRing:Gut(Xht)});function xct(t,e){for(var r=Zn(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}aht(t,n.join(""))}var Cct=qut(vht,{Data:Hut((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&Yut(n,Cct,Vut,[i.displayName],r,["displayName"]),null!==i&&i.value&&Yut(n,Cct,Vut,[i.value],r,["value"])):Yut(n,Cct,Vut,[i],r,["value"])})),value:Hut((function(t,e){aht(t,e)})),displayName:Hut((function(t,e){!function(t,e){t.appendChild($ut().createCDATASection(e))}(t,e)}))}),Ect=qut(vht,{Placemark:Hut(Yct)}),Sct=function(t,e,r){return Out(e[e.length-1].node.namespaceURI,"Placemark")},Bct=zut("Data"),Ict=qut(vht,["href"],qut(mht,["x","y","w","h"])),Tct=qut(vht,{href:Hut(aht)},qut(mht,{x:Hut(sht),y:Hut(sht),w:Hut(sht),h:Hut(sht)})),Pct=function(t,e,r){return Out(mht[0],"gx:"+r)},Fct=qut(vht,["scale","heading","Icon","color","hotSpot"]),Lct=qut(vht,{Icon:Hut((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=Ict[i.namespaceURI],s=Kut(e,o);Yut(n,Tct,Vut,s,r,o),s=Kut(e,o=Ict[mht[0]]),Yut(n,Tct,Pct,s,r,o)})),color:Hut(xct),heading:Hut(sht),hotSpot:Hut((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:Hut(sAt)}),Mct=qut(vht,["color","scale"]),Oct=qut(vht,{color:Hut(xct),scale:Hut(sAt)}),kct=qut(vht,["color","width"]),Nct=qut(vht,{color:Hut(xct),width:Hut(sht)}),Rct={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Uct=function(t,e,r){if(t)return Out(e[e.length-1].node.namespaceURI,Rct[t.getType()])},Dct=zut("Point"),Qct=zut("LineString"),Gct=zut("LinearRing"),jct=zut("Polygon"),Hct=qut(vht,{LineString:Hut($ct),Point:Hut($ct),Polygon:Hut(iAt),GeometryCollection:Hut(zct)});function zct(t,e,r){var n,i={node:t},o=e.getType(),s=[];"GeometryCollection"===o?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();"MultiPoint"===e?s=s.concat(t.getPoints()):"MultiLineString"===e?s=s.concat(t.getLineStrings()):"MultiPolygon"===e?s=s.concat(t.getPolygons()):"Point"===e||"LineString"===e||"Polygon"===e?s.push(t):K(!1,39)})),n=Uct):"MultiPoint"===o?(s=e.getPoints(),n=Dct):"MultiLineString"===o?(s=e.getLineStrings(),n=Qct):"MultiPolygon"===o?(s=e.getPolygons(),n=jct):K(!1,39),Yut(i,Hct,n,s,r)}var Vct=qut(vht,{LinearRing:Hut($ct)});function Kct(t,e,r){Yut({node:t},Vct,Gct,[e],r)}var qct=qut(vht,{ExtendedData:Hut((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,s=i.length,a=0;a<s;a++)Yut(n,Cct,Bct,[{name:i[a],value:o[a]}],r)})),MultiGeometry:Hut(zct),LineString:Hut($ct),LinearRing:Hut($ct),Point:Hut($ct),Polygon:Hut(iAt),Style:Hut((function(t,e,r){var n,i={node:t},o={};if(e.pointStyles.length){var s=e.pointStyles[0].getText();s&&(o.LabelStyle=s);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(o.IconStyle=a)}e.lineStyles.length&&(n=e.lineStyles[0].getStroke())&&(o.LineStyle=n),e.polyStyles.length&&((n=e.polyStyles[0].getStroke())&&!o.LineStyle&&(o.LineStyle=n),o.PolyStyle=e.polyStyles[0]);var l=r[r.length-1].node,u=aAt[l.namespaceURI],h=Kut(o,u);Yut(i,lAt,Vut,h,r,u)})),address:Hut(aht),description:Hut(aht),name:Hut(aht),open:Hut(oht),phoneNumber:Hut(aht),styleUrl:Hut(aht),visibility:Hut(oht)}),Wct=qut(vht,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Xct=zut("ExtendedData");function Yct(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var s=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),a=e.getStyleFunction();if(a){var l=a(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e})).length:"Point"===n||"MultiPoint"===n}}))),this.writeStyles_){var c=u,A=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"LineString"===e||"MultiLineString"===e})).length:"LineString"===n||"MultiLineString"===n}})),A=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e})).length:"Polygon"===n||"MultiPolygon"===n}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:A}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var p=r[r.length-1].node,d=Wct[p.namespaceURI],g=Kut(i,d);if(Yut(n,qct,Vut,g,r,d),s.length>0){var y=Kut(i,s);Yut(n,qct,Xct,[{names:s,values:y}],r)}var m=r[0],v=e.getGeometry();v&&(v=$c(v,!0,m)),Yut(n,qct,Uct,[v],r)}var Zct=qut(vht,["extrude","tessellate","altitudeMode","coordinates"]),Jct=qut(vht,{extrude:Hut(oht),tessellate:Hut(oht),altitudeMode:Hut(aht),coordinates:Hut((function(t,e,r){var n,i=r[r.length-1],o=i.layout,s=i.stride;o==Y.XY||o==Y.XYM?n=2:o==Y.XYZ||o==Y.XYZM?n=3:K(!1,34);var a=e.length,l="";if(a>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=s;h<a;h+=s)for(l+=" "+e[h],u=1;u<n;++u)l+=","+e[h+u]}aht(t,l)}))});function $ct(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var s=r[r.length-1].node,a=Zct[s.namespaceURI],l=Kut(o,a);Yut(i,Jct,Vut,l,r,a)}var tAt=qut(vht,["color","fill","outline"]),eAt=qut(vht,{outerBoundaryIs:Hut(Kct),innerBoundaryIs:Hut(Kct)}),rAt=zut("innerBoundaryIs"),nAt=zut("outerBoundaryIs");function iAt(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};Yut(o,eAt,rAt,n,r),Yut(o,eAt,nAt,[i],r)}var oAt=qut(vht,{color:Hut(xct),fill:Hut(oht),outline:Hut(oht)});function sAt(t,e){sht(t,Math.round(1e6*e)/1e6)}var aAt=qut(vht,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),lAt=qut(vht,{IconStyle:Hut((function(t,e,r){var n={node:t},i={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),l={href:o};if(s){l.w=s[0],l.h=s[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&a&&0!==h[0]&&h[1]!==s[1]&&(l.x=h[0],l.y=a[1]-(h[1]+s[1])),u&&(u[0]!==s[0]/2||u[1]!==s[1]/2)){var c={x:u[0],xunits:xs.PIXELS,y:s[1]-u[1],yunits:xs.PIXELS};i.hotSpot=c}}i.Icon=l;var A=e.getScaleArray()[0],f=s;null===f&&(f=Aht),2==f.length&&(A/=Mht(f)),1!==A&&(i.scale=A);var p=e.getRotation();0!==p&&(i.heading=p);var d=e.getColor();d&&(i.color=d);var g=r[r.length-1].node,y=Fct[g.namespaceURI],m=Kut(i,y);Yut(n,Lct,Vut,m,r,y)})),LabelStyle:Hut((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var s=e.getScale();s&&1!==s&&(i.scale=s);var a=r[r.length-1].node,l=Mct[a.namespaceURI],u=Kut(i,l);Yut(n,Oct,Vut,u,r,l)})),LineStyle:Hut((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,s=kct[o.namespaceURI],a=Kut(i,s);Yut(n,Nct,Vut,a,r,s)})),PolyStyle:Hut((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),s={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},a=r[r.length-1].node,l=tAt[a.namespaceURI],u=Kut(s,l);Yut(n,oAt,Vut,u,r,l)}))});const uAt=kht;var hAt=function(t){t=t||{},this.duration_="number"==typeof t.duration?t.duration>=0?t.duration:0:1e3,this.fade_="function"==typeof t.fade?t.fade:null,this.repeat_=Number(t.repeat);var e="function"==typeof t.easing?t.easing:wa;t.revers?this.easing_=function(t){return 1-e(t)}:this.easing_=e,this.hiddenStyle=t.hiddenStyle,D.call(this)};qm(hAt,D),hAt.hiddenStyle=new Vi({image:new Di({}),stroke:new Rn({color:"transparent"})}),hAt.prototype.drawGeom_=function(t,e,r){this.fade_&&(t.context.globalAlpha=this.fade_(1-t.elapsed));for(var n=t.style,i=0;i<n.length;i++)try{var o=t.vectorContext||yut(t),s=vut(t,n[i]);o.setStyle(s),s.getZIndex()<0?o.drawGeometry(r||e):o.drawGeometry(e)}catch(a){}},hAt.prototype.animate=function(){return!1},Qh.prototype.animateFeature=function(t,e){var r=this._featureAnimationLayer;r||(r=this._featureAnimationLayer=new ta({source:new pa})).setMap(this),r.getSource().addFeature(t);var n=e.on("animationend",(function(e){e.feature===t&&(r.getSource().removeFeature(t),k(n))}));r.animateFeature(t,e)},Zi.prototype.animateFeature=function(t,e,r){var n,i=this,o=t.getStyle(),s=o||(this.getStyleFunction?this.getStyleFunction()(t):null);s||(s=[]),s instanceof Array||(s=[s]);var a={vectorContext:null,frameState:null,start:0,time:0,elapsed:0,extent:!1,feature:t,geom:t.getGeometry(),typeGeom:t.getGeometry().getType(),bbox:t.getGeometry().getExtent(),coord:Vt(t.getGeometry().getExtent()),style:s};e instanceof Array||(e=[e]);for(var l=e.length-1;l>=0;l--)0===e[l].duration_&&e.splice(l,1);var u=0,h=0,c=r&&this.getFilters?this.getFilters():[];function A(r){a.type=r.type;try{a.vectorContext=r.vectorContext||yut(r)}catch(o){}if(a.frameState=r.frameState,a.inversePixelTransform=r.inversePixelTransform,a.extent||(a.extent=r.frameState.extent,a.start=r.frameState.time,a.context=r.context),a.time=r.frameState.time-a.start,a.elapsed=a.time/e[h].duration_,a.elapsed>1&&(a.elapsed=1),r.context.save(),c.forEach((function(t){t.get("active")&&t.precompose(r)})),this.getOpacity&&(r.context.globalAlpha=this.getOpacity()),e[h].animate(a)){var n={type:"animating",step:h,start:a.start,time:a.time,elapsed:a.elapsed,rotation:a.rotation||0,geom:a.geom,coordinate:a.coord,feature:t};e[h].dispatchEvent(n),i.dispatchEvent(n)}else++u<e[h].repeat_?a.extent=!1:h<e.length-1?(e[h].dispatchEvent({type:"animationend",feature:t}),h++,u=0,a.extent=!1):f();c.forEach((function(t){t.get("active")&&t.postcompose(r)})),r.context.restore(),r.frameState.animate=!0}function f(r){k(n),n=null,t.setStyle(o);var s={type:"animationend",feature:t};if(r)for(var a in r)r.hasOwnProperty(a)&&(s[a]=r[a]);e[h].dispatchEvent(s),i.dispatchEvent(s)}function p(r){if(e.length&&!n){if(n=i.on(["postcompose","postrender"],A.bind(i)),i.renderSync)try{i.renderSync()}catch(FX){}else i.changed();t.setStyle(e[h].hiddenStyle||hAt.hiddenStyle);var o={type:"animationstart",feature:t};if(r)for(var s in r)r.hasOwnProperty(s)&&(o[s]=r[s]);e[h].dispatchEvent(o),i.dispatchEvent(o)}}return p(),{start:p,stop:f,isPlaying:function(){return!!n}}};var cAt=function(t){t=t||{},hAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||3)};qm(cAt,hAt),cAt.prototype.animate=function(t){var e=t.geom.clone(),r=Math.abs(Math.sin(this.bounce_*t.elapsed))*this.amplitude_*(1-this.easing_(t.elapsed))*t.frameState.viewState.resolution;return e.translate(0,r),this.drawGeom_(t,e,t.geom),t.time<=this.duration_};var AAt=function(t){hAt.call(this,t),this.set("nb",t.nb||10)};qm(AAt,hAt),AAt.prototype.animate=function(t){return Math.round(this.easing_(t.elapsed)*this.get("nb"))%2||this.drawGeom_(t,t.geom),t.time<=this.duration_};var fAt=function(t){t=t||{},this.speed_=t.speed||0,hAt.call(this,t),this.side_=t.side||"top"};qm(fAt,hAt),fAt.prototype.animate=function(t){if(!t.time){var e=t.frameState.viewState.rotation,r=t.frameState.size[1]*t.frameState.viewState.resolution;"top"!=this.side_&&(r*=-1),this.dx=-Math.sin(e)*r,this.dy=Math.cos(e)*r,this.speed_&&(this.duration_=r/this.speed_/t.frameState.viewState.resolution)}var n=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*(1-this.easing_(t.elapsed))),this.drawGeom_(t,n,t.geom),t.time<=this.duration_};var pAt=function(t){t=t||{},this.speed_=t.speed||0,hAt.call(this,t)};qm(pAt,hAt),pAt.prototype.animate=function(t){return t.context.globalAlpha=this.easing_(t.elapsed),this.drawGeom_(t,t.geom),t.time<=this.duration_};var dAt=function(t){switch(t=t||{},hAt.call(this,t),this.speed_=t.speed||0,this.path_=t.path,t.rotate){case!0:case 0:this.rotate_=0;break;default:this.rotate_=t.rotate||!1}this.path_&&this.path_.getGeometry&&(this.path_=this.path_.getGeometry()),this.path_&&this.path_.getLineString&&(this.path_=this.path_.getLineString()),this.path_.getLength?(this.dist_=this.path_.getLength(),this.path_&&this.path_.getCoordinates&&(this.path_=this.path_.getCoordinates())):this.dist_=0,this.speed_>0&&(this.duration_=this.dist_/this.speed_)};qm(dAt,hAt),dAt.prototype.animate=function(t){if(!t.time&&!this.dist_)return!1;var e,r,n,i,o,s,a=this.dist_*this.easing_(t.elapsed),l=0;r=this.path_[0];for(var u=1;u<this.path_.length;u++){if(e=r,i=(r=this.path_[u])[0]-e[0],o=r[1]-e[1],(s=Math.sqrt(i*i+o*o))&&l+s>=a){n=(a-l)/s,r=[e[0]+(r[0]-e[0])*n,e[1]+(r[1]-e[1])*n];break}l+=s}var h=t.style;if(t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]),!1!==this.rotate_){var c=[],A=this.rotate_-t.rotation+t.frameState.viewState.rotation;t.rotation=Math.PI/2+Math.atan2(e[1]-r[1],e[0]-r[0]);for(var f=0;n=t.style[f];f++)n.getImage()&&n.getImage().setRotation(A),c.push(n);t.style=c}return t.geom.setCoordinates(r),this.drawGeom_(t,t.geom),t.style=h,t.time<=this.duration_};var gAt=function(t){t=t||{},hAt.call(this,t),this.amplitude_=t.amplitude||40,this.bounce_=-Math.PI*(t.bounce||6),this.horizontal_=t.horizontal};qm(gAt,hAt),gAt.prototype.animate=function(t){var e=t.geom.clone(),r=t.geom.clone(),n=this.easing_(t.elapsed);return n=Math.sin(this.bounce_*n)*this.amplitude_*(1-n)*t.frameState.viewState.resolution,this.horizontal_?(e.translate(n,0),r.translate(n,0)):e.translate(0,n),this.drawGeom_(t,e,r),t.time<=this.duration_};var yAt=function(t){hAt.call(this,t)};qm(yAt,hAt),yAt.prototype.animate=function(t){return this.drawGeom_(t,t.geom),t.time<=this.duration_};var mAt=function(t){t=t||{},this.speed_=t.speed||0,hAt.call(this,t),this.side_=t.side||"left"};qm(mAt,hAt),mAt.prototype.animate=function(t){t.time||("left"==this.side_?this.dx=t.extent[0]-t.bbox[2]:this.dx=t.extent[2]-t.bbox[0],this.speed_&&(this.duration_=Math.abs(this.dx)/this.speed_/t.frameState.viewState.resolution));var e=t.geom.clone();return e.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,e),t.time<=this.duration_};var vAt=function(t){hAt.call(this,t)};qm(vAt,hAt),vAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){t.context.save();var r=t.frameState.pixelRatio;t.context.globalAlpha=e,t.context.scale(e,1/e);var n=t.frameState.coordinateToPixelTransform,i=(1/e-1)*r*(n[0]*t.coord[0]+n[1]*t.coord[1]+n[4]),o=(e-1)*r*(n[2]*t.coord[0]+n[3]*t.coord[1]+n[5]);t.context.translate(i,o),this.drawGeom_(t,t.geom),t.context.restore()}return t.time<=this.duration_};var _At=function(t){t=t||{},hAt.call(this,t),this.speed_=t.speed||0,this.side_=t.side||"left"};qm(_At,hAt),_At.prototype.animate=function(t){var e,r;!t.time&&this.speed_&&("left"==this.side_?(e=this.dx=t.extent[0]-t.bbox[2],r=this.dy=t.extent[3]-t.bbox[1]):(e=this.dx=t.extent[2]-t.bbox[0],r=this.dy=t.extent[3]-t.bbox[1]),this.duration_=Math.sqrt(e*e+r*r)/this.speed_/t.frameState.viewState.resolution);var n=t.geom.clone(),i=t.geom.clone();return n.translate(this.dx*(1-this.easing_(t.elapsed)),this.dy*Math.cos(Math.PI/2*this.easing_(t.elapsed))),i.translate(this.dx*(1-this.easing_(t.elapsed)),0),this.drawGeom_(t,n,i),t.time<=this.duration_};var wAt=function(t){t=t||{},hAt.call(this,t),this.set("zoomout",t.zoomOut)};qm(wAt,hAt),qm((function(t){(t=t||{}).zoomOut=!0,wAt.call(this,t)}),wAt),wAt.prototype.animate=function(t){var e=this.easing_(t.elapsed);if(e){this.get("zoomout")&&(e=1/e);var r,n,i=t.style,o=[];for(r=0;r<i.length;r++)(n=i[r].getImage())&&(o[r]=n.getScale(),"postrender"===t.type?n.setScale(o[r]*e/t.frameState.pixelRatio):n.setScale(o[r]*e));for(this.drawGeom_(t,t.geom),r=0;r<i.length;r++)(n=i[r].getImage())&&n.setScale(o[r])}return t.time<=this.duration_};class bAt extends GO{constructor(t,r){super(t,r),e(this,"animList"),this.animList=[],this.layertype="GraphicLayer",this.layer=new ta({source:this._source,zIndex:this.option.zIndex,declutter:this.option.declutter}),this.layer.set("layerid",t),this.layer.on("sourceready",(t=>{this.trigger(Cm.onLoadEnd,t)})),this._source.on("addfeature",(t=>{t.feature.get("loadAnimation")&&setTimeout((()=>{this.animateFeature(t.feature,t.feature.get("loadAnimation"))}),1),t.feature.get("pulseAnimate")&&setTimeout((()=>{this.pulseAnimate(t.feature,t.feature.get("pulseAnimate"))}),1)})),this._source.on("removefeature",(t=>{t.feature.get("pulseAnimate")&&this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&e.anim.stop({user:!0})}))})),this.layer.on(this.EventType.featureType.onFeatureContextmenu,(t=>{this._setFeatureContextmenu(t.data.feature,t.data.contextmenu)})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}pathAnimate(t,e,r){let n={rotate:!0,speed:1,revers:!0,repeat:1/0,easing:wa};r=Object.assign({},n,r);let i=new dAt({path:e,rotate:r.rotate,speed:r.speed,repeat:r.repeat,revers:r.revers});return this.trigger(Cm.onPathAnimateStart,{data:t}),i.on("animationend",(t=>{this.trigger(Cm.onPathAnimateEnd,{data:t.feature})})),i.on("animating",(t=>{this.trigger(Cm.onPathAnimateRunning,{data:t})})),this.layer.animateFeature(t,i)}pulseAnimate(t,e){let r={fade:va,duration:2e3,revers:!1,repeat:1/0,easing:va,radius:30,fillcolor:"rgba(255,0,0,0.2)",strokecolor:"red",strokewidth:1};e=Object.assign({},r,e);let n=new lv({graphicType:"PointGraphic",lnglat:t.getGeometry().getCoordinates(),style:{image:{radius:e.radius,scale:1,fill:{color:e.fillcolor},stroke:{color:e.strokecolor,width:e.strokewidth}},zIndex:990},attribute:{uuid:t.get("uuid")}}),i=new wAt(e);this.animList.push({uuid:t.get("uuid"),anim:this.layer.animateFeature(n,i)}),i.on("animationend",(t=>{this.animList.forEach(((e,r)=>{t.feature.get("uuid")===e.uuid&&this.animList.splice(r,1)}))}))}animateFeatures(t,e){t.forEach(((t,r)=>{this.animateFeature(t,e)}))}animateFeature(t,e){let r,n={duration:3e3,animateType:km.Bounce,repeat:1,speed:.8,revers:!1,zoomOut:!1,side:!1};switch((e=Object.assign({},n,e)).animateType){case km.Blink:r=new AAt(e);break;case km.Drop:r=new fAt(e);break;case km.Fade:r=new pAt(e);break;case km.Path:r=new dAt(e);break;case km.Shake:r=new gAt(e);break;case km.Show:r=new yAt(e);break;case km.Slide:r=new mAt(e);break;case km.Teleport:r=new vAt(e);break;case km.Throw:r=new _At(e);break;case km.Zoom:r=new wAt(e);break;case km.ZoomOut:e.zoomOut=!0,r=new wAt(e);break;default:r=new cAt(e)}this.layer.animateFeature(t,r)}}var xAt=function(t){(t=t||{}).displacement||(t.displacement=[t.offsetX||0,-t.offsetY||0]),this.sanchor_="anchored"===t.kind?8:0,this._shadow=Number(t.shadow)||0,t.stroke||(t.stroke=new Rn({width:0,color:"#000"}));var e=t.stroke.getWidth();if(e<0&&(e=0),"folio"==t.kind&&(e+=6),t.stroke.setWidth(e),Ri.call(this,{radius:t.radius+e+this.sanchor_/2+this._shadow/2,points:0,displacement:[t.displacement[0]||0,(t.displacement[1]||0)+this.sanchor_],fill:Ri.prototype.render?new Fn({color:[0,0,0,0]}):null}),!this.getHitDetectionImage){var r=Ri.prototype.getImage.call(this);if(!this.hitDetectionCanvas_)for(var n in this)if(this[n]&&this[n].getContext&&this[n]!==r){this.hitDetectionCanvas_=this[n];break}this.hitDetectionCanvas_=document.createElement("canvas"),this.hitDetectionCanvas_.width=r.width,this.hitDetectionCanvas_.height=r.height;var i=this.hitDetectionCanvas_;this.getHitDetectionImage=function(){return i}}this._stroke=t.stroke,this._fill=t.fill,this._crop=t.crop,this._crossOrigin=t.crossOrigin,this._kind=t.kind||"default",this._radius=t.radius,this._src=t.src,this._offset=[t.offsetX?t.offsetX:0,t.offsetY?t.offsetY:0],this._onload=t.onload,"number"==typeof t.opacity&&this.setOpacity(t.opacity),"number"==typeof t.rotation&&this.setRotation(t.rotation),this.getImage()};qm(xAt,Ri),xAt.prototype.setOffset=function(t){this._offset=[t[0]||0,t[1]||0],this.getImage()},xAt.prototype.clone=function(){var t=new xAt({stroke:this._stroke,fill:this._fill,shadow:this._shadow,crop:this._crop,crossOrigin:this._crossOrigin,kind:this._kind,radius:this._radius,src:this._src,offsetX:this._offset[0],offsetY:this._offset[1],opacity:this.getOpacity(),rotation:this.getRotation()});return t.getImage(),t},CanvasRenderingContext2D.prototype.roundRect=function(t,e,r,n,i){return i?(r<2*i&&(i=r/2),n<2*i&&(i=n/2),this.beginPath(),this.moveTo(t+i,e),this.arcTo(t+r,e,t+r,e+n,i),this.arcTo(t+r,e+n,t,e+n,i),this.arcTo(t,e+n,t,e,i),this.arcTo(t,e,t+r,e,i),this.closePath()):this.rect(t,e,r,n),this},xAt.prototype.drawBack_=function(t,e,r,n){var i=this._shadow,o=t.canvas;t.beginPath(),t.fillStyle=e,t.clearRect(0,0,o.width,o.height);var s=o.width/n,a=o.height/n;switch(this._kind){case"square":t.rect(0,0,s-i,a-i);break;case"circle":t.arc(this._radius+r,this._radius+r,this._radius+r,0,2*Math.PI,!1);break;case"folio":r-=6,t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=1;var l=s-i-12,u=Math.atan(6/l);t.save(),t.rotate(-u),t.translate(-6,2),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.save(),t.translate(6,-1),t.rotate(u),t.beginPath(),t.rect(6,6,l,l),t.stroke(),t.fill(),t.restore(),t.beginPath(),t.rect(6,6,l,l),t.stroke();break;case"anchored":t.roundRect(this.sanchor_/2,0,s-this.sanchor_-i,a-this.sanchor_-i,r),t.moveTo(s/2-this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2+this.sanchor_-i/2,a-this.sanchor_-i),t.lineTo(s/2-i/2,a-i);break;default:t.roundRect(0,0,s-i,a-i,r)}t.closePath()},xAt.prototype.getImage=function(t){t=t||1;var e,r=Ri.prototype.getImage.call(this,t);if(this._gethit)return r;var n=0;this._stroke&&(e=Kn(this._stroke.getColor()),n=this._stroke.getWidth()),this._gethit=!0;var i=this.getHitDetectionImage().getContext("2d");i.save(),i.setTransform(1,0,0,1,0,0),this.drawBack_(i,"#000",n,1),i.fill(),i.restore(),this._gethit=!1,(i=r.getContext("2d")).save(),i.setTransform(t,0,0,t,0,0),this.drawBack_(i,e,n,t),this._shadow&&(i.shadowColor="rgba(0,0,0,0.5)",i.shadowBlur=t*this._shadow/2,i.shadowOffsetX=t*this._shadow/2,i.shadowOffsetY=t*this._shadow/2),i.fill(),i.restore();var o=this,s=this.img_=new Image;if(this._crossOrigin&&(s.crossOrigin=this._crossOrigin),s.src=this._src,s.width?o.drawImage_(r,s,t):s.onload=function(){o.drawImage_(r,s,t),o._onload&&o._onload()},!this.getDisplacement){var a=this.getAnchor();a[0]=(r.width/t-this._shadow)/2-this._offset[0],this.sanchor_?a[1]=r.height/t-this._shadow-this._offset[1]:a[1]=(r.height/t-this._shadow)/2-this._offset[1]}return r},xAt.prototype.getPhoto=function(){return this.img_},xAt.prototype.drawImage_=function(t,e,r){var n=t.getContext("2d"),i=0;this._stroke&&(i=this._stroke.getWidth());var o,s,a,l,u,h,c,A,f,p=2*this._radius;n.save(),Ri.prototype.render&&n.setTransform(r,0,0,r,0,0),"circle"==this._kind&&(n.beginPath(),n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.clip()),this._crop?(A=f=(o=Math.min(e.width/p,e.height/p))*p,h=(e.width-A)/2,c=(e.height-f)/2,s=a=0,l=u=p+1):(h=c=0,s=(p-(l=(o=Math.min(p/e.width,p/e.height))*(A=e.width)))/2,a=(p-(u=o*(f=e.height)))/2),s+=i+this.sanchor_/2,a+=i,n.drawImage(e,h,c,A,f,s,a,l,u),"circle"==this._kind&&i&&(n.beginPath(),n.strokeStyle=Kn(this._stroke.getColor()),n.lineWidth=i/4,n.arc(this._radius+i,this._radius+i,this._radius,0,2*Math.PI,!1),n.stroke()),n.restore()};var CAt=function(t){(t=t||{}).loader=this._loader,t.strategy=aa,pa.call(this,t),this.set("time",t.time||new Date),this.set("step",t.step||1)};qm(CAt,pa),function(){function t(t){var e=Math.PI/180,r=t-2451545,n=280.46+.9856474*r,i=357.528+.9856003*r;return i%=360,{lambda:(n%=360)+1.915*Math.sin(i*e)+.02*Math.sin(2*i*e),R:1.00014-.01671*Math.cos(i*e)-.0014*Math.cos(2*i*e)}}function e(t){var e=(t-2451545)/36525;return 23.43929111-e*(46.836769/3600-e*(1831e-7/3600+e*(5.565e-7-e*(1.6e-10-4.34e-8*e/3600))))}function r(t,e){var r=180/Math.PI,n=Math.PI/180,i=Math.atan(Math.cos(e*n)*Math.tan(t*n))*r,o=Math.asin(Math.sin(e*n)*Math.sin(t*n))*r;return{alpha:i+=90*Math.floor(t/90)-90*Math.floor(i/90),delta:o}}CAt.prototype._loader=function(t,e,r){var n=this.getCoordinates(this.get("time")),i=new xn([n]);i.transform("EPSG:4326",r),this.addFeature(new X(i))},CAt.prototype.setTime=function(t){this.set("time",t),this.refresh()},CAt.prototype.getSunPosition=function(n){var i=(n?new Date(n):new Date)/864e5+2440587.5,o=(18.697374558+24.06570982441908*(i-2451545))%24,s=t(i),a=e(i),l=r(s.lambda,a);return[l.alpha-15*o,l.delta]},CAt.getNightLat=function(n,i){var o=180/Math.PI,s=Math.PI/180,a=(i?new Date(i):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=t(a),h=e(a),c=r(u.lambda,h),A=15*l+n-c.alpha;return Math.atan(-Math.cos(A*s)/Math.tan(c.delta*s))*o},CAt.prototype.getCoordinates=function(n,i){for(var o=180/Math.PI,s=Math.PI/180,a=(n?new Date(n):new Date)/864e5+2440587.5,l=(18.697374558+24.06570982441908*(a-2451545))%24,u=[],h=t(a),c=e(a),A=r(h.lambda,c),f=this.get("step")||1,p=-180;p<=180;p+=f){var d=p,g=15*l+d-A.alpha,y=Math.atan(-Math.cos(g*s)/Math.tan(A.delta*s))*o;u.push([d,y])}switch(i){case"line":break;case"day":A.delta*=-1;default:y=A.delta<0?90:-90;for(var m=180;m>=-180;m-=f)u.push([m,y]);u.push(u[0])}if("daynight"===i){var v=[];u.forEach((function(t){v.push(t.slice())})),v[0][1]=-v[0][1],v[v.length-1][1]=-v[0][1],v[v.length-1][1]=-v[0][1],u=[u,v]}return u}}();var EAt=function(t){t=t||{},this.source=t.source,this.nodes=new pa,this.maxIteration=t.maxIteration||2e4,this.stepIteration=t.stepIteration||2e3,this.astar=!0,this.candidat=[],D.call(this),this.set("epsilon",t.epsilon||1e-6)};qm(EAt,D),EAt.prototype.weight=function(){return 1},EAt.prototype.direction=function(){return 2},EAt.prototype.getLength=function(t){return t.getGeometry&&(t=t.getGeometry()),t.getLength()},EAt.prototype.getNodeSource=function(){return this.nodes},EAt.prototype.getEdges=function(t){var e=Et(Ct([t]),this.get("epsilon")),r=[];return this.source.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r},EAt.prototype.getNode=function(t){var e=Et(Ct([t]),this.get("epsilon")),r=[];return this.nodes.forEachFeatureIntersectingExtent(e,(function(t){r.push(t)})),r[0]},EAt.prototype.addNode=function(t,e,r,n,i){if(this.wdist&&e>this.wdist)return!1;var o=this.getNode(t),s=e+this.getLength(new Nn([this.end,t]))*this.weight();if(this.astar&&this.wdist&&s>this.wdist)return!1;if(o){if(o!==this.arrival&&o.get("wdist")<=e)return o;o.set("dist",r),o.set("wdist",e),o.set("dtotal",s),o.set("from",n),o.set("prev",i),o===this.arrival&&(this.wdist=e),this.candidat.push(o)}else o=new X({geometry:new on(t),from:n,prev:i,dist:r||0,wdist:e,dtotal:s}),e<0?o.set("wdist",!1):this.candidat.push(o),this.nodes.addFeature(o);return o},EAt.prototype.closestCoordinate=function(t){var e=this.source.getClosestFeatureToCoordinate(t),r=e.getGeometry().getFirstCoordinate(),n=e.getGeometry().getLastCoordinate();return uut(t,r)<uut(t,n)?r:n},EAt.prototype.path=function(t,e){if(this.running)return!1;if(t=this.closestCoordinate(t),this.end=this.closestCoordinate(e),t[0]===this.end[0]&&t[1]===this.end[1])return this.dispatchEvent({type:"finish",route:[],wDistance:-1,distance:this.wdist}),!1;var r=this;return this.nodes.clear(),this.candidat=[],this.wdist=0,this.running=!0,this.addNode(t,0),this.arrival=this.addNode(this.end,-1),this.nb=0,this.dispatchEvent({type:"start"}),setTimeout((function(){r._resume()})),[t,this.end]},EAt.prototype.resume=function(){this.running||this.candidat.length&&(this.running=!0,this.nb=0,this._resume())},EAt.prototype.pause=function(){this.running&&(this.nb=-1)},EAt.prototype.getBestWay=function(){for(var t,e,r=-1,n=0;e=this.candidat[n];n++)e.get("wdist")>r&&(t=e,r=e.get("wdist"));return this.getRoute(t)},EAt.prototype._resume=function(){if(this.running){for(;this.candidat.length;){this.candidat.sort((function(t,e){return t.get("dtotal")<e.get("dtotal")?1:t.get("dtotal")===e.get("dtotal")?0:-1}));for(var t,e=this.candidat.pop(),r=e.getGeometry().getCoordinates(),n=this.getEdges(r),i=0;t=n[i];i++){if(e.get("from")!==t){var o=this.getLength(t),s=e.get("wdist")+o*this.weight(t);o=e.get("dist")+o;var a=t.getGeometry().getFirstCoordinate(),l=t.getGeometry().getLastCoordinate(),u=this.direction(t);0!==u&&(r[0]===a[0]&&r[1]===a[1]&&-1!==u&&this.addNode(l,s,o,t,e),r[0]===l[0]&&r[0]===l[0]&&1!==u&&this.addNode(a,s,o,t,e))}if(-1===this.nb||this.nb++>this.maxIteration)return this.running=!1,void this.dispatchEvent({type:"pause",overflow:-1!==this.nb});if(!(this.nb%this.stepIteration)){var h=this;return window.setTimeout((function(){h._resume()}),5),void this.dispatchEvent({type:"calculating"})}}}this.nodes.clear(),this.running=!1,this.dispatchEvent({type:"finish",route:this.getRoute(this.arrival),wDistance:this.wdist,distance:this.arrival.get("dist")})}},EAt.prototype.getRoute=function(t){for(var e=[];t;)e.unshift(t.get("from")),t=t.get("prev");return e.shift(),e};var SAt=a_,BAt=function(t,e){return[Math.round(t[0]/e)*e,Math.round(t[1]/e)*e]},IAt=eA(Z_),TAt=BAt;function PAt(t,e,r){return"FeatureCollection"===t.type?t.features.reduce((function(t,r){return PAt(r,e,t)}),r):e(r,t)}function FAt(t){return"LineString"===t.geometry.type}var LAt={compactNode:MAt,compactGraph:function(t,e,r,n){var i=(n=n||{}).progress,o=Object.keys(t).reduce((function(e,r,o,s){var a=t[r],l=Object.keys(a),u=l.length;return!(void 0!==n.compact&&!n.compact)&&(1===u?!t[l[0]][r]:2===u&&l.filter((function(e){return t[e][r]})).length===u)||(e[r]=a),o%1e3==0&&i&&i("compact:ends",o,s.length),e}),{});return Object.keys(o).reduce((function(s,a,l,u){var h=MAt(a,t,o,e,r,!1,n);return s.graph[a]=h.edges,s.coordinates[a]=h.coordinates,n.edgeDataReduceFn&&(s.reducedEdges[a]=h.reducedEdges),l%1e3==0&&i&&i("compact:nodes",l,u.length),s}),{graph:{},coordinates:{},reducedEdges:{}})}};function MAt(t,e,r,n,i,o,s){s=s||{};var a=e[t];return Object.keys(a).reduce((function(a,l){var u=function(t,e,r,n,i,o,s,a){var l=r[t][e],u=r[e][t],h=[],c=[],A=a.edgeDataSeed;for(a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][t]));!n[e];){var f=r[e];if(!f)break;var p=Object.keys(f).filter((function(e){return e!==t}))[0];if(l+=f[p],s){if(u+=r[p][e],c.indexOf(e)>=0){n[e]=r[e];break}c.push(e)}a.edgeDataReduceFn&&(A=a.edgeDataReduceFn(A,o[e][p])),h.push(i[e]),t=e,e=p}return{vertex:e,weight:l,reverseWeight:u,coordinates:h,reducedEdge:A}}(t,l,e,r,n,i,o,s),h=u.weight,c=u.reverseWeight;if(u.vertex!==t&&((!a.edges[u.vertex]||a.edges[u.vertex]>h)&&(a.edges[u.vertex]=h,a.coordinates[u.vertex]=[n[t]].concat(u.coordinates),a.reducedEdges[u.vertex]=u.reducedEdge),o&&!isNaN(c)&&(!a.incomingEdges[u.vertex]||a.incomingEdges[u.vertex]>c))){a.incomingEdges[u.vertex]=c;var A=[n[t]].concat(u.coordinates);A.reverse(),a.incomingCoordinates[u.vertex]=A}return a}),{edges:{},incomingEdges:{},coordinates:{},incomingCoordinates:{},reducedEdges:{}})}var OAt=function(t,e){var r=(e=e||{}).keyFn||function(t){return t.join(",")},n=e.precision||1e-5,i=function(t,e){var r=[];return"FeatureCollection"===t.type&&(r=r.concat(t.features.filter(e))),{type:"FeatureCollection",features:r}}(t,FAt),o=IAt(i).features.reduce((function(t,i,o,s){var a=TAt(i.geometry.coordinates,n);return t[r(a)]=i.geometry.coordinates,o%1e3==0&&e.progress&&e.progress("topo:vertices",o,s.length),t}),{}),s=PAt(i,(function(t,i,o,s){return i.geometry.coordinates.forEach((function(e,o,s){if(o>0){var a=r(TAt(s[o-1],n)),l=r(TAt(e,n));t.push([a,l,i.properties])}})),o%1e3==0&&e.progress&&e.progress("topo:edges",o,s.length),t}),[]);return{vertices:o,edges:s}},kAt=LAt,NAt=eA(c_).default,{point:RAt}=ew,UAt=function(t,e){var r,n=(e=e||{}).weightFn||function(t,e){return NAt(RAt(t),RAt(e))};"FeatureCollection"===t.type?r=OAt(t,e):t.edges&&(r=t),t=r.edges.reduce((function(t,i,o,s){var a=i[0],l=i[1],u=i[2],h=n(r.vertices[a],r.vertices[l],u),c=function(r){t.vertices[r]||(t.vertices[r]={},e.edgeDataReduceFn&&(t.edgeData[r]={}))},A=function(r,n,i){t.vertices[r][n]=i,e.edgeDataReduceFn&&(t.edgeData[r][n]=e.edgeDataReduceFn(e.edgeDataSeed,u))};return h&&(c(a),c(l),h instanceof Object?(h.forward&&A(a,l,h.forward),h.backward&&A(l,a,h.backward)):(A(a,l,h),A(l,a,h))),o%1e3==0&&e.progress&&e.progress("edgeweights",o,s.length),t}),{edgeData:{},vertices:{}});var i=kAt.compactGraph(t.vertices,r.vertices,t.edgeData,e);return{vertices:t.vertices,edgeData:t.edgeData,sourceVertices:r.vertices,compactedVertices:i.graph,compactedCoordinates:i.coordinates,compactedEdges:e.edgeDataReduceFn?i.reducedEdges:null}},DAt=LAt,QAt=BAt,GAt=jAt;function jAt(t,e){if(e=e||{},t.compactedVertices||(t=UAt(t,e)),this._graph=t,this._keyFn=e.keyFn||function(t){return t.join(",")},this._precision=e.precision||1e-5,this._options=e,0===Object.keys(this._graph.compactedVertices).filter((function(t){return"edgeData"!==t})).length)throw new Error("Compacted graph contains no forks (topology has no intersections).")}jAt.prototype={findPath:function(t,e){var r=this._keyFn(QAt(t.geometry.coordinates,this._precision)),n=this._keyFn(QAt(e.geometry.coordinates,this._precision));if(!this._graph.vertices[r]||!this._graph.vertices[n])return null;this._createPhantom(r),this._createPhantom(n);var i=function(t,e,r){var n={};n[e]=0;for(var i=new SAt([[0,[e],e]],(function(t,e){return t[0]-e[0]}));i.length;){var o=i.pop(),s=o[0],a=o[2];if(a===r)return o.slice(0,2);var l=t[a];Object.keys(l).forEach((function(t){var e=s+l[t];if(!(t in n)||e<n[t]){n[t]=e;var r=[e,o[1].concat([t]),t];i.push(r)}}))}return null}(this._graph.compactedVertices,r,n);if(i){var o=i[0];return{path:(i=i[1]).reduce(function(t,e,r,n){return r>0&&(t=t.concat(this._graph.compactedCoordinates[n[r-1]][e])),t}.bind(this),[]).concat([this._graph.sourceVertices[n]]),weight:o,edgeDatas:this._graph.compactedEdges?i.reduce(function(t,e,r,n){return r>0&&t.push({reducedEdge:this._graph.compactedEdges[n[r-1]][e]}),t}.bind(this),[]):void 0}}return null},serialize:function(){return this._graph},_createPhantom:function(t){if(this._graph.compactedVertices[t])return null;var e=DAt.compactNode(t,this._graph.vertices,this._graph.compactedVertices,this._graph.sourceVertices,this._graph.edgeData,!0,this._options);return this._graph.compactedVertices[t]=e.edges,this._graph.compactedCoordinates[t]=e.coordinates,this._graph.compactedEdges&&(this._graph.compactedEdges[t]=e.reducedEdges),Object.keys(e.incomingEdges).forEach(function(r){this._graph.compactedVertices[r][t]=e.incomingEdges[r],this._graph.compactedCoordinates[r][t]=[this._graph.sourceVertices[r]].concat(e.incomingCoordinates[r].slice(0,-1)),this._graph.compactedEdges&&(this._graph.compactedEdges[r][t]=e.reducedEdges[r])}.bind(this)),t},_removePhantom:function(t){t&&(Object.keys(this._graph.compactedVertices[t]).forEach(function(e){delete this._graph.compactedVertices[e][t]}.bind(this)),Object.keys(this._graph.compactedCoordinates[t]).forEach(function(e){delete this._graph.compactedCoordinates[e][t]}.bind(this)),this._graph.compactedEdges&&Object.keys(this._graph.compactedEdges[t]).forEach(function(e){delete this._graph.compactedEdges[e][t]}.bind(this)),delete this._graph.compactedVertices[t],delete this._graph.compactedCoordinates[t],this._graph.compactedEdges&&delete this._graph.compactedEdges[t])}};var HAt=function(t){t||(t={}),null==t.typing&&(t.typing=300);var e=document.createElement("DIV"),r=(t.className||"")+" ol-scale";t.target||(r+=" ol-unselectable ol-control"),this._input=document.createElement("INPUT"),this._input.value="-",e.setAttribute("class",r),!1===t.editable&&(this._input.readOnly=!0),e.appendChild(this._input),Bl.call(this,{element:e,target:t.target}),this._input.addEventListener("change",this.setScale.bind(this)),this.set("ppi",t.ppi||96)};qm(HAt,Bl),HAt.prototype.setMap=function(t){this._listener&&k(this._listener),this._listener=null,Bl.prototype.setMap.call(this,t),t&&(this._listener=t.on("moveend",this.getScale.bind(this)))},HAt.prototype.getScale=function(){var t=this.getMap();if(t){var e=function(t,e){var r=t.getView(),n=r.getProjection(),i=r.getCenter(),o=t.getPixelFromCoordinate(i);o[1]+=1;var s=t.getCoordinateFromPixel(o);return We(dr(i,n,"EPSG:4326"),dr(s,n,"EPSG:4326"))*((e||96)/.0254)}(t,this.get("ppi"));return this._input.value=this.formatScale(e),e}},HAt.prototype.formatScale=function(t){return"1 / "+(t=t>100?100*Math.round(t/100):Math.round(t)).toLocaleString()},HAt.prototype.setScale=function(t){var e=this.getMap();e&&t&&(t.target&&(t=t.target.value),function(t,e,r){if(t&&e){var n=e;if("string"==typeof e&&((n=e.split("/")[1])||(n=e),n=n.replace(/[^\d]/g,""),n=parseInt(n)),!n)return;var i=t.getView(),o=i.getProjection(),s=i.getCenter(),a=t.getPixelFromCoordinate(s);a[1]+=1;var l=t.getCoordinateFromPixel(a),u=We(dr(s,o,"EPSG:4326"),dr(l,o,"EPSG:4326"));u*=(r||96)/.0254,i.setResolution(i.getResolution()*n/u)}}(e,t,this.get("ppi"))),this.getScale()};var zAt=function(t){Zc.call(this,t)};qm(zAt,Zc),zAt.prototype.getExtent=function(){return this.getSource().getExtent()};var VAt=function(t){var e={attributions:t.attributions,logo:t.logo,projection:t.projection};this._image=t.image?t.image:new Image,this._image.crossOrigin=t.crossOrigin;var r=this;this._image.onload=function(){r.setCrop(r.crop),r.changed()},t.image||(this._image.src=t.url),e.canvasFunction=this.calculateImage,tU.call(this,e),this.center=t.imageCenter,this.setScale(t.imageScale),this.rotate=t.imageRotate?t.imageRotate:0,this.crop=t.imageCrop,this.mask=t.imageMask,this.setCrop(this.crop),this.on("change",function(){this.set("extent",this.calculateExtent())}.bind(this))};qm(VAt,tU),VAt.prototype.calculateImage=function(t,e,r,n){if(this.center){var i=document.createElement("canvas");i.width=n[0],i.height=n[1];var o=i.getContext("2d");if(!this._imageSize)return i;if(this.mask){o.beginPath();var s=f(this.mask[0]);o.moveTo(s[0],s[1]);for(var a=1;a<this.mask.length;a++)s=f(this.mask[a]),o.lineTo(s[0],s[1]);o.clip()}var l=f(this.center),u=(this._image.naturalWidth/2-this.crop[0])*this.scale[0]/e*r,h=(this._image.naturalHeight/2-this.crop[1])*this.scale[1]/e*r,c=this._imageSize[0]*this.scale[0]/e*r,A=this._imageSize[1]*this.scale[1]/e*r;return o.translate(l[0],l[1]),this.rotate&&o.rotate(this.rotate),o.drawImage(this._image,this.crop[0],this.crop[1],this._imageSize[0],this._imageSize[1],-u,-h,c,A),i}function f(e){return[(e[0]-t[0])/(t[2]-t[0])*n[0],(e[1]-t[3])/(t[1]-t[3])*n[1]]}},VAt.prototype.getCenter=function(){return this.center},VAt.prototype.setCenter=function(t){this.center=t,this.changed()},VAt.prototype.getScale=function(){return this.scale},VAt.prototype.setScale=function(t){switch(typeof t){case"number":t=[t,t];break;case"object":if(2!=t.length)return;break;default:return}this.scale=t,this.changed()},VAt.prototype.getRotation=function(){return this.rotate},VAt.prototype.setRotation=function(t){this.rotate=t,this.changed()},VAt.prototype.getGeoImage=function(){return this._image},VAt.prototype.getCrop=function(){return this.crop},VAt.prototype.setMask=function(t){this.mask=t,this.changed()},VAt.prototype.getMask=function(){return this.mask},VAt.prototype.setCrop=function(t){if(this._image.naturalWidth){if(t){switch(typeof t){case"number":t=[t,t,this._image.naturalWidth-t,this._image.naturalHeight-t];break;case"object":if(4!=t.length)return;break;default:return}t=Ct([[t[0],t[1]],[t[2],t[3]]]),this.crop=[Math.max(0,t[0]),Math.max(0,t[1]),Math.min(this._image.naturalWidth,t[2]),Math.min(this._image.naturalHeight,t[3])]}else this.crop=[0,0,this._image.naturalWidth,this._image.naturalHeight];this.crop[2]<=this.crop[0]&&(this.crop[2]=this.crop[0]+1),this.crop[3]<=this.crop[1]&&(this.crop[3]=this.crop[1]+1),this._imageSize=[this.crop[2]-this.crop[0],this.crop[3]-this.crop[1]],this.changed()}else this.crop=t},VAt.prototype.getExtent=function(t){var e=this.get("extent");if(e||(e=this.calculateExtent()),t)for(var r=0;r<t.length;r++)t[r]=e[r];return e},VAt.prototype.calculateExtent=function(t){var e;if(!1!==t&&this.getMask())e=new xn([this.getMask()]);else{var r=this.getCenter(),n=this.getScale(),i=this.getGeoImage().width*n[0],o=this.getGeoImage().height*n[1];(e=Cn(Ct([[r[0]-i/2,r[1]-o/2],[r[0]+i/2,r[1]+o/2]]))).rotate(-this.getRotation(),r)}return e.getExtent()};const KAt=Object.freeze(Object.defineProperty({__proto__:null,ArcGisFeatureServiceLayer:class extends bAt{constructor(t,r){super(t,r),e(this,"queryParams"),e(this,"isLoading"),e(this,"defaultExtent"),this.layertype="ArcGisFeatureServiceLayer",this.isLoading=!1,this.queryParams={f:"json",where:"1=1",outFields:"*",returnGeometry:"true",spatialRel:"esriSpatialRelIntersects",geometryType:"esriGeometryEnvelope",inSR:"102100",outSR:"102100",extent:null,extentWkid:"102100",onlyField:"OBJECTID",autoShowFeature:!1},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t={}){try{this.isLoading=!0;let e,r=this,n=this.option.url+"/query/",i=new Lut,o=Object.assign({},this.queryParams,t),s="";if(o.feature){let t=o.feature.getGeometry(),e=t.getType();if("Polygon"===e||"MultiPolygon"===e){let r=t;"Polygon"===e?r.getLinearRing(0):r.getLinearRings(),s=`{"rings":${JSON.stringify(r.getCoordinates())},"spatialReference":{"wkid":102100}}`}o.geometryType="esriGeometryPolygon",delete o.feature,delete o.extent,delete o.extentWkid}else o.extent&&("4326"===o.extentWkid&&(o.extent=gr(o.extent,"EPSG:4326","EPSG:3857")),delete o.extent,delete o.extentWkid,o.geometryType="esriGeometryEnvelope",s=`{"xmin":${o.extent[0]},"ymin":${o.extent[1]},"xmax":${o.extent[2]},"ymax":${o.extent[3]},"spatialReference":{"wkid":102100}}`);""!==s?e=Object.assign({},o,{geometry:s}):this.defaultExtent&&(o.geometryType="esriGeometryEnvelope",e=Object.assign({},o,{geometry:`{"xmin":${this.defaultExtent[0]},"ymin":${this.defaultExtent[1]},"xmax":${this.defaultExtent[2]},"ymax":${this.defaultExtent[3]},"spatialReference":{"wkid":102100}}`}));let a=!1;fetch(`${n}?${new URLSearchParams(e)}`).then((t=>t.json())).then((t=>{const e=i.readFeatures(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(o.onlyField)===e.get(o.onlyField)}))||t.push(e)})),r.addFeatures("arcgisFeature",t),r.trigger(Cm.onFeaturesLoad,e)}})).catch((t=>{a||(a=!0)})).finally((()=>{this.isLoading=!1}))}catch(FX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},ArcGisMapServerLayer:EU,ArcGisTileXyzLayer:CU,ClusterImageLayer:class extends GO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.styleCache={},this.layertype="ClusterImageLayer",this.option={distance:40,imageFieldName:"主照片地址",animationDuration:600,maxResolution:40},this.option=Object.assign({},this.option,r),this._source=new pa,this.clusterSource=new KO({distance:this.option.distance,source:this._source}),this.layer=new _ut({source:this.clusterSource,animationDuration:this.option.animationDuration,maxResolution:this.option.maxResolution,renderOrder:function(t,e){return e.getGeometry().getExtent()[1]-t.getGeometry().getExtent()[1]},style:(t,e)=>this.getFeatureStyle(t,e,"")}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype),this.selectCluster=new Th({layers:[this.layer],condition:pu,style:(t,e)=>this.getFeatureStyle(t,e,"sel")}),this.selectCluster.setActive(!0),this.selectCluster.getFeatures().on(["add"],(t=>{let e=t.target.getArray()[0].get("features");e&&this.trigger(Cm.onFeatureSelected,e)})),this.selectCluster.getFeatures().on(["remove"],(function(t){}))}addFeaturesMN(t,e){var r,n,i,o;let s=t.getView().calculateExtent(t.getSize()),a=[];for(let l=0;l<e;++l)a[l]=new X(new on([s[0]+(s[2]-s[0])*Math.random(),s[1]+(s[3]-s[1])*Math.random()])),a[l].set("id",l),a[l].set("name","123123"),a[l].set("classname",l),a[l].set("thumbnail","");null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.clear(),null==(o=null==(i=this.clusterSource)?void 0:i.getSource())||o.addFeatures(a)}getFeatureStyle(t,e,r){let n,i=t.get("features")[0].get("uuid"),o=t.get("features")[0],s=t.get("features").length,a=o.get(this.option.imageFieldName);if(a=a.replace("_sss","_s"),n||(this.styleCache[i]=n=new Vi({image:new xAt({src:a,radius:20,crop:!0,kind:s>1?"folio":"square",shadow:!0,onload:function(){try{t.changed()}catch{}},stroke:new Rn({width:2,color:"sel"===r?"rgba(0, 255, 0,1)":"#fff"})})})),s>1){let t=new Vi({image:new Ri({points:12,radius:9,fill:new Fn({color:"rgba(0, 255, 0,0.3)"})}),text:new Wi({text:s.toString(),font:"bold 12px helvetica,sans-serif",fill:new Fn({color:"#000"})})}),e=t.getImage().getAnchor();return e[0]-=20,e[1]+=20,[n,t]}return[n]}appendTo(t){var e,r;this._map=t,this.selectCluster&&(null==(e=this._map)||e.addInteraction(this.selectCluster)),this.layer&&(null==(r=this._map)||r.addLayer(this.layer))}},ClusterLayer:class extends GO{constructor(t,r){super(t,r),e(this,"styleCache"),e(this,"clusterSource"),e(this,"selectCluster"),this.option={convexhull:!0,animatesel:!0,haslink:!0,distance:40,popupInfo:"",popupOption:{offset:[0,0]},levelColor:[{maxnum:5e3,strokecolor:"rgba(192,0,0,0.5)",strokewidth:15,fillcolor:"rgba(192,0,0,1)"},{maxnum:1e3,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(255,165,0,1)"},{maxnum:500,strokecolor:"rgba(255,128,0,0.5)",strokewidth:15,fillcolor:"rgba(255,128,0,1)"},{maxnum:100,strokecolor:"rgba(0,191,255,0.5)",strokewidth:15,fillcolor:"rgba(0,191,255,1)"},{maxnum:50,strokecolor:"rgba(139,0,139,0.5)",strokewidth:15,fillcolor:"rgba(139,0,139,1)"},{maxnum:2,strokecolor:"rgba(255,165,0,0.5)",strokewidth:15,fillcolor:"rgba(\t255,165,0,1)"}]},this.option=Object.assign({},this.option,r),this.styleCache={},this.layertype="ClusterLayer",this.clusterSource=new KO({distance:this.option.distance,source:this._source}),this.layer=new _ut({zIndex:this.option.zIndex,source:this.clusterSource,style:this.getStyle.bind(this)}),this.layer.set("layerid",t);let n=new Di({radius:5,stroke:new Rn({color:"rgba(0,255,255,1)",width:1}),fill:new Fn({color:"rgba(0,255,255,0.3)"})}),i=new Vi({image:n}),o=new Vi({image:n,stroke:new Rn({color:"#fff",width:1})});this.selectCluster=new but({layers:[this.layer],condition:pu,pointRadius:7,animate:this.option.animatesel,featureStyle:()=>[this.option.haslink?o:i],style:(t,e)=>{let r=t.get("features");if(r){if(r.length>1){let n=[this.getStyle(t,e)];if(this.option.convexhull&&xut){let t=[];for(let n=0;n<r.length;n++)t.push(r[n].getGeometry().getFirstCoordinate());let e=xut(t);n.push(new Vi({stroke:new Rn({color:"rgba(0,0,192,0.5)",width:2}),fill:new Fn({color:"rgba(0,0,192,0.3)"}),geometry:new xn([e]),zIndex:100}))}return n}return[new Vi({image:new Di({radius:5,stroke:new Rn({color:"rgba(255,0,0,0.5)",width:10}),fill:new Fn({color:"rgba(255,0,0,1)"})}),text:new Wi({text:r[0].getProperties().name,font:"13px Microsoft YaHei",offsetY:-15,fill:new Fn({color:"#8B4513"}),stroke:new Rn({color:"#fff",width:2})})})]}}}),this.selectCluster.getFeatures().on(["add"],(t=>{t.target.getArray()[0].get("features")})),this.selectCluster.getFeatures().on(["remove"],(function(t){})),this._on("onClickTolayer",(t=>{"function"==typeof t.isPopupBind&&t.isPopupBind()?t.openPopup():this.option.enabledPopup&&this.openPopup(t,this.option.popupInfo,this.option.popupOption)}))}appendTo(t){var e;this._map=t,this._map.addInteraction(this.selectCluster),this.layer&&(null==(e=this._map)||e.addLayer(this.layer))}showTitle(t,e){new Promise(((r,n)=>{this._source.getFeatures().forEach((r=>{let n=r.getProperties();if(t===n.dataType)try{r.getStyle().getText().setText(e?r.get("name"):"")}catch(FX){}})),this.layer.changed()}))}addFeaturesMN(t,e){var r,n;let i=t.getView().calculateExtent(t.getSize()),o=[];for(let s=0;s<e;++s)o[s]=new X(new on([i[0]+(i[2]-i[0])*Math.random(),i[1]+(i[3]-i[1])*Math.random()])),o[s].set("id",s),o[s].set("name","123123"),o[s].set("classname",s);null==(n=null==(r=this.clusterSource)?void 0:r.getSource())||n.addFeatures(o)}getStyle(t,e){let r=t.get("features").length,n=this.styleCache[r];return 1===r?n=this.styleCache[r]=t.get("features")[0].getStyle():n||(this.option.levelColor.sort((function(t,e){return t.maxnum-e.maxnum})),this.option.levelColor.forEach((t=>{let e=Math.max(8,Math.min(.75*r,20));r>=t.maxnum&&(n=this.styleCache[r]=new Vi({image:new Di({radius:e,stroke:new Rn({color:t.strokecolor,width:t.strokewidth,lineCap:"butt"}),fill:new Fn({color:t.fillcolor})}),text:new Wi({text:r.toString(),fill:new Fn({color:"#fff"})})}))}))),n}},DayNightLayer:class extends GO{constructor(t,e){super(t,e),this.layertype="DayNightLayer",this._source=new CAt({}),this.layer=new ta({source:this._source,zIndex:500,style:new Vi({image:new Di({radius:5,fill:new Fn({color:"red"})}),fill:new Fn({color:[0,0,50,.5]})})}),this.layer.set("layerid",t),this._source.on("addfeature",(t=>{}))}setDataTime(t){this._source.setTime(t)}},DivLayer:class extends Im{constructor(t,r){super(t,r),e(this,"DivGraphicList"),this.layertype="DivLayer",this.layerid=t,this.DivGraphicList=[],this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.layerid===t&&this.DivGraphicList.length>0&&this.removeAll()}))}getDivList(){return this.DivGraphicList}addDiv(t){this.DivGraphicList.push(t),this._map.addOverlay(t)}removeDiv(t){this._map.removeOverlay(t),this.DivGraphicList.forEach(((e,r,n)=>{if(e===t)return this.DivGraphicList.slice(r,1),void this.trigger(Cm.onFeatureDeleted,{value:e})}))}removeAll(){this.DivGraphicList.forEach((t=>{this._map.removeOverlay(t),this.trigger(Cm.onFeatureDeleted,{element:t})})),this.DivGraphicList=[]}appendTo(t){this._map=t}},GeoImageLayer:class extends xU{constructor(t,r){super(t,r),e(this,"GraphicLayer"),e(this,"graphic");let n={imageCenter:[0,0],imageScale:[1,1],imageRotate:0,imageMask:null,ImageExtentWKID:Lm.EPSG3857,opacity:1,hashEdit:!1};this.option=Object.assign({},n,this.option),this.GraphicLayer=null,this.graphic=null,this.option.ImageExtentWKID===Lm.EPSG4326&&(this.option.imageCenter=hr(this.option.imageCenter)),this.layertype="GeoImageLayer",this.layerSource=new VAt({url:this.option.url,imageMask:this.option.imageMask,imageCenter:this.option.imageCenter,imageScale:this.option.imageScale,imageRotate:Number(this.option.imageRotate*Math.PI/180)}),this.layer=new zAt({source:this.layerSource,opacity:this.option.opacity}),this.layer.set("layerid",t),this.layerSource.on("imageloadend",(t=>{this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.trigger(this.EventType.LayerEventType.tileloadend,t)})),this.layerSource.on("change",(t=>{this.layerSource._image.setAttribute("crossOrigin","Anonymous"),this.graphic&&this.graphic.setGeometryFromExtent(this.layerSource.getExtent())})),this.layerSource.on("tileloaderror",(function(){})),this._on(this.EventType.XMapEventType.onRemoveLayer,(t=>{this.GraphicLayer&&this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}))}getAttribute(){return this.option}startEdit(t){this.option.hashEdit=!0,this.GraphicLayer=t,this.graphic?this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic):this.setExtent()}endEdit(){this.option.hashEdit=!1,this.graphic&&this.GraphicLayer.removeFeature(this.graphic)}setExtent(){this.graphic||(this.graphic=new cv({graphicType:"PolygonGraphic",style:{stroke:{color:"rgba(255, 0, 0,0)",width:0},fill:{color:"rgba(255, 0, 0,0)"},zIndex:800},attribute:{name:this.layerid+"_graphic",movestate:!1,editallows:!1}}),this.graphic.setGeometryFromExtent(this.layerSource.getExtent()),this.GraphicLayer.addFeature("GeoImageLayerGraphicTemp",this.graphic),this.graphic.set("Scale",this.option.imageScale),this.graphic.on("onRotating",(t=>{this.option.imageRotate=t.data,this.layerSource.setRotation(t.data)})),this.graphic.on("onScaling",(t=>{this.option.imageScale=[t.data,t.data],this.layerSource.setScale(t.data)})),this.graphic.on("onMoveing",(t=>{this.option.imageCenter=t.data,this.layerSource.setCenter(t.data)})))}setScale(t){this.graphic.set("Scale",t),this.layerSource.setScale(t)}computeAutoScale(t){let e=jt(t)/jt(this.layerSource.getExtent());this.graphic.set("Scale",[e,e]),this.layerSource.setScale([e,e])}getGraphic(){return this.graphic}},GraphicImageLayer:jO,GraphicLayer:bAt,HeatmapLayer:class extends GO{constructor(t,e){super(t,e),this.layertype="HeatmapLayer",this._source=new pa({wrapX:!1}),this.option={blur:25,radius:8,gradient:["#00f","#0ff","#0f0","#ff0","#f00"]},this.option=Object.assign({},this.option,e),this.layer=new jc({source:this._source,zIndex:this.option.zIndex,gradient:this.option.gradient,blur:this.option.blur,radius:this.option.radius}),this.layer.set("layerid",t)}setBlur(t){this.layer.setBlur(parseInt(t,10))}setRadius(t){this.layer.setRadius(parseInt(t,10))}},ImageCanvasLayer:class extends Im{constructor(t,r){if(super(t,r),e(this,"scale"),e(this,"ppi"),e(this,"layerOption"),e(this,"drawText"),this.option={},this.layerOption={line1Style:"rgba(255,0,0, 0.1)",line1Width:.5,line5Style:"rgba(255,0,0, 0.3)",line5Width:1,line10Style:"rgba(255,0,0, 0.5)",line10Width:2,lineRectStyle:"rgba(255, 0, 0, 1)",lineRectWidth:5},this.layerOption=Object.assign({},this.layerOption,r),this.layertype="ImageCanvasLayer",this.layer=new Zc({zIndex:r.zIndex}),!document.getElementById("hutia")){let t=document.createElement("div");t.setAttribute("id","hutia"),t.style.width="1cm",document.body.appendChild(t)}this.layer.setSource(new tU({canvasFunction:(t,e,r,n,i)=>{let o=document.createElement("canvas");this.trigger(Cm.onScaleChange,{Scale:Math.round(this.scale.getScale())});let s=this._map.getSize(),a=new Array(2);a[0]=n[0]-s[0],a[1]=n[1]-s[1],o.width=n[0],o.height=n[1],a[0]=0,a[1]=0;const l=this.ppi/2.54/10;let u=a[0]/2,h=a[1]/2,c=o.width-a[0],A=o.height-a[1],f=o.getContext("2d");f.clearRect(u,h,c,A);let p=0;for(let d=h;d<o.height-h;d+=l)f.beginPath(),f.moveTo(u,d),f.lineTo(o.width-u,d),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;p=0;for(let d=u;d<o.width-u;d+=l)f.beginPath(),f.moveTo(d,h),f.lineTo(d,o.height-h),f.closePath(),p%10==0?(f.lineWidth=this.layerOption.line10Width,f.strokeStyle=this.layerOption.line10Style):p%5==0?(f.lineWidth=this.layerOption.line5Width,f.strokeStyle=this.layerOption.line5Style):(f.lineWidth=this.layerOption.line1Width,f.strokeStyle=this.layerOption.line1Style),f.stroke(),p++;return f.lineWidth=this.layerOption.lineRectWidth,f.strokeStyle=this.layerOption.lineRectStyle,f.strokeRect(u,h,c,A),o}})),this.layer.set("layerid",t),this.layer.on(Cm.onClick,(t=>{t.feature&&this.trigger(Cm.onClick,t.feature.getProperties())}))}setScale(t){this.scale.setScale(t)}setText(t){this.drawText.updateHtml(t)}setElementStyle(t,e){this.drawText.updateElementStyle(t,e)}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0);let r=document.getElementById("hutia").offsetWidth,n=screen.width/r,i=screen.height/r,o=Math.round(Math.sqrt(n*n+i*i)/2.54);this.ppi=Math.sqrt(window.screen.width*window.screen.width+window.screen.height*window.screen.height)/o,this.ppi=Math.round(this.ppi),this.scale=new HAt({}),this.scale.set("ppi",this.ppi),this.scale.set("Visible",!1),this._map.addControl(this.scale),this.drawText=new eut({}),this._map.addControl(this.drawText),this._map.getView().on("change",(t=>{this.layer.getSource().changed()})),document.querySelector(".ol-scale").style.display="none"}setMouseLock(t=!1){let e,r;this._map.getInteractions().forEach((function(n){n instanceof bu&&(e=n),n instanceof ju&&(r=n),e&&e.setActive(t),r&&r.setActive(t)}))}},PathLayer:class extends Im{constructor(t,r){super(t,r),e(this,"autoPointSize"),e(this,"result"),e(this,"resultlayer"),e(this,"resultSource"),e(this,"nodesLayer"),e(this,"dijkstra"),e(this,"pathDatalayer"),e(this,"animating"),e(this,"distance"),e(this,"lastTime"),e(this,"pathLine"),e(this,"position"),e(this,"geoMarker"),e(this,"styles"),e(this,"vueThis"),e(this,"pathLineFeature"),e(this,"lastAngle"),e(this,"pathIndex"),e(this,"pathNodeInfo"),e(this,"geoMarkerCircle"),e(this,"moveNodeInfo"),e(this,"FeatureMoveProgressInfo"),e(this,"oldPathLineFeature"),e(this,"routeFeatures"),e(this,"_source"),e(this,"multiLinePathData"),e(this,"timer"),e(this,"fun",(t=>{this.vueThis.moveFeature(t)})),this.option=$m.merge({roadNetworkData:"",pathDefaultStyle:{color:"rgba(255, 255, 255, 0.1)",width:1},pathStyle:{color:"#089519",width:10,imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACISURBVDhP3Yy9CYAwFIQzg+ASTuFmuokjuIaFpb2Vc8S7vEswKFE78YOD5H6e+zne+xqq9H0Hhj0U6WU/gwPbZTw7gmJn/UvKR1iwXmKRjlwfYWB5gsNGKh+hYX4ijBUzLx/BZzUvkI0j9JRFNkUhHM3zE3QaR5hBM4tgkG3AaPW85U338zi3A+g3FErF6/qjAAAAAElFTkSuQmCC"},trackPathStyle:{color:"rgba(180,205,205, 1)",width:10},geoMarkerStyle:{url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAlCAYAAABGWhk4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABYgAAAWIBXyfQUwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAYGSURBVEiJlZdvaFvXFcB/7+mPI8lvjmxHil0vKkuq1bCuYbVsQrDxFup9aSAezA5pExpGRh26hdF0FOIv+9CyrLCh7dvABARmyIWB6Qad69Ik1PH8h67E0C6anbqTI8myZUeWZE1/nu4+6D7n2VZpcuCgq/vu/d37zjvn3HMVIQS1RFEUxWiaFECYFPE1AGtN6iNRAYv8VWVfRaouf2tKTbDcrQG1AXbZRgKLprGVWrtW93ZIqCJBdsAB1Mfj8d/H4/F3gXrZZyymmMz2SIQQu1RCrYATaAKeDoVC54WUUCh0HnhaPnPKscpejmJ+C5MJrMABQAMOpjY2xgpW13cB6sq5e02NjQPAQyAD/A8oA7tMstcUe8Gu8fHxM41ud/u1Ww/Ua7ceqI1ud/v4+PgZwCXHWOWc3ebYYwKLHOwGfG1tbV2ZbG51IZnT1bdnhfr2rFhI5vRMNrfa1tbWBfjk2AOGvQ2eecfm3dYBznA4fKHe5fS8MbmiVgRUBLwxuaLWu5yecDh8Qdq4rtauVZNtjY9mBxx9fX0tL3QEXv3wyy0xcT+9s/rE/TQffrklXugIvNrX19fCIw+xYvIQ1QRVzeBgMPia3W5zvPlRdJ8rvflRVLHbbY5gMPjaHrBqwC01TOC6evVq++DZs78JLaTUqWiWn//Aw7s/ahOXjh/icL1d+WI9j9OmKj9sb3t2e3t74s6dOymgxKNo3Oe3h4BjiURiUgghbi5vGe4r1lOp5fVUatn4bzxLJBKTwDE5d8evDTvbqEaUd2xsbNCYXNb10szMzGh/f//LwIvAi/39/S/PzMyMlnW9ZIwbGxsbBLySYTO+3S7ww4dbt4QQIrm29unQ0NArQC/QA3RL7QF6h4aGXkmurX0qhBDp9NYne8H7XGx+fv58Op22njp16pb8KCpAIBCoB5ibm8vKb1gBihMTEz1ut7sQCAT+AuSoJqiyERRGYLiohrHW0NDQEA6Hf+L3+497PJ5jLpfLC5DL5VaTyeRiJBL5bHBw8K/pdDpNNbS3gG2qIa4jd+sAGoEjwPeHh4cvbm5uLgqTFPWKKOoVc5fY3NxcHB4evgg8J+c2SpZVka9bJ+1z8ObNmxd7enp+pSiK9at0kd9Nx5mN5VhIbgPwnMdJZ6uLX59owddgRwhRvn379h96e3tvUE1MWaBgkVAHoF2/fr3r3Llzv1UUxfrnf63R/94iUytZYtkSugBdQCxbYi6eY+SzdZqcVjpaXKrP5+tyOp1zk5OTCaqZTleAbwGa3+9vnZ+ff0/TNN+f5lb55cR/9wZcTflj3xF+EfCSyWS+6ujo+GkkEokBmZ0UOTo6ekHTNN/iZoG3Pl55LCjAWx+vsLhZQNM03+jo6AXpBNad/NDa2noc4J2pGNulrz0j98l2qcI7UzEAJMNugC2A1e12Pwvwzwe5x4YaYsyRDCtgUQF1YGCg2eFwNGeKOvdS+ScG30vlyRR1HA5H88DAQDOgqoCIRqMFIYSos6jY1P0H7jeJTVWos6gIIUQ0Gi0AQgUq09PTW7lcbsVuUXje63xi8PNeJ3aLQi6XW5ment4CKirV8CttbGz8G6DniPbEYGOOZJQAXaXq0MVIJDIFcO1kC09p9seGPqXZuXayBQDJ2ElCGtVwbkwkEiNer7frH/fTvBT+D+VK7YLREKuq8LfBZ/jxdxpYXV2dOXz48M+ADSBrLvjUeDx+9/Tp02f8zc66l545yJ2VLMntck3o9w45+PtZP93f1iiVSpnLly8PLSwsJKhmuAJUE7OL6tFydGRk5FI+n08KIUShrIvQ3XXx+gfL4sSNz8WJG5+L1z9YFqG766JQ1oUQQuTz+eTIyMgl4KhkuCRzp/jTAA9wtLu7++TS0tL74htkaWnp/e7u7pMS6pEMO2CpdfQfoJrtXMFgsKOzs7OztbW1vampyQ+QSqUisVjsi9nZ2dkrV67MUz018lQTfBFZxylCiFr1sI1qOq1jd80A1SOpLCEFqSVMx78QQuxUmya4sYBFAo22+aqgSy2b2hVMFWetMtasxkK17iDGlWHnTmIuY/8P3C0FYo4OztIAAAAASUVORK5CYII="},navigationOption:{defaultZoom:15,turnToZoom:17,speed:1,tracking:!0,trackingDirection:!0,showNode:!0,showStartEndNode:!0,showPathLine:!0,scale:1,pointDistance:.5}},r,!0),this.layertype="PathLayer",this._source=new pa({wrapX:!1,url:this.option.roadNetworkData,format:new Df}),this._source.on("featuresloadend",(t=>{let e=[];t.features.forEach((t=>{let r=t.getGeometry();e.push(r.getCoordinates())})),this.multiLinePathData=new X({geometry:new th(e)})}));let n=[];this.pathDatalayer=new ta({source:this._source,zIndex:900,style:new Vi({stroke:new Rn({width:this.option.pathDefaultStyle.width,color:this.option.pathDefaultStyle.color}),fill:new Fn({color:this.option.pathDefaultStyle.color})})}),this.vueThis=this,this.styles={route:new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]})}),icon:new Vi({image:new Us({anchor:[.5,1],src:"data/icon.png"})}),geoMarker:new Vi({zIndex:999,image:new Us({src:this.option.geoMarkerStyle.url,rotation:0,rotateWithView:!1})})},this.resultSource=new pa,this.resultlayer=new ta({source:this.resultSource,zIndex:200,updateWhileAnimating:!0,updateWhileInteracting:!0}),this.position=new on([0,0]),this.geoMarker=new X({geometry:this.position}),this.geoMarker.setStyle(this.styles.geoMarker),this.resultSource.addFeature(this.geoMarker),this.resultlayer.on("change",(t=>{})),this.dijkstra=new EAt({source:this._source}),this.dijkstra.on("start",(t=>{this.resultSource.clear()})),this.dijkstra.on("finish",(t=>{if(this.resultSource.clear(),!t.route.length)return void this.trigger(Cm.onPathComputerComplete,{pathLine:null,distance:0});if(this.routeFeatures=t.route,this.pathNodeInfo=NO.lineMerger(t.route,this.option.navigationOption.pointDistance),this.pathLineFeature=this.pathNodeInfo.line,this.pathLine=this.pathLineFeature.getGeometry(),this.option.navigationOption.totalDistance=Ye(this.pathLine)*this.option.navigationOption.scale,this.option.navigationOption.showNode){let t=0;this.pathLine.forEachSegment(((e,r)=>{let n=new X({geometry:new on(e)});n.setStyle(new Vi({image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:t.toString(),font:"12px sans-serif",fill:new Fn({color:"white"})})})),t++,this.resultSource.addFeature(n)}))}this.position.setCoordinates(this.pathLine.getFirstCoordinate()),this.setNavigationMarker(this.pathLine.getFirstCoordinate(),0),this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom)),this.geoMarkerCircle=new X({geometry:new Zu(this.pathLine.getFirstCoordinate(),50)}),this.oldPathLineFeature=new X({geometry:new Nn([this.pathLine.getFirstCoordinate()])}),this.oldPathLineFeature.setStyle(new Vi({stroke:new Rn({color:this.option.trackPathStyle.color,width:this.option.trackPathStyle.width})})),this.pathLineFeature.setStyle(this.styleFunc.bind(this)),this.geoMarkerCircle.setStyle(new Vi({stroke:new Rn({width:6,color:[237,212,0,.8]}),fill:new Fn({color:"rgba(255, 255, 255, 0.1)"})})),this.option.navigationOption.showPathLine&&(this.resultSource.addFeature(this.geoMarker),this.resultSource.addFeature(this.oldPathLineFeature),this.resultSource.addFeature(this.pathLineFeature));let e=Ye(this.pathLineFeature.getGeometry());this.trigger(Cm.onPathComputerComplete,{pathLine:this.pathLineFeature,distance:e})})),this.dijkstra.on("pause",(t=>{t.overflow&&this.dijkstra.resume()})),this.dijkstra.on("calculating",(t=>{let e=this.dijkstra.getBestWay();this.resultSource.clear(),this.resultSource.addFeatures(e)})),this.nodesLayer=new ta({source:this.dijkstra.getNodeSource(),style:new Vi({image:new Di({radius:5,fill:new Fn({color:[255,0,0,.1]})})})}),n.push(this.nodesLayer),n.push(this.resultlayer),n.push(this.pathDatalayer),this.layer=new Da({layers:n}),this.layer.set("layerid",t),this.animating=!1,this.distance=0,this.lastTime}styleFunc(t,e){let r=[];r.push(new Vi({stroke:new Rn({color:this.option.pathStyle.color,width:this.option.pathStyle.width})}));const n=t.get("geometry");if("linestring"===n.getType().toLowerCase()){const t=n.getCoordinates(),i=n.getLength(),o=80*e,s=Math.ceil(i/o);for(let e=1;e<s;e++){const t=e/s,i=n.getCoordinateAt(t),o=n.getCoordinateAt(t+.05*t),a=o[0]-i[0],l=o[1]-i[1],u=Math.atan2(l,a);r.push(new Vi({geometry:new on(i),image:new Us({scale:.8,rotateWithView:!0,rotation:-u,src:this.option.pathStyle.imageUrl})}))}this.option.navigationOption.showStartEndNode&&(r.push(new Vi({geometry:new on(t[0]),image:new Di({radius:12,fill:new Fn({color:"green"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"起",font:"12px sans-serif",fill:new Fn({color:"white"})})})),r.push(new Vi({geometry:new on(t[t.length-1]),image:new Di({radius:12,fill:new Fn({color:"#bb1422"})}),text:new Wi({offsetX:0,offsetY:0,textAlign:"center",textBaseline:"middle",text:"终",font:"12px sans-serif",fill:new Fn({color:"white"})})})))}return r}moveFeature(t){this.resultlayer.changed();const e=t.frameState.time,r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,this.trigger(Cm.onFeatureMoveProgress,{progress:this.distance,distance:this.distance,elapsedTime:r}),this.distance>=1)this.stopAnimation();else{const e=this.pathLine.getCoordinateAt(this.distance);let n,i=(this.distance+this.option.navigationOption.speed*r/1e6)%2;n=i>=1?this.pathLine.getLastCoordinate():this.pathLine.getCoordinateAt(i);let o=this.setAngle(e,n);this.position.setCoordinates(e),this.option.navigationOption.tracking?(this._map.getView().setCenter(e),this._map.getView().setRotation(o.viewAngle)):this.styles.geoMarker.getImage().setRotation(o.markAngle);const s=function(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");var e=t.inversePixelTransform[0],r=t.frameState,n=pt(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),i=Ks(r.viewState.resolution,e);return new bs(t.context,e,r.extent,n,r.viewState.rotation,i,void 0)}(t);s.setStyle(this.styles.geoMarker),s.drawGeometry(this.position),this._map.render()}}setAngle(t,e){let r=e[1]-t[1],n=e[0]-t[0],i=1,o=Math.atan(r/n);r<=0&&n>=0?(i=2,o=-o):n>=0&&r>=0?(o=-o,i=1):n<=0&&r>=0?(o=Math.PI-o,i=4):n<=0&&r<=0&&(o=Math.PI-o,i=3);let s=Math.atan2(1,0);return{viewAngle:-s-o,markAngle:s+o,Angle:s-Math.atan2(r,n),xx:i}}startAnimation(t=!0,e=!0,r=10){this.lastAngle=0,this.distance=0,this.animating=!0,this.lastTime=Date.now(),this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(15),this.resultlayer.addEventListener("postrender",this.fun)}pauseAnimation(){this.resultlayer.removeEventListener("postrender",this.fun)}resumeAnimation(){this.resultlayer.addEventListener("postrender",this.fun)}stopAnimation(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),this.resultlayer.removeEventListener("postrender",this.fun)}startAnimation2(t){clearInterval(this.timer),t&&(this.option.navigationOption=Object.assign({},this.option.navigationOption,t)),this.distance=0,this.animating=!0,this.lastTime=Date.now(),this.pathNodeInfo.nodeData.length>3?this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[2]}:this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[0],nextNode:this.pathNodeInfo.nodeData[1],threeNode:this.pathNodeInfo.nodeData[1]},this.option.navigationOption.tracking&&(this._map.getView().setCenter(this.pathLine.getFirstCoordinate()),this._map.getView().setZoom(this.option.navigationOption.defaultZoom),this._map.getView().setRotation(this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)).viewAngle)),this.oldPathLineFeature.getGeometry().setCoordinates([this.pathLine.getFirstCoordinate()]),this.pathIndex=0,this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.pathIndex/this.pathNodeInfo.coordinates.length,remainingDistance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*(this.pathIndex/this.pathNodeInfo.coordinates.length),nextNodeDistance:this.moveNodeInfo.currentNode.distance*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:this.ComputDirection()},this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),1)}stopAnimation2(){this.animating=!1,this.position.setCoordinates(this.pathLine.getLastCoordinate()),this.geoMarker.setGeometry(this.position),this._map.getView().setRotation(0),this._map.getView().setCenter(this.pathLine.getLastCoordinate()),clearInterval(this.timer)}pauseAnimation2(){clearInterval(this.timer)}resumeAnimation2(){this.timer=setInterval((()=>{this.moveFeature3(this.pathIndex),this.pathIndex=this.pathIndex+this.option.navigationOption.speed}),100)}moveFeature3(t){const e=(new Date).getTime(),r=e-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*r/1e6)%2,this.lastTime=e,t>=this.pathNodeInfo.coordinates.length)this.stopAnimation2();else{const e=hr(this.pathNodeInfo.coordinates[t]);this.oldPathLineFeature.getGeometry().appendCoordinate(e),this.oldPathLineFeature.getGeometry().changed();let r=Ye(new Nn([e,hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale;if(this.position.setCoordinates(e),this.geoMarker.getGeometry().setCoordinates(e),this.geoMarkerCircle.getGeometry().setCenter(e),this.FeatureMoveProgressInfo.nodeNum=this.moveNodeInfo.currentNode.coordIndex,this.FeatureMoveProgressInfo.nextNodeDistance=r,this.FeatureMoveProgressInfo.progress=t/this.pathNodeInfo.coordinates.length,this.FeatureMoveProgressInfo.remainingDistance=this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.FeatureMoveProgressInfo.progress,r<=1*this.option.navigationOption.speed){let t=this.moveNodeInfo.currentNode.coordIndex+1;if(t<this.pathNodeInfo.nodeData.length-1){this.moveNodeInfo.currentNode=this.pathNodeInfo.nodeData[t],this.moveNodeInfo.nextNode=this.pathNodeInfo.nodeData[t+1],t<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[t+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):this.FeatureMoveProgressInfo.angle="直行";let e=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(e.viewAngle):this.styles.geoMarker.getImage().setRotation(e.markAngle)}}this.trigger(Cm.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.option.navigationOption.tracking&&this._map.getView().setCenter(e)}}moveFeature2(){const t=(new Date).getTime(),e=t-this.lastTime;if(this.distance=(this.distance+this.option.navigationOption.speed*e/1e6)%2,this.lastTime=t,this.distance>=1)this.stopAnimation2();else{const t=this.pathLine.getCoordinateAt(this.distance);let r,n=Ye(new Nn([t,hr(this.moveNodeInfo.nextNode.coords)]));if(this.position.setCoordinates(t),this.geoMarker.getGeometry().setCoordinates(t),this.geoMarkerCircle.getGeometry().setCenter(t),n<100){let t=NO.movePointContain(this.geoMarkerCircle,this.pathNodeInfo.nodeData);if(-1!==t.coordIndex&&t.coordIndex!==this.moveNodeInfo.currentNode.coordIndex&&t.coordIndex<=this.moveNodeInfo.currentNode.coordIndex+2){this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[t.coordIndex],nextNode:this.pathNodeInfo.nodeData[t.coordIndex+1],threeNode:this.pathNodeInfo.nodeData[t.coordIndex+2]};let n=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),i=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),o=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),s=(i[0]-n[0])*(o[1]-i[1])-(i[1]-n[1])*(o[0]-i[0]),a=this.setAngle(hr(this.moveNodeInfo.nextNode.coords),hr(this.moveNodeInfo.threeNode.coords));this.trigger(Cm.onFeatureMoveProgress,{nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:this.distance,distance:this.option.navigationOption.totalDistance-this.option.navigationOption.totalDistance*this.distance,elapsedTime:e,nextNodeDistance:this.moveNodeInfo.currentNode.distance,nextNodeDirection:a.markAngle,angle:s>0?"右":"左",xx:a.xx}),r=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords)),this.option.navigationOption.tracking?this._map.getView().setRotation(r.viewAngle):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}this.option.navigationOption.tracking?this._map.getView().setCenter(t):this.styles.geoMarker.getImage().setRotation(r.markAngle)}}ComputDirection(){let t=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.currentNode.coords)),e=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.nextNode.coords)),r=this._map.getPixelFromCoordinate(hr(this.moveNodeInfo.threeNode.coords)),n=(e[0]-t[0])*(r[1]-e[1])-(e[1]-t[1])*(r[0]-e[0]);return 0===n?"直行":n>0?"右":"左"}getNearestPointOnPathNetWork(t){let e;return e=t instanceof X?t:new X({geometry:new on(t)}),NO.nearestPointOnLine(e,this.multiLinePathData)}addNavigationMarker(){this.resultSource.addFeature(this.geoMarker)}setNavigationMarker(t,e=0){let r;r=t instanceof X?t:new X({geometry:new on(t)}),this.position.setCoordinates(r.getGeometry().getCoordinates());let n=NO.nearestPointOnLine(r,this.multiLinePathData);this.geoMarker.setGeometry(n.getGeometry()),this.styles.geoMarker.getImage().setRotation(e),this.pathLineFeature&&this.resultSource.hasFeature(this.pathLineFeature)&&this.updateNavigationMarker(n)}updateNavigationMarker(t){let e=new X({geometry:new on(this.pathLine.getFirstCoordinate())});new X({geometry:new on(this.pathLine.getLastCoordinate())});let r=NO.lineSlice(e,t,this.pathLineFeature);this.pathIndex=t.get("index"),this.moveNodeInfo={currentNode:this.pathNodeInfo.nodeData[this.pathIndex],nextNode:this.pathNodeInfo.nodeData[this.pathIndex+1]};let n=Ye(r.getGeometry())*this.option.navigationOption.scale;this.FeatureMoveProgressInfo={nodeNum:this.moveNodeInfo.currentNode.coordIndex,progress:n/this.option.navigationOption.totalDistance,remainingDistance:this.option.navigationOption.totalDistance-n,nextNodeDistance:Ye(new Nn([t.getGeometry().getCoordinates(),hr(this.moveNodeInfo.nextNode.coords)]))*this.option.navigationOption.scale,totalDistance:this.option.navigationOption.totalDistance,angle:""},this.pathIndex<this.pathNodeInfo.nodeData.length-2?(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+2],this.FeatureMoveProgressInfo.angle=this.ComputDirection()):(this.moveNodeInfo.threeNode=this.pathNodeInfo.nodeData[this.pathIndex+1],this.FeatureMoveProgressInfo.angle="直行"),this.trigger(Cm.onFeatureMoveProgress,this.FeatureMoveProgressInfo),this.oldPathLineFeature.setGeometry(r.getGeometry()),this.oldPathLineFeature.getGeometry().changed();let i=this.setAngle(hr(this.moveNodeInfo.currentNode.coords),hr(this.moveNodeInfo.nextNode.coords));this.option.navigationOption.tracking?this._map.getView().setRotation(i.viewAngle):this.styles.geoMarker.getImage().setRotation(i.markAngle),this.option.navigationOption.tracking&&this._map.getView().setCenter(t.getGeometry().getCoordinates())}getPathLine(){return this.pathLine}computerPath(t,e){let r,n;r=t instanceof X?t.getGeometry().getCoordinates():t,n=e instanceof X?e.getGeometry().getCoordinates():e,clearInterval(this.timer),this.resultSource.clear(),this.dijkstra.path(r,n)}computerPath2(t,e){let r=this.getFile("../public/tempData/铁路_简版.json","text/json"),n=this.formatJsonTo4326Json(JSON.parse(r)),i=new GAt(n,{weightFn:function(t,e,r){let n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)}}),o=NO.featureTo4326(t),s=NO.featureTo4326(e);i.findPath(o,s)}addGeoJsonUrl(t,e){let r=this.getFile(e,"text/json"),n=this.formatJsonTo3857(JSON.parse(r));this.addFeatures(t,n)}addGeoJson(t,e){this.addFeatures(t,this.formatJsonTo3857(e))}convertGeoJsontoFeatures(t){return this.formatJsonTo3857(t)}addFeatures(t,e){var r;null==(r=this._map)||r.getView().getZoom(),e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector),QO.getFeaturesDefaultStyle(e,25,this.autoPointSize);let r=QO.getStyle(e.getGeometry().getType(),e.get("style"));e.setStyle(r)})),this._source.addFeatures(e)}addFeature(t,e){e.set("classname",t),this._source.addFeature(e)}getFeaturesByClassName(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("classname")===t&&e.push(r)})),e}getFeatures(t){let e=[];return this._source.getFeatures().forEach((r=>{r.get("name")===t&&e.push(r)})),e}getFeature(t){let e=null;return this._source.getFeatures().forEach((r=>{r.get("name")!==t||(e=r)})),e}removeFeatures(t){this._source.getFeatures().forEach((e=>{e.get("classname")===t&&this._source.removeFeature(e)}))}removeNavigationPath(){this.resultSource.forEachFeature((t=>{t!==this.geoMarker&&this.resultSource.removeFeature(t)}))}removeNavigationMarker(){this.resultSource.removeFeature(this.geoMarker)}removeNavigationAll(){this.resultSource.clear()}pathToGeoJSON(){return(new Df).writeFeaturesObject(this.routeFeatures,{dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"})}appendTo(t){var e;this._map=t,this.layer&&(null==(e=this._map)||e.addLayer(this.layer),this.isAdded=!0)}},PbfLayer:class extends Im{constructor(t,r){super(t,r),e(this,"_source"),e(this,"isLoading"),e(this,"queryParams"),this.layertype="PbfLayer",this.layerid=t,this.isLoading=!1,new AbortController,this._source=new Pf({format:new RA,url:r.url,tileUrlFunction:this.tileUrlFunction});const n=new Vi({fill:new Fn({color:"#eeeeee"}),stroke:new Rn({color:"#eeeeee",width:1})});this.queryParams={onlyField:"OBJECTID"},this._source.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this._source.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this._source.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)})),this.layer=new af({zIndex:r.zIndex,source:this._source,style:t=>(r.featureStyle&&r.featureStyle.forEach((e=>{if(t.get(e.propertiesName)===e.propertiesValue)return n.getFill().setColor(e.fillColor),n.getStroke().setColor(e.strokeColor),void n.getStroke().setWidth(e.strokeWidth)})),n)}),this.layer.set("layerid",t),this.layer.set("layertype",this.layertype)}tileUrlFunction(t,e){return"http://192.168.28.252:8018/pbf/{z}/{x}/{y}.pbf".replace("{z}",String(2*t[0]-1)).replace("{x}",String(t[1])).replace("{y}",String(t[2]))}appendTo(t){t.addLayer(this.layer),this.isAdded=!0}},TifLayer:class extends xU{constructor(t,e){super(t,e),this.layertype="GeoTIFFLayer",this.layerSource=new HR({sources:[{url:this.option.url}]}),this.layer=new qp({source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(t=>{this.trigger(Sm.tileloadstart,t)})),this.layerSource.on("tileloadend",(t=>{this.trigger(Sm.tileloadend,t)})),this.layerSource.on("tileloaderror",(t=>{this.trigger(Sm.tileloaderror,t)}))}padLeft(t,e,r){let n=t.toString(r||10);return(new Array(e).join("0")+n).slice(-e)}},TileTencentLayer:iD,TileXyzLayer:nD,WfsLayer:class extends bAt{constructor(t,r){super(t,r),e(this,"geoserverData"),e(this,"queryParams"),e(this,"defaultExtent"),e(this,"isLoading"),this.layertype="WfsLayer",this.option.url,this.layer.set("layerid",t),this.queryParams={service:"WFS",request:"GetFeature",version:"1.0.0",outputFormat:"application/json",maxFeatures:"1000",typeName:"data:name",bbox:"",filter:"",queryField:"",querykeyword:"",autoShowFeature:!0},this.queryParams=Object.assign({},this.queryParams,r.queryParams),this._on("appendToEnd",(()=>{this._map.on("moveend",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this._map.getView().on("change:resolution",(t=>{this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()})),this.defaultExtent=this._map.getView().calculateExtent(),this.queryParams.autoShowFeature&&this.query()}))}queryData(t){try{this.isLoading=!0;let e,r=this,n=this.option.url,i=Object.assign({},this.queryParams,t);if(i.feature){let t=i.feature.getGeometry(),e=(t.getType(),(new Df).writeGeometryObject(t,{featureProjection:"EPSG:3857",dataProjection:"EPSG:4326"}).coordinates[0].map((function(t){return t.join(",")})).join(" ")),r="";""!==i.querykeyword?r=`\n <PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">\n <PropertyName>${i.queryField}</PropertyName>\n <Literal>*${i.querykeyword}*</Literal>\n </PropertyIsLike>`:(delete i.queryField,delete i.querykeyword),i.filter=`<Filter xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">\n <And>\n ${r}\n <Intersects>\n <PropertyName>the_geom</PropertyName>\n <gml:Polygon>\n <gml:outerBoundaryIs>\n <gml:LinearRing>\n <gml:coordinates>${e}</gml:coordinates>\n </gml:LinearRing>\n </gml:outerBoundaryIs>\n </gml:Polygon>\n </Intersects>\n </And>\n </Filter>`,delete i.feature,delete i.extent,delete i.extentWkid}else i.extent?("4326"===i.extentWkid&&(i.extent=gr(i.extent,"EPSG:4326","EPSG:3857")),i.bbox=i.extent.join(",")+",EPSG:3857",delete i.extent,delete i.extentWkid,delete i.filter):(delete i.filter,delete i.extent,delete i.extentWkid);""===i.bbox&&this.defaultExtent&&(i.bbox=this.defaultExtent.join(",")+",EPSG:3857"),""!==i.filter&&delete i.bbox,e=Object.assign({},i);let o=!1;fetch(`${n}?${new URLSearchParams(e)}`,{method:"GET",headers:{"content-type":"application/json"}}).then((t=>t.json())).then((t=>{const e=NO.formatJsonTo3857(t);if(e.length>0){let t=[];e.forEach((function(e){r._source.getFeatures().some((function(t){return t.get(i.onlyField)===e.get(i.onlyField)}))||t.push(e)})),r.addFeatures("wfsFeature",t),r.trigger(Cm.onFeaturesLoad,e)}})).catch((t=>{o||(o=!0)})).finally((()=>{this.isLoading=!1}))}catch(FX){this.isLoading=!1}}query(t={}){this.isLoading||(this.queryData(t),this._source.changed())}},WmsLayer:fut,WmsTileLayer:gut,WmtsLayer:class extends xU{constructor(t,e){super(t,e),this.layertype="ImageWMSLayer",this.option=Object.assign({},{opacity:.7,attributions:"",layer:"",matrixSet:"GoogleMapsCompatible",format:"image/png"},e);const r=ir("EPSG:3857"),n=r.getExtent(),i=$t(n)/256,o=new Array(19),s=new Array(19);for(let a=0;a<19;++a)o[a]=i/Math.pow(2,a),s[a]=a;this.layerSource=new pU({attributions:this.option.attributions,url:this.option.url,layer:this.option.layer,matrixSet:this.option.matrixSet,format:this.option.format,projection:r,tileGrid:new cU({origin:Zt(n),resolutions:o,matrixIds:s}),style:"default",wrapX:!0}),this.layer=new qf({zIndex:this.option.zIndex,opacity:this.option.opacity,source:this.layerSource}),this.layer.set("layerid",t),this.mImageExtent&&this.layer.setExtent(this.mImageExtent),this.layerSource.on("tileloadstart",(function(){})),this.layerSource.on("tileloadend",(function(){})),this.layerSource.on("tileloaderror",(function(){}))}},XWebGLPointsLayer:class extends Im{constructor(t,e){super(t,e),this.layertype="XWebGLPointsLayer",this._source=new pa({wrapX:!1}),this.Layer=new Hp({source:this._source,style:{symbol:{symbolType:"circle",size:["interpolate",["exponential",2.5],["zoom"],2,1,12,8,16,12],color:"#ffed02",offset:[0,0],opacity:.95}},disableHitDetection:!1,colorCallback:function(t,e,r){},attributes:[{name:"color",callback:function(t){}},{name:"size",callback:function(t){}},{name:"GraphicColor",callback:function(t){}}]}),this.Layer.on(Cm.onClick,(t=>{t.feature&&this.trigger(Cm.onClick,t.feature.getProperties())}))}appendTo(t){var e;this._map=t,null==(e=this._map)||e.addLayer(this.Layer)}addGeoJson(t,e){let r=this.formatJsonTo3857(e);this.addFeatures(t,r)}addFeatures(t,e){var r;let n=null==(r=this._map)?void 0:r.getView().getZoom();e.forEach((e=>{e.set("classname",t),e.get("featuretype")||e.set("featuretype",Tm.vector);let r=QO.getFeaturesDefaultStyle(e,n,!1);e.setStyle(r)})),this._source.addFeatures(e)}},imageLayer:UD,kmlLayer:class extends GO{constructor(t,r){super(t,r),e(this,"styleOptions"),this.option={},Object.assign(this.option,r),this.layertype="KmlLayer",this._source=new pa({url:r.url,format:new uAt({extractStyles:!1})}),this.styleOptions={Font:"12px Microsoft YaHei",FontColor:"#8B4513",FontStrokeColor:"#fff",FontStrokeWidth:2,FontoffsetX:0,FontoffsetY:-10,fillcolor:"rgba(0, 153, 255,1)",strokecolor:"rgba(255, 255, 255,1)",strokewidth:1,radius:10,scale:1,text:""},this.layer=new ta({source:this._source,zIndex:r.zIndex,style:(t,e)=>{let r=QO.getStyle(t.getGeometry().getType(),this.styleOptions);if(this.styleOptions.text){let e=this.replaceField(this.styleOptions.text);e!==this.styleOptions.text&&r.getText().setText(t.getProperties()[e])}return r}}),this.layer.set("layerid",t),this.layer.on(Cm.onClick,(t=>{t.feature&&this.trigger(Cm.onClick,t.feature.getProperties())}))}setSymbol(t){this.styleOptions=Object.assign({},this.styleOptions,t)}}},Symbol.toStringTag,{value:"Module"})),qAt=Object.freeze(Object.defineProperty({__proto__:null,getJSON:function(t){const e=new XMLHttpRequest;return e.open("get",t,!1),e.setRequestHeader("content-type","application/json"),e.send(),JSON.parse(e.response)}},Symbol.toStringTag,{value:"Module"}));class WAt{constructor(t){e(this,"option"),this.option={key:"50da1a3686015849769f4a414bfdfb8f"},this.option=Object.assign({},this.option,t)}}const XAt=Object.freeze(Object.defineProperty({__proto__:null,GaodePOI:class extends WAt{constructor(t){super(t)}query(t){let e=new ov,r={serverUrl:"",queryType:1,keywords:"",location:"",radius:"3000",city:"西安市",city_limit:!0,polygon:"",extensions:"base",offset:20,page:1,success:null,error:null};r=Object.assign({},r,t);let n=[{type:"周边搜索",url:r.serverUrl+"/v3/place/around",parameters:{key:this.option.key,keywords:r.keywords,location:r.location,radius:r.radius,offset:r.offset,page:r.page}},{type:"关键字搜索",url:r.serverUrl+"/v3/place/text",parameters:{key:this.option.key,keywords:r.keywords,city:t.city,city_limit:t.city_limit,offset:r.offset,page:r.page}},{type:"多边形区域搜索",url:r.serverUrl+"/v3/place/polygon",parameters:{key:this.option.key,keywords:t.keywords,polygon:t.polygon,offset:r.offset,page:r.page}}];r.keywords=r.keywords.replace("","|"),rv(n[r.queryType].url+tv(n[r.queryType].parameters)).then((function(r){r.pois.forEach((t=>{let r=t.location.split(","),n=e.gcj02ToWgs84(parseFloat(r[1]),parseFloat(r[0]));t.lnglat=[n.lontitude,n.latitude]})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}queryUrl(){}},GaodeRoute:class extends WAt{constructor(t){super(t)}query(t){let e=new ov,r=[{type:"驾车",url:t.serverUrl+"/v3/direction/driving"},{type:"步行",url:t.serverUrl+"/v3/direction/walking"},{type:"公交",url:t.serverUrl+"/v3/direction/transit/integrated"}];t.params.key=this.option.key,rv(r[t.queryType].url+tv(t.params)).then((function(r){r.route.paths.forEach((t=>{t.points=[],t.steps.forEach((r=>{r.polyline.split(";").forEach((r=>{let n=r.split(","),i=e.gcj02ToWgs84(parseFloat(n[1]),parseFloat(n[0]));t.points.push([i.lontitude,i.latitude])}))}))})),t.success(r)})).catch((function(e){t.error&&t.error(e)}))}}},Symbol.toStringTag,{value:"Module"}));function YAt(t,e){let r=t.length-e,n=0;do{for(let r=e;r>0;r--)t[n+e]+=t[n],n++;r-=e}while(r>0)}function ZAt(t,e,r){let n=0,i=t.length;const o=i/r;for(;i>e;){for(let r=e;r>0;--r)t[n+e]+=t[n],++n;i-=e}const s=t.slice();for(let a=0;a<o;++a)for(let e=0;e<r;++e)t[r*a+e]=s[(r-e-1)*o+a]}class JAt{async decode(t,e){const r=await this.decodeBlock(e),n=t.Predictor||1;if(1!==n){const e=!t.StripOffsets;return function(t,e,r,n,i,o){if(!e||1===e)return t;for(let l=0;l<i.length;++l){if(i[l]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[l]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const s=i[0]/8,a=2===o?1:i.length;for(let l=0;l<n&&!(l*a*r*s>=t.byteLength);++l){let n;if(2===e){switch(i[0]){case 8:n=new Uint8Array(t,l*a*r*s,a*r*s);break;case 16:n=new Uint16Array(t,l*a*r*s,a*r*s/2);break;case 32:n=new Uint32Array(t,l*a*r*s,a*r*s/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}YAt(n,a)}else 3===e&&(n=new Uint8Array(t,l*a*r*s,a*r*s),ZAt(n,a,s))}return t}(r,n,e?t.TileWidth:t.ImageWidth,e?t.TileLength:t.RowsPerStrip||t.ImageLength,t.BitsPerSample,t.PlanarConfiguration)}return r}}const $At=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{decodeBlock(t){return t}}},Symbol.toStringTag,{value:"Module"})),tft=9,eft=257;function rft(t,e){for(let r=e.length-1;r>=0;r--)t.push(e[r]);return t}const nft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{decodeBlock(t){return function(t){const e=new Uint16Array(4093),r=new Uint8Array(4093);for(let p=0;p<=257;p++)e[p]=4096,r[p]=p;let n=258,i=tft,o=0;function s(){n=258,i=tft}function a(t){const e=function(t,e,r){const n=e%8,i=Math.floor(e/8),o=8-n,s=e+r-8*(i+1);let a=8*(i+2)-(e+r);const l=8*(i+2)-e;if(a=Math.max(0,a),i>=t.length)return eft;let u=t[i]&2**(8-n)-1;u<<=r-o;let h=u;if(i+1<t.length){let e=t[i+1]>>>a;e<<=Math.max(0,r-l),h+=e}if(s>8&&i+2<t.length){const n=8*(i+3)-(e+r);h+=t[i+2]>>>n}return h}(t,o,i);return o+=i,e}function l(t,i){return r[n]=i,e[n]=t,n++,n-1}function u(t){const n=[];for(let i=t;4096!==i;i=e[i])n.push(r[i]);return n}const h=[];s();const c=new Uint8Array(t);let A,f=a(c);for(;f!==eft;){if(256===f){for(s(),f=a(c);256===f;)f=a(c);if(f===eft)break;if(f>256)throw new Error(`corrupted code at scanline ${f}`);rft(h,u(f)),A=f}else if(f<n){const t=u(f);rft(h,t),l(A,t[t.length-1]),A=f}else{const t=u(A);if(!t)throw new Error(`Bogus entry. Not in dictionary, ${A} / ${n}, position: ${o}`);rft(h,t),h.push(t[t.length-1]),l(A,t[t.length-1]),A=f}n+1>=2**i&&(12===i?A=void 0:i++),f=a(c)}return new Uint8Array(h)}(t).buffer}}},Symbol.toStringTag,{value:"Module"})),ift=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),oft=4017,sft=799,aft=3406,lft=2276,uft=1567,hft=3784,cft=5793,Aft=2896;function fft(t,e){let r=0;const n=[];let i=16;for(;i>0&&!t[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<t[a];i++){for(s=n.pop(),s.children[s.index]=e[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function pft(t,e,r,n,i,o,s,a,l){const{mcusPerLine:u,progressive:h}=r,c=e;let A=e,f=0,p=0;function d(){if(p>0)return p--,f>>p&1;if(f=t[A++],255===f){const e=t[A++];if(e)throw new Error(`unexpected marker: ${(f<<8|e).toString(16)}`)}return p=7,f>>>7}function g(t){let e,r=t;for(;null!==(e=d());){if(r=r[e],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(t){let e=t,r=0;for(;e>0;){const t=d();if(null===t)return;r=r<<1|t,--e}return r}function m(t){const e=y(t);return e>=1<<t-1?e:e+(-1<<t)+1}let v,_=0,w=0;function b(t,e,r,n,i){const o=r%u,s=(r/u|0)*t.v+n,a=o*t.h+i;e(t,t.blocks[s][a])}function x(t,e,r){const n=r/t.blocksPerLine|0,i=r%t.blocksPerLine;e(t,t.blocks[n][i])}const C=n.length;let E,S,B,I,T,P;P=h?0===o?0===a?function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r)<<l;t.pred+=n,e[0]=t.pred}:function(t,e){e[0]|=d()<<l}:0===a?function(t,e){if(_>0)return void _--;let r=o;const n=s;for(;r<=n;){const n=g(t.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){_=y(o)+(1<<o)-1;break}r+=16}else r+=o,e[ift[r]]=m(i)*(1<<l),r++}}:function(t,e){let r=o;const n=s;let i=0;for(;r<=n;){const n=ift[r],o=e[n]<0?-1:1;switch(w){case 0:{const e=g(t.huffmanTableAC),r=15&e;if(i=e>>4,0===r)i<15?(_=y(i)+(1<<i),w=4):(i=16,w=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=m(r),w=i?2:3}continue}case 1:case 2:e[n]?e[n]+=(d()<<l)*o:(i--,0===i&&(w=2===w?3:0));break;case 3:e[n]?e[n]+=(d()<<l)*o:(e[n]=v<<l,w=0);break;case 4:e[n]&&(e[n]+=(d()<<l)*o)}r++}4===w&&(_--,0===_&&(w=0))}:function(t,e){const r=g(t.huffmanTableDC),n=0===r?0:m(r);t.pred+=n,e[0]=t.pred;let i=1;for(;i<64;){const r=g(t.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else i+=o,e[ift[i]]=m(n),i++}};let F,L,M=0;L=1===C?n[0].blocksPerLine*n[0].blocksPerColumn:u*r.mcusPerColumn;const O=i||L;for(;M<L;){for(S=0;S<C;S++)n[S].pred=0;if(_=0,1===C)for(E=n[0],T=0;T<O;T++)x(E,P,M),M++;else for(T=0;T<O;T++){for(S=0;S<C;S++){E=n[S];const{h:t,v:e}=E;for(B=0;B<e;B++)for(I=0;I<t;I++)b(E,P,M,B,I)}if(M++,M===L)break}if(p=0,F=t[A]<<8|t[A+1],F<65280)throw new Error("marker was not found");if(!(F>=65488&&F<=65495))break;A+=2}return A-c}function dft(t,e){const r=[],{blocksPerLine:n,blocksPerColumn:i}=e,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function l(t,r,n){const i=e.quantizationTable;let o,s,a,l,u,h,c,A,f;const p=n;let d;for(d=0;d<64;d++)p[d]=t[d]*i[d];for(d=0;d<8;++d){const t=8*d;0!==p[1+t]||0!==p[2+t]||0!==p[3+t]||0!==p[4+t]||0!==p[5+t]||0!==p[6+t]||0!==p[7+t]?(o=cft*p[0+t]+128>>8,s=cft*p[4+t]+128>>8,a=p[2+t],l=p[6+t],u=Aft*(p[1+t]-p[7+t])+128>>8,A=Aft*(p[1+t]+p[7+t])+128>>8,h=p[3+t]<<4,c=p[5+t]<<4,f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*hft+l*uft+128>>8,a=a*uft-l*hft+128>>8,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*lft+A*aft+2048>>12,u=u*aft-A*lft+2048>>12,A=f,f=h*sft+c*oft+2048>>12,h=h*oft-c*sft+2048>>12,c=f,p[0+t]=o+A,p[7+t]=o-A,p[1+t]=s+c,p[6+t]=s-c,p[2+t]=a+h,p[5+t]=a-h,p[3+t]=l+u,p[4+t]=l-u):(f=cft*p[0+t]+512>>10,p[0+t]=f,p[1+t]=f,p[2+t]=f,p[3+t]=f,p[4+t]=f,p[5+t]=f,p[6+t]=f,p[7+t]=f)}for(d=0;d<8;++d){const t=d;0!==p[8+t]||0!==p[16+t]||0!==p[24+t]||0!==p[32+t]||0!==p[40+t]||0!==p[48+t]||0!==p[56+t]?(o=cft*p[0+t]+2048>>12,s=cft*p[32+t]+2048>>12,a=p[16+t],l=p[48+t],u=Aft*(p[8+t]-p[56+t])+2048>>12,A=Aft*(p[8+t]+p[56+t])+2048>>12,h=p[24+t],c=p[40+t],f=o-s+1>>1,o=o+s+1>>1,s=f,f=a*hft+l*uft+2048>>12,a=a*uft-l*hft+2048>>12,l=f,f=u-c+1>>1,u=u+c+1>>1,c=f,f=A+h+1>>1,h=A-h+1>>1,A=f,f=o-l+1>>1,o=o+l+1>>1,l=f,f=s-a+1>>1,s=s+a+1>>1,a=f,f=u*lft+A*aft+2048>>12,u=u*aft-A*lft+2048>>12,A=f,f=h*sft+c*oft+2048>>12,h=h*oft-c*sft+2048>>12,c=f,p[0+t]=o+A,p[56+t]=o-A,p[8+t]=s+c,p[48+t]=s-c,p[16+t]=a+h,p[40+t]=a-h,p[24+t]=l+u,p[32+t]=l-u):(f=cft*n[d+0]+8192>>14,p[0+t]=f,p[8+t]=f,p[16+t]=f,p[24+t]=f,p[32+t]=f,p[40+t]=f,p[48+t]=f,p[56+t]=f)}for(d=0;d<64;++d){const t=128+(p[d]+8>>4);r[d]=t<0?0:t>255?255:t}}for(let u=0;u<i;u++){const t=u<<3;for(let e=0;e<8;e++)r.push(new Uint8Array(o));for(let i=0;i<n;i++){l(e.blocks[u][i],a,s);let n=0;const o=i<<3;for(let e=0;e<8;e++){const i=r[t+e];for(let t=0;t<8;t++)i[o+t]=a[n++]}}}return r}class gft{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(t){let e=0;function r(){const r=t[e]<<8|t[e+1];return e+=2,r}function n(){const n=r(),i=t.subarray(e,e+n-2);return e+=i.length,i}function i(t){let e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(e=t.components[r],n<e.h&&(n=e.h),i<e.v&&(i=e.v));const o=Math.ceil(t.samplesPerLine/8/n),s=Math.ceil(t.scanLines/8/i);for(r in t.components)if(t.components.hasOwnProperty(r)){e=t.components[r];const a=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/n),l=Math.ceil(Math.ceil(t.scanLines/8)*e.v/i),u=o*e.h,h=s*e.v,c=[];for(let t=0;t<h;t++){const t=[];for(let e=0;e<u;e++)t.push(new Int32Array(64));c.push(t)}e.blocksPerLine=a,e.blocksPerColumn=l,e.blocks=c}t.maxH=n,t.maxV=i,t.mcusPerLine=o,t.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const t=n();65504===o&&74===t[0]&&70===t[1]&&73===t[2]&&70===t[3]&&0===t[4]&&(this.jfif={version:{major:t[5],minor:t[6]},densityUnits:t[7],xDensity:t[8]<<8|t[9],yDensity:t[10]<<8|t[11],thumbWidth:t[12],thumbHeight:t[13],thumbData:t.subarray(14,14+3*t[12]*t[13])}),65518===o&&65===t[0]&&100===t[1]&&111===t[2]&&98===t[3]&&101===t[4]&&0===t[5]&&(this.adobe={version:t[6],flags0:t[7]<<8|t[8],flags1:t[9]<<8|t[10],transformCode:t[11]});break}case 65499:{const n=r()+e-2;for(;e<n;){const n=t[e++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++)i[ift[r]]=t[e++];else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let t=0;t<64;t++)i[ift[t]]=r()}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:t[e++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=t[e++];let a;for(let r=0;r<s;r++){a=t[e];const r=t[e+1]>>4,i=15&t[e+1],o=t[e+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},e+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=t[e++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,e++)i[r]=t[e],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,e++)s[r]=t[e];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=fft(i,s):this.huffmanTablesAC[15&n]=fft(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=t[e++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[t[e++]],n=t[e++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=t[e++],a=t[e++],l=t[e++],u=pft(t,e,o,i,this.resetInterval,s,a,l>>4,15&l);e+=u;break}case 65535:255!==t[e]&&e--;break;default:if(255===t[e-3]&&t[e-2]>=192&&t[e-2]<=254){e-=3;break}throw new Error(`unknown JPEG marker ${o.toString(16)}`)}o=r()}}getResult(){const{frames:t}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length;for(let u=0;u<this.frames.length;u++){const t=this.frames[u].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const e=t[0],{components:r,componentsOrder:n}=e,i=[],o=e.samplesPerLine,s=e.scanLines;for(let u=0;u<n.length;u++){const t=r[n[u]];i.push({lines:dft(0,t),scaleX:t.h/e.maxH,scaleY:t.v/e.maxV})}const a=new Uint8Array(o*s*i.length);let l=0;for(let u=0;u<s;++u)for(let t=0;t<o;++t)for(let e=0;e<i.length;++e){const r=i[e];a[l]=r.lines[0|u*r.scaleY][0|t*r.scaleX],++l}return a}}const yft=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{constructor(t){super(),this.reader=new gft,t.JPEGTables&&this.reader.parse(t.JPEGTables)}decodeBlock(t){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(t)),this.reader.getResult().buffer}}},Symbol.toStringTag,{value:"Module"}));
470
470
  /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function mft(t){let e=t.length;for(;--e>=0;)t[e]=0}const vft=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),_ft=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wft=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bft=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xft=new Array(576);mft(xft);const Cft=new Array(60);mft(Cft);const Eft=new Array(512);mft(Eft);const Sft=new Array(256);mft(Sft);const Bft=new Array(29);mft(Bft);const Ift=new Array(30);function Tft(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}let Pft,Fft,Lft;function Mft(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}mft(Ift);const Oft=t=>t<256?Eft[t]:Eft[256+(t>>>7)],kft=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},Nft=(t,e,r)=>{t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,kft(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},Rft=(t,e,r)=>{Nft(t,r[2*e],r[2*e+1])},Uft=(t,e)=>{let r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},Dft=(t,e,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=15;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=e;o++){let e=t[2*o+1];0!==e&&(t[2*o]=Uft(n[e]++,e))}},Qft=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},Gft=t=>{t.bi_valid>8?kft(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},jft=(t,e,r,n)=>{const i=2*e,o=2*r;return t[i]<t[o]||t[i]===t[o]&&n[e]<=n[r]},Hft=(t,e,r)=>{const n=t.heap[r];let i=r<<1;for(;i<=t.heap_len&&(i<t.heap_len&&jft(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!jft(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},zft=(t,e,r)=>{let n,i,o,s,a=0;if(0!==t.sym_next)do{n=255&t.pending_buf[t.sym_buf+a++],n+=(255&t.pending_buf[t.sym_buf+a++])<<8,i=t.pending_buf[t.sym_buf+a++],0===n?Rft(t,i,e):(o=Sft[i],Rft(t,o+256+1,e),s=vft[o],0!==s&&(i-=Bft[o],Nft(t,i,s)),n--,o=Oft(n),Rft(t,o,r),s=_ft[o],0!==s&&(n-=Ift[o],Nft(t,n,s)))}while(a<t.sym_next);Rft(t,256,e)},Vft=(t,e)=>{const r=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,o=e.stat_desc.elems;let s,a,l,u=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(t.heap[++t.heap_len]=u=s,t.depth[s]=0):r[2*s+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=u<2?++u:0,r[2*l]=1,t.depth[l]=0,t.opt_len--,i&&(t.static_len-=n[2*l+1]);for(e.max_code=u,s=t.heap_len>>1;s>=1;s--)Hft(t,r,s);l=o;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Hft(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=a,r[2*l]=r[2*s]+r[2*a],t.depth[l]=(t.depth[s]>=t.depth[a]?t.depth[s]:t.depth[a])+1,r[2*s+1]=r[2*a+1]=l,t.heap[1]=l++,Hft(t,r,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const r=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length;let u,h,c,A,f,p,d=0;for(A=0;A<=15;A++)t.bl_count[A]=0;for(r[2*t.heap[t.heap_max]+1]=0,u=t.heap_max+1;u<573;u++)h=t.heap[u],A=r[2*r[2*h+1]+1]+1,A>l&&(A=l,d++),r[2*h+1]=A,h>n||(t.bl_count[A]++,f=0,h>=a&&(f=s[h-a]),p=r[2*h],t.opt_len+=p*(A+f),o&&(t.static_len+=p*(i[2*h+1]+f)));if(0!==d){do{for(A=l-1;0===t.bl_count[A];)A--;t.bl_count[A]--,t.bl_count[A+1]+=2,t.bl_count[l]--,d-=2}while(d>0);for(A=l;0!==A;A--)for(h=t.bl_count[A];0!==h;)c=t.heap[--u],c>n||(r[2*c+1]!==A&&(t.opt_len+=(A-r[2*c+1])*r[2*c],r[2*c+1]=A),h--)}})(t,e),Dft(r,u,t.bl_count)},Kft=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++a<l&&i===s||(a<u?t.bl_tree[2*i]+=a:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=i,0===s?(l=138,u=3):i===s?(l=6,u=3):(l=7,u=4))},qft=(t,e,r)=>{let n,i,o=-1,s=e[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),n=0;n<=r;n++)if(i=s,s=e[2*(n+1)+1],!(++a<l&&i===s)){if(a<u)do{Rft(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(Rft(t,i,t.bl_tree),a--),Rft(t,16,t.bl_tree),Nft(t,a-3,2)):a<=10?(Rft(t,17,t.bl_tree),Nft(t,a-3,3)):(Rft(t,18,t.bl_tree),Nft(t,a-11,7));a=0,o=i,0===s?(l=138,u=3):i===s?(l=6,u=3):(l=7,u=4)}};let Wft=!1;const Xft=(t,e,r,n)=>{Nft(t,0+(n?1:0),3),Gft(t),kft(t,r),kft(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r};var Yft={_tr_init:t=>{Wft||((()=>{let t,e,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(Bft[n]=r,t=0;t<1<<vft[n];t++)Sft[r++]=n;for(Sft[r-1]=n,i=0,n=0;n<16;n++)for(Ift[n]=i,t=0;t<1<<_ft[n];t++)Eft[i++]=n;for(i>>=7;n<30;n++)for(Ift[n]=i<<7,t=0;t<1<<_ft[n]-7;t++)Eft[256+i++]=n;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)xft[2*t+1]=8,t++,o[8]++;for(;t<=255;)xft[2*t+1]=9,t++,o[9]++;for(;t<=279;)xft[2*t+1]=7,t++,o[7]++;for(;t<=287;)xft[2*t+1]=8,t++,o[8]++;for(Dft(xft,287,o),t=0;t<30;t++)Cft[2*t+1]=5,Cft[2*t]=Uft(t,5);Pft=new Tft(xft,vft,257,286,15),Fft=new Tft(Cft,_ft,0,30,15),Lft=new Tft(new Array(0),wft,0,19,7)})(),Wft=!0),t.l_desc=new Mft(t.dyn_ltree,Pft),t.d_desc=new Mft(t.dyn_dtree,Fft),t.bl_desc=new Mft(t.bl_tree,Lft),t.bi_buf=0,t.bi_valid=0,Qft(t)},_tr_stored_block:Xft,_tr_flush_block:(t,e,r,n)=>{let i,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),Vft(t,t.l_desc),Vft(t,t.d_desc),s=(t=>{let e;for(Kft(t,t.dyn_ltree,t.l_desc.max_code),Kft(t,t.dyn_dtree,t.d_desc.max_code),Vft(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*bft[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==e?Xft(t,e,r,n):4===t.strategy||o===i?(Nft(t,2+(n?1:0),3),zft(t,xft,Cft)):(Nft(t,4+(n?1:0),3),((t,e,r,n)=>{let i;for(Nft(t,e-257,5),Nft(t,r-1,5),Nft(t,n-4,4),i=0;i<n;i++)Nft(t,t.bl_tree[2*bft[i]+1],3);qft(t,t.dyn_ltree,e-1),qft(t,t.dyn_dtree,r-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),zft(t,t.dyn_ltree,t.dyn_dtree)),Qft(t),n&&Gft(t)},_tr_tally:(t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(Sft[r]+256+1)]++,t.dyn_dtree[2*Oft(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{Nft(t,2,3),Rft(t,256,xft),(t=>{16===t.bi_valid?(kft(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}},Zft=(t,e,r,n)=>{let i=65535&t|0,o=t>>>16&65535|0,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+e[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16|0};const Jft=new Uint32Array((()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e})());var $ft=(t,e,r,n)=>{const i=Jft,o=n+r;t^=-1;for(let s=n;s<o;s++)t=t>>>8^i[255&(t^e[s])];return-1^t},tpt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ept={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:rpt,_tr_stored_block:npt,_tr_flush_block:ipt,_tr_tally:opt,_tr_align:spt}=Yft,{Z_NO_FLUSH:apt,Z_PARTIAL_FLUSH:lpt,Z_FULL_FLUSH:upt,Z_FINISH:hpt,Z_BLOCK:cpt,Z_OK:Apt,Z_STREAM_END:fpt,Z_STREAM_ERROR:ppt,Z_DATA_ERROR:dpt,Z_BUF_ERROR:gpt,Z_DEFAULT_COMPRESSION:ypt,Z_FILTERED:mpt,Z_HUFFMAN_ONLY:vpt,Z_RLE:_pt,Z_FIXED:wpt,Z_DEFAULT_STRATEGY:bpt,Z_UNKNOWN:xpt,Z_DEFLATED:Cpt}=ept,Ept=286,Spt=30,Bpt=19,Ipt=2*Ept+1,Tpt=15,Ppt=258,Fpt=262,Lpt=42,Mpt=113,Opt=666,kpt=(t,e)=>(t.msg=tpt[e],e),Npt=t=>2*t-(t>4?9:0),Rpt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},Upt=t=>{let e,r,n,i=t.w_size;e=t.hash_size,n=e;do{r=t.head[--n],t.head[n]=r>=i?r-i:0}while(--e);e=i,n=e;do{r=t.prev[--n],t.prev[n]=r>=i?r-i:0}while(--e)};let Dpt=(t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask;const Qpt=t=>{const e=t.state;let r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},Gpt=(t,e)=>{ipt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Qpt(t.strm)},jpt=(t,e)=>{t.pending_buf[t.pending++]=e},Hpt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},zpt=(t,e,r,n)=>{let i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=Zft(t.adler,e,i,r):2===t.state.wrap&&(t.adler=$ft(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Vpt=(t,e)=>{let r,n,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match;const l=t.strstart>t.w_size-Fpt?t.strstart-(t.w_size-Fpt):0,u=t.window,h=t.w_mask,c=t.prev,A=t.strstart+Ppt;let f=u[o+s-1],p=u[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(r=e,u[r+s]===p&&u[r+s-1]===f&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&o<A);if(n=Ppt-(A-o),o=A-Ppt,n>s){if(t.match_start=e,s=n,n>=a)break;f=u[o+s-1],p=u[o+s]}}}while((e=c[e&h])>l&&0!=--i);return s<=t.lookahead?s:t.lookahead},Kpt=t=>{const e=t.w_size;let r,n,i;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Fpt)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),Upt(t),n+=e),0===t.strm.avail_in)break;if(r=zpt(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Dpt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Dpt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Fpt&&0!==t.strm.avail_in)},qpt=(t,e)=>{let r,n,i,o=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,a=t.strm.avail_in;do{if(r=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,n=t.strstart-t.block_start,r>n+t.strm.avail_in&&(r=n+t.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&e!==hpt||e===apt||r!==n+t.strm.avail_in))break;s=e===hpt&&r===n+t.strm.avail_in?1:0,npt(t,0,0,s),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,Qpt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(zpt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===s);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==apt&&e!==hpt&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(zpt(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,o=i>t.w_size?t.w_size:i,n=t.strstart-t.block_start,(n>=o||(n||e===hpt)&&e!==apt&&0===t.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=e===hpt&&0===t.strm.avail_in&&r===n?1:0,npt(t,t.block_start,r,s),t.block_start+=r,Qpt(t.strm)),s?3:1)},Wpt=(t,e)=>{let r,n;for(;;){if(t.lookahead<Fpt){if(Kpt(t),t.lookahead<Fpt&&e===apt)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=Dpt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-Fpt&&(t.match_length=Vpt(t,r)),t.match_length>=3)if(n=opt(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Dpt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Dpt(t,t.ins_h,t.window[t.strstart+1]);else n=opt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Gpt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===hpt?(Gpt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Gpt(t,!1),0===t.strm.avail_out)?1:2},Xpt=(t,e)=>{let r,n,i;for(;;){if(t.lookahead<Fpt){if(Kpt(t),t.lookahead<Fpt&&e===apt)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=Dpt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Fpt&&(t.match_length=Vpt(t,r),t.match_length<=5&&(t.strategy===mpt||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=opt(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=Dpt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Gpt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(n=opt(t,0,t.window[t.strstart-1]),n&&Gpt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=opt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===hpt?(Gpt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Gpt(t,!1),0===t.strm.avail_out)?1:2};function Ypt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}const Zpt=[new Ypt(0,0,0,0,qpt),new Ypt(4,4,8,4,Wpt),new Ypt(4,5,16,8,Wpt),new Ypt(4,6,32,32,Wpt),new Ypt(4,4,16,16,Xpt),new Ypt(8,16,32,32,Xpt),new Ypt(8,16,128,128,Xpt),new Ypt(8,32,128,256,Xpt),new Ypt(32,128,258,1024,Xpt),new Ypt(32,258,258,4096,Xpt)];function Jpt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Cpt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*Ipt),this.dyn_dtree=new Uint16Array(2*(2*Spt+1)),this.bl_tree=new Uint16Array(2*(2*Bpt+1)),Rpt(this.dyn_ltree),Rpt(this.dyn_dtree),Rpt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Tpt+1),this.heap=new Uint16Array(2*Ept+1),Rpt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ept+1),Rpt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const $pt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Lpt&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==Mpt&&e.status!==Opt?1:0},tdt=t=>{if($pt(t))return kpt(t,ppt);t.total_in=t.total_out=0,t.data_type=xpt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?Lpt:Mpt,t.adler=2===e.wrap?0:1,e.last_flush=-2,rpt(e),Apt},edt=t=>{const e=tdt(t);var r;return e===Apt&&((r=t.state).window_size=2*r.w_size,Rpt(r.head),r.max_lazy_match=Zpt[r.level].max_lazy,r.good_match=Zpt[r.level].good_length,r.nice_match=Zpt[r.level].nice_length,r.max_chain_length=Zpt[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),e},rdt=(t,e,r,n,i,o)=>{if(!t)return ppt;let s=1;if(e===ypt&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==Cpt||n<8||n>15||e<0||e>9||o<0||o>wpt||8===n&&1!==s)return kpt(t,ppt);8===n&&(n=9);const a=new Jpt;return t.state=a,a.strm=t,a.status=Lpt,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=o,a.method=r,edt(t)};var ndt={deflateInit:(t,e)=>rdt(t,e,Cpt,15,8,bpt),deflateInit2:rdt,deflateReset:edt,deflateResetKeep:tdt,deflateSetHeader:(t,e)=>$pt(t)||2!==t.state.wrap?ppt:(t.state.gzhead=e,Apt),deflate:(t,e)=>{if($pt(t)||e>cpt||e<0)return t?kpt(t,ppt):ppt;const r=t.state;if(!t.output||0!==t.avail_in&&!t.input||r.status===Opt&&e!==hpt)return kpt(t,0===t.avail_out?gpt:ppt);const n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(Qpt(t),0===t.avail_out)return r.last_flush=-1,Apt}else if(0===t.avail_in&&Npt(e)<=Npt(n)&&e!==hpt)return kpt(t,gpt);if(r.status===Opt&&0!==t.avail_in)return kpt(t,gpt);if(r.status===Lpt&&0===r.wrap&&(r.status=Mpt),r.status===Lpt){let e=Cpt+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=vpt||r.level<2?0:r.level<6?1:6===r.level?2:3,e|=n<<6,0!==r.strstart&&(e|=32),e+=31-e%31,Hpt(r,e),0!==r.strstart&&(Hpt(r,t.adler>>>16),Hpt(r,65535&t.adler)),t.adler=1,r.status=Mpt,Qpt(t),0!==r.pending)return r.last_flush=-1,Apt}if(57===r.status)if(t.adler=0,jpt(r,31),jpt(r,139),jpt(r,8),r.gzhead)jpt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),jpt(r,255&r.gzhead.time),jpt(r,r.gzhead.time>>8&255),jpt(r,r.gzhead.time>>16&255),jpt(r,r.gzhead.time>>24&255),jpt(r,9===r.level?2:r.strategy>=vpt||r.level<2?4:0),jpt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(jpt(r,255&r.gzhead.extra.length),jpt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=$ft(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(jpt(r,0),jpt(r,0),jpt(r,0),jpt(r,0),jpt(r,0),jpt(r,9===r.level?2:r.strategy>=vpt||r.level<2?4:0),jpt(r,3),r.status=Mpt,Qpt(t),0!==r.pending)return r.last_flush=-1,Apt;if(69===r.status){if(r.gzhead.extra){let e=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>e&&(t.adler=$ft(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex+=i,Qpt(t),0!==r.pending)return r.last_flush=-1,Apt;e=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>e&&(t.adler=$ft(t.adler,r.pending_buf,r.pending-e,e)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=$ft(t.adler,r.pending_buf,r.pending-n,n)),Qpt(t),0!==r.pending)return r.last_flush=-1,Apt;n=0}e=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,jpt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=$ft(t.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let e,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(t.adler=$ft(t.adler,r.pending_buf,r.pending-n,n)),Qpt(t),0!==r.pending)return r.last_flush=-1,Apt;n=0}e=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,jpt(r,e)}while(0!==e);r.gzhead.hcrc&&r.pending>n&&(t.adler=$ft(t.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Qpt(t),0!==r.pending))return r.last_flush=-1,Apt;jpt(r,255&t.adler),jpt(r,t.adler>>8&255),t.adler=0}if(r.status=Mpt,Qpt(t),0!==r.pending)return r.last_flush=-1,Apt}if(0!==t.avail_in||0!==r.lookahead||e!==apt&&r.status!==Opt){let n=0===r.level?qpt(r,e):r.strategy===vpt?((t,e)=>{let r;for(;;){if(0===t.lookahead&&(Kpt(t),0===t.lookahead)){if(e===apt)return 1;break}if(t.match_length=0,r=opt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Gpt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===hpt?(Gpt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Gpt(t,!1),0===t.strm.avail_out)?1:2})(r,e):r.strategy===_pt?((t,e)=>{let r,n,i,o;const s=t.window;for(;;){if(t.lookahead<=Ppt){if(Kpt(t),t.lookahead<=Ppt&&e===apt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=t.strstart+Ppt;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);t.match_length=Ppt-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=opt(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=opt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Gpt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===hpt?(Gpt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(Gpt(t,!1),0===t.strm.avail_out)?1:2})(r,e):Zpt[r.level].func(r,e);if(3!==n&&4!==n||(r.status=Opt),1===n||3===n)return 0===t.avail_out&&(r.last_flush=-1),Apt;if(2===n&&(e===lpt?spt(r):e!==cpt&&(npt(r,0,0,!1),e===upt&&(Rpt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Qpt(t),0===t.avail_out))return r.last_flush=-1,Apt}return e!==hpt?Apt:r.wrap<=0?fpt:(2===r.wrap?(jpt(r,255&t.adler),jpt(r,t.adler>>8&255),jpt(r,t.adler>>16&255),jpt(r,t.adler>>24&255),jpt(r,255&t.total_in),jpt(r,t.total_in>>8&255),jpt(r,t.total_in>>16&255),jpt(r,t.total_in>>24&255)):(Hpt(r,t.adler>>>16),Hpt(r,65535&t.adler)),Qpt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Apt:fpt)},deflateEnd:t=>{if($pt(t))return ppt;const e=t.state.status;return t.state=null,e===Mpt?kpt(t,dpt):Apt},deflateSetDictionary:(t,e)=>{let r=e.length;if($pt(t))return ppt;const n=t.state,i=n.wrap;if(2===i||1===i&&n.status!==Lpt||n.lookahead)return ppt;if(1===i&&(t.adler=Zft(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){0===i&&(Rpt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let t=new Uint8Array(n.w_size);t.set(e.subarray(r-n.w_size,r),0),e=t,r=n.w_size}const o=t.avail_in,s=t.next_in,a=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Kpt(n);n.lookahead>=3;){let t=n.strstart,e=n.lookahead-2;do{n.ins_h=Dpt(n,n.ins_h,n.window[t+3-1]),n.prev[t&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=t,t++}while(--e);n.strstart=t,n.lookahead=2,Kpt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=a,t.avail_in=o,n.wrap=i,Apt},deflateInfo:"pako deflate (from Nodeca project)"};const idt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var odt={assign:function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const e in r)idt(r,e)&&(t[e]=r[e])}}return t},flattenChunks:t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;const r=new Uint8Array(e);for(let n=0,i=0,o=t.length;n<o;n++){let e=t[n];r.set(e,i),i+=e.length}return r}};let sdt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(gCt){sdt=!1}const adt=new Uint8Array(256);for(let ol=0;ol<256;ol++)adt[ol]=ol>=252?6:ol>=248?5:ol>=240?4:ol>=224?3:ol>=192?2:1;adt[254]=adt[254]=1;var ldt={string2buf:t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,r,n,i,o,s=t.length,a=0;for(i=0;i<s;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(a),o=0,i=0;o<a;i++)r=t.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=t.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|63&r):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|63&r):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|63&r);return e},buf2string:(t,e)=>{const r=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let e=t[n++];if(e<128){o[i++]=e;continue}let s=adt[e];if(s>4)o[i++]=65533,n+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&n<r;)e=e<<6|63&t[n++],s--;s>1?o[i++]=65533:e<65536?o[i++]=e:(e-=65536,o[i++]=55296|e>>10&1023,o[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&sdt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r})(o,i)},utf8border:(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let r=e-1;for(;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+adt[t[r]]>e?r:e}},udt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const hdt=Object.prototype.toString,{Z_NO_FLUSH:cdt,Z_SYNC_FLUSH:Adt,Z_FULL_FLUSH:fdt,Z_FINISH:pdt,Z_OK:ddt,Z_STREAM_END:gdt,Z_DEFAULT_COMPRESSION:ydt,Z_DEFAULT_STRATEGY:mdt,Z_DEFLATED:vdt}=ept;function _dt(t){this.options=odt.assign({level:ydt,method:vdt,chunkSize:16384,windowBits:15,memLevel:8,strategy:mdt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new udt,this.strm.avail_out=0;let r=ndt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==ddt)throw new Error(tpt[r]);if(e.header&&ndt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?ldt.string2buf(e.dictionary):"[object ArrayBuffer]"===hdt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=ndt.deflateSetDictionary(this.strm,t),r!==ddt)throw new Error(tpt[r]);this._dict_set=!0}}_dt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=e===~~e?e:!0===e?pdt:cdt,"string"==typeof t?r.input=ldt.string2buf(t):"[object ArrayBuffer]"===hdt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Adt||o===fdt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=ndt.deflate(r,o),i===gdt)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=ndt.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ddt;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},_dt.prototype.onData=function(t){this.chunks.push(t)},_dt.prototype.onEnd=function(t){t===ddt&&(this.result=odt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const wdt=16209;var bdt=function(t,e){let r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x,C,E;const S=t.state;r=t.next_in,C=t.input,n=r+(t.avail_in-5),i=t.next_out,E=t.output,o=i-(e-t.avail_out),s=i+(t.avail_out-257),a=S.dmax,l=S.wsize,u=S.whave,h=S.wnext,c=S.window,A=S.hold,f=S.bits,p=S.lencode,d=S.distcode,g=(1<<S.lenbits)-1,y=(1<<S.distbits)-1;t:do{f<15&&(A+=C[r++]<<f,f+=8,A+=C[r++]<<f,f+=8),m=p[A&g];e:for(;;){if(v=m>>>24,A>>>=v,f-=v,v=m>>>16&255,0===v)E[i++]=65535&m;else{if(!(16&v)){if(0==(64&v)){m=p[(65535&m)+(A&(1<<v)-1)];continue e}if(32&v){S.mode=16191;break t}t.msg="invalid literal/length code",S.mode=wdt;break t}_=65535&m,v&=15,v&&(f<v&&(A+=C[r++]<<f,f+=8),_+=A&(1<<v)-1,A>>>=v,f-=v),f<15&&(A+=C[r++]<<f,f+=8,A+=C[r++]<<f,f+=8),m=d[A&y];r:for(;;){if(v=m>>>24,A>>>=v,f-=v,v=m>>>16&255,!(16&v)){if(0==(64&v)){m=d[(65535&m)+(A&(1<<v)-1)];continue r}t.msg="invalid distance code",S.mode=wdt;break t}if(w=65535&m,v&=15,f<v&&(A+=C[r++]<<f,f+=8,f<v&&(A+=C[r++]<<f,f+=8)),w+=A&(1<<v)-1,w>a){t.msg="invalid distance too far back",S.mode=wdt;break t}if(A>>>=v,f-=v,v=i-o,w>v){if(v=w-v,v>u&&S.sane){t.msg="invalid distance too far back",S.mode=wdt;break t}if(b=0,x=c,0===h){if(b+=l-v,v<_){_-=v;do{E[i++]=c[b++]}while(--v);b=i-w,x=E}}else if(h<v){if(b+=l+h-v,v-=h,v<_){_-=v;do{E[i++]=c[b++]}while(--v);if(b=0,h<_){v=h,_-=v;do{E[i++]=c[b++]}while(--v);b=i-w,x=E}}}else if(b+=h-v,v<_){_-=v;do{E[i++]=c[b++]}while(--v);b=i-w,x=E}for(;_>2;)E[i++]=x[b++],E[i++]=x[b++],E[i++]=x[b++],_-=3;_&&(E[i++]=x[b++],_>1&&(E[i++]=x[b++]))}else{b=i-w;do{E[i++]=E[b++],E[i++]=E[b++],E[i++]=E[b++],_-=3}while(_>2);_&&(E[i++]=E[b++],_>1&&(E[i++]=E[b++]))}break}}break}}while(r<n&&i<s);_=f>>3,r-=_,f-=_<<3,A&=(1<<f)-1,t.next_in=r,t.next_out=i,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=i<s?s-i+257:257-(i-s),S.hold=A,S.bits=f};const xdt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Cdt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Edt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Sdt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Bdt=(t,e,r,n,i,o,s,a)=>{const l=a.bits;let u,h,c,A,f,p,d=0,g=0,y=0,m=0,v=0,_=0,w=0,b=0,x=0,C=0,E=null;const S=new Uint16Array(16),B=new Uint16Array(16);let I,T,P,F=null;for(d=0;d<=15;d++)S[d]=0;for(g=0;g<n;g++)S[e[r+g]]++;for(v=l,m=15;m>=1&&0===S[m];m--);if(v>m&&(v=m),0===m)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(y=1;y<m&&0===S[y];y++);for(v<y&&(v=y),b=1,d=1;d<=15;d++)if(b<<=1,b-=S[d],b<0)return-1;if(b>0&&(0===t||1!==m))return-1;for(B[1]=0,d=1;d<15;d++)B[d+1]=B[d]+S[d];for(g=0;g<n;g++)0!==e[r+g]&&(s[B[e[r+g]]++]=g);if(0===t?(E=F=s,p=20):1===t?(E=xdt,F=Cdt,p=257):(E=Edt,F=Sdt,p=0),C=0,g=0,d=y,f=o,_=v,w=0,c=-1,x=1<<v,A=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){I=d-w,s[g]+1<p?(T=0,P=s[g]):s[g]>=p?(T=F[s[g]-p],P=E[s[g]-p]):(T=96,P=0),u=1<<d-w,h=1<<_,y=h;do{h-=u,i[f+(C>>w)+h]=I<<24|T<<16|P|0}while(0!==h);for(u=1<<d-1;C&u;)u>>=1;if(0!==u?(C&=u-1,C+=u):C=0,g++,0==--S[d]){if(d===m)break;d=e[r+s[g]]}if(d>v&&(C&A)!==c){for(0===w&&(w=v),f+=y,_=d-w,b=1<<_;_+w<m&&(b-=S[_+w],!(b<=0));)_++,b<<=1;if(x+=1<<_,1===t&&x>852||2===t&&x>592)return 1;c=C&A,i[c]=v<<24|_<<16|f-o|0}}return 0!==C&&(i[f+C]=d-w<<24|64<<16|0),a.bits=v,0};const{Z_FINISH:Idt,Z_BLOCK:Tdt,Z_TREES:Pdt,Z_OK:Fdt,Z_STREAM_END:Ldt,Z_NEED_DICT:Mdt,Z_STREAM_ERROR:Odt,Z_DATA_ERROR:kdt,Z_MEM_ERROR:Ndt,Z_BUF_ERROR:Rdt,Z_DEFLATED:Udt}=ept,Ddt=16180,Qdt=16190,Gdt=16191,jdt=16192,Hdt=16194,zdt=16199,Vdt=16200,Kdt=16206,qdt=16209,Wdt=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Xdt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ydt=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Ddt||e.mode>16211?1:0},Zdt=t=>{if(Ydt(t))return Odt;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Ddt,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Fdt},Jdt=t=>{if(Ydt(t))return Odt;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Zdt(t)},$dt=(t,e)=>{let r;if(Ydt(t))return Odt;const n=t.state;return e<0?(r=0,e=-e):(r=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Odt:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Jdt(t))},tgt=(t,e)=>{if(!t)return Odt;const r=new Xdt;t.state=r,r.strm=t,r.window=null,r.mode=Ddt;const n=$dt(t,e);return n!==Fdt&&(t.state=null),n};let egt,rgt,ngt=!0;const igt=t=>{if(ngt){egt=new Int32Array(512),rgt=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Bdt(1,t.lens,0,288,egt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Bdt(2,t.lens,0,32,rgt,0,t.work,{bits:5}),ngt=!1}t.lencode=egt,t.lenbits=9,t.distcode=rgt,t.distbits=5},ogt=(t,e,r,n)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(e.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(e.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(e.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var sgt={inflateReset:Jdt,inflateReset2:$dt,inflateResetKeep:Zdt,inflateInit:t=>tgt(t,15),inflateInit2:tgt,inflate:(t,e)=>{let r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m,v,_,w,b,x,C=0;const E=new Uint8Array(4);let S,B;const I=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Ydt(t)||!t.output||!t.input&&0!==t.avail_in)return Odt;r=t.state,r.mode===Gdt&&(r.mode=jdt),s=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,h=r.bits,c=a,A=l,x=Fdt;t:for(;;)switch(r.mode){case Ddt:if(0===r.wrap){r.mode=jdt;break}for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(2&r.wrap&&35615===u){0===r.wbits&&(r.wbits=15),r.check=0,E[0]=255&u,E[1]=u>>>8&255,r.check=$ft(r.check,E,2,0),u=0,h=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=qdt;break}if((15&u)!==Udt){t.msg="unknown compression method",r.mode=qdt;break}if(u>>>=4,h-=4,b=8+(15&u),0===r.wbits&&(r.wbits=b),b>15||b>r.wbits){t.msg="invalid window size",r.mode=qdt;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=512&u?16189:Gdt,u=0,h=0;break;case 16181:for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(r.flags=u,(255&r.flags)!==Udt){t.msg="unknown compression method",r.mode=qdt;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=qdt;break}r.head&&(r.head.text=u>>8&1),512&r.flags&&4&r.wrap&&(E[0]=255&u,E[1]=u>>>8&255,r.check=$ft(r.check,E,2,0)),u=0,h=0,r.mode=16182;case 16182:for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.head&&(r.head.time=u),512&r.flags&&4&r.wrap&&(E[0]=255&u,E[1]=u>>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=$ft(r.check,E,4,0)),u=0,h=0,r.mode=16183;case 16183:for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.head&&(r.head.xflags=255&u,r.head.os=u>>8),512&r.flags&&4&r.wrap&&(E[0]=255&u,E[1]=u>>>8&255,r.check=$ft(r.check,E,2,0)),u=0,h=0,r.mode=16184;case 16184:if(1024&r.flags){for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.length=u,r.head&&(r.head.extra_len=u),512&r.flags&&4&r.wrap&&(E[0]=255&u,E[1]=u>>>8&255,r.check=$ft(r.check,E,2,0)),u=0,h=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(f=r.length,f>a&&(f=a),f&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),b)),512&r.flags&&4&r.wrap&&(r.check=$ft(r.check,n,f,o)),a-=f,o+=f,r.length-=f),r.length))break t;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break t;f=0;do{b=n[o+f++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b))}while(b&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=$ft(r.check,n,f,o)),a-=f,o+=f,b)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break t;f=0;do{b=n[o+f++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b))}while(b&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=$ft(r.check,n,f,o)),a-=f,o+=f,b)break t}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;h<16;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(4&r.wrap&&u!==(65535&r.check)){t.msg="header crc mismatch",r.mode=qdt;break}u=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Gdt;break;case 16189:for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}t.adler=r.check=Wdt(u),u=0,h=0,r.mode=Qdt;case Qdt:if(0===r.havedict)return t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,Mdt;t.adler=r.check=1,r.mode=Gdt;case Gdt:if(e===Tdt||e===Pdt)break t;case jdt:if(r.last){u>>>=7&h,h-=7&h,r.mode=Kdt;break}for(;h<3;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}switch(r.last=1&u,u>>>=1,h-=1,3&u){case 0:r.mode=16193;break;case 1:if(igt(r),r.mode=zdt,e===Pdt){u>>>=2,h-=2;break t}break;case 2:r.mode=16196;break;case 3:t.msg="invalid block type",r.mode=qdt}u>>>=2,h-=2;break;case 16193:for(u>>>=7&h,h-=7&h;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if((65535&u)!=(u>>>16^65535)){t.msg="invalid stored block lengths",r.mode=qdt;break}if(r.length=65535&u,u=0,h=0,r.mode=Hdt,e===Pdt)break t;case Hdt:r.mode=16195;case 16195:if(f=r.length,f){if(f>a&&(f=a),f>l&&(f=l),0===f)break t;i.set(n.subarray(o,o+f),s),a-=f,o+=f,l-=f,s+=f,r.length-=f;break}r.mode=Gdt;break;case 16196:for(;h<14;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(r.nlen=257+(31&u),u>>>=5,h-=5,r.ndist=1+(31&u),u>>>=5,h-=5,r.ncode=4+(15&u),u>>>=4,h-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=qdt;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;h<3;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.lens[I[r.have++]]=7&u,u>>>=3,h-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=Bdt(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg="invalid code lengths set",r.mode=qdt;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;C=r.lencode[u&(1<<r.lenbits)-1],g=C>>>24,y=C>>>16&255,m=65535&C,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(m<16)u>>>=g,h-=g,r.lens[r.have++]=m;else{if(16===m){for(B=g+2;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(u>>>=g,h-=g,0===r.have){t.msg="invalid bit length repeat",r.mode=qdt;break}b=r.lens[r.have-1],f=3+(3&u),u>>>=2,h-=2}else if(17===m){for(B=g+3;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=g,h-=g,b=0,f=3+(7&u),u>>>=3,h-=3}else{for(B=g+7;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=g,h-=g,b=0,f=11+(127&u),u>>>=7,h-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=qdt;break}for(;f--;)r.lens[r.have++]=b}}if(r.mode===qdt)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=qdt;break}if(r.lenbits=9,S={bits:r.lenbits},x=Bdt(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){t.msg="invalid literal/lengths set",r.mode=qdt;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=Bdt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){t.msg="invalid distances set",r.mode=qdt;break}if(r.mode=zdt,e===Pdt)break t;case zdt:r.mode=Vdt;case Vdt:if(a>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,bdt(t,A),s=t.next_out,i=t.output,l=t.avail_out,o=t.next_in,n=t.input,a=t.avail_in,u=r.hold,h=r.bits,r.mode===Gdt&&(r.back=-1);break}for(r.back=0;C=r.lencode[u&(1<<r.lenbits)-1],g=C>>>24,y=C>>>16&255,m=65535&C,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(y&&0==(240&y)){for(v=g,_=y,w=m;C=r.lencode[w+((u&(1<<v+_)-1)>>v)],g=C>>>24,y=C>>>16&255,m=65535&C,!(v+g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=v,h-=v,r.back+=v}if(u>>>=g,h-=g,r.back+=g,r.length=m,0===y){r.mode=16205;break}if(32&y){r.back=-1,r.mode=Gdt;break}if(64&y){t.msg="invalid literal/length code",r.mode=qdt;break}r.extra=15&y,r.mode=16201;case 16201:if(r.extra){for(B=r.extra;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;C=r.distcode[u&(1<<r.distbits)-1],g=C>>>24,y=C>>>16&255,m=65535&C,!(g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(0==(240&y)){for(v=g,_=y,w=m;C=r.distcode[w+((u&(1<<v+_)-1)>>v)],g=C>>>24,y=C>>>16&255,m=65535&C,!(v+g<=h);){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}u>>>=v,h-=v,r.back+=v}if(u>>>=g,h-=g,r.back+=g,64&y){t.msg="invalid distance code",r.mode=qdt;break}r.offset=m,r.extra=15&y,r.mode=16203;case 16203:if(r.extra){for(B=r.extra;h<B;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=qdt;break}r.mode=16204;case 16204:if(0===l)break t;if(f=A-l,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=qdt;break}f>r.wnext?(f-=r.wnext,p=r.wsize-f):p=r.wnext-f,f>r.length&&(f=r.length),d=r.window}else d=i,p=s-r.offset,f=r.length;f>l&&(f=l),l-=f,r.length-=f;do{i[s++]=d[p++]}while(--f);0===r.length&&(r.mode=Vdt);break;case 16205:if(0===l)break t;i[s++]=r.length,l--,r.mode=Vdt;break;case Kdt:if(r.wrap){for(;h<32;){if(0===a)break t;a--,u|=n[o++]<<h,h+=8}if(A-=l,t.total_out+=A,r.total+=A,4&r.wrap&&A&&(t.adler=r.check=r.flags?$ft(r.check,i,A,s-A):Zft(r.check,i,A,s-A)),A=l,4&r.wrap&&(r.flags?u:Wdt(u))!==r.check){t.msg="incorrect data check",r.mode=qdt;break}u=0,h=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;h<32;){if(0===a)break t;a--,u+=n[o++]<<h,h+=8}if(4&r.wrap&&u!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=qdt;break}u=0,h=0}r.mode=16208;case 16208:x=Ldt;break t;case qdt:x=kdt;break t;case 16210:return Ndt;default:return Odt}return t.next_out=s,t.avail_out=l,t.next_in=o,t.avail_in=a,r.hold=u,r.bits=h,(r.wsize||A!==t.avail_out&&r.mode<qdt&&(r.mode<Kdt||e!==Idt))&&ogt(t,t.output,t.next_out,A-t.avail_out),c-=t.avail_in,A-=t.avail_out,t.total_in+=c,t.total_out+=A,r.total+=A,4&r.wrap&&A&&(t.adler=r.check=r.flags?$ft(r.check,i,A,t.next_out-A):Zft(r.check,i,A,t.next_out-A)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Gdt?128:0)+(r.mode===zdt||r.mode===Hdt?256:0),(0===c&&0===A||e===Idt)&&x===Fdt&&(x=Rdt),x},inflateEnd:t=>{if(Ydt(t))return Odt;let e=t.state;return e.window&&(e.window=null),t.state=null,Fdt},inflateGetHeader:(t,e)=>{if(Ydt(t))return Odt;const r=t.state;return 0==(2&r.wrap)?Odt:(r.head=e,e.done=!1,Fdt)},inflateSetDictionary:(t,e)=>{const r=e.length;let n,i,o;return Ydt(t)?Odt:(n=t.state,0!==n.wrap&&n.mode!==Qdt?Odt:n.mode===Qdt&&(i=1,i=Zft(i,e,r,0),i!==n.check)?kdt:(o=ogt(t,e,r,r),o?(n.mode=16210,Ndt):(n.havedict=1,Fdt)))},inflateInfo:"pako inflate (from Nodeca project)"},agt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const lgt=Object.prototype.toString,{Z_NO_FLUSH:ugt,Z_FINISH:hgt,Z_OK:cgt,Z_STREAM_END:Agt,Z_NEED_DICT:fgt,Z_STREAM_ERROR:pgt,Z_DATA_ERROR:dgt,Z_MEM_ERROR:ggt}=ept;function ygt(t){this.options=odt.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new udt,this.strm.avail_out=0;let r=sgt.inflateInit2(this.strm,e.windowBits);if(r!==cgt)throw new Error(tpt[r]);if(this.header=new agt,sgt.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=ldt.string2buf(e.dictionary):"[object ArrayBuffer]"===lgt.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=sgt.inflateSetDictionary(this.strm,e.dictionary),r!==cgt)))throw new Error(tpt[r])}function mgt(t,e){const r=new ygt(e);if(r.push(t),r.err)throw r.msg||tpt[r.err];return r.result}ygt.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=e===~~e?e:!0===e?hgt:ugt,"[object ArrayBuffer]"===lgt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=sgt.inflate(r,s),o===fgt&&i&&(o=sgt.inflateSetDictionary(r,i),o===cgt?o=sgt.inflate(r,s):o===dgt&&(o=fgt));r.avail_in>0&&o===Agt&&r.state.wrap>0&&0!==t[r.next_in];)sgt.inflateReset(r),o=sgt.inflate(r,s);switch(o){case pgt:case dgt:case fgt:case ggt:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===Agt))if("string"===this.options.to){let t=ldt.utf8border(r.output,r.next_out),e=r.next_out-t,i=ldt.buf2string(r.output,t);r.next_out=e,r.avail_out=n-e,e&&r.output.set(r.output.subarray(t,t+e),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==cgt||0!==a){if(o===Agt)return o=sgt.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},ygt.prototype.onData=function(t){this.chunks.push(t)},ygt.prototype.onEnd=function(t){t===cgt&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=odt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var vgt={Inflate:ygt,inflate:mgt,inflateRaw:function(t,e){return(e=e||{}).raw=!0,mgt(t,e)},ungzip:mgt,constants:ept};const{Inflate:_gt,inflate:wgt,inflateRaw:bgt,ungzip:xgt}=vgt;var Cgt=wgt;const Egt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{decodeBlock(t){return Cgt(new Uint8Array(t)).buffer}}},Symbol.toStringTag,{value:"Module"})),Sgt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{decodeBlock(t){const e=new DataView(t),r=[];for(let n=0;n<t.byteLength;++n){let t=e.getInt8(n);if(t<0){const i=e.getUint8(n+1);t=-t;for(let e=0;e<=t;++e)r.push(i);n+=1}else{for(let i=0;i<=t;++i)r.push(e.getUint8(n+i+1));n+=t+1}}return new Uint8Array(r).buffer}}},Symbol.toStringTag,{value:"Module"}));var Bgt={};!function(t){
471
471
  /* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */
472
472
  !function(){var e,r,n,i,o,s,a,l,u,h,c,A,f,p,d,g,y,m=(e={defaultNoDataValue:-34027999387901484e22,decode:function(t,s){var a=(s=s||{}).encodedMaskData||null===s.encodedMaskData,l=o(t,s.inputOffset||0,a),u=null!==s.noDataValue?s.noDataValue:e.defaultNoDataValue,h=r(l,s.pixelType||Float32Array,s.encodedMaskData,u,s.returnMask),c={width:l.width,height:l.height,pixelData:h.resultPixels,minValue:h.minValue,maxValue:l.pixels.maxValue,noDataValue:u};return h.resultMask&&(c.maskData=h.resultMask),s.returnEncodedMask&&l.mask&&(c.encodedMaskData=l.mask.bitset?l.mask.bitset:null),s.returnFileInfo&&(c.fileInfo=n(l),s.computeUsedBitDepths&&(c.fileInfo.bitDepths=i(l))),c}},r=function(t,e,r,n,i){var o,a,l,u=0,h=t.pixels.numBlocksX,c=t.pixels.numBlocksY,A=Math.floor(t.width/h),f=Math.floor(t.height/c),p=2*t.maxZError,d=Number.MAX_VALUE;r=r||(t.mask?t.mask.bitset:null),a=new e(t.width*t.height),i&&r&&(l=new Uint8Array(t.width*t.height));for(var g,y,m=new Float32Array(A*f),v=0;v<=c;v++){var _=v!==c?f:t.height%c;if(0!==_)for(var w=0;w<=h;w++){var b=w!==h?A:t.width%h;if(0!==b){var x,C,E,S,B=v*t.width*f+w*A,I=t.width-b,T=t.pixels.blocks[u];if(T.encoding<2?(0===T.encoding?x=T.rawData:(s(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,m,t.pixels.maxValue),x=m),C=0):E=2===T.encoding?0:T.offset,r)for(y=0;y<_;y++){for(7&B&&(S=r[B>>3],S<<=7&B),g=0;g<b;g++)7&B||(S=r[B>>3]),128&S?(l&&(l[B]=1),d=d>(o=T.encoding<2?x[C++]:E)?o:d,a[B++]=o):(l&&(l[B]=0),a[B++]=n),S<<=1;B+=I}else if(T.encoding<2)for(y=0;y<_;y++){for(g=0;g<b;g++)d=d>(o=x[C++])?o:d,a[B++]=o;B+=I}else for(d=d>E?E:d,y=0;y<_;y++){for(g=0;g<b;g++)a[B++]=E;B+=I}if(1===T.encoding&&C!==T.numValidPixels)throw"Block and Mask do not match";u++}}}return{resultPixels:a,resultMask:l,minValue:d}},n=function(t){return{fileIdentifierString:t.fileIdentifierString,fileVersion:t.fileVersion,imageType:t.imageType,height:t.height,width:t.width,maxZError:t.maxZError,eofOffset:t.eofOffset,mask:t.mask?{numBlocksX:t.mask.numBlocksX,numBlocksY:t.mask.numBlocksY,numBytes:t.mask.numBytes,maxValue:t.mask.maxValue}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,numBytes:t.pixels.numBytes,maxValue:t.pixels.maxValue,noDataValue:t.noDataValue}}},i=function(t){for(var e=t.pixels.numBlocksX*t.pixels.numBlocksY,r={},n=0;n<e;n++){var i=t.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},o=function(t,e,r){var n={},i=new Uint8Array(t,e,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;e+=10;var o=new DataView(t,e,24);if(n.fileVersion=o.getInt32(0,!0),n.imageType=o.getInt32(4,!0),n.height=o.getUint32(8,!0),n.width=o.getUint32(12,!0),n.maxZError=o.getFloat64(16,!0),e+=24,!r)if(o=new DataView(t,e,16),n.mask={},n.mask.numBlocksY=o.getUint32(0,!0),n.mask.numBlocksX=o.getUint32(4,!0),n.mask.numBytes=o.getUint32(8,!0),n.mask.maxValue=o.getFloat32(12,!0),e+=16,n.mask.numBytes>0){var s=new Uint8Array(Math.ceil(n.width*n.height/8)),a=(o=new DataView(t,e,n.mask.numBytes)).getInt16(0,!0),l=2,u=0;do{if(a>0)for(;a--;)s[u++]=o.getUint8(l++);else{var h=o.getUint8(l++);for(a=-a;a--;)s[u++]=h}a=o.getInt16(l,!0),l+=2}while(l<n.mask.numBytes);if(-32768!==a||u<s.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=s,e+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));o=new DataView(t,e,16),n.pixels={},n.pixels.numBlocksY=o.getUint32(0,!0),n.pixels.numBlocksX=o.getUint32(4,!0),n.pixels.numBytes=o.getUint32(8,!0),n.pixels.maxValue=o.getFloat32(12,!0),e+=16;var c=n.pixels.numBlocksX,A=n.pixels.numBlocksY,f=c+(n.width%c>0?1:0),p=A+(n.height%A>0?1:0);n.pixels.blocks=new Array(f*p);for(var d=0,g=0;g<p;g++)for(var y=0;y<f;y++){var m=0,v=t.byteLength-e;o=new DataView(t,e,Math.min(10,v));var _={};n.pixels.blocks[d++]=_;var w=o.getUint8(0);if(m++,_.encoding=63&w,_.encoding>3)throw"Invalid block encoding ("+_.encoding+")";if(2!==_.encoding){if(0!==w&&2!==w){if(w>>=6,_.offsetType=w,2===w)_.offset=o.getInt8(1),m++;else if(1===w)_.offset=o.getInt16(1,!0),m+=2;else{if(0!==w)throw"Invalid block offset type";_.offset=o.getFloat32(1,!0),m+=4}if(1===_.encoding)if(w=o.getUint8(m),m++,_.bitsPerPixel=63&w,w>>=6,_.numValidPixelsType=w,2===w)_.numValidPixels=o.getUint8(m),m++;else if(1===w)_.numValidPixels=o.getUint16(m,!0),m+=2;else{if(0!==w)throw"Invalid valid pixel count type";_.numValidPixels=o.getUint32(m,!0),m+=4}}var b;if(e+=m,3!==_.encoding)if(0===_.encoding){var x=(n.pixels.numBytes-1)/4;if(x!==Math.floor(x))throw"uncompressed block has invalid length";b=new ArrayBuffer(4*x),new Uint8Array(b).set(new Uint8Array(t,e,4*x));var C=new Float32Array(b);_.rawData=C,e+=4*x}else if(1===_.encoding){var E=Math.ceil(_.numValidPixels*_.bitsPerPixel/8),S=Math.ceil(E/4);b=new ArrayBuffer(4*S),new Uint8Array(b).set(new Uint8Array(t,e,E)),_.stuffedData=new Uint32Array(b),e+=E}}else e++}return n.eofOffset=e,n},s=function(t,e,r,n,i,o,s){var a,l,u,h=(1<<e)-1,c=0,A=0,f=Math.ceil((s-n)/i),p=4*t.length-Math.ceil(e*r/8);for(t[t.length-1]<<=8*p,a=0;a<r;a++){if(0===A&&(u=t[c++],A=32),A>=e)l=u>>>A-e&h,A-=e;else{var d=e-A;l=(u&h)<<d&h,l+=(u=t[c++])>>>(A=32-d)}o[a]=l<f?n+l*i:s}return o},e),v=(a=function(t,e,r,n,i,o,s,a){var l,u,h,c,A,f=(1<<r)-1,p=0,d=0,g=4*t.length-Math.ceil(r*n/8);if(t[t.length-1]<<=8*g,i)for(l=0;l<n;l++)0===d&&(h=t[p++],d=32),d>=r?(u=h>>>d-r&f,d-=r):(u=(h&f)<<(c=r-d)&f,u+=(h=t[p++])>>>(d=32-c)),e[l]=i[u];else for(A=Math.ceil((a-o)/s),l=0;l<n;l++)0===d&&(h=t[p++],d=32),d>=r?(u=h>>>d-r&f,d-=r):(u=(h&f)<<(c=r-d)&f,u+=(h=t[p++])>>>(d=32-c)),e[l]=u<A?o+u*s:a},l=function(t,e,r,n,i,o){var s,a=(1<<e)-1,l=0,u=0,h=0,c=0,A=0,f=[],p=4*t.length-Math.ceil(e*r/8);t[t.length-1]<<=8*p;var d=Math.ceil((o-n)/i);for(u=0;u<r;u++)0===c&&(s=t[l++],c=32),c>=e?(A=s>>>c-e&a,c-=e):(A=(s&a)<<(h=e-c)&a,A+=(s=t[l++])>>>(c=32-h)),f[u]=A<d?n+A*i:o;return f.unshift(n),f},u=function(t,e,r,n,i,o,s,a){var l,u,h,c,A=(1<<r)-1,f=0,p=0,d=0;if(i)for(l=0;l<n;l++)0===p&&(h=t[f++],p=32,d=0),p>=r?(u=h>>>d&A,p-=r,d+=r):(u=h>>>d&A,p=32-(c=r-p),u|=((h=t[f++])&(1<<c)-1)<<r-c,d=c),e[l]=i[u];else{var g=Math.ceil((a-o)/s);for(l=0;l<n;l++)0===p&&(h=t[f++],p=32,d=0),p>=r?(u=h>>>d&A,p-=r,d+=r):(u=h>>>d&A,p=32-(c=r-p),u|=((h=t[f++])&(1<<c)-1)<<r-c,d=c),e[l]=u<g?o+u*s:a}return e},h=function(t,e,r,n,i,o){var s,a=(1<<e)-1,l=0,u=0,h=0,c=0,A=0,f=0,p=[],d=Math.ceil((o-n)/i);for(u=0;u<r;u++)0===c&&(s=t[l++],c=32,f=0),c>=e?(A=s>>>f&a,c-=e,f+=e):(A=s>>>f&a,c=32-(h=e-c),A|=((s=t[l++])&(1<<h)-1)<<e-h,f=h),p[u]=A<d?n+A*i:o;return p.unshift(n),p},c=function(t,e,r,n){var i,o,s,a,l=(1<<r)-1,u=0,h=0,c=4*t.length-Math.ceil(r*n/8);for(t[t.length-1]<<=8*c,i=0;i<n;i++)0===h&&(s=t[u++],h=32),h>=r?(o=s>>>h-r&l,h-=r):(o=(s&l)<<(a=r-h)&l,o+=(s=t[u++])>>>(h=32-a)),e[i]=o;return e},A=function(t,e,r,n){var i,o,s,a,l=(1<<r)-1,u=0,h=0,c=0;for(i=0;i<n;i++)0===h&&(s=t[u++],h=32,c=0),h>=r?(o=s>>>c&l,h-=r,c+=r):(o=s>>>c&l,h=32-(a=r-h),o|=((s=t[u++])&(1<<a)-1)<<r-a,c=a),e[i]=o;return e},f={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(t){for(var e=65535,r=65535,n=t.length,i=Math.floor(n/2),o=0;i;){var s=i>=359?359:i;i-=s;do{e+=t[o++]<<8,r+=e+=t[o++]}while(--s);e=(65535&e)+(e>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=e+=t[o]<<8),((r=(65535&r)+(r>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(t,e){var r=e.ptr,n=new Uint8Array(t,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var o,s=new DataView(t,r,8),a=s.getInt32(0,!0);if(i.fileVersion=a,r+=4,a>=3&&(i.checksum=s.getUint32(4,!0),r+=4),s=new DataView(t,r,12),i.height=s.getUint32(0,!0),i.width=s.getUint32(4,!0),r+=8,a>=4?(i.numDims=s.getUint32(8,!0),r+=4):i.numDims=1,s=new DataView(t,r,40),i.numValidPixel=s.getUint32(0,!0),i.microBlockSize=s.getInt32(4,!0),i.blobSize=s.getInt32(8,!0),i.imageType=s.getInt32(12,!0),i.maxZError=s.getFloat64(16,!0),i.zMin=s.getFloat64(24,!0),i.zMax=s.getFloat64(32,!0),r+=40,e.headerInfo=i,e.ptr=r,a>=3&&(o=a>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(t,r-o,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(t,e){var r=e.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),o=this.readSubArray(t,e.ptr,n,i),s=this.readSubArray(t,e.ptr+i,n,i);e.ptr+=2*i;var a,l=!0;for(a=0;a<r.numDims;a++)if(o[a]!==s[a]){l=!1;break}return r.minValues=o,r.maxValues=s,l},readSubArray:function(t,e,r,n){var i;if(r===Uint8Array)i=new Uint8Array(t,e,n);else{var o=new ArrayBuffer(n);new Uint8Array(o).set(new Uint8Array(t,e,n)),i=new r(o)}return i},readMask:function(t,e){var r,n,i=e.ptr,o=e.headerInfo,s=o.width*o.height,a=o.numValidPixel,l=new DataView(t,i,4),u={};if(u.numBytes=l.getUint32(0,!0),i+=4,(0===a||s===a)&&0!==u.numBytes)throw"invalid mask";if(0===a)r=new Uint8Array(Math.ceil(s/8)),u.bitset=r,n=new Uint8Array(s),e.pixels.resultMask=n,i+=u.numBytes;else if(u.numBytes>0){r=new Uint8Array(Math.ceil(s/8));var h=(l=new DataView(t,i,u.numBytes)).getInt16(0,!0),c=2,A=0,f=0;do{if(h>0)for(;h--;)r[A++]=l.getUint8(c++);else for(f=l.getUint8(c++),h=-h;h--;)r[A++]=f;h=l.getInt16(c,!0),c+=2}while(c<u.numBytes);if(-32768!==h||A<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(s);var p=0,d=0;for(d=0;d<s;d++)7&d?(p=r[d>>3],p<<=7&d):p=r[d>>3],128&p&&(n[d]=1);e.pixels.resultMask=n,u.bitset=r,i+=u.numBytes}return e.ptr=i,e.mask=u,!0},readDataOneSweep:function(t,e,r,n){var i,o=e.ptr,s=e.headerInfo,a=s.numDims,l=s.width*s.height,u=s.imageType,h=s.numValidPixel*f.getDataTypeSize(u)*a,c=e.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(t,o,h);else{var A=new ArrayBuffer(h);new Uint8Array(A).set(new Uint8Array(t,o,h)),i=new r(A)}if(i.length===l*a)e.pixels.resultPixels=n?f.swapDimensionOrder(i,l,a,r,!0):i;else{e.pixels.resultPixels=new r(l*a);var p=0,d=0,g=0,y=0;if(a>1){if(n){for(d=0;d<l;d++)if(c[d])for(y=d,g=0;g<a;g++,y+=l)e.pixels.resultPixels[y]=i[p++]}else for(d=0;d<l;d++)if(c[d])for(y=d*a,g=0;g<a;g++)e.pixels.resultPixels[y+g]=i[p++]}else for(d=0;d<l;d++)c[d]&&(e.pixels.resultPixels[d]=i[p++])}return o+=h,e.ptr=o,!0},readHuffmanTree:function(t,e){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(t,e.ptr,16);if(e.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),o=n.getInt32(8,!0),s=n.getInt32(12,!0);if(o>=s)return!1;var a=new Uint32Array(s-o);f.decodeBits(t,e,a);var l,u,h,c,A=[];for(l=o;l<s;l++)A[u=l-(l<i?0:i)]={first:a[l-o],second:null};var d=t.byteLength-e.ptr,g=Math.ceil(d/4),y=new ArrayBuffer(4*g);new Uint8Array(y).set(new Uint8Array(t,e.ptr,d));var m,v=new Uint32Array(y),_=0,w=0;for(m=v[0],l=o;l<s;l++)(c=A[u=l-(l<i?0:i)].first)>0&&(A[u].second=m<<_>>>32-c,32-_>=c?32===(_+=c)&&(_=0,m=v[++w]):(_+=c-32,m=v[++w],A[u].second|=m>>>32-_));var b,x=0,C=new p;for(l=0;l<A.length;l++)void 0!==A[l]&&(x=Math.max(x,A[l].first));b=x>=r?r:x;var E,S,B,I,T,P=[];for(l=o;l<s;l++)if((c=A[u=l-(l<i?0:i)].first)>0)if(E=[c,u],c<=b)for(S=A[u].second<<b-c,B=1<<b-c,h=0;h<B;h++)P[S|h]=E;else for(S=A[u].second,T=C,I=c-1;I>=0;I--)S>>>I&1?(T.right||(T.right=new p),T=T.right):(T.left||(T.left=new p),T=T.left),0!==I||T.val||(T.val=E[1]);return{decodeLut:P,numBitsLUTQick:b,numBitsLUT:x,tree:C,stuffedData:v,srcPtr:w,bitPos:_}},readHuffman:function(t,e,r,n){var i,o,s,a,l,u,h,c,A,p=e.headerInfo.numDims,d=e.headerInfo.height,g=e.headerInfo.width,y=g*d,m=this.readHuffmanTree(t,e),v=m.decodeLut,_=m.tree,w=m.stuffedData,b=m.srcPtr,x=m.bitPos,C=m.numBitsLUTQick,E=m.numBitsLUT,S=0===e.headerInfo.imageType?128:0,B=e.pixels.resultMask,I=0;x>0&&(b++,x=0);var T,P=w[b],F=1===e.encodeMode,L=new r(y*p),M=L;if(p<2||F){for(T=0;T<p;T++)if(p>1&&(M=new r(L.buffer,y*T,y),I=0),e.headerInfo.numValidPixel===g*d)for(c=0,u=0;u<d;u++)for(h=0;h<g;h++,c++){if(o=0,l=a=P<<x>>>32-C,32-x<C&&(l=a|=w[b+1]>>>64-x-C),v[l])o=v[l][1],x+=v[l][0];else for(l=a=P<<x>>>32-E,32-x<E&&(l=a|=w[b+1]>>>64-x-E),i=_,A=0;A<E;A++)if(!(i=a>>>E-A-1&1?i.right:i.left).left&&!i.right){o=i.val,x=x+A+1;break}x>=32&&(x-=32,P=w[++b]),s=o-S,F?(s+=h>0?I:u>0?M[c-g]:I,s&=255,M[c]=s,I=s):M[c]=s}else for(c=0,u=0;u<d;u++)for(h=0;h<g;h++,c++)if(B[c]){if(o=0,l=a=P<<x>>>32-C,32-x<C&&(l=a|=w[b+1]>>>64-x-C),v[l])o=v[l][1],x+=v[l][0];else for(l=a=P<<x>>>32-E,32-x<E&&(l=a|=w[b+1]>>>64-x-E),i=_,A=0;A<E;A++)if(!(i=a>>>E-A-1&1?i.right:i.left).left&&!i.right){o=i.val,x=x+A+1;break}x>=32&&(x-=32,P=w[++b]),s=o-S,F?(h>0&&B[c-1]?s+=I:u>0&&B[c-g]?s+=M[c-g]:s+=I,s&=255,M[c]=s,I=s):M[c]=s}}else for(c=0,u=0;u<d;u++)for(h=0;h<g;h++)if(c=u*g+h,!B||B[c])for(T=0;T<p;T++,c+=y){if(o=0,l=a=P<<x>>>32-C,32-x<C&&(l=a|=w[b+1]>>>64-x-C),v[l])o=v[l][1],x+=v[l][0];else for(l=a=P<<x>>>32-E,32-x<E&&(l=a|=w[b+1]>>>64-x-E),i=_,A=0;A<E;A++)if(!(i=a>>>E-A-1&1?i.right:i.left).left&&!i.right){o=i.val,x=x+A+1;break}x>=32&&(x-=32,P=w[++b]),s=o-S,M[c]=s}e.ptr=e.ptr+4*(b+1)+(x>0?4:0),e.pixels.resultPixels=L,p>1&&!n&&(e.pixels.resultPixels=f.swapDimensionOrder(L,y,p,r))},decodeBits:function(t,e,r,n,i){var o=e.headerInfo,s=o.fileVersion,f=0,p=t.byteLength-e.ptr>=5?5:t.byteLength-e.ptr,d=new DataView(t,e.ptr,p),g=d.getUint8(0);f++;var y=g>>6,m=0===y?4:3-y,v=(32&g)>0,_=31&g,w=0;if(1===m)w=d.getUint8(f),f++;else if(2===m)w=d.getUint16(f,!0),f+=2;else{if(4!==m)throw"Invalid valid pixel count type";w=d.getUint32(f,!0),f+=4}var b,x,C,E,S,B,I,T,P,F=2*o.maxZError,L=o.numDims>1?o.maxValues[i]:o.zMax;if(v){for(e.counter.lut++,T=d.getUint8(f),f++,E=Math.ceil((T-1)*_/8),S=Math.ceil(E/4),x=new ArrayBuffer(4*S),C=new Uint8Array(x),e.ptr+=f,C.set(new Uint8Array(t,e.ptr,E)),I=new Uint32Array(x),e.ptr+=E,P=0;T-1>>>P;)P++;E=Math.ceil(w*P/8),S=Math.ceil(E/4),x=new ArrayBuffer(4*S),(C=new Uint8Array(x)).set(new Uint8Array(t,e.ptr,E)),b=new Uint32Array(x),e.ptr+=E,B=s>=3?h(I,_,T-1,n,F,L):l(I,_,T-1,n,F,L),s>=3?u(b,r,P,w,B):a(b,r,P,w,B)}else e.counter.bitstuffer++,P=_,e.ptr+=f,P>0&&(E=Math.ceil(w*P/8),S=Math.ceil(E/4),x=new ArrayBuffer(4*S),(C=new Uint8Array(x)).set(new Uint8Array(t,e.ptr,E)),b=new Uint32Array(x),e.ptr+=E,s>=3?null==n?A(b,r,P,w):u(b,r,P,w,!1,n,F,L):null==n?c(b,r,P,w):a(b,r,P,w,!1,n,F,L))},readTiles:function(t,e,r,n){var i=e.headerInfo,o=i.width,s=i.height,a=o*s,l=i.microBlockSize,u=i.imageType,h=f.getDataTypeSize(u),c=Math.ceil(o/l),A=Math.ceil(s/l);e.pixels.numBlocksY=A,e.pixels.numBlocksX=c,e.pixels.ptr=0;var p,d,g,y,m,v,_,w,b,x,C=0,E=0,S=0,B=0,I=0,T=0,P=0,F=0,L=0,M=0,O=0,k=0,N=0,R=0,U=0,D=new r(l*l),Q=s%l||l,G=o%l||l,j=i.numDims,H=e.pixels.resultMask,z=e.pixels.resultPixels,V=i.fileVersion>=5?14:15,K=i.zMax;for(S=0;S<A;S++)for(I=S!==A-1?l:Q,B=0;B<c;B++)for(M=S*o*l+B*l,O=o-(T=B!==c-1?l:G),w=0;w<j;w++){if(j>1?(x=z,M=S*o*l+B*l,z=new r(e.pixels.resultPixels.buffer,a*w*h,a),K=i.maxValues[w]):x=null,P=t.byteLength-e.ptr,d={},U=0,F=(p=new DataView(t,e.ptr,Math.min(10,P))).getUint8(0),U++,b=i.fileVersion>=5?4&F:0,L=F>>6&255,(F>>2&V)!=(B*l>>3&V))throw"integrity issue";if(b&&0===w)throw"integrity issue";if((m=3&F)>3)throw e.ptr+=U,"Invalid block encoding ("+m+")";if(2!==m)if(0===m){if(b)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=U,k=(k=I*T*h)<(N=t.byteLength-e.ptr)?k:N,g=new ArrayBuffer(k%h==0?k:k+h-k%h),new Uint8Array(g).set(new Uint8Array(t,e.ptr,k)),y=new r(g),R=0,H)for(C=0;C<I;C++){for(E=0;E<T;E++)H[M]&&(z[M]=y[R++]),M++;M+=O}else for(C=0;C<I;C++){for(E=0;E<T;E++)z[M++]=y[R++];M+=O}e.ptr+=R*h}else if(v=f.getDataTypeUsed(b&&u<6?4:u,L),_=f.getOnePixel(d,U,v,p),U+=f.getDataTypeSize(v),3===m)if(e.ptr+=U,e.counter.constantoffset++,H)for(C=0;C<I;C++){for(E=0;E<T;E++)H[M]&&(z[M]=b?Math.min(K,x[M]+_):_),M++;M+=O}else for(C=0;C<I;C++){for(E=0;E<T;E++)z[M]=b?Math.min(K,x[M]+_):_,M++;M+=O}else if(e.ptr+=U,f.decodeBits(t,e,D,_,w),U=0,b)if(H)for(C=0;C<I;C++){for(E=0;E<T;E++)H[M]&&(z[M]=D[U++]+x[M]),M++;M+=O}else for(C=0;C<I;C++){for(E=0;E<T;E++)z[M]=D[U++]+x[M],M++;M+=O}else if(H)for(C=0;C<I;C++){for(E=0;E<T;E++)H[M]&&(z[M]=D[U++]),M++;M+=O}else for(C=0;C<I;C++){for(E=0;E<T;E++)z[M++]=D[U++];M+=O}else{if(b)if(H)for(C=0;C<I;C++)for(E=0;E<T;E++)H[M]&&(z[M]=x[M]),M++;else for(C=0;C<I;C++)for(E=0;E<T;E++)z[M]=x[M],M++;e.counter.constant++,e.ptr+=U}}j>1&&!n&&(e.pixels.resultPixels=f.swapDimensionOrder(e.pixels.resultPixels,a,j,r))},formatFileInfo:function(t){return{fileIdentifierString:t.headerInfo.fileIdentifierString,fileVersion:t.headerInfo.fileVersion,imageType:t.headerInfo.imageType,height:t.headerInfo.height,width:t.headerInfo.width,numValidPixel:t.headerInfo.numValidPixel,microBlockSize:t.headerInfo.microBlockSize,blobSize:t.headerInfo.blobSize,maxZError:t.headerInfo.maxZError,pixelType:f.getPixelType(t.headerInfo.imageType),eofOffset:t.eofOffset,mask:t.mask?{numBytes:t.mask.numBytes}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,maxValue:t.headerInfo.zMax,minValue:t.headerInfo.zMin,noDataValue:t.noDataValue}}},constructConstantSurface:function(t,e){var r=t.headerInfo.zMax,n=t.headerInfo.zMin,i=t.headerInfo.maxValues,o=t.headerInfo.numDims,s=t.headerInfo.height*t.headerInfo.width,a=0,l=0,u=0,h=t.pixels.resultMask,c=t.pixels.resultPixels;if(h)if(o>1){if(e)for(a=0;a<o;a++)for(u=a*s,r=i[a],l=0;l<s;l++)h[l]&&(c[u+l]=r);else for(l=0;l<s;l++)if(h[l])for(u=l*o,a=0;a<o;a++)c[u+o]=i[a]}else for(l=0;l<s;l++)h[l]&&(c[l]=r);else if(o>1&&n!==r)if(e)for(a=0;a<o;a++)for(u=a*s,r=i[a],l=0;l<s;l++)c[u+l]=r;else for(l=0;l<s;l++)for(u=l*o,a=0;a<o;a++)c[u+a]=i[a];else for(l=0;l<s*o;l++)c[l]=r},getDataTypeArray:function(t){var e;switch(t){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:default:e=Float32Array;break;case 7:e=Float64Array}return e},getPixelType:function(t){var e;switch(t){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:default:e="F32";break;case 7:e="F64"}return e},isValidPixelValue:function(t,e){if(null==e)return!1;var r;switch(t){case 0:r=e>=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(t){var e=0;switch(t){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=t}return e},getDataTypeUsed:function(t,e){var r=t;switch(t){case 2:case 4:r=t-e;break;case 3:case 5:r=t-2*e;break;case 6:r=0===e?t:1===e?2:1;break;case 7:r=0===e?t:t-2*e+1;break;default:r=t}return r},getOnePixel:function(t,e,r,n){var i=0;switch(r){case 0:i=n.getInt8(e);break;case 1:i=n.getUint8(e);break;case 2:i=n.getInt16(e,!0);break;case 3:i=n.getUint16(e,!0);break;case 4:i=n.getInt32(e,!0);break;case 5:i=n.getUInt32(e,!0);break;case 6:i=n.getFloat32(e,!0);break;case 7:i=n.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(t,e,r,n,i){var o=0,s=0,a=0,l=0,u=t;if(r>1)if(u=new n(e*r),i)for(o=0;o<e;o++)for(l=o,a=0;a<r;a++,l+=e)u[l]=t[s++];else for(o=0;o<e;o++)for(l=o,a=0;a<r;a++,l+=e)u[s++]=t[l];return u}},p=function(t,e,r){this.val=t,this.left=e,this.right=r},d={decode:function(t,e){var r=(e=e||{}).noDataValue,n=0,i={};if(i.ptr=e.inputOffset||0,i.pixels={},f.readHeaderInfo(t,i)){var o=i.headerInfo,s=o.fileVersion,a=f.getDataTypeArray(o.imageType);if(s>5)throw"unsupported lerc version 2."+s;f.readMask(t,i),o.numValidPixel===o.width*o.height||i.pixels.resultMask||(i.pixels.resultMask=e.maskData);var l=o.width*o.height;i.pixels.resultPixels=new a(l*o.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var u,h=!e.returnPixelInterleavedDims;if(0!==o.numValidPixel)if(o.zMax===o.zMin)f.constructConstantSurface(i,h);else if(s>=4&&f.checkMinMaxRanges(t,i))f.constructConstantSurface(i,h);else{var c=new DataView(t,i.ptr,2),A=c.getUint8(0);if(i.ptr++,A)f.readDataOneSweep(t,i,a,h);else if(s>1&&o.imageType<=1&&Math.abs(o.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||s<4&&p>1)throw"Invalid Huffman flag "+p;p?f.readHuffman(t,i,a,h):f.readTiles(t,i,a,h)}else f.readTiles(t,i,a,h)}i.eofOffset=i.ptr,e.inputOffset?(u=i.headerInfo.blobSize+e.inputOffset-i.ptr,Math.abs(u)>=1&&(i.eofOffset=e.inputOffset+i.headerInfo.blobSize)):(u=i.headerInfo.blobSize-i.ptr,Math.abs(u)>=1&&(i.eofOffset=i.headerInfo.blobSize));var d={width:o.width,height:o.height,pixelData:i.pixels.resultPixels,minValue:o.zMin,maxValue:o.zMax,validPixelCount:o.numValidPixel,dimCount:o.numDims,dimStats:{minValues:o.minValues,maxValues:o.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&f.isValidPixelValue(o.imageType,r)){var g=i.pixels.resultMask;for(n=0;n<l;n++)g[n]||(d.pixelData[n]=r);d.noDataValue=r}return i.noDataValue=r,e.returnFileInfo&&(d.fileInfo=f.formatFileInfo(i)),d}},getBandCount:function(t){for(var e=0,r=0,n={ptr:0,pixels:{}};r<t.byteLength-58;)f.readHeaderInfo(t,n),r+=n.headerInfo.blobSize,e++,n.ptr=r;return e}},d),_=(g=new ArrayBuffer(4),y=new Uint8Array(g),new Uint32Array(g)[0]=1,1===y[0]),w={decode:function(t,e){if(!_)throw"Big endian system is not supported.";var r,n,i=(e=e||{}).inputOffset||0,o=new Uint8Array(t,i,10),s=String.fromCharCode.apply(null,o);if("CntZImage"===s.trim())r=m,n=1;else{if("Lerc2"!==s.substring(0,5))throw"Unexpected file identifier string: "+s;r=v,n=2}for(var a,l,u,h,c,A,f=0,p=t.byteLength-10,d=[],g={width:0,height:0,pixels:[],pixelType:e.pixelType,mask:null,statistics:[]},y=0;i<p;){var w=r.decode(t,{inputOffset:i,encodedMaskData:a,maskData:u,returnMask:0===f,returnEncodedMask:0===f,returnFileInfo:!0,returnPixelInterleavedDims:e.returnPixelInterleavedDims,pixelType:e.pixelType||null,noDataValue:e.noDataValue||null});i=w.fileInfo.eofOffset,u=w.maskData,0===f&&(a=w.encodedMaskData,g.width=w.width,g.height=w.height,g.dimCount=w.dimCount||1,g.pixelType=w.pixelType||w.fileInfo.pixelType,g.mask=u),n>1&&(u&&d.push(u),w.fileInfo.mask&&w.fileInfo.mask.numBytes>0&&y++),f++,g.pixels.push(w.pixelData),g.statistics.push({minValue:w.minValue,maxValue:w.maxValue,noDataValue:w.noDataValue,dimStats:w.dimStats})}if(n>1&&y>1){for(A=g.width*g.height,g.bandMasks=d,(u=new Uint8Array(A)).set(d[0]),h=1;h<d.length;h++)for(l=d[h],c=0;c<A;c++)u[c]=u[c]&l[c];g.maskData=u}return g}};t.exports?t.exports=w:this.Lerc=w}()}({get exports(){return Bgt},set exports(t){Bgt=t}});const Igt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{constructor(t){super(),this.planarConfiguration=void 0!==t.PlanarConfiguration?t.PlanarConfiguration:1,this.samplesPerPixel=void 0!==t.SamplesPerPixel?t.SamplesPerPixel:1,this.addCompression=t.LercParameters[1]}decodeBlock(t){switch(this.addCompression){case 0:break;case 1:t=Cgt(new Uint8Array(t)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return Bgt.decode(t,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}},Symbol.toStringTag,{value:"Module"})),Tgt=Object.freeze(Object.defineProperty({__proto__:null,default:class extends JAt{constructor(){if(super(),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(t,e){const r=new Blob([e]),n=await createImageBitmap(r);let i;"undefined"!=typeof document?(i=document.createElement("canvas"),i.width=n.width,i.height=n.height):i=new OffscreenCanvas(n.width,n.height);const o=i.getContext("2d");return o.drawImage(n,0,0),o.getImageData(0,0,n.width,n.height).data.buffer}}},Symbol.toStringTag,{value:"Module"}));var Pgt=Worker;const Fgt=Object.freeze(Object.defineProperty({__proto__:null,create:function(){const t='function e(e,t,r,n,i,a,o){try{var s=e[a](o),f=s.value}catch(e){return void r(e)}s.done?t(f):Promise.resolve(f).then(n,i)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=t.apply(r,n);function s(t){e(o,i,a,s,f,"next",t)}function f(t){e(o,i,a,s,f,"throw",t)}s(void 0)}))}}function r(e){return r="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},r(e)}var n={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),o=new T(n||[]);return a._invoke=function(e,t,r){var n=h;return function(i,a){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return E()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var f=c(e,t,r);if("normal"===f.type){if(n=r.done?m:d,f.arg===v)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n=m,r.method="throw",r.arg=f.arg)}}}(e,r,o),a}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",v={};function y(){}function w(){}function g(){}var b={};l(b,o,(function(){return this}));var k=Object.getPrototypeOf,x=k&&k(k(D([])));x&&x!==n&&i.call(x,o)&&(b=x);var _=g.prototype=y.prototype=Object.create(b);function A(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(a,o,s,f){var l=c(e[a],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"===r(h)&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,s,f)}),(function(e){n("throw",e,s,f)})):t.resolve(h).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,f)}))}f(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return a=a?a.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a \'throw\' method")}return v}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function U(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 S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(U,this),this.reset(!0)}function D(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(i.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:E}}function E(){return{value:t,done:!0}}return w.prototype=g,l(_,"constructor",g),l(g,"constructor",w),w.displayName=l(g,f,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,f,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},A(P.prototype),l(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new P(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},A(_),l(_,f,"Generator"),l(_,o,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=D,T.prototype={constructor:T,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(S),!e)for(var r in this)"t"===r.charAt(0)&&i.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 a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var f=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(f&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(f){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(o)},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;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"===("undefined"==typeof globalThis?"undefined":r(globalThis))?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n);var i=n.exports,a=new Map;function o(e,t){Array.isArray(e)||(e=[e]),e.forEach((function(e){return a.set(e,t)}))}function s(e){return f.apply(this,arguments)}function f(){return(f=t(i.mark((function e(t){var r,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.get(t.Compression)){e.next=3;break}throw new Error("Unknown compression method identifier: ".concat(t.Compression));case 3:return e.next=5,r();case 5:return n=e.sent,e.abrupt("return",new n(t));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}o([void 0,1],(function(){return Promise.resolve().then((function(){return _})).then((function(e){return e.default}))})),o(5,(function(){return Promise.resolve().then((function(){return S})).then((function(e){return e.default}))})),o(6,(function(){throw new Error("old style JPEG compression is not supported.")})),o(7,(function(){return Promise.resolve().then((function(){return L})).then((function(e){return e.default}))})),o([8,32946],(function(){return Promise.resolve().then((function(){return Ne})).then((function(e){return e.default}))})),o(32773,(function(){return Promise.resolve().then((function(){return Ye})).then((function(e){return e.default}))})),o(34887,(function(){return Promise.resolve().then((function(){return ut})).then((function(e){return e.default}))})),o(50001,(function(){return Promise.resolve().then((function(){return dt})).then((function(e){return e.default}))}));var l=globalThis;function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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)}}function h(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function m(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return e}(e)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function w(e,t,r){for(var n=0,i=e.length,a=i/r;i>t;){for(var o=t;o>0;--o)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),f=0;f<a;++f)for(var l=0;l<r;++l)e[r*f+l]=s[(r-l-1)*a+f]}function g(e,t,r,n,i,a){if(!t||1===t)return e;for(var o=0;o<i.length;++o){if(i[o]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[o]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var s=i[0]/8,f=2===a?1:i.length,l=0;l<n&&!(l*f*r*s>=e.byteLength);++l){var u=void 0;if(2===t){switch(i[0]){case 8:u=new Uint8Array(e,l*f*r*s,f*r*s);break;case 16:u=new Uint16Array(e,l*f*r*s,f*r*s/2);break;case 32:u=new Uint32Array(e,l*f*r*s,f*r*s/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(i[0]," bits per sample."))}y(u,f)}else 3===t&&w(u=new Uint8Array(e,l*f*r*s,f*r*s),f,s)}return e}l.addEventListener("message",function(){var e=t(i.mark((function e(t){var r,n,a,o,f,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.data,n=r.id,a=r.fileDirectory,o=r.buffer,e.next=3,s(a);case 3:return f=e.sent,e.next=6,f.decode(a,o);case 6:u=e.sent,l.postMessage({decoded:u,id:n},[u]);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var b=function(){function e(){u(this,e)}var r;return h(e,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.decodeBlock(r);case 2:if(n=e.sent,1===(a=t.Predictor||1)){e.next=9;break}return o=!t.StripOffsets,s=o?t.TileWidth:t.ImageWidth,f=o?t.TileLength:t.RowsPerStrip||t.ImageLength,e.abrupt("return",g(n,a,s,f,t.BitsPerSample,t.PlanarConfiguration));case 9:return e.abrupt("return",n);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})}]),e}();function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var x=function(e){p(r,b);var t=k(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return e}}]),r}(),_=Object.freeze({__proto__:null,default:x});function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}function P(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function I(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,a=9,o=0;function s(){i=258,a=9}function f(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),a=8-n,o=t+r-8*(i+1),s=8*(i+2)-(t+r),f=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var l=e[i]&Math.pow(2,8-n)-1,u=l<<=r-a;if(i+1<e.length){var c=e[i+1]>>>s;u+=c<<=Math.max(0,r-f)}if(o>8&&i+2<e.length){var h=8*(i+3)-(t+r);u+=e[i+2]>>>h}return u}(e,o,a);return o+=a,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function u(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var c=[];s();for(var h,d=new Uint8Array(e),p=f(d);257!==p;){if(256===p){for(s(),p=f(d);256===p;)p=f(d);if(257===p)break;if(p>256)throw new Error("corrupted code at scanline ".concat(p));P(c,u(p)),h=p}else if(p<i){var m=u(p);P(c,m),l(h,m[m.length-1]),h=p}else{var v=u(h);if(!v)throw new Error("Bogus entry. Not in dictionary, ".concat(h," / ").concat(i,", position: ").concat(o));P(c,v),c.push(v[v.length-1]),l(h,v[v.length-1]),h=p}i+1>=Math.pow(2,a)&&(12===a?h=void 0:a++),p=f(d)}return new Uint8Array(c)}var U=function(e){p(r,b);var t=A(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return I(e).buffer}}]),r}(),S=Object.freeze({__proto__:null,default:U});function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var D=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function E(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var a,o=n[0],s=0;s<i;s++){for(var f=0;f<e[s];f++){for((o=n.pop()).children[o.index]=t[r];o.index>0;)o=n.pop();for(o.index++,n.push(o);n.length<=s;)n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a;r++}s+1<i&&(n.push(a={children:[],index:0}),o.children[o.index]=a.children,o=a)}return n[0].children}function B(e,t,n,i,a,o,s,f,l){var u=n.mcusPerLine,c=n.progressive,h=t,d=t,p=0,m=0;function v(){if(m>0)return m--,p>>m&1;if(255===(p=e[d++])){var t=e[d++];if(t)throw new Error("unexpected marker: ".concat((p<<8|t).toString(16)))}return m=7,p>>>7}function y(e){for(var t,n=e;null!==(t=v());){if("number"==typeof(n=n[t]))return n;if("object"!==r(n))throw new Error("invalid huffman sequence")}return null}function w(e){for(var t=e,r=0;t>0;){var n=v();if(null===n)return;r=r<<1|n,--t}return r}function g(e){var t=w(e);return t>=1<<e-1?t:t+(-1<<e)+1}var b=0;var k,x=0;function _(e,t,r,n,i){var a=r%u,o=(r/u|0)*e.v+n,s=a*e.h+i;t(e,e.blocks[o][s])}function A(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var P,I,U,S,T,E,B=i.length;E=c?0===o?0===f?function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=v()<<l}:0===f?function(e,t){if(b>0)b--;else for(var r=o,n=s;r<=n;){var i=y(e.huffmanTableAC),a=15&i,f=i>>4;if(0===a){if(f<15){b=w(f)+(1<<f)-1;break}r+=16}else t[D[r+=f]]=g(a)*(1<<l),r++}}:function(e,t){for(var r=o,n=s,i=0;r<=n;){var a=D[r],f=t[a]<0?-1:1;switch(x){case 0:var u=y(e.huffmanTableAC),c=15&u;if(i=u>>4,0===c)i<15?(b=w(i)+(1<<i),x=4):(i=16,x=1);else{if(1!==c)throw new Error("invalid ACn encoding");k=g(c),x=i?2:3}continue;case 1:case 2:t[a]?t[a]+=(v()<<l)*f:0==--i&&(x=2===x?3:0);break;case 3:t[a]?t[a]+=(v()<<l)*f:(t[a]=k<<l,x=0);break;case 4:t[a]&&(t[a]+=(v()<<l)*f)}r++}4===x&&0==--b&&(x=0)}:function(e,t){var r=y(e.huffmanTableDC),n=0===r?0:g(r);e.pred+=n,t[0]=e.pred;for(var i=1;i<64;){var a=y(e.huffmanTableAC),o=15&a,s=a>>4;if(0===o){if(s<15)break;i+=16}else t[D[i+=s]]=g(o),i++}};var O,M,C=0;M=1===B?i[0].blocksPerLine*i[0].blocksPerColumn:u*n.mcusPerColumn;for(var L=a||M;C<M;){for(I=0;I<B;I++)i[I].pred=0;if(b=0,1===B)for(P=i[0],T=0;T<L;T++)A(P,E,C),C++;else for(T=0;T<L;T++){for(I=0;I<B;I++){var R=P=i[I],V=R.h,G=R.v;for(U=0;U<G;U++)for(S=0;S<V;S++)_(P,E,C,U,S)}if(++C===M)break}if(m=0,(O=e[d]<<8|e[d+1])<65280)throw new Error("marker was not found");if(!(O>=65488&&O<=65495))break;d+=2}return d-h}function O(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,a=n<<3,o=new Int32Array(64),s=new Uint8Array(64);function f(e,r,n){var i,a,o,s,f,l,u,c,h,d,p=t.quantizationTable,m=n;for(d=0;d<64;d++)m[d]=e[d]*p[d];for(d=0;d<8;++d){var v=8*d;0!==m[1+v]||0!==m[2+v]||0!==m[3+v]||0!==m[4+v]||0!==m[5+v]||0!==m[6+v]||0!==m[7+v]?(i=5793*m[0+v]+128>>8,a=5793*m[4+v]+128>>8,o=m[2+v],s=m[6+v],f=2896*(m[1+v]-m[7+v])+128>>8,c=2896*(m[1+v]+m[7+v])+128>>8,l=m[3+v]<<4,h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+128>>8,o=1567*o-3784*s+128>>8,s=h,h=f-(u=m[5+v]<<4)+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+v]=i+c,m[7+v]=i-c,m[1+v]=a+u,m[6+v]=a-u,m[2+v]=o+l,m[5+v]=o-l,m[3+v]=s+f,m[4+v]=s-f):(h=5793*m[0+v]+512>>10,m[0+v]=h,m[1+v]=h,m[2+v]=h,m[3+v]=h,m[4+v]=h,m[5+v]=h,m[6+v]=h,m[7+v]=h)}for(d=0;d<8;++d){var y=d;0!==m[8+y]||0!==m[16+y]||0!==m[24+y]||0!==m[32+y]||0!==m[40+y]||0!==m[48+y]||0!==m[56+y]?(i=5793*m[0+y]+2048>>12,a=5793*m[32+y]+2048>>12,o=m[16+y],s=m[48+y],f=2896*(m[8+y]-m[56+y])+2048>>12,c=2896*(m[8+y]+m[56+y])+2048>>12,l=m[24+y],h=i-a+1>>1,i=i+a+1>>1,a=h,h=3784*o+1567*s+2048>>12,o=1567*o-3784*s+2048>>12,s=h,h=f-(u=m[40+y])+1>>1,f=f+u+1>>1,u=h,h=c+l+1>>1,l=c-l+1>>1,c=h,h=i-s+1>>1,i=i+s+1>>1,s=h,h=a-o+1>>1,a=a+o+1>>1,o=h,h=2276*f+3406*c+2048>>12,f=3406*f-2276*c+2048>>12,c=h,h=799*l+4017*u+2048>>12,l=4017*l-799*u+2048>>12,u=h,m[0+y]=i+c,m[56+y]=i-c,m[8+y]=a+u,m[48+y]=a-u,m[16+y]=o+l,m[40+y]=o-l,m[24+y]=s+f,m[32+y]=s-f):(h=5793*n[d+0]+8192>>14,m[0+y]=h,m[8+y]=h,m[16+y]=h,m[24+y]=h,m[32+y]=h,m[40+y]=h,m[48+y]=h,m[56+y]=h)}for(d=0;d<64;++d){var w=128+(m[d]+8>>4);r[d]=w<0?0:w>255?255:w}}for(var l=0;l<i;l++){for(var u=l<<3,c=0;c<8;c++)r.push(new Uint8Array(a));for(var h=0;h<n;h++){f(t.blocks[l][h],s,o);for(var d=0,p=h<<3,m=0;m<8;m++)for(var v=r[u+m],y=0;y<8;y++)v[p+y]=s[d++]}}return r}var M=function(){function e(){u(this,e),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return h(e,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(e){var t=0;function r(){var r=e[t]<<8|e[t+1];return t+=2,r}function n(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var a=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),f=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=a*t.h,u=o*t.v,c=[],h=0;h<u;h++){for(var d=[],p=0;p<l;p++)d.push(new Int32Array(64));c.push(d)}t.blocksPerLine=s,t.blocksPerColumn=f,t.blocks=c}e.maxH=n,e.maxV=i,e.mcusPerLine=a,e.mcusPerColumn=o}var i,a,o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var s=(i=void 0,a=void 0,i=r(),a=e.subarray(t,t+i-2),t+=a.length,a);65504===o&&74===s[0]&&70===s[1]&&73===s[2]&&70===s[3]&&0===s[4]&&(this.jfif={version:{major:s[5],minor:s[6]},densityUnits:s[7],xDensity:s[8]<<8|s[9],yDensity:s[10]<<8|s[11],thumbWidth:s[12],thumbHeight:s[13],thumbData:s.subarray(14,14+3*s[12]*s[13])}),65518===o&&65===s[0]&&100===s[1]&&111===s[2]&&98===s[3]&&101===s[4]&&0===s[5]&&(this.adobe={version:s[6],flags0:s[7]<<8|s[8],flags1:s[9]<<8|s[10],transformCode:s[11]});break;case 65499:for(var f=r()+t-2;t<f;){var l=e[t++],u=new Int32Array(64);if(l>>4==0)for(var c=0;c<64;c++){u[D[c]]=e[t++]}else{if(l>>4!=1)throw new Error("DQT: invalid table spec");for(var h=0;h<64;h++){u[D[h]]=r()}}this.quantizationTables[15&l]=u}break;case 65472:case 65473:case 65474:r();for(var d={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},p=e[t++],m=void 0,v=0;v<p;v++){m=e[t];var y=e[t+1]>>4,w=15&e[t+1],g=e[t+2];d.componentsOrder.push(m),d.components[m]={h:y,v:w,quantizationIdx:g},t+=3}n(d),this.frames.push(d);break;case 65476:for(var b=r(),k=2;k<b;){for(var x=e[t++],_=new Uint8Array(16),A=0,P=0;P<16;P++,t++)_[P]=e[t],A+=_[P];for(var I=new Uint8Array(A),U=0;U<A;U++,t++)I[U]=e[t];k+=17+A,x>>4==0?this.huffmanTablesDC[15&x]=E(_,I):this.huffmanTablesAC[15&x]=E(_,I)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var S=e[t++],T=[],O=this.frames[0],M=0;M<S;M++){var C=O.components[e[t++]],L=e[t++];C.huffmanTableDC=this.huffmanTablesDC[L>>4],C.huffmanTableAC=this.huffmanTablesAC[15&L],T.push(C)}var R=e[t++],V=e[t++],G=e[t++],F=B(e,t,O,T,this.resetInterval,R,V,G>>4,15&G);t+=F;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(o.toString(16)))}o=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t<this.frames.length;t++)for(var r=this.frames[t].components,n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];r[a].quantizationTable=this.quantizationTables[r[a].quantizationIdx],delete r[a].quantizationIdx}for(var o=e[0],s=o.components,f=o.componentsOrder,l=[],u=o.samplesPerLine,c=o.scanLines,h=0;h<f.length;h++){var d=s[f[h]];l.push({lines:O(0,d),scaleX:d.h/o.maxH,scaleY:d.v/o.maxV})}for(var p=new Uint8Array(u*c*l.length),m=0,v=0;v<c;++v)for(var y=0;y<u;++y)for(var w=0;w<l.length;++w){var g=l[w];p[m]=g.lines[0|v*g.scaleY][0|y*g.scaleX],++m}return p}}]),e}(),C=function(e){p(r,b);var t=T(r);function r(e){var n;return u(this,r),(n=t.call(this)).reader=new M,e.JPEGTables&&n.reader.parse(e.JPEGTables),n}return h(r,[{key:"decodeBlock",value:function(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}]),r}(),L=Object.freeze({__proto__:null,default:C});function R(e){for(var t=e.length;--t>=0;)e[t]=0}R(new Array(576)),R(new Array(60)),R(new Array(512)),R(new Array(256)),R(new Array(29)),R(new Array(30));var V=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0},G=new Uint32Array(function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}()),F=function(e,t,r,n){var i=G,a=n+r;e^=-1;for(var o=n;o<a;o++)e=e>>>8^i[255&(e^t[o])];return-1^e},z={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},N=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Z=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==r(n))throw new TypeError(n+"must be non-object");for(var i in n)N(n,i)&&(e[i]=n[i])}}return e},K=function(e){for(var t=0,r=0,n=e.length;r<n;r++)t+=e[r].length;for(var i=new Uint8Array(t),a=0,o=0,s=e.length;a<s;a++){var f=e[a];i.set(f,o),o+=f.length}return i},H=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){H=!1}for(var Y=new Uint8Array(256),X=0;X<256;X++)Y[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;Y[254]=Y[254]=1;var W=function(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);var t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},q=function(e,t){var r,n,i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));var a=new Array(2*i);for(n=0,r=0;r<i;){var o=e[r++];if(o<128)a[n++]=o;else{var s=Y[o];if(s>4)a[n++]=65533,r+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&r<i;)o=o<<6|63&e[r++],s--;s>1?a[n++]=65533:o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|1023&o)}}}return function(e,t){if(t<65534&&e.subarray&&H)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}(a,n)},J=function(e,t){(t=t||e.length)>e.length&&(t=e.length);for(var r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Y[e[r]]>t?r:t};var Q=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=e.state;r=e.next_in,A=e.input,n=r+(e.avail_in-5),i=e.next_out,P=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=I.dmax,f=I.wsize,l=I.whave,u=I.wnext,c=I.window,h=I.hold,d=I.bits,p=I.lencode,m=I.distcode,v=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=p[h&v];t:for(;;){if(h>>>=g=w>>>24,d-=g,0===(g=w>>>16&255))P[i++]=65535&w;else{if(!(16&g)){if(0==(64&g)){w=p[(65535&w)+(h&(1<<g)-1)];continue t}if(32&g){I.mode=12;break e}e.msg="invalid literal/length code",I.mode=30;break e}b=65535&w,(g&=15)&&(d<g&&(h+=A[r++]<<d,d+=8),b+=h&(1<<g)-1,h>>>=g,d-=g),d<15&&(h+=A[r++]<<d,d+=8,h+=A[r++]<<d,d+=8),w=m[h&y];r:for(;;){if(h>>>=g=w>>>24,d-=g,!(16&(g=w>>>16&255))){if(0==(64&g)){w=m[(65535&w)+(h&(1<<g)-1)];continue r}e.msg="invalid distance code",I.mode=30;break e}if(k=65535&w,d<(g&=15)&&(h+=A[r++]<<d,(d+=8)<g&&(h+=A[r++]<<d,d+=8)),(k+=h&(1<<g)-1)>s){e.msg="invalid distance too far back",I.mode=30;break e}if(h>>>=g,d-=g,k>(g=i-a)){if((g=k-g)>l&&I.sane){e.msg="invalid distance too far back",I.mode=30;break e}if(x=0,_=c,0===u){if(x+=f-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}else if(u<g){if(x+=f+u-g,(g-=u)<b){b-=g;do{P[i++]=c[x++]}while(--g);if(x=0,u<b){b-=g=u;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}}}else if(x+=u-g,g<b){b-=g;do{P[i++]=c[x++]}while(--g);x=i-k,_=P}for(;b>2;)P[i++]=_[x++],P[i++]=_[x++],P[i++]=_[x++],b-=3;b&&(P[i++]=_[x++],b>1&&(P[i++]=_[x++]))}else{x=i-k;do{P[i++]=P[x++],P[i++]=P[x++],P[i++]=P[x++],b-=3}while(b>2);b&&(P[i++]=P[x++],b>1&&(P[i++]=P[x++]))}break}}break}}while(r<n&&i<o);r-=b=d>>3,h&=(1<<(d-=b<<3))-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),I.hold=h,I.bits=d},ee=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),te=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),re=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ne=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ie=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d,p,m,v,y=s.bits,w=0,g=0,b=0,k=0,x=0,_=0,A=0,P=0,I=0,U=0,S=null,T=0,D=new Uint16Array(16),E=new Uint16Array(16),B=null,O=0;for(w=0;w<=15;w++)D[w]=0;for(g=0;g<n;g++)D[t[r+g]]++;for(x=y,k=15;k>=1&&0===D[k];k--);if(x>k&&(x=k),0===k)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(b=1;b<k&&0===D[b];b++);for(x<b&&(x=b),P=1,w=1;w<=15;w++)if(P<<=1,(P-=D[w])<0)return-1;if(P>0&&(0===e||1!==k))return-1;for(E[1]=0,w=1;w<15;w++)E[w+1]=E[w]+D[w];for(g=0;g<n;g++)0!==t[r+g]&&(o[E[t[r+g]]++]=g);if(0===e?(S=B=o,d=19):1===e?(S=ee,T-=257,B=te,O-=257,d=256):(S=re,B=ne,d=-1),U=0,g=0,w=b,h=a,_=x,A=0,u=-1,c=(I=1<<x)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){p=w-A,o[g]<d?(m=0,v=o[g]):o[g]>d?(m=B[O+o[g]],v=S[T+o[g]]):(m=96,v=0),f=1<<w-A,b=l=1<<_;do{i[h+(U>>A)+(l-=f)]=p<<24|m<<16|v|0}while(0!==l);for(f=1<<w-1;U&f;)f>>=1;if(0!==f?(U&=f-1,U+=f):U=0,g++,0==--D[w]){if(w===k)break;w=t[r+o[g]]}if(w>x&&(U&c)!==u){for(0===A&&(A=x),h+=b,P=1<<(_=w-A);_+A<k&&!((P-=D[_+A])<=0);)_++,P<<=1;if(I+=1<<_,1===e&&I>852||2===e&&I>592)return 1;i[u=U&c]=x<<24|_<<16|h-a|0}}return 0!==U&&(i[h+U]=w-A<<24|64<<16|0),s.bits=x,0},ae=j.Z_FINISH,oe=j.Z_BLOCK,se=j.Z_TREES,fe=j.Z_OK,le=j.Z_STREAM_END,ue=j.Z_NEED_DICT,ce=j.Z_STREAM_ERROR,he=j.Z_DATA_ERROR,de=j.Z_MEM_ERROR,pe=j.Z_BUF_ERROR,me=j.Z_DEFLATED,ve=function(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)};function ye(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var we,ge,be=function(e){if(!e||!e.state)return ce;var t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,fe},ke=function(e){if(!e||!e.state)return ce;var t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,be(e)},xe=function(e,t){var r;if(!e||!e.state)return ce;var n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ce:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ke(e))},_e=function(e,t){if(!e)return ce;var r=new ye;e.state=r,r.window=null;var n=xe(e,t);return n!==fe&&(e.state=null),n},Ae=!0,Pe=function(e){if(Ae){we=new Int32Array(512),ge=new Int32Array(32);for(var t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ie(1,e.lens,0,288,we,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ie(2,e.lens,0,32,ge,0,e.work,{bits:5}),Ae=!1}e.lencode=we,e.lenbits=9,e.distcode=ge,e.distbits=5},Ie=function(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):((i=a.wsize-a.wnext)>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},Ue={inflateReset:ke,inflateReset2:xe,inflateResetKeep:be,inflateInit:function(e){return _e(e,15)},inflateInit2:_e,inflate:function(e,t){var r,n,i,a,o,s,f,l,u,c,h,d,p,m,v,y,w,g,b,k,x,_,A,P,I=0,U=new Uint8Array(4),S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ce;12===(r=e.state).mode&&(r.mode=13),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,c=s,h=f,_=fe;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(2&r.wrap&&35615===l){r.check=0,U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0),l=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&l)!==me){e.msg="unknown compression method",r.mode=30;break}if(u-=4,x=8+(15&(l>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&l?10:12,l=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.flags=l,(255&r.flags)!==me){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.time=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,U[2]=l>>>16&255,U[3]=l>>>24&255,r.check=F(r.check,U,4,0)),l=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&(U[0]=255&l,U[1]=l>>>8&255,r.check=F(r.check,U,2,0)),l=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+d),x)),512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;d=0;do{x=n[a+d++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&d<s);if(512&r.flags&&(r.check=F(r.check,n,d,a)),s-=d,a+=d,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}l=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}e.adler=r.check=ve(l),l=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,ue;e.adler=r.check=1,r.mode=12;case 12:if(t===oe||t===se)break e;case 13:if(r.last){l>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}switch(r.last=1&l,u-=1,3&(l>>>=1)){case 0:r.mode=14;break;case 1:if(Pe(r),r.mode=20,t===se){l>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,u-=2;break;case 14:for(l>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,l=0,u=0,r.mode=15,t===se)break e;case 15:r.mode=16;case 16:if(d=r.length){if(d>s&&(d=s),d>f&&(d=f),0===d)break e;i.set(n.subarray(a,a+d),o),s-=d,a+=d,f-=d,o+=d,r.length-=d;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(r.nlen=257+(31&l),l>>>=5,u-=5,r.ndist=1+(31&l),l>>>=5,u-=5,r.ncode=4+(15&l),l>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.lens[S[r.have++]]=7&l,l>>>=3,u-=3}for(;r.have<19;)r.lens[S[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,A={bits:r.lenbits},_=ie(0,r.lens,0,19,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(w<16)l>>>=v,u-=v,r.lens[r.have++]=w;else{if(16===w){for(P=v+2;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l>>>=v,u-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}x=r.lens[r.have-1],d=3+(3&l),l>>>=2,u-=2}else if(17===w){for(P=v+3;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=3+(7&(l>>>=v)),l>>>=3,u-=3}else{for(P=v+7;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}u-=v,x=0,d=11+(127&(l>>>=v)),l>>>=7,u-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=x}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,A={bits:r.lenbits},_=ie(1,r.lens,0,r.nlen,r.lencode,0,r.work,A),r.lenbits=A.bits,_){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,A={bits:r.distbits},_=ie(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,A),r.distbits=A.bits,_){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===se)break e;case 20:r.mode=21;case 21:if(s>=6&&f>=258){e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,$(e,h),o=e.next_out,i=e.output,f=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;y=(I=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(y&&0==(240&y)){for(g=v,b=y,k=w;y=(I=r.lencode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,r.length=w,0===y){r.mode=26;break}if(32&y){r.back=-1,r.mode=12;break}if(64&y){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&y,r.mode=22;case 22:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;y=(I=r.distcode[l&(1<<r.distbits)-1])>>>16&255,w=65535&I,!((v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(0==(240&y)){for(g=v,b=y,k=w;y=(I=r.distcode[k+((l&(1<<g+b)-1)>>g)])>>>16&255,w=65535&I,!(g+(v=I>>>24)<=u);){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}l>>>=g,u-=g,r.back+=g}if(l>>>=v,u-=v,r.back+=v,64&y){e.msg="invalid distance code",r.mode=30;break}r.offset=w,r.extra=15&y,r.mode=24;case 24:if(r.extra){for(P=r.extra;u<P;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===f)break e;if(d=h-f,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=i,p=o-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do{i[o++]=m[p++]}while(--d);0===r.length&&(r.mode=21);break;case 26:if(0===f)break e;i[o++]=r.length,f--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,l|=n[a++]<<u,u+=8}if(h-=f,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?F(r.check,i,h,o-h):V(r.check,i,h,o-h)),h=f,(r.flags?l:ve(l))!==r.check){e.msg="incorrect data check",r.mode=30;break}l=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,l+=n[a++]<<u,u+=8}if(l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}l=0,u=0}r.mode=29;case 29:_=le;break e;case 30:_=he;break e;case 31:return de;default:return ce}return e.next_out=o,e.avail_out=f,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==ae))&&Ie(e,e.output,e.next_out,h-e.avail_out),c-=e.avail_in,h-=e.avail_out,e.total_in+=c,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?F(r.check,i,h,e.next_out-h):V(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===c&&0===h||t===ae)&&_===fe&&(_=pe),_},inflateEnd:function(e){if(!e||!e.state)return ce;var t=e.state;return t.window&&(t.window=null),e.state=null,fe},inflateGetHeader:function(e,t){if(!e||!e.state)return ce;var r=e.state;return 0==(2&r.wrap)?ce:(r.head=t,t.done=!1,fe)},inflateSetDictionary:function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?ce:11===r.mode&&V(1,t,n,0)!==r.check?he:Ie(e,t,n,n)?(r.mode=31,de):(r.havedict=1,fe):ce},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Te=Object.prototype.toString,De=j.Z_NO_FLUSH,Ee=j.Z_FINISH,Be=j.Z_OK,Oe=j.Z_STREAM_END,Me=j.Z_NEED_DICT,Ce=j.Z_STREAM_ERROR,Le=j.Z_DATA_ERROR,Re=j.Z_MEM_ERROR;function Ve(e){this.options=Z({chunkSize:65536,windowBits:15,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Q,this.strm.avail_out=0;var r=Ue.inflateInit2(this.strm,t.windowBits);if(r!==Be)throw new Error(z[r]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=W(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ue.inflateSetDictionary(this.strm,t.dictionary))!==Be))throw new Error(z[r])}function Ge(e,t){var r=new Ve(t);if(r.push(e),r.err)throw r.msg||z[r.err];return r.result}Ve.prototype.push=function(e,t){var r,n,i,a=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Ee:De,"[object ArrayBuffer]"===Te.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(o),a.next_out=0,a.avail_out=o),(r=Ue.inflate(a,n))===Me&&s&&((r=Ue.inflateSetDictionary(a,s))===Be?r=Ue.inflate(a,n):r===Le&&(r=Me));a.avail_in>0&&r===Oe&&a.state.wrap>0&&0!==e[a.next_in];)Ue.inflateReset(a),r=Ue.inflate(a,n);switch(r){case Ce:case Le:case Me:case Re:return this.onEnd(r),this.ended=!0,!1}if(i=a.avail_out,a.next_out&&(0===a.avail_out||r===Oe))if("string"===this.options.to){var f=J(a.output,a.next_out),l=a.next_out-f,u=q(a.output,f);a.next_out=l,a.avail_out=o-l,l&&a.output.set(a.output.subarray(f,f+l),0),this.onData(u)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(r!==Be||0!==i){if(r===Oe)return r=Ue.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Be&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=K(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Fe={Inflate:Ve,inflate:Ge,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Ge(e,t)},ungzip:Ge,constants:j}.inflate;function ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var je=function(e){p(r,b);var t=ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){return Fe(new Uint8Array(e)).buffer}}]),r}(),Ne=Object.freeze({__proto__:null,default:je});function Ze(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var Ke,He=function(e){p(r,b);var t=Ze(r);function r(){return u(this,r),t.apply(this,arguments)}return h(r,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n<e.byteLength;++n){var i=t.getInt8(n);if(i<0){var a=t.getUint8(n+1);i=-i;for(var o=0;o<=i;++o)r.push(a);n+=1}else{for(var s=0;s<=i;++s)r.push(t.getUint8(n+s+1));n+=i+1}}return new Uint8Array(r).buffer}}]),r}(),Ye=Object.freeze({__proto__:null,default:He}),Xe={exports:{}};Ke=Xe,\n/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */\nfunction(){var e,t,r,n,i,a,o,s,f,l,u,c,h,d,p,m,v=(e={defaultNoDataValue:-34027999387901484e22,decode:function(a,o){var s=(o=o||{}).encodedMaskData||null===o.encodedMaskData,f=i(a,o.inputOffset||0,s),l=null!==o.noDataValue?o.noDataValue:e.defaultNoDataValue,u=t(f,o.pixelType||Float32Array,o.encodedMaskData,l,o.returnMask),c={width:f.width,height:f.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:f.pixels.maxValue,noDataValue:l};return u.resultMask&&(c.maskData=u.resultMask),o.returnEncodedMask&&f.mask&&(c.encodedMaskData=f.mask.bitset?f.mask.bitset:null),o.returnFileInfo&&(c.fileInfo=r(f),o.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(f))),c}},t=function(e,t,r,n,i){var o,s,f,l=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,h=Math.floor(e.width/u),d=Math.floor(e.height/c),p=2*e.maxZError,m=Number.MAX_VALUE;r=r||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),i&&r&&(f=new Uint8Array(e.width*e.height));for(var v,y,w=new Float32Array(h*d),g=0;g<=c;g++){var b=g!==c?d:e.height%c;if(0!==b)for(var k=0;k<=u;k++){var x=k!==u?h:e.width%u;if(0!==x){var _,A,P,I,U=g*e.width*d+k*h,S=e.width-x,T=e.pixels.blocks[l];if(T.encoding<2?(0===T.encoding?_=T.rawData:(a(T.stuffedData,T.bitsPerPixel,T.numValidPixels,T.offset,p,w,e.pixels.maxValue),_=w),A=0):P=2===T.encoding?0:T.offset,r)for(y=0;y<b;y++){for(7&U&&(I=r[U>>3],I<<=7&U),v=0;v<x;v++)7&U||(I=r[U>>3]),128&I?(f&&(f[U]=1),m=m>(o=T.encoding<2?_[A++]:P)?o:m,s[U++]=o):(f&&(f[U]=0),s[U++]=n),I<<=1;U+=S}else if(T.encoding<2)for(y=0;y<b;y++){for(v=0;v<x;v++)m=m>(o=_[A++])?o:m,s[U++]=o;U+=S}else for(m=m>P?P:m,y=0;y<b;y++){for(v=0;v<x;v++)s[U++]=P;U+=S}if(1===T.encoding&&A!==T.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:s,resultMask:f,minValue:m}},r=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,r={},n=0;n<t;n++){var i=e.pixels.blocks[n];0===i.encoding?r.float32=!0:1===i.encoding?r[i.bitsPerPixel]=!0:r[0]=!0}return Object.keys(r)},i=function(e,t,r){var n={},i=new Uint8Array(e,t,10);if(n.fileIdentifierString=String.fromCharCode.apply(null,i),"CntZImage"!==n.fileIdentifierString.trim())throw"Unexpected file identifier string: "+n.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(n.fileVersion=a.getInt32(0,!0),n.imageType=a.getInt32(4,!0),n.height=a.getUint32(8,!0),n.width=a.getUint32(12,!0),n.maxZError=a.getFloat64(16,!0),t+=24,!r)if(a=new DataView(e,t,16),n.mask={},n.mask.numBlocksY=a.getUint32(0,!0),n.mask.numBlocksX=a.getUint32(4,!0),n.mask.numBytes=a.getUint32(8,!0),n.mask.maxValue=a.getFloat32(12,!0),t+=16,n.mask.numBytes>0){var o=new Uint8Array(Math.ceil(n.width*n.height/8)),s=(a=new DataView(e,t,n.mask.numBytes)).getInt16(0,!0),f=2,l=0;do{if(s>0)for(;s--;)o[l++]=a.getUint8(f++);else{var u=a.getUint8(f++);for(s=-s;s--;)o[l++]=u}s=a.getInt16(f,!0),f+=2}while(f<n.mask.numBytes);if(-32768!==s||l<o.length)throw"Unexpected end of mask RLE encoding";n.mask.bitset=o,t+=n.mask.numBytes}else 0==(n.mask.numBytes|n.mask.numBlocksY|n.mask.maxValue)&&(n.mask.bitset=new Uint8Array(Math.ceil(n.width*n.height/8)));a=new DataView(e,t,16),n.pixels={},n.pixels.numBlocksY=a.getUint32(0,!0),n.pixels.numBlocksX=a.getUint32(4,!0),n.pixels.numBytes=a.getUint32(8,!0),n.pixels.maxValue=a.getFloat32(12,!0),t+=16;var c=n.pixels.numBlocksX,h=n.pixels.numBlocksY,d=c+(n.width%c>0?1:0),p=h+(n.height%h>0?1:0);n.pixels.blocks=new Array(d*p);for(var m=0,v=0;v<p;v++)for(var y=0;y<d;y++){var w=0,g=e.byteLength-t;a=new DataView(e,t,Math.min(10,g));var b={};n.pixels.blocks[m++]=b;var k=a.getUint8(0);if(w++,b.encoding=63&k,b.encoding>3)throw"Invalid block encoding ("+b.encoding+")";if(2!==b.encoding){if(0!==k&&2!==k){if(k>>=6,b.offsetType=k,2===k)b.offset=a.getInt8(1),w++;else if(1===k)b.offset=a.getInt16(1,!0),w+=2;else{if(0!==k)throw"Invalid block offset type";b.offset=a.getFloat32(1,!0),w+=4}if(1===b.encoding)if(k=a.getUint8(w),w++,b.bitsPerPixel=63&k,k>>=6,b.numValidPixelsType=k,2===k)b.numValidPixels=a.getUint8(w),w++;else if(1===k)b.numValidPixels=a.getUint16(w,!0),w+=2;else{if(0!==k)throw"Invalid valid pixel count type";b.numValidPixels=a.getUint32(w,!0),w+=4}}var x;if(t+=w,3!==b.encoding)if(0===b.encoding){var _=(n.pixels.numBytes-1)/4;if(_!==Math.floor(_))throw"uncompressed block has invalid length";x=new ArrayBuffer(4*_),new Uint8Array(x).set(new Uint8Array(e,t,4*_));var A=new Float32Array(x);b.rawData=A,t+=4*_}else if(1===b.encoding){var P=Math.ceil(b.numValidPixels*b.bitsPerPixel/8),I=Math.ceil(P/4);x=new ArrayBuffer(4*I),new Uint8Array(x).set(new Uint8Array(e,t,P)),b.stuffedData=new Uint32Array(x),t+=P}}else t++}return n.eofOffset=t,n},a=function(e,t,r,n,i,a,o){var s,f,l,u=(1<<t)-1,c=0,h=0,d=Math.ceil((o-n)/i),p=4*e.length-Math.ceil(t*r/8);for(e[e.length-1]<<=8*p,s=0;s<r;s++){if(0===h&&(l=e[c++],h=32),h>=t)f=l>>>h-t&u,h-=t;else{var m=t-h;f=(l&u)<<m&u,f+=(l=e[c++])>>>(h=32-m)}a[s]=f<d?n+f*i:o}return a},e),y=(o=function(e,t,r,n,i,a,o,s){var f,l,u,c,h,d=(1<<r)-1,p=0,m=0,v=4*e.length-Math.ceil(r*n/8);if(e[e.length-1]<<=8*v,i)for(f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=i[l];else for(h=Math.ceil((s-a)/o),f=0;f<n;f++)0===m&&(u=e[p++],m=32),m>=r?(l=u>>>m-r&d,m-=r):(l=(u&d)<<(c=r-m)&d,l+=(u=e[p++])>>>(m=32-c)),t[f]=l<h?a+l*o:s},s=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=[],p=4*e.length-Math.ceil(t*r/8);e[e.length-1]<<=8*p;var m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32),c>=t?(h=o>>>c-t&s,c-=t):(h=(o&s)<<(u=t-c)&s,h+=(o=e[f++])>>>(c=32-u)),d[l]=h<m?n+h*i:a;return d.unshift(n),d},f=function(e,t,r,n,i,a,o,s){var f,l,u,c,h=(1<<r)-1,d=0,p=0,m=0;if(i)for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=i[l];else{var v=Math.ceil((s-a)/o);for(f=0;f<n;f++)0===p&&(u=e[d++],p=32,m=0),p>=r?(l=u>>>m&h,p-=r,m+=r):(l=u>>>m&h,p=32-(c=r-p),l|=((u=e[d++])&(1<<c)-1)<<r-c,m=c),t[f]=l<v?a+l*o:s}return t},l=function(e,t,r,n,i,a){var o,s=(1<<t)-1,f=0,l=0,u=0,c=0,h=0,d=0,p=[],m=Math.ceil((a-n)/i);for(l=0;l<r;l++)0===c&&(o=e[f++],c=32,d=0),c>=t?(h=o>>>d&s,c-=t,d+=t):(h=o>>>d&s,c=32-(u=t-c),h|=((o=e[f++])&(1<<u)-1)<<t-u,d=u),p[l]=h<m?n+h*i:a;return p.unshift(n),p},u=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=4*e.length-Math.ceil(r*n/8);for(e[e.length-1]<<=8*c,i=0;i<n;i++)0===u&&(o=e[l++],u=32),u>=r?(a=o>>>u-r&f,u-=r):(a=(o&f)<<(s=r-u)&f,a+=(o=e[l++])>>>(u=32-s)),t[i]=a;return t},c=function(e,t,r,n){var i,a,o,s,f=(1<<r)-1,l=0,u=0,c=0;for(i=0;i<n;i++)0===u&&(o=e[l++],u=32,c=0),u>=r?(a=o>>>c&f,u-=r,c+=r):(a=o>>>c&f,u=32-(s=r-u),a|=((o=e[l++])&(1<<s)-1)<<r-s,c=s),t[i]=a;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,r=65535,n=e.length,i=Math.floor(n/2),a=0;i;){var o=i>=359?359:i;i-=o;do{t+=e[a++]<<8,r+=t+=e[a++]}while(--o);t=(65535&t)+(t>>>16),r=(65535&r)+(r>>>16)}return 1&n&&(r+=t+=e[a]<<8),((r=(65535&r)+(r>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var r=t.ptr,n=new Uint8Array(e,r,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,n),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;r+=6;var a,o=new DataView(e,r,8),s=o.getInt32(0,!0);if(i.fileVersion=s,r+=4,s>=3&&(i.checksum=o.getUint32(4,!0),r+=4),o=new DataView(e,r,12),i.height=o.getUint32(0,!0),i.width=o.getUint32(4,!0),r+=8,s>=4?(i.numDims=o.getUint32(8,!0),r+=4):i.numDims=1,o=new DataView(e,r,40),i.numValidPixel=o.getUint32(0,!0),i.microBlockSize=o.getInt32(4,!0),i.blobSize=o.getInt32(8,!0),i.imageType=o.getInt32(12,!0),i.maxZError=o.getFloat64(16,!0),i.zMin=o.getFloat64(24,!0),i.zMax=o.getFloat64(32,!0),r+=40,t.headerInfo=i,t.ptr=r,s>=3&&(a=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,r-a,i.blobSize-14))!==i.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var r=t.headerInfo,n=this.getDataTypeArray(r.imageType),i=r.numDims*this.getDataTypeSize(r.imageType),a=this.readSubArray(e,t.ptr,n,i),o=this.readSubArray(e,t.ptr+i,n,i);t.ptr+=2*i;var s,f=!0;for(s=0;s<r.numDims;s++)if(a[s]!==o[s]){f=!1;break}return r.minValues=a,r.maxValues=o,f},readSubArray:function(e,t,r,n){var i;if(r===Uint8Array)i=new Uint8Array(e,t,n);else{var a=new ArrayBuffer(n);new Uint8Array(a).set(new Uint8Array(e,t,n)),i=new r(a)}return i},readMask:function(e,t){var r,n,i=t.ptr,a=t.headerInfo,o=a.width*a.height,s=a.numValidPixel,f=new DataView(e,i,4),l={};if(l.numBytes=f.getUint32(0,!0),i+=4,(0===s||o===s)&&0!==l.numBytes)throw"invalid mask";if(0===s)r=new Uint8Array(Math.ceil(o/8)),l.bitset=r,n=new Uint8Array(o),t.pixels.resultMask=n,i+=l.numBytes;else if(l.numBytes>0){r=new Uint8Array(Math.ceil(o/8));var u=(f=new DataView(e,i,l.numBytes)).getInt16(0,!0),c=2,h=0,d=0;do{if(u>0)for(;u--;)r[h++]=f.getUint8(c++);else for(d=f.getUint8(c++),u=-u;u--;)r[h++]=d;u=f.getInt16(c,!0),c+=2}while(c<l.numBytes);if(-32768!==u||h<r.length)throw"Unexpected end of mask RLE encoding";n=new Uint8Array(o);var p=0,m=0;for(m=0;m<o;m++)7&m?(p=r[m>>3],p<<=7&m):p=r[m>>3],128&p&&(n[m]=1);t.pixels.resultMask=n,l.bitset=r,i+=l.numBytes}return t.ptr=i,t.mask=l,!0},readDataOneSweep:function(e,t,r,n){var i,a=t.ptr,o=t.headerInfo,s=o.numDims,f=o.width*o.height,l=o.imageType,u=o.numValidPixel*h.getDataTypeSize(l)*s,c=t.pixels.resultMask;if(r===Uint8Array)i=new Uint8Array(e,a,u);else{var d=new ArrayBuffer(u);new Uint8Array(d).set(new Uint8Array(e,a,u)),i=new r(d)}if(i.length===f*s)t.pixels.resultPixels=n?h.swapDimensionOrder(i,f,s,r,!0):i;else{t.pixels.resultPixels=new r(f*s);var p=0,m=0,v=0,y=0;if(s>1){if(n){for(m=0;m<f;m++)if(c[m])for(y=m,v=0;v<s;v++,y+=f)t.pixels.resultPixels[y]=i[p++]}else for(m=0;m<f;m++)if(c[m])for(y=m*s,v=0;v<s;v++)t.pixels.resultPixels[y+v]=i[p++]}else for(m=0;m<f;m++)c[m]&&(t.pixels.resultPixels[m]=i[p++])}return a+=u,t.ptr=a,!0},readHuffmanTree:function(e,t){var r=this.HUFFMAN_LUT_BITS_MAX,n=new DataView(e,t.ptr,16);if(t.ptr+=16,n.getInt32(0,!0)<2)throw"unsupported Huffman version";var i=n.getInt32(4,!0),a=n.getInt32(8,!0),o=n.getInt32(12,!0);if(a>=o)return!1;var s=new Uint32Array(o-a);h.decodeBits(e,t,s);var f,l,u,c,p=[];for(f=a;f<o;f++)p[l=f-(f<i?0:i)]={first:s[f-a],second:null};var m=e.byteLength-t.ptr,v=Math.ceil(m/4),y=new ArrayBuffer(4*v);new Uint8Array(y).set(new Uint8Array(e,t.ptr,m));var w,g=new Uint32Array(y),b=0,k=0;for(w=g[0],f=a;f<o;f++)(c=p[l=f-(f<i?0:i)].first)>0&&(p[l].second=w<<b>>>32-c,32-b>=c?32===(b+=c)&&(b=0,w=g[++k]):(b+=c-32,w=g[++k],p[l].second|=w>>>32-b));var x=0,_=0,A=new d;for(f=0;f<p.length;f++)void 0!==p[f]&&(x=Math.max(x,p[f].first));_=x>=r?r:x;var P,I,U,S,T,D=[];for(f=a;f<o;f++)if((c=p[l=f-(f<i?0:i)].first)>0)if(P=[c,l],c<=_)for(I=p[l].second<<_-c,U=1<<_-c,u=0;u<U;u++)D[I|u]=P;else for(I=p[l].second,T=A,S=c-1;S>=0;S--)I>>>S&1?(T.right||(T.right=new d),T=T.right):(T.left||(T.left=new d),T=T.left),0!==S||T.val||(T.val=P[1]);return{decodeLut:D,numBitsLUTQick:_,numBitsLUT:x,tree:A,stuffedData:g,srcPtr:k,bitPos:b}},readHuffman:function(e,t,r,n){var i,a,o,s,f,l,u,c,d,p=t.headerInfo.numDims,m=t.headerInfo.height,v=t.headerInfo.width,y=v*m,w=this.readHuffmanTree(e,t),g=w.decodeLut,b=w.tree,k=w.stuffedData,x=w.srcPtr,_=w.bitPos,A=w.numBitsLUTQick,P=w.numBitsLUT,I=0===t.headerInfo.imageType?128:0,U=t.pixels.resultMask,S=0;_>0&&(x++,_=0);var T,D=k[x],E=1===t.encodeMode,B=new r(y*p),O=B;if(p<2||E){for(T=0;T<p;T++)if(p>1&&(O=new r(B.buffer,y*T,y),S=0),t.headerInfo.numValidPixel===v*m)for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(o+=u>0?S:l>0?O[c-v]:S,o&=255,O[c]=o,S=o):O[c]=o}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++,c++)if(U[c]){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,E?(u>0&&U[c-1]?o+=S:l>0&&U[c-v]?o+=O[c-v]:o+=S,o&=255,O[c]=o,S=o):O[c]=o}}else for(c=0,l=0;l<m;l++)for(u=0;u<v;u++)if(c=l*v+u,!U||U[c])for(T=0;T<p;T++,c+=y){if(a=0,f=s=D<<_>>>32-A,32-_<A&&(f=s|=k[x+1]>>>64-_-A),g[f])a=g[f][1],_+=g[f][0];else for(f=s=D<<_>>>32-P,32-_<P&&(f=s|=k[x+1]>>>64-_-P),i=b,d=0;d<P;d++)if(!(i=s>>>P-d-1&1?i.right:i.left).left&&!i.right){a=i.val,_=_+d+1;break}_>=32&&(_-=32,D=k[++x]),o=a-I,O[c]=o}t.ptr=t.ptr+4*(x+1)+(_>0?4:0),t.pixels.resultPixels=B,p>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(B,y,p,r))},decodeBits:function(e,t,r,n,i){var a=t.headerInfo,h=a.fileVersion,d=0,p=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,m=new DataView(e,t.ptr,p),v=m.getUint8(0);d++;var y=v>>6,w=0===y?4:3-y,g=(32&v)>0,b=31&v,k=0;if(1===w)k=m.getUint8(d),d++;else if(2===w)k=m.getUint16(d,!0),d+=2;else{if(4!==w)throw"Invalid valid pixel count type";k=m.getUint32(d,!0),d+=4}var x,_,A,P,I,U,S,T,D,E=2*a.maxZError,B=a.numDims>1?a.maxValues[i]:a.zMax;if(g){for(t.counter.lut++,T=m.getUint8(d),d++,P=Math.ceil((T-1)*b/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),A=new Uint8Array(_),t.ptr+=d,A.set(new Uint8Array(e,t.ptr,P)),S=new Uint32Array(_),t.ptr+=P,D=0;T-1>>>D;)D++;P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,U=h>=3?l(S,b,T-1,n,E,B):s(S,b,T-1,n,E,B),h>=3?f(x,r,D,k,U):o(x,r,D,k,U)}else t.counter.bitstuffer++,D=b,t.ptr+=d,D>0&&(P=Math.ceil(k*D/8),I=Math.ceil(P/4),_=new ArrayBuffer(4*I),(A=new Uint8Array(_)).set(new Uint8Array(e,t.ptr,P)),x=new Uint32Array(_),t.ptr+=P,h>=3?null==n?c(x,r,D,k):f(x,r,D,k,!1,n,E,B):null==n?u(x,r,D,k):o(x,r,D,k,!1,n,E,B))},readTiles:function(e,t,r,n){var i=t.headerInfo,a=i.width,o=i.height,s=a*o,f=i.microBlockSize,l=i.imageType,u=h.getDataTypeSize(l),c=Math.ceil(a/f),d=Math.ceil(o/f);t.pixels.numBlocksY=d,t.pixels.numBlocksX=c,t.pixels.ptr=0;var p,m,v,y,w,g,b,k,x,_,A=0,P=0,I=0,U=0,S=0,T=0,D=0,E=0,B=0,O=0,M=0,C=0,L=0,R=0,V=0,G=new r(f*f),F=o%f||f,z=a%f||f,j=i.numDims,N=t.pixels.resultMask,Z=t.pixels.resultPixels,K=i.fileVersion>=5?14:15,H=i.zMax;for(I=0;I<d;I++)for(S=I!==d-1?f:F,U=0;U<c;U++)for(O=I*a*f+U*f,M=a-(T=U!==c-1?f:z),k=0;k<j;k++){if(j>1?(_=Z,O=I*a*f+U*f,Z=new r(t.pixels.resultPixels.buffer,s*k*u,s),H=i.maxValues[k]):_=null,D=e.byteLength-t.ptr,m={},V=0,E=(p=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),V++,x=i.fileVersion>=5?4&E:0,B=E>>6&255,(E>>2&K)!=(U*f>>3&K))throw"integrity issue";if(x&&0===k)throw"integrity issue";if((w=3&E)>3)throw t.ptr+=V,"Invalid block encoding ("+w+")";if(2!==w)if(0===w){if(x)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=V,C=(C=S*T*u)<(L=e.byteLength-t.ptr)?C:L,v=new ArrayBuffer(C%u==0?C:C+u-C%u),new Uint8Array(v).set(new Uint8Array(e,t.ptr,C)),y=new r(v),R=0,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=y[R++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=y[R++];O+=M}t.ptr+=R*u}else if(g=h.getDataTypeUsed(x&&l<6?4:l,B),b=h.getOnePixel(m,V,g,p),V+=h.getDataTypeSize(g),3===w)if(t.ptr+=V,t.counter.constantoffset++,N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=x?Math.min(H,_[O]+b):b),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=x?Math.min(H,_[O]+b):b,O++;O+=M}else if(t.ptr+=V,h.decodeBits(e,t,G,b,k),V=0,x)if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]+_[O]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O]=G[V++]+_[O],O++;O+=M}else if(N)for(A=0;A<S;A++){for(P=0;P<T;P++)N[O]&&(Z[O]=G[V++]),O++;O+=M}else for(A=0;A<S;A++){for(P=0;P<T;P++)Z[O++]=G[V++];O+=M}else{if(x)if(N)for(A=0;A<S;A++)for(P=0;P<T;P++)N[O]&&(Z[O]=_[O]),O++;else for(A=0;A<S;A++)for(P=0;P<T;P++)Z[O]=_[O],O++;t.counter.constant++,t.ptr+=V}}j>1&&!n&&(t.pixels.resultPixels=h.swapDimensionOrder(t.pixels.resultPixels,s,j,r))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var r=e.headerInfo.zMax,n=e.headerInfo.zMin,i=e.headerInfo.maxValues,a=e.headerInfo.numDims,o=e.headerInfo.height*e.headerInfo.width,s=0,f=0,l=0,u=e.pixels.resultMask,c=e.pixels.resultPixels;if(u)if(a>1){if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)u[f]&&(c[l+f]=r);else for(f=0;f<o;f++)if(u[f])for(l=f*a,s=0;s<a;s++)c[l+a]=i[s]}else for(f=0;f<o;f++)u[f]&&(c[f]=r);else if(a>1&&n!==r)if(t)for(s=0;s<a;s++)for(l=s*o,r=i[s],f=0;f<o;f++)c[l+f]=r;else for(f=0;f<o;f++)for(l=f*a,s=0;s<a;s++)c[l+s]=i[s];else for(f=0;f<o*a;f++)c[f]=r},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var r;switch(e){case 0:r=t>=-128&&t<=127;break;case 1:r=t>=0&&t<=255;break;case 2:r=t>=-32768&&t<=32767;break;case 3:r=t>=0&&t<=65536;break;case 4:r=t>=-2147483648&&t<=2147483647;break;case 5:r=t>=0&&t<=4294967296;break;case 6:r=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:r=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var r=e;switch(e){case 2:case 4:r=e-t;break;case 3:case 5:r=e-2*t;break;case 6:r=0===t?e:1===t?2:1;break;case 7:r=0===t?e:e-2*t+1;break;default:r=e}return r},getOnePixel:function(e,t,r,n){var i=0;switch(r){case 0:i=n.getInt8(t);break;case 1:i=n.getUint8(t);break;case 2:i=n.getInt16(t,!0);break;case 3:i=n.getUint16(t,!0);break;case 4:i=n.getInt32(t,!0);break;case 5:i=n.getUInt32(t,!0);break;case 6:i=n.getFloat32(t,!0);break;case 7:i=n.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return i},swapDimensionOrder:function(e,t,r,n,i){var a=0,o=0,s=0,f=0,l=e;if(r>1)if(l=new n(t*r),i)for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[f]=e[o++];else for(a=0;a<t;a++)for(f=a,s=0;s<r;s++,f+=t)l[o++]=e[f];return l}},d=function(e,t,r){this.val=e,this.left=t,this.right=r},{decode:function(e,t){var r=(t=t||{}).noDataValue,n=0,i={};i.ptr=t.inputOffset||0,i.pixels={},h.readHeaderInfo(e,i);var a=i.headerInfo,o=a.fileVersion,s=h.getDataTypeArray(a.imageType);if(o>5)throw"unsupported lerc version 2."+o;h.readMask(e,i),a.numValidPixel===a.width*a.height||i.pixels.resultMask||(i.pixels.resultMask=t.maskData);var f=a.width*a.height;i.pixels.resultPixels=new s(f*a.numDims),i.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,u=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)h.constructConstantSurface(i,u);else if(o>=4&&h.checkMinMaxRanges(e,i))h.constructConstantSurface(i,u);else{var c=new DataView(e,i.ptr,2),d=c.getUint8(0);if(i.ptr++,d)h.readDataOneSweep(e,i,s,u);else if(o>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var p=c.getUint8(1);if(i.ptr++,i.encodeMode=p,p>2||o<4&&p>1)throw"Invalid Huffman flag "+p;p?h.readHuffman(e,i,s,u):h.readTiles(e,i,s,u)}else h.readTiles(e,i,s,u)}i.eofOffset=i.ptr,t.inputOffset?(l=i.headerInfo.blobSize+t.inputOffset-i.ptr,Math.abs(l)>=1&&(i.eofOffset=t.inputOffset+i.headerInfo.blobSize)):(l=i.headerInfo.blobSize-i.ptr,Math.abs(l)>=1&&(i.eofOffset=i.headerInfo.blobSize));var m={width:a.width,height:a.height,pixelData:i.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:i.pixels.resultMask};if(i.pixels.resultMask&&h.isValidPixelValue(a.imageType,r)){var v=i.pixels.resultMask;for(n=0;n<f;n++)v[n]||(m.pixelData[n]=r);m.noDataValue=r}return i.noDataValue=r,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(i)),m},getBandCount:function(e){for(var t=0,r=0,n={ptr:0,pixels:{}};r<e.byteLength-58;)h.readHeaderInfo(e,n),r+=n.headerInfo.blobSize,t++,n.ptr=r;return t}}),w=(p=new ArrayBuffer(4),m=new Uint8Array(p),new Uint32Array(p)[0]=1,1===m[0]),g={decode:function(e,t){if(!w)throw"Big endian system is not supported.";var r,n,i=(t=t||{}).inputOffset||0,a=new Uint8Array(e,i,10),o=String.fromCharCode.apply(null,a);if("CntZImage"===o.trim())r=v,n=1;else{if("Lerc2"!==o.substring(0,5))throw"Unexpected file identifier string: "+o;r=y,n=2}for(var s,f,l,u,c,h,d=0,p=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},b=0;i<p;){var k=r.decode(e,{inputOffset:i,encodedMaskData:s,maskData:l,returnMask:0===d,returnEncodedMask:0===d,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});i=k.fileInfo.eofOffset,l=k.maskData,0===d&&(s=k.encodedMaskData,g.width=k.width,g.height=k.height,g.dimCount=k.dimCount||1,g.pixelType=k.pixelType||k.fileInfo.pixelType,g.mask=l),n>1&&(l&&m.push(l),k.fileInfo.mask&&k.fileInfo.mask.numBytes>0&&b++),d++,g.pixels.push(k.pixelData),g.statistics.push({minValue:k.minValue,maxValue:k.maxValue,noDataValue:k.noDataValue,dimStats:k.dimStats})}if(n>1&&b>1){for(h=g.width*g.height,g.bandMasks=m,(l=new Uint8Array(h)).set(m[0]),u=1;u<m.length;u++)for(f=m[u],c=0;c<h;c++)l[c]=l[c]&f[c];g.maskData=l}return g}};Ke.exports?Ke.exports=g:this.Lerc=g}();var We=Xe.exports,qe={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Je={};for(var Qe in qe)qe.hasOwnProperty(Qe)&&(Je[qe[Qe]]=parseInt(Qe,10));Je.BitsPerSample,Je.ExtraSamples,Je.SampleFormat,Je.StripByteCounts,Je.StripOffsets,Je.StripRowCounts,Je.TileByteCounts,Je.TileOffsets,Je.SubIFDs;var $e={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},et={};for(var tt in $e)$e.hasOwnProperty(tt)&&(et[$e[tt]]=parseInt(tt,10));var rt=1,nt=0,it=1,at={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},ot={};for(var st in at)at.hasOwnProperty(st)&&(ot[at[st]]=parseInt(st,10));function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var lt=function(e){p(r,b);var t=ft(r);function r(e){var n;return u(this,r),(n=t.call(this)).planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,n.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,n.addCompression=e.LercParameters[rt],n}return h(r,[{key:"decodeBlock",value:function(e){switch(this.addCompression){case nt:break;case it:e=Fe(new Uint8Array(e)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return We.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),r}(),ut=Object.freeze({__proto__:null,default:lt});function ct(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m(this,r)}}var ht=function(e){p(a,b);var r,n=ct(a);function a(){var e;if(u(this,a),e=n.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return e}return h(a,[{key:"decode",value:(r=t(i.mark((function e(t,r){var n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new Blob([r]),e.next=3,createImageBitmap(n);case 3:return a=e.sent,"undefined"!=typeof document?((o=document.createElement("canvas")).width=a.width,o.height=a.height):o=new OffscreenCanvas(a.width,a.height),(s=o.getContext("2d")).drawImage(a,0,0),e.abrupt("return",s.getImageData(0,0,a.width,a.height).data.buffer);case 8:case"end":return e.stop()}}),e)}))),function(e,t){return r.apply(this,arguments)})}]),a}(),dt=Object.freeze({__proto__:null,default:ht});';return new Pgt("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}},Symbol.toStringTag,{value:"Module"}));