0&&t[1]>0}function MMe(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function Jl(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}var RMe=function(){function t(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=Jl(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return $t()},t.prototype.getImage=function(e){return $t()},t.prototype.getHitDetectionImage=function(){return $t()},t.prototype.getPixelRatio=function(e){return 1},t.prototype.getImageState=function(){return $t()},t.prototype.getImageSize=function(){return $t()},t.prototype.getOrigin=function(){return $t()},t.prototype.getSize=function(){return $t()},t.prototype.setDisplacement=function(e){this.displacement_=e},t.prototype.setOpacity=function(e){this.opacity_=e},t.prototype.setRotateWithView=function(e){this.rotateWithView_=e},t.prototype.setRotation=function(e){this.rotation_=e},t.prototype.setScale=function(e){this.scale_=e,this.scaleArray_=Jl(e)},t.prototype.listenImageChange=function(e){$t()},t.prototype.load=function(){$t()},t.prototype.unlistenImageChange=function(e){$t()},t}(),tgt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ngt=/^([a-z]*)$|^hsla?\(.*\)$/i;function DMe(t){return typeof t=="string"?t:IMe(t)}function rgt(t){var e=document.createElement("div");if(e.style.color=t,e.style.color!==""){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}else return""}var igt=function(){var t=1024,e={},n=0;return function(r){var i;if(e.hasOwnProperty(r))i=e[r];else{if(n>=t){var o=0;for(var s in e)o++&3||(delete e[s],--n)}i=ogt(r),e[r]=i,++n}return i}}();function qF(t){return Array.isArray(t)?t:igt(t)}function ogt(t){var e,n,r,i,o;if(ngt.exec(t)&&(t=rgt(t)),tgt.exec(t)){var s=t.length-1,a=void 0;s<=4?a=1:a=2;var l=s===4||s===8;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),l?i=parseInt(t.substr(1+3*a,a),16):i=255,a==1&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else t.indexOf("rgba(")==0?(o=t.slice(5,-1).split(",").map(Number),Dhe(o)):t.indexOf("rgb(")==0?(o=t.slice(4,-1).split(",").map(Number),o.push(1),Dhe(o)):bn(!1,14);return o}function Dhe(t){return t[0]=oo(t[0]+.5|0,0,255),t[1]=oo(t[1]+.5|0,0,255),t[2]=oo(t[2]+.5|0,0,255),t[3]=oo(t[3],0,1),t}function IMe(t){var e=t[0];e!=(e|0)&&(e=e+.5|0);var n=t[1];n!=(n|0)&&(n=n+.5|0);var r=t[2];r!=(r|0)&&(r=r+.5|0);var i=t[3]===void 0?1:Math.round(t[3]*100)/100;return"rgba("+e+","+n+","+r+","+i+")"}function Xd(t){return Array.isArray(t)?IMe(t):t}function Sc(t,e,n,r){var i;return n&&n.length?i=n.shift():C4?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function LMe(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Ihe(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function Oq(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function sgt(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function agt(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;if(i!==o){if(!i){t.appendChild(o);continue}if(!o){t.removeChild(i),--r;continue}t.insertBefore(o,i)}}}var fI="ol-hidden",jM="ol-unselectable",Cte="ol-control",Lhe="ol-collapsed",lgt=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),$he=["style","variant","weight","size","lineHeight","family"],$Me=function(t){var e=t.match(lgt);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=$he.length;r=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}function Jgt(t,e,n,r,i){EMe(t,e,n||0,r||t.length-1,i||emt)}function EMe(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1),u=Math.max(n,Math.floor(e-s*l/o+c)),f=Math.min(r,Math.floor(e+(o-s)*l/o+c));EMe(t,e,u,f,i)}var d=t[e],h=n,p=r;for($E(t,n,e),i(t[r],d)>0&&$E(t,n,r);h0;)p--}i(t[n],d)===0?$E(t,n,p):(p++,$E(t,p,r)),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function $E(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function emt(t,e){return te?1:0}let TMe=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!vI(e,n))return r;const i=this.toBBox,o=[];for(;n;){for(let s=0;s=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(i,o,n)}_split(e,n){const r=e[n],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);const s=this._chooseSplitIndex(r,o,i),a=Iw(r.children.splice(s,r.children.length-s));a.height=r.height,a.leaf=r.leaf,jb(r,this.toBBox),jb(a,this.toBBox),n?e[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(e,n){this.data=Iw([e,n]),this.data.height=e.height+1,this.data.leaf=!1,jb(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,o=1/0,s=1/0;for(let a=n;a<=r-n;a++){const l=Z2(e,0,a,this.toBBox),c=Z2(e,a,r,this.toBBox),u=omt(l,c),f=dW(l)+dW(c);u=n;c--){const u=e.children[c];J2(a,e.leaf?o(u):u),l+=mI(a)}return l}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)J2(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():jb(e[n],this.toBBox)}};function tmt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function Iw(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Che(t,e,n,r,i){const o=[e,n];for(;o.length;){if(n=o.pop(),e=o.pop(),n-e<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Jgt(t,s,e,n,i),o.push(e,s,s,n)}}var smt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ohe={RENDER_ORDER:"renderOrder"},amt=function(t){smt(e,t);function e(n){var r=this,i=n||{},o=fi({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,r=t.call(this,o)||this,r.declutter_=i.declutter!==void 0?i.declutter:!1,r.renderBuffer_=i.renderBuffer!==void 0?i.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(i.style),r.updateWhileAnimating_=i.updateWhileAnimating!==void 0?i.updateWhileAnimating:!1,r.updateWhileInteracting_=i.updateWhileInteracting!==void 0?i.updateWhileInteracting:!1,r}return e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Ohe.RENDER_ORDER)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(n){n.declutterTree||(n.declutterTree=new TMe(9)),this.getRenderer().renderDeclutter(n)},e.prototype.setRenderOrder=function(n){this.set(Ohe.RENDER_ORDER,n)},e.prototype.setStyle=function(n){this.style_=n!==void 0?n:Xgt,this.styleFunction_=n===null?void 0:qgt(this.style_),this.changed()},e}(D4),Wt={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},yI=[Wt.FILL],fv=[Wt.STROKE],hx=[Wt.BEGIN_PATH],Ehe=[Wt.CLOSE_PATH],kMe=function(){function t(){}return t.prototype.drawCustom=function(e,n,r,i){},t.prototype.drawGeometry=function(e){},t.prototype.setStyle=function(e){},t.prototype.drawCircle=function(e,n){},t.prototype.drawFeature=function(e,n){},t.prototype.drawGeometryCollection=function(e,n){},t.prototype.drawLineString=function(e,n){},t.prototype.drawMultiLineString=function(e,n){},t.prototype.drawMultiPoint=function(e,n){},t.prototype.drawMultiPolygon=function(e,n){},t.prototype.drawPoint=function(e,n){},t.prototype.drawPolygon=function(e,n){},t.prototype.drawText=function(e,n){},t.prototype.setFillStrokeStyle=function(e,n){},t.prototype.setImageStyle=function(e,n){},t.prototype.setTextStyle=function(e,n){},t}(),lmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GM=function(t){lmt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.tolerance=n,s.maxExtent=r,s.pixelRatio=o,s.maxLineWidth=0,s.resolution=i,s.beginGeometryInstruction1_=null,s.beginGeometryInstruction2_=null,s.bufferedMaxExtent_=null,s.instructions=[],s.coordinates=[],s.tmpCoordinate_=[],s.hitDetectionInstructions=[],s.state={},s}return e.prototype.applyPixelRatio=function(n){var r=this.pixelRatio;return r==1?n:n.map(function(i){return i*r})},e.prototype.appendFlatPointCoordinates=function(n,r){for(var i=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,s=this.coordinates,a=s.length,l=0,c=n.length;ll&&(this.instructions.push([Wt.CUSTOM,l,u,n,i,uv]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i,uv]));break;case"Point":c=n.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),u=this.coordinates.length,this.instructions.push([Wt.CUSTOM,l,u,n,i]),this.hitDetectionInstructions.push([Wt.CUSTOM,l,u,n,o||i]);break}this.endGeometry(r)},e.prototype.beginGeometry=function(n,r){this.beginGeometryInstruction1_=[Wt.BEGIN_GEOMETRY,r,0,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Wt.BEGIN_GEOMETRY,r,0,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var n=this.hitDetectionInstructions;n.reverse();var r,i=n.length,o,s,a=-1;for(r=0;rthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(n){var r=n.fillStyle,i=[Wt.SET_FILL_STYLE,r];return typeof r!="string"&&i.push(!0),i},e.prototype.applyStroke=function(n){this.instructions.push(this.createStroke(n))},e.prototype.createStroke=function(n){return[Wt.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth*this.pixelRatio,n.lineCap,n.lineJoin,n.miterLimit,this.applyPixelRatio(n.lineDash),n.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(n,r){var i=n.fillStyle;(typeof i!="string"||n.currentFillStyle!=i)&&(i!==void 0&&this.instructions.push(r.call(this,n)),n.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(n,r){var i=n.strokeStyle,o=n.lineCap,s=n.lineDash,a=n.lineDashOffset,l=n.lineJoin,c=n.lineWidth,u=n.miterLimit;(n.currentStrokeStyle!=i||n.currentLineCap!=o||s!=n.currentLineDash&&!eb(n.currentLineDash,s)||n.currentLineDashOffset!=a||n.currentLineJoin!=l||n.currentLineWidth!=c||n.currentMiterLimit!=u)&&(i!==void 0&&r.call(this,n),n.currentStrokeStyle=i,n.currentLineCap=o,n.currentLineDash=s,n.currentLineDashOffset=a,n.currentLineJoin=l,n.currentLineWidth=c,n.currentMiterLimit=u)},e.prototype.endGeometry=function(n){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[Wt.END_GEOMETRY,n];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=PPe(this.maxExtent),this.maxLineWidth>0)){var n=this.resolution*(this.maxLineWidth+1)/2;lA(this.bufferedMaxExtent_,n,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(kMe),cmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),umt=function(t){cmt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.hitDetectionImage_=null,s.image_=null,s.imagePixelRatio_=void 0,s.anchorX_=void 0,s.anchorY_=void 0,s.height_=void 0,s.opacity_=void 0,s.originX_=void 0,s.originY_=void 0,s.rotateWithView_=void 0,s.rotation_=void 0,s.scale_=void 0,s.width_=void 0,s.declutterMode_=void 0,s.declutterImageWithText_=void 0,s}return e.prototype.drawPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Wt.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.drawMultiPoint=function(n,r){if(this.image_){this.beginGeometry(n,r);var i=n.getFlatCoordinates(),o=n.getStride(),s=this.coordinates.length,a=this.appendFlatPointCoordinates(i,o);this.instructions.push([Wt.DRAW_IMAGE,s,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Wt.DRAW_IMAGE,s,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(r)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(n,r){var i=n.getAnchor(),o=n.getSize(),s=n.getOrigin();this.imagePixelRatio_=n.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n.getHitDetectionImage(),this.image_=n.getImage(this.pixelRatio),this.height_=o[1],this.opacity_=n.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=n.getRotateWithView(),this.rotation_=n.getRotation(),this.scale_=n.getScaleArray(),this.width_=o[0],this.declutterMode_=n.getDeclutterMode(),this.declutterImageWithText_=r},e}(GM),fmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dmt=function(t){fmt(e,t);function e(n,r,i,o){return t.call(this,n,r,i,o)||this}return e.prototype.drawFlatCoordinates_=function(n,r,i,o){var s=this.coordinates.length,a=this.appendFlatLineCoordinates(n,r,i,o,!1,!1),l=[Wt.MOVE_TO_LINE_TO,s,a];return this.instructions.push(l),this.hitDetectionInstructions.push(l),i},e.prototype.drawLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,hA,pA],hx);var a=n.getFlatCoordinates(),l=n.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(fv),this.endGeometry(r)}},e.prototype.drawMultiLineString=function(n,r){var i=this.state,o=i.strokeStyle,s=i.lineWidth;if(!(o===void 0||s===void 0)){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(n,r),this.hitDetectionInstructions.push([Wt.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],hx);for(var a=n.getEnds(),l=n.getFlatCoordinates(),c=n.getStride(),u=0,f=0,d=a.length;ft&&(l>a&&(a=l,o=c,s=f),l=0,c=f-i)),d=h,m=y,v=x),p=b,g=w}return l+=h,l>a?[c,f]:[o,s]}var gmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rk={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},mmt=function(t){gmt(e,t);function e(n,r,i,o){var s=t.call(this,n,r,i,o)||this;return s.labels_=null,s.text_="",s.textOffsetX_=0,s.textOffsetY_=0,s.textRotateWithView_=void 0,s.textRotation_=0,s.textFillState_=null,s.fillStates={},s.textStrokeState_=null,s.strokeStates={},s.textState_={},s.textStates={},s.textKey_="",s.fillKey_="",s.strokeKey_="",s.declutterImageWithText_=void 0,s}return e.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},e.prototype.drawText=function(n,r){var i=this.textFillState_,o=this.textStrokeState_,s=this.textState_;if(!(this.text_===""||!s||!i&&!o)){var a=this.coordinates,l=a.length,c=n.getType(),u=null,f=n.getStride();if(s.placement===Qgt.LINE&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!va(this.getBufferedMaxExtent(),n.getExtent()))return;var d=void 0;if(u=n.getFlatCoordinates(),c=="LineString")d=[u.length];else if(c=="MultiLineString")d=n.getEnds();else if(c=="Polygon")d=n.getEnds().slice(0,1);else if(c=="MultiPolygon"){var h=n.getEndss();d=[];for(var p=0,g=h.length;pA[2]}else M=b>k;var P=Math.PI,T=[],R=_+r===e;e=_,m=0,v=S,d=t[e],h=t[e+1];var I;if(R){y(),I=Math.atan2(h-g,d-p),M&&(I+=I>0?-P:P);var B=(k+b)/2,$=(E+w)/2;return T[0]=[B,$,(O-o)/2,I,i],T}i=i.replace(/\n/g," ");for(var z=0,L=i.length;z0?-P:P),I!==void 0){var N=j-I;if(N+=N>P?-2*P:N<-P?2*P:0,Math.abs(N)>s)return null}I=j;for(var F=z,H=0;z0&&t.push(`
-`,""),t.push(e,""),t}var Emt=function(){function t(e,n,r,i){this.overlaps=r,this.pixelRatio=n,this.resolution=e,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=dh(),this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(e,n,r,i){var o=e+n+r+i;if(this.labels_[o])return this.labels_[o];var s=i?this.strokeStates[i]:null,a=r?this.fillStates[r]:null,l=this.textStates[n],c=this.pixelRatio,u=[l.scale[0]*c,l.scale[1]*c],f=Array.isArray(e),d=l.justify?rk[l.justify]:Mhe(Array.isArray(e)?e[0]:e,l.textAlign||vA),h=i&&s.lineWidth?s.lineWidth:0,p=f?e:e.split(`
-`).reduce(Omt,[]),g=Ugt(l,p),m=g.width,v=g.height,y=g.widths,x=g.heights,b=g.lineWidths,w=m+h,_=[],S=(w+2)*u[0],O=(v+h)*u[1],k={width:S<0?Math.floor(S):Math.ceil(S),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:_};if((u[0]!=1||u[1]!=1)&&_.push("scale",u),i){_.push("strokeStyle",s.strokeStyle),_.push("lineWidth",h),_.push("lineCap",s.lineCap),_.push("lineJoin",s.lineJoin),_.push("miterLimit",s.miterLimit);var E=E4?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;E.prototype.setLineDash&&(_.push("setLineDash",[s.lineDash]),_.push("lineDashOffset",s.lineDashOffset))}r&&_.push("fillStyle",a.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");for(var M=.5-d,A=d*w+M*h,P=[],T=[],R=0,I=0,B=0,$=0,z,L=0,j=p.length;Le?e-c:o,b=s+u>n?n-u:s,w=p[3]+x*d[0]+p[1],_=p[0]+b*d[1]+p[2],S=v-p[3],O=y-p[0];(g||f!==0)&&(um[0]=S,fm[0]=S,um[1]=O,ap[1]=O,ap[0]=S+w,lp[0]=ap[0],lp[1]=O+_,fm[1]=lp[1]);var k;return f!==0?(k=Dg(dh(),r,i,1,1,f,-r,-i),Ui(k,um),Ui(k,ap),Ui(k,lp),Ui(k,fm),Bf(Math.min(um[0],ap[0],lp[0],fm[0]),Math.min(um[1],ap[1],lp[1],fm[1]),Math.max(um[0],ap[0],lp[0],fm[0]),Math.max(um[1],ap[1],lp[1],fm[1]),Bb)):Bf(Math.min(S,S+w),Math.min(O,O+_),Math.max(S,S+w),Math.max(O,O+_),Bb),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:x,drawImageH:b,originX:c,originY:u,declutterBox:{minX:Bb[0],minY:Bb[1],maxX:Bb[2],maxY:Bb[3],value:m},canvasTransform:k,scale:d}},t.prototype.replayImageOrLabel_=function(e,n,r,i,o,s,a){var l=!!(s||a),c=i.declutterBox,u=e.canvas,f=a?a[2]*i.scale[0]/2:0,d=c.minX-f<=u.width/n&&c.maxX+f>=0&&c.minY-f<=u.height/n&&c.maxY+f>=0;return d&&(l&&this.replayTextBackground_(e,um,ap,lp,fm,s,a),Wgt(e,i.canvasTransform,o,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(e){if(this.alignFill_){var n=Ui(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()},t.prototype.setStrokeStyle_=function(e,n){e.strokeStyle=n[1],e.lineWidth=n[2],e.lineCap=n[3],e.lineJoin=n[4],e.miterLimit=n[5],e.setLineDash&&(e.lineDashOffset=n[7],e.setLineDash(n[6]))},t.prototype.drawLabelWithPointPlacement_=function(e,n,r,i){var o=this.textStates[n],s=this.createLabel(e,n,i,r),a=this.strokeStates[r],l=this.pixelRatio,c=Mhe(Array.isArray(e)?e[0]:e,o.textAlign||vA),u=rk[o.textBaseline||nN],f=a&&a.lineWidth?a.lineWidth:0,d=s.width/l-2*o.scale[0],h=c*d+2*(.5-c)*f,p=u*s.height/l+2*(.5-u)*f;return{label:s,anchorX:h,anchorY:p}},t.prototype.execute_=function(e,n,r,i,o,s,a,l){var c;this.pixelCoordinates_&&eb(r,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Dx(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),Jdt(this.renderedTransform_,r));for(var u=0,f=i.length,d=0,h,p,g,m,v,y,x,b,w,_,S,O,k=0,E=0,M=null,A=null,P=this.coordinateCache_,T=this.viewRotation_,R=Math.round(Math.atan2(-r[1],r[0])*1e12)/1e12,I={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},B=this.instructions!=i||this.overlaps?0:200,$,z,L,j;uB&&(this.fill_(e),k=0),E>B&&(e.stroke(),E=0),!k&&!E&&(e.beginPath(),m=NaN,v=NaN),++u;break;case Wt.CIRCLE:d=N[1];var H=c[d],q=c[d+1],Y=c[d+2],le=c[d+3],K=Y-H,ee=le-q,re=Math.sqrt(K*K+ee*ee);e.moveTo(H+re,q),e.arc(H,q,re,0,2*Math.PI,!0),++u;break;case Wt.CLOSE_PATH:e.closePath(),++u;break;case Wt.CUSTOM:d=N[1],h=N[2];var me=N[3],te=N[4],ae=N.length==6?N[5]:void 0;I.geometry=me,I.feature=$,u in P||(P[u]=[]);var U=P[u];ae?ae(c,d,h,2,U):(U[0]=c[d],U[1]=c[d+1],U.length=2),te(U,I),++u;break;case Wt.DRAW_IMAGE:d=N[1],h=N[2],b=N[3],p=N[4],g=N[5];var oe=N[6],ne=N[7],V=N[8],X=N[9],Z=N[10],he=N[11],xe=N[12],G=N[13],W=N[14],J=N[15];if(!b&&N.length>=20){w=N[19],_=N[20],S=N[21],O=N[22];var se=this.drawLabelWithPointPlacement_(w,_,S,O);b=se.label,N[3]=b;var ye=N[23];p=(se.anchorX-ye)*this.pixelRatio,N[4]=p;var ie=N[24];g=(se.anchorY-ie)*this.pixelRatio,N[5]=g,oe=b.height,N[6]=oe,G=b.width,N[13]=G}var fe=void 0;N.length>25&&(fe=N[25]);var Q=void 0,_e=void 0,we=void 0;N.length>17?(Q=N[16],_e=N[17],we=N[18]):(Q=dx,_e=!1,we=!1),Z&&R?he+=T:!Z&&!R&&(he-=T);for(var Ie=0;d0){if(!s||h!=="Image"&&h!=="Text"||s.indexOf(_)!==-1){var M=(d[k]-3)/4,A=i-M%a,P=i-(M/a|0),T=o(_,S,A*A+P*P);if(T)return T}u.clearRect(0,0,a,a);break}}var g=Object.keys(this.executorsByZIndex_).map(Number);g.sort(o1);var m,v,y,x,b;for(m=g.length-1;m>=0;--m){var w=g[m].toString();for(y=this.executorsByZIndex_[w],v=pW.length-1;v>=0;--v)if(h=pW[v],x=y[h],x!==void 0&&(b=x.executeHitDetection(u,l,r,p,f),b))return b}},t.prototype.getClipCoords=function(e){var n=this.maxExtent_;if(!n)return null;var r=n[0],i=n[1],o=n[2],s=n[3],a=[r,i,r,s,o,s,o,i];return Dx(a,0,8,2,e,a),a},t.prototype.isEmpty=function(){return ES(this.executorsByZIndex_)},t.prototype.execute=function(e,n,r,i,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(o1),this.maxExtent_&&(e.save(),this.clip(e,r));var c=s||pW,u,f,d,h,p,g;for(a&&l.reverse(),u=0,f=l.length;un)break;var a=r[s];a||(a=[],r[s]=a),a.push(((t+i)*e+(t+o))*4+3),i>0&&a.push(((t-i)*e+(t+o))*4+3),o>0&&(a.push(((t+i)*e+(t-o))*4+3),i>0&&a.push(((t-i)*e+(t-o))*4+3))}for(var l=[],i=0,c=r.length;ithis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var e=0;for(var n in this.cache_){var r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],--this.cacheSize_)}}},t.prototype.get=function(e,n,r){var i=Dhe(e,n,r);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(e,n,r,i){var o=Dhe(e,n,r);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t}();function Dhe(t,e,n){var r=n?xMe(n):"null";return e+":"+t+":"+r}var oN=new Pmt,Mmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rmt=function(t){Mmt(e,t);function e(n,r,i,o){var s=t.call(this)||this;return s.extent=n,s.pixelRatio_=i,s.resolution=r,s.state=o,s}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return $t()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){$t()},e}(JC),Dmt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){Dmt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,i,zr.IDLE)||this;return l.src_=o,l.image_=new Image,s!==null&&(l.image_.crossOrigin=s),l.unlisten_=null,l.state=zr.IDLE,l.imageLoadFunction_=a,l}return e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=zr.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Ou(this.extent)/this.image_.height),this.state=zr.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){(this.state==zr.IDLE||this.state==zr.ERROR)&&(this.state=zr.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=mte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(n){this.image_=n,this.resolution=Ou(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e})(Rmt);function mte(t,e,n){var r=t,i=!0,o=!1,s=!1,a=[GF(r,nn.LOAD,function(){s=!0,o||e()})];return r.src&&Kdt?(o=!0,r.decode().then(function(){i&&e()}).catch(function(l){i&&(s?e():n())})):a.push(GF(r,nn.ERROR,n)),function(){i=!1,a.forEach(ri)}}var Imt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FE=null,Lmt=function(t){Imt(e,t);function e(n,r,i,o,s,a){var l=t.call(this)||this;return l.hitDetectionImage_=null,l.image_=n||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=a,l.unlisten_=null,l.imageState_=s,l.size_=i,l.src_=r,l.tainted_,l}return e.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===zr.LOADED){FE||(FE=Cc(1,1)),FE.drawImage(this.image_,0,0);try{FE.getImageData(0,0,1,1),this.tainted_=!1}catch{FE=null,this.tainted_=!0}}return this.tainted_===!0},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=zr.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=zr.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(n){return this.replaceColor_(n),this.canvas_[n]?this.canvas_[n]:this.image_},e.prototype.getPixelRatio=function(n){return this.replaceColor_(n),this.canvas_[n]?n:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var n=this.size_[0],r=this.size_[1],i=Cc(n,r);i.fillRect(0,0,n,r),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==zr.IDLE){this.imageState_=zr.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=mte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(n){if(!(!this.color_||this.canvas_[n]||this.imageState_!==zr.LOADED)){var r=document.createElement("canvas");this.canvas_[n]=r,r.width=Math.ceil(this.image_.width*n),r.height=Math.ceil(this.image_.height*n);var i=r.getContext("2d");if(i.scale(n,n),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply",i.globalCompositeOperation==="multiply"||this.isTainted_())i.fillStyle=xMe(this.color_),i.fillRect(0,0,r.width/n,r.height/n),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var o=i.getImageData(0,0,r.width,r.height),s=o.data,a=this.color_[0]/255,l=this.color_[1]/255,c=this.color_[2]/255,u=this.color_[3],f=0,d=s.length;f0,6);var f=i.src!==void 0?zr.IDLE:zr.LOADED;return r.color_=i.color!==void 0?eN(i.color):null,r.iconImage_=$mt(c,u,r.imgSize_!==void 0?r.imgSize_:null,r.crossOrigin_,f,r.color_),r.offset_=i.offset!==void 0?i.offset:[0,0],r.offsetOrigin_=i.offsetOrigin!==void 0?i.offsetOrigin:$c.TOP_LEFT,r.origin_=null,r.size_=i.size!==void 0?i.size:null,r}return e.prototype.clone=function(){var n=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(n)?n.slice():n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var n=this.normalizedAnchor_;if(!n){n=this.anchor_;var r=this.getSize();if(this.anchorXUnits_==Gm.FRACTION||this.anchorYUnits_==Gm.FRACTION){if(!r)return null;n=this.anchor_.slice(),this.anchorXUnits_==Gm.FRACTION&&(n[0]*=r[0]),this.anchorYUnits_==Gm.FRACTION&&(n[1]*=r[1])}if(this.anchorOrigin_!=$c.TOP_LEFT){if(!r)return null;n===this.anchor_&&(n=this.anchor_.slice()),(this.anchorOrigin_==$c.TOP_RIGHT||this.anchorOrigin_==$c.BOTTOM_RIGHT)&&(n[0]=-n[0]+r[0]),(this.anchorOrigin_==$c.BOTTOM_LEFT||this.anchorOrigin_==$c.BOTTOM_RIGHT)&&(n[1]=-n[1]+r[1])}this.normalizedAnchor_=n}var i=this.getDisplacement();return[n[0]-i[0],n[1]+i[1]]},e.prototype.setAnchor=function(n){this.anchor_=n,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(n){return this.iconImage_.getImage(n)},e.prototype.getPixelRatio=function(n){return this.iconImage_.getPixelRatio(n)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var n=this.offset_;if(this.offsetOrigin_!=$c.TOP_LEFT){var r=this.getSize(),i=this.iconImage_.getSize();if(!r||!i)return null;n=n.slice(),(this.offsetOrigin_==$c.TOP_RIGHT||this.offsetOrigin_==$c.BOTTOM_RIGHT)&&(n[0]=i[0]-r[0]-n[0]),(this.offsetOrigin_==$c.BOTTOM_LEFT||this.offsetOrigin_==$c.BOTTOM_RIGHT)&&(n[1]=i[1]-r[1]-n[1])}return this.origin_=n,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(n){this.iconImage_.addEventListener(nn.CHANGE,n)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(n){this.iconImage_.removeEventListener(nn.CHANGE,n)},e}(yMe),zd=.5;function zmt(t,e,n,r,i,o,s){var a=t[0]*zd,l=t[1]*zd,c=Cc(a,l);c.imageSmoothingEnabled=!1;for(var u=c.canvas,f=new Amt(c,zd,i,null,s),d=n.length,h=Math.floor((256*256*256-1)/d),p={},g=1;g<=d;++g){var m=n[g-1],v=m.getStyleFunction()||r;if(r){var y=v(m,o);if(y){Array.isArray(y)||(y=[y]);for(var x=g*h,b="#"+("000000"+x.toString(16)).slice(-6),w=0,_=y.length;w<_;++w){var S=y[w],O=S.getGeometryFunction()(m);if(!(!O||!va(i,O.getExtent()))){var k=S.clone(),E=k.getFill();E&&E.setColor(b);var M=k.getStroke();M&&(M.setColor(b),M.setLineDash(null)),k.setText(void 0);var A=S.getImage();if(A&&A.getOpacity()!==0){var P=A.getImageSize();if(!P)continue;var T=Cc(P[0],P[1],void 0,{alpha:!1}),R=T.canvas;T.fillStyle=b,T.fillRect(0,0,R.width,R.height),k.setImage(new Nmt({img:R,imgSize:P,anchor:A.getAnchor(),anchorXUnits:Gm.PIXELS,anchorYUnits:Gm.PIXELS,offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}var I=k.getZIndex()||0,B=p[I];B||(B={},p[I]=B,B.Polygon=[],B.Circle=[],B.LineString=[],B.Point=[]),B[O.getType().replace("Multi","")].push(O,k)}}}}}for(var $=Object.keys(p).map(Number).sort(o1),g=0,z=$.length;gg[2];)++y,x=v*y,f.push(this.getRenderTransform(o,s,a,zd,d,h,x).slice()),m-=v}this.hitDetectionImageData_=zmt(i,f,this.renderedFeatures_,u.getStyleFunction(),c,s,a)}r(jmt(n,this.renderedFeatures_,this.hitDetectionImageData_))}).bind(this))},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s){var a=this;if(this.replayGroup_){var l=r.viewState.resolution,c=r.viewState.rotation,u=this.getLayer(),f={},d=function(g,m,v){var y=or(g),x=f[y];if(x){if(x!==!0&&vw[0]&&O[2]>w[2]&&b.push([O[0]-_,O[1],O[2]-_,O[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==m&&r_(this.wrappedRenderedExtent_,y))return eb(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=v,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var k=new khe(vq(d,h),y,d,h),E;this.getLayer().getDeclutter()&&(E=new khe(vq(d,h),y,d,h));for(var M,A,P,A=0,P=b.length;A=200&&a.status<300){var c=e.getType(),u=void 0;c=="json"||c=="text"?u=a.responseText:c=="xml"?(u=a.responseXML,u||(u=new DOMParser().parseFromString(a.responseText,"application/xml"))):c=="arraybuffer"&&(u=a.response),u?o(e.readFeatures(u,{extent:n,featureProjection:i}),e.readProjection(u)):s()}else s()},a.onerror=s,a.send()}function Fhe(t,e){return function(n,r,i,o,s){var a=this;ovt(t,e,n,r,i,function(l,c){a.addFeatures(l),o!==void 0&&o(l)},s||s1)}}var IMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dm=function(t){IMe(e,t);function e(n,r,i){var o=t.call(this,n)||this;return o.feature=r,o.features=i,o}return e}(Nh),HM=function(t){IMe(e,t);function e(n){var r=this,i=n||{};r=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:i.wrapX!==void 0?i.wrapX:!0})||this,r.on,r.once,r.un,r.loader_=s1,r.format_=i.format,r.overlaps_=i.overlaps===void 0?!0:i.overlaps,r.url_=i.url,i.loader!==void 0?r.loader_=i.loader:r.url_!==void 0&&(bn(r.format_,7),r.loader_=Fhe(r.url_,r.format_)),r.strategy_=i.strategy!==void 0?i.strategy:rvt;var o=i.useSpatialIndex!==void 0?i.useSpatialIndex:!0;r.featuresRtree_=o?new Lhe:null,r.loadedExtentsRtree_=new Lhe,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null;var s,a;return Array.isArray(i.features)?a=i.features:i.features&&(s=i.features,a=s.getArray()),!o&&s===void 0&&(s=new ru(a)),a!==void 0&&r.addFeaturesInternal(a),s!==void 0&&r.bindFeaturesCollection_(s),r}return e.prototype.addFeature=function(n){this.addFeatureInternal(n),this.changed()},e.prototype.addFeatureInternal=function(n){var r=or(n);if(!this.addToIndex_(r,n)){this.featuresCollection_&&this.featuresCollection_.remove(n);return}this.setupChangeEvents_(r,n);var i=n.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,n)}else this.nullGeometryFeatures_[r]=n;this.dispatchEvent(new dm(qu.ADDFEATURE,n))},e.prototype.setupChangeEvents_=function(n,r){this.featureChangeKeys_[n]=[zn(r,nn.CHANGE,this.handleFeatureChange_,this),zn(r,OS.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(n,r){var i=!0,o=r.getId();return o!==void 0&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=r),i&&(bn(!(n in this.uidIndex_),30),this.uidIndex_[n]=r),i},e.prototype.addFeatures=function(n){this.addFeaturesInternal(n),this.changed()},e.prototype.addFeaturesInternal=function(n){for(var r=[],i=[],o=[],s=0,a=n.length;s0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(n){var r=this.loadedExtentsRtree_,i;r.forEachInExtent(n,function(o){if(cA(o.extent,n))return i=o,!0}),i&&r.remove(i)},e.prototype.removeFeature=function(n){if(n){var r=or(n);r in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[r]:this.featuresRtree_&&this.featuresRtree_.remove(n);var i=this.removeFeatureInternal(n);i&&this.changed()}},e.prototype.removeFeatureInternal=function(n){var r=or(n),i=this.featureChangeKeys_[r];if(i){i.forEach(ri),delete this.featureChangeKeys_[r];var o=n.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[r],this.dispatchEvent(new dm(qu.REMOVEFEATURE,n)),n}},e.prototype.removeFromIdIndex_=function(n){var r=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===n){delete this.idIndex_[i],r=!0;break}return r},e.prototype.setLoader=function(n){this.loader_=n},e.prototype.setUrl=function(n){bn(this.format_,7),this.url_=n,this.setLoader(Fhe(n,this.format_))},e}(DMe);function hm(t,e){return Ui(t.inversePixelTransform,e.slice(0))}const Xt={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function LMe(t){return Math.pow(t,3)}function rO(t){return 1-LMe(1-t)}function svt(t){return 3*t*t-2*t*t*t}function avt(t){return t}var lvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$Me=function(t){lvt(e,t);function e(n,r,i){var o=t.call(this)||this,s=i||{};return o.tileCoord=n,o.state=r,o.interimTile=null,o.key="",o.transition_=s.transition===void 0?250:s.transition,o.transitionStarts_={},o.interpolate=!!s.interpolate,o}return e.prototype.changed=function(){this.dispatchEvent(nn.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var n=this.interimTile;do{if(n.getState()==Xt.LOADED)return this.transition_=0,n;n=n.interimTile}while(n);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var n=this.interimTile,r=this;do{if(n.getState()==Xt.LOADED){n.interimTile=null;break}else n.getState()==Xt.LOADING?r=n:n.getState()==Xt.IDLE?r.interimTile=n.interimTile:r=n;n=r.interimTile}while(n)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(n){if(this.state!==Xt.ERROR&&this.state>n)throw new Error("Tile load sequence violation");this.state=n,this.changed()},e.prototype.load=function(){$t()},e.prototype.getAlpha=function(n,r){if(!this.transition_)return 1;var i=this.transitionStarts_[n];if(!i)i=r,this.transitionStarts_[n]=i;else if(i===-1)return 1;var o=r-i+1e3/60;return o>=this.transition_?1:LMe(o/this.transition_)},e.prototype.inTransition=function(n){return this.transition_?this.transitionStarts_[n]!==-1:!1},e.prototype.endTransition=function(n){this.transition_&&(this.transitionStarts_[n]=-1)},e}(JC),cvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vte=function(t){cvt(e,t);function e(n,r,i,o,s,a){var l=t.call(this,n,r,a)||this;return l.crossOrigin_=o,l.src_=i,l.key=i,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=s,l}return e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(n){this.image_=n,this.state=Xt.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){this.state=Xt.ERROR,this.unlistenImage_(),this.image_=uvt(),this.changed()},e.prototype.handleImageLoad_=function(){var n=this.image_;n.naturalWidth&&n.naturalHeight?this.state=Xt.LOADED:this.state=Xt.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Xt.ERROR&&(this.state=Xt.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Xt.IDLE&&(this.state=Xt.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=mte(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}($Me);function uvt(){var t=Cc(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var fvt=function(){function t(e,n,r){this.decay_=e,this.minVelocity_=n,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(e,n){this.points_.push(e,n,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var e=Date.now()-this.delay_,n=this.points_.length-3;if(this.points_[n+2]0&&this.points_[r+2]>e;)r-=3;var i=this.points_[n+2]-this.points_[r+2];if(i<1e3/60)return!1;var o=this.points_[n]-this.points_[r],s=this.points_[n+1]-this.points_[r+1];return this.angle_=Math.atan2(s,o),this.initialVelocity_=Math.sqrt(o*o+s*s)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),dvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hvt=function(t){dvt(e,t);function e(n){var r=t.call(this)||this;return r.map_=n,r}return e.prototype.dispatchRenderEvent=function(n,r){$t()},e.prototype.calculateMatrices2D=function(n){var r=n.viewState,i=n.coordinateToPixelTransform,o=n.pixelToCoordinateTransform;Dg(i,n.size[0]/2,n.size[1]/2,1/r.resolution,-1/r.resolution,-r.rotation,-r.center[0],-r.center[1]),Bee(o,i)},e.prototype.forEachFeatureAtCoordinate=function(n,r,i,o,s,a,l,c){var u,f=r.viewState;function d(R,I,B,$){return s.call(a,I,R?B:null,$)}var h=f.projection,p=FPe(n.slice(),h),g=[[0,0]];if(h.canWrapX()&&o){var m=h.getExtent(),v=Kr(m);g.push([-v,0],[v,0])}for(var y=r.layerStatesArray,x=y.length,b=[],w=[],_=0;_=0;--S){var O=y[S],k=O.layer;if(k.hasRenderer()&&iN(O,f)&&l.call(c,k)){var E=k.getRenderer(),M=k.getSource();if(E&&M){var A=M.getWrapX()?p:n,P=d.bind(null,O.managed);w[0]=A[0]+g[_][0],w[1]=A[1]+g[_][1],u=E.forEachFeatureAtCoordinate(w,r,i,P,b)}if(u)return u}}if(b.length!==0){var T=1/b.length;return b.forEach(function(R,I){return R.distanceSq+=I*T}),b.sort(function(R,I){return R.distanceSq-I.distanceSq}),b.some(function(R){return u=R.callback(R.feature,R.layer,R.geometry)}),u}},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){return $t()},e.prototype.hasFeatureAtCoordinate=function(n,r,i,o,s,a){var l=this.forEachFeatureAtCoordinate(n,r,i,o,Mx,this,s,a);return l!==void 0},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(n){$t()},e.prototype.scheduleExpireIconCache=function(n){oN.canExpireCache()&&n.postRenderFunctions.push(pvt)},e}(zee);function pvt(t,e){oN.expire()}var gvt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mvt=function(t){gvt(e,t);function e(n){var r=t.call(this,n)||this;r.fontChangeListenerKey_=zn(_p,OS.PROPERTYCHANGE,n.redrawText.bind(n)),r.element_=document.createElement("div");var i=r.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",r.element_.className=WM+" ol-layers";var o=n.getViewport();return o.insertBefore(r.element_,o.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return e.prototype.dispatchRenderEvent=function(n,r){var i=this.getMap();if(i.hasListener(n)){var o=new AMe(n,void 0,r);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){ri(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(n){if(!n){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(n),this.dispatchRenderEvent(Fv.PRECOMPOSE,n);var r=n.layerStatesArray.sort(function(h,p){return h.zIndex-p.zIndex}),i=n.viewState;this.children_.length=0;for(var o=[],s=null,a=0,l=r.length;a=0;--a)o[a].renderDeclutter(n);Fgt(this.element_,this.children_),this.dispatchRenderEvent(Fv.POSTCOMPOSE,n),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(n)},e.prototype.forEachLayerAtPixel=function(n,r,i,o,s){for(var a=r.viewState,l=r.layerStatesArray,c=l.length,u=c-1;u>=0;--u){var f=l[u],d=f.layer;if(d.hasRenderer()&&iN(f,a)&&s(d)){var h=d.getRenderer(),p=h.getDataAtPixel(n,r,i);if(p){var g=o(d,p);if(g)return g}}}},e}(hvt),FMe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hm=function(t){FMe(e,t);function e(n,r){var i=t.call(this,n)||this;return i.layer=r,i}return e}(Nh),mW={LAYERS:"layers"},L4=function(t){FMe(e,t);function e(n){var r=this,i=n||{},o=fi({},i);delete o.layers;var s=i.layers;return r=t.call(this,o)||this,r.on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(mW.LAYERS,r.handleLayersChanged_),s?Array.isArray(s)?s=new ru(s.slice(),{unique:!0}):bn(typeof s.getArray=="function",43):s=new ru(void 0,{unique:!0}),r.setLayers(s),r}return e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(ri),this.layersListenerKeys_.length=0;var n=this.getLayers();this.layersListenerKeys_.push(zn(n,Qa.ADD,this.handleLayersAdd_,this),zn(n,Qa.REMOVE,this.handleLayersRemove_,this));for(var r in this.listenerKeys_)this.listenerKeys_[r].forEach(ri);LM(this.listenerKeys_);for(var i=n.getArray(),o=0,s=i.length;othis.moveTolerance_||Math.abs(n.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(ri(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(nn.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(ri(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(ri),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(JC);const Mm={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},$s={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var sN=1/0,wvt=function(){function t(e,n){this.priorityFunction_=e,this.keyFunction_=n,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,LM(this.queuedElements_)},t.prototype.dequeue=function(){var e=this.elements_,n=this.priorities_,r=e[0];e.length==1?(e.length=0,n.length=0):(e[0]=e.pop(),n[0]=n.pop(),this.siftUp_(0));var i=this.keyFunction_(r);return delete this.queuedElements_[i],r},t.prototype.enqueue=function(e){bn(!(this.keyFunction_(e)in this.queuedElements_),31);var n=this.priorityFunction_(e);return n!=sN?(this.elements_.push(e),this.priorities_.push(n),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(e){return e*2+1},t.prototype.getRightChildIndex_=function(e){return e*2+2},t.prototype.getParentIndex_=function(e){return e-1>>1},t.prototype.heapify_=function(){var e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)},t.prototype.isEmpty=function(){return this.elements_.length===0},t.prototype.isKeyQueued=function(e){return e in this.queuedElements_},t.prototype.isQueued=function(e){return this.isKeyQueued(this.keyFunction_(e))},t.prototype.siftUp_=function(e){for(var n=this.elements_,r=this.priorities_,i=n.length,o=n[e],s=r[e],a=e;e>1;){var l=this.getLeftChildIndex_(e),c=this.getRightChildIndex_(e),u=ce;){var a=this.getParentIndex_(n);if(i[a]>s)r[n]=r[a],i[n]=i[a],n=a;else break}r[n]=o,i[n]=s},t.prototype.reprioritize=function(){var e=this.priorityFunction_,n=this.elements_,r=this.priorities_,i=0,o=n.length,s,a,l;for(a=0;a0;)s=this.dequeue()[0],a=s.getKey(),o=s.getState(),o===Xt.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++i,s.load())},e}(wvt);function Cvt(t,e,n,r,i){if(!t||!(n in t.wantedTiles)||!t.wantedTiles[n][e.getKey()])return sN;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}const Xu={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var Ovt=42,yte=256;function Nhe(t,e,n){return function(r,i,o,s,a){if(r){if(!i&&!e)return r;var l=e?0:o[0]*i,c=e?0:o[1]*i,u=a?a[0]:0,f=a?a[1]:0,d=t[0]+l/2+u,h=t[2]-l/2+u,p=t[1]+c/2+f,g=t[3]-c/2+f;d>h&&(d=(h+d)/2,h=d),p>g&&(p=(g+p)/2,g=p);var m=so(r[0],d,h),v=so(r[1],p,g);if(s&&n&&i){var y=30*i;m+=-y*Math.log(1+Math.max(0,d-r[0])/y)+y*Math.log(1+Math.max(0,r[0]-h)/y),v+=-y*Math.log(1+Math.max(0,p-r[1])/y)+y*Math.log(1+Math.max(0,r[1]-g)/y)}return[m,v]}}}function Evt(t){return t}function xte(t,e,n,r){var i=Kr(e)/n[0],o=Ou(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function bte(t,e,n){var r=Math.min(t,e),i=50;return r*=Math.log(1+i*Math.max(0,t/e-1))/i+1,n&&(r=Math.max(r,n),r/=Math.log(1+i*Math.max(0,n/t-1))/i+1),so(r,n/2,e*2)}function Tvt(t,e,n,r){return function(i,o,s,a){if(i!==void 0){var l=t[0],c=t[t.length-1],u=n?xte(l,n,s,r):l;if(a){var f=e!==void 0?e:!0;return f?bte(i,u,c):so(i,c,u)}var d=Math.min(u,i),h=Math.floor(jee(t,d,o));return t[h]>u&&h1&&typeof arguments[r-1]=="function"&&(i=arguments[r-1],--r);for(var o=0;o