reverend
547179b0ca
commit 97b044cafb7f17f23b3b1beedcf70af209a60ddc Author: reverend <reverend@reverend2048.de> Date: Mon Sep 14 17:25:40 2020 +0200 Updating gitignore commit 4891d80486e1f95db8ae66385c7c97426a3ca1a4 Author: reverend <reverend@reverend2048.de> Date: Mon Sep 14 17:25:20 2020 +0200 Updating Readme commit f05c43abbdc7eb30896ad6d10fe80fd6483338d9 Author: reverend <reverend@reverend2048.de> Date: Mon Sep 14 17:23:30 2020 +0200 Renaming Module commit fd5ad2ee9f8cbacd565da45b257928192ffc651c Author: reverend <reverend@reverend2048.de> Date: Mon Sep 14 17:23:16 2020 +0200 Renaming module references commit 828a0dd5dd73723b84b77908497903ed26b6966b Author: reverend <reverend@reverend2048.de> Date: Mon Sep 14 17:21:20 2020 +0200 Renaming Project
2 lines
648 KiB
JavaScript
2 lines
648 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ol=e():t.ol=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(t,e,r){t.exports=function(){"use strict";function t(t,n,i,o,a){!function t(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),h=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*h*(s-h)/s)*(u-s/2<0?-1:1),p=Math.max(i,Math.floor(n-u*h/s+c)),f=Math.min(o,Math.floor(n+(s-u)*h/s+c));t(r,n,p,f,a)}var d=r[n],_=i,g=o;for(e(r,i,n),a(r[o],d)>0&&e(r,i,o);_<g;){for(e(r,_,g),_++,g--;a(r[_],d)<0;)_++;for(;a(r[g],d)>0;)g--}0===a(r[i],d)?e(r,i,g):(g++,e(r,g,o)),g<=n&&(i=g+1),n<=g&&(o=g-1)}}(t,n,i||0,o||t.length-1,a||r)}function e(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function r(t,e){return t<e?-1:t>e?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,r,n,i){i||(i=d(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<r;o++){var a=t.children[o];s(i,t.leaf?n(a):a)}return i}function s(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function _(e,r,n,i,o){for(var a=[r,n];a.length;)if(!((n=a.pop())-(r=a.pop())<=i)){var s=r+Math.ceil((n-r)/i/2)*i;t(e,s,r,n,o),a.push(r,s,s,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var e=this.data,r=[];if(!f(t,e))return r;for(var n=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?n(a):a;f(t,s)&&(e.leaf?r.push(a):p(t,s)?this._all(a,r):i.push(a))}e=i.pop()}return r},n.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var r=[];e;){for(var n=0;n<e.children.length;n++){var i=e.children[n],o=e.leaf?this.toBBox(i):i;if(f(t,o)){if(e.leaf||p(t,o))return!0;r.push(i)}}e=r.pop()}return!1},n.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=d([]),this},n.prototype.remove=function(t,e){if(!t)return this;for(var r,n,o,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],r=l.pop(),o=!0),a.leaf){var h=i(t,a.children,e);if(-1!==h)return a.children.splice(h,1),u.push(a),this._condense(u),this}o||a.leaf||!p(a,s)?n?(r++,a=n.children[r],o=!1):a=null:(u.push(a),l.push(r),r=0,n=a,a=a.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,e){for(var r=[];t;)t.leaf?e.push.apply(e,t.children):r.push.apply(r,t.children),t=r.pop();return e},n.prototype._build=function(t,e,r,n){var i,a=r-e+1,s=this._maxEntries;if(a<=s)return o(i=d(t.slice(e,r+1)),this.toBBox),i;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),(i=d([])).leaf=!1,i.height=n;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));_(t,e,r,l,this.compareMinX);for(var h=e;h<=r;h+=l){var c=Math.min(h+l-1,r);_(t,h,c,u,this.compareMinY);for(var p=h;p<=c;p+=u){var f=Math.min(p+u-1,c);i.children.push(this._build(t,p,f,n-1))}}return o(i,this.toBBox),i},n.prototype._chooseSubtree=function(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var u=e.children[s],l=h(u),c=(p=t,f=u,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l);c<o?(o=c,i=l<i?l:i,a=u):c===o&&l<i&&(i=l,a=u)}e=a||e.children[0]}var p,f;return e},n.prototype._insert=function(t,e,r){var n=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,e,i);for(o.children.push(t),s(o,n);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)},n.prototype._split=function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var a=this._chooseSplitIndex(r,i,n),s=d(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,o(r,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},n.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,e,r){for(var n,i,o,s,u,l,c,p=1/0,f=1/0,d=e;d<=r-e;d++){var _=a(t,0,d,this.toBBox),g=a(t,d,r,this.toBBox),y=(i=_,o=g,s=void 0,u=void 0,l=void 0,c=void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),c=Math.min(i.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,c-u)),v=h(_)+h(g);y<p?(p=y,n=d,f=v<f?v:f):y===p&&v<f&&(f=v,n=d)}return n||r-e},n.prototype._chooseSplitAxis=function(t,e,r){var n=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,i)&&t.children.sort(n)},n.prototype._allDistMargin=function(t,e,r,n){t.children.sort(n);for(var i=this.toBBox,o=a(t,0,e,i),u=a(t,r-e,r,i),l=c(o)+c(u),h=e;h<r-e;h++){var p=t.children[h];s(o,t.leaf?i(p):p),l+=c(o)}for(var f=r-e-1;f>=e;f--){var d=t.children[f];s(u,t.leaf?i(d):d),l+=c(u)}return l},n.prototype._adjustParentBBoxes=function(t,e,r){for(var n=r;n>=0;n--)s(e[n],t)},n.prototype._condense=function(t){for(var e=t.length-1,r=void 0;e>=0;e--)0===t[e].children.length?e>0?(r=t[e-1].children).splice(r.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},n}()},function(t,e){var r=null,n=null;function i(t,e,r){t.addEventListener(e,(function(t){var i=new MouseEvent(r,t);i.pointerId=1,i.isPrimary=!0,i.pointerType="mouse",i.width=1,i.height=1,i.tiltX=0,i.tiltY=0,"buttons"in t&&0!==t.buttons?i.pressure=.5:i.pressure=0;var o=t.target;null!==n&&(o=n,"mouseup"===e&&(n=null)),o.dispatchEvent(i),i.defaultPrevented&&t.preventDefault()}))}function o(t,e,n){t.addEventListener(e,(function(t){for(var i=t.changedTouches,o=i.length,a=0;a<o;a++){var s=new CustomEvent(n,{bubbles:!0,cancelable:!0});s.ctrlKey=t.ctrlKey,s.shiftKey=t.shiftKey,s.altKey=t.altKey,s.metaKey=t.metaKey;var u=i.item(a);s.clientX=u.clientX,s.clientY=u.clientY,s.screenX=u.screenX,s.screenY=u.screenY,s.pageX=u.pageX,s.pageY=u.pageY;var l=u.target.getBoundingClientRect();s.offsetX=u.clientX-l.left,s.offsetY=u.clientY-l.top,s.pointerId=1+u.identifier,s.button=0,s.buttons=1,s.movementX=0,s.movementY=0,s.region=null,s.relatedTarget=null,s.x=s.clientX,s.y=s.clientY,s.pointerType="touch",s.width=1,s.height=1,s.tiltX=0,s.tiltY=0,s.pressure=1,"touchstart"===e&&null===r&&(r=u.identifier),s.isPrimary=u.identifier===r,"touchend"===e&&s.isPrimary&&(r=null),t.target.dispatchEvent(s),s.defaultPrevented&&t.preventDefault()}}))}"PointerEvent"in window||(Element.prototype.setPointerCapture=Element.prototype.setCapture,Element.prototype.releasePointerCapture=Element.prototype.releaseCapture,"TouchEvent"in window||(i(document,"mousedown","pointerdown"),i(document,"mousemove","pointermove"),i(document,"mouseup","pointerup")),o(document,"touchstart","pointerdown"),o(document,"touchmove","pointermove"),o(document,"touchend","pointerup"))},function(t,e,r){"use strict";t.exports=i;var n=r(4);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function l(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function h(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function c(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function p(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function f(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function d(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function _(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function g(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function y(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function v(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function m(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=v(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=v(this.buf,this.pos)+4294967296*v(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=v(this.buf,this.pos)+4294967296*x(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return s(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return s(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,r){return o.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,u=t[i],l=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h>r)break;1===h?u<128&&(l=u):2===h?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===h?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===h&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,h=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var r=a(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),m(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),m(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),m(this.buf,-1&t,this.pos),m(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),m(this.buf,-1&t,this.pos),m(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&u(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),n.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),n.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&u(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,_,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,r){var n=r(5);e.Processor=n},function(t,e){e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,h=-7,c=r?i-1:0,p=r?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-h)-1,f>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=p,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=p,h-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=l}return(f?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,h=(1<<l)-1,c=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?p/u:p*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*u-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[r+f]=255&a,f+=d,a/=256,l-=8);t[r+f-d]|=128*_}},function(t,e,r){var n=r(6).newImageData;function i(t){var e=!0;try{new ImageData(10,10)}catch(t){e=!1}function r(t,r,n){return e?new ImageData(t,r,n):{data:t,width:r,height:n}}return function(e){var n,i,o=e.buffers,a=e.meta,s=e.imageOps,u=e.width,l=e.height,h=o.length,c=o[0].byteLength;if(s){var p=new Array(h);for(i=0;i<h;++i)p[i]=r(new Uint8ClampedArray(o[i]),u,l);n=t(p,a).data}else{n=new Uint8ClampedArray(c);var f=new Array(h),d=new Array(h);for(i=0;i<h;++i)f[i]=new Uint8ClampedArray(o[i]),d[i]=[0,0,0,0];for(var _=0;_<c;_+=4){for(var g=0;g<h;++g){var y=f[g];d[g][0]=y[_],d[g][1]=y[_+1],d[g][2]=y[_+2],d[g][3]=y[_+3]}var v=t(d,a);n[_]=v[0],n[_+1]=v[1],n[_+2]=v[2],n[_+3]=v[3]}}return n.buffer}}function o(t,e){var r=Object.keys(t.lib||{}).map((function(e){return"var "+e+" = "+t.lib[e].toString()+";"})).concat(["var __minion__ = ("+i.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),n=new Blob(r,{type:"text/javascript"}),o=URL.createObjectURL(n),a=new Worker(o);return a.addEventListener("message",e),a}function a(t){var e;this._imageOps=!!t.imageOps;var r=[];if(e=0===t.threads?0:this._imageOps?1:t.threads||1)for(var n=0;n<e;++n)r[n]=o(t,this._onWorkerMessage.bind(this,n));else r[0]=function(t,e){var r=i(t.operation);return{postMessage:function(t){setTimeout((function(){e({data:{buffer:r(t),meta:t.meta}})}),0)}}}(t,this._onWorkerMessage.bind(this,0));this._workers=r,this._queue=[],this._maxQueueLength=t.queue||1/0,this._running=0,this._dataLookup={},this._job=null}a.prototype.process=function(t,e,r){this._enqueue({inputs:t,meta:e,callback:r}),this._dispatch()},a.prototype.destroy=function(){for(var t in this)this[t]=null;this._destroyed=!0},a.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},a.prototype._dispatch=function(){if(0===this._running&&this._queue.length>0){var t=this._job=this._queue.shift(),e=t.inputs[0].width,r=t.inputs[0].height,n=t.inputs.map((function(t){return t.data.buffer})),i=this._workers.length;if(this._running=i,1===i)this._workers[0].postMessage({buffers:n,meta:t.meta,imageOps:this._imageOps,width:e,height:r},n);else for(var o=t.inputs[0].data.length,a=4*Math.ceil(o/4/i),s=0;s<i;++s){for(var u=s*a,l=[],h=0,c=n.length;h<c;++h)l.push(n[s].slice(u,u+a));this._workers[s].postMessage({buffers:l,meta:t.meta,imageOps:this._imageOps,width:e,height:r},l)}}},a.prototype._onWorkerMessage=function(t,e){this._destroyed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())},a.prototype._resolveJob=function(){var t,e,r=this._job,i=this._workers.length;if(1===i)t=new Uint8ClampedArray(this._dataLookup[0].buffer),e=this._dataLookup[0].meta;else{var o=r.inputs[0].data.length;t=new Uint8ClampedArray(o),e=new Array(o);for(var a=4*Math.ceil(o/4/i),s=0;s<i;++s){var u=this._dataLookup[s].buffer,l=s*a;t.set(new Uint8ClampedArray(u),l),e[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},r.callback(null,n(t,r.inputs[0].width,r.inputs[0].height),e),this._dispatch()},t.exports=a},function(t,e){var r=!0;try{new ImageData(10,10)}catch(t){r=!1}var n=document.createElement("canvas").getContext("2d");e.newImageData=function(t,e,i){if(r)return new ImageData(t,e,i);var o=n.createImageData(e,i);return o.data.set(t),o}},function(t,e,r){"use strict";function n(){return function(){throw new Error("Unimplemented abstract method.")}()}r.r(e);var i=0;function o(t){return t.ol_uid||(t.ol_uid=String(++i))}var a,s=(a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),u=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.3.1".split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,n)||this).code=e,r.name="AssertionError",r.message=n,r}return s(e,t),e}(Error),l="add",h="remove",c="propertychange",p="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,i=arguments.length;n<i;++n){var o=arguments[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a])}return r};function f(t){for(var e in t)delete t[e]}var d="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function _(t){var e;for(e in t)return!1;return!e}function g(t,e,r,n,i){if(n&&n!==t&&(r=r.bind(n)),i){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var a={target:t,type:e,listener:r};return t.addEventListener(e,r),a}function y(t,e,r,n){return g(t,e,r,n,!0)}function v(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),f(t))}var m=function(){function t(){this.disposed_=!1}return t.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function x(t,e){return t>e?1:t<e?-1:0}function w(t,e){return t.indexOf(e)>=0}function S(t,e,r){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var i=void 0;if(r>0){for(i=1;i<n;++i)if(t[i]<e)return i-1}else if(r<0){for(i=1;i<n;++i)if(t[i]<=e)return i}else for(i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return n-1}function E(t,e,r){for(;e<r;){var n=t[e];t[e]=t[r],t[r]=n,++e,--r}}function T(t,e){for(var r=Array.isArray(e)?e:[e],n=r.length,i=0;i<n;i++)t[t.length]=r[i]}function C(t,e){for(var r,n=t.length>>>0,i=0;i<n;i++)if(e(r=t[i],i,t))return r;return null}function b(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function P(t,e){var r;return!t.every((function(n,i){return r=i,!e(n,i,t)}))?r:-1}function R(){return!0}function O(){return!1}function I(){}function L(t){t.stopPropagation()}var F=function(){function t(t){this.propagationStopped,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.propagationStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),M=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),A=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_={},r.dispatching_={},r.listeners_={},r}return M(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_[t];r||(r=[],this.listeners_[t]=r),-1===r.indexOf(e)&&r.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new F(t):t,r=e.type;e.target||(e.target=this.eventTarget_||this);var n,i=this.listeners_[r];if(i){r in this.dispatching_||(this.dispatching_[r]=0,this.pendingRemovals_[r]=0),++this.dispatching_[r];for(var o=0,a=i.length;o<a;++o)if(!1===(n="handleEvent"in i[o]?i[o].handleEvent(e):i[o].call(this,e))||e.propagationStopped){n=!1;break}if(--this.dispatching_[r],0===this.dispatching_[r]){var s=this.pendingRemovals_[r];for(delete this.pendingRemovals_[r];s--;)this.removeEventListener(r,I);delete this.dispatching_[r]}return n}},e.prototype.disposeInternal=function(){f(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_[t]},e.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},e.prototype.removeEventListener=function(t,e){var r=this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(t in this.pendingRemovals_?(r[n]=I,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(m),N="change",G="error",j="contextmenu",D="click",k="dblclick",U="dragenter",z="dragover",B="drop",Y="keydown",V="keypress",X="load",W="resize",Z="touchmove",K="wheel",q=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var H=function(t){function e(){var e=t.call(this)||this;return e.revision_=0,e}return q(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(N)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=g(this,t[i],e);return n}return g(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=y(this,t[i],e);return n}return y(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var r=0,n=t.length;r<n;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}(A),J=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Q=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.key=r,i.oldValue=n,i}return J(e,t),e}(F),$=function(t){function e(e){var r=t.call(this)||this;return o(r),r.values_={},void 0!==e&&r.setProperties(e),r}return J(e,t),e.prototype.get=function(t){var e;return this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return Object.keys(this.values_)},e.prototype.getProperties=function(){return p({},this.values_)},e.prototype.notify=function(t,e){var r;r=et(t),this.dispatchEvent(new Q(r,t,e)),r=c,this.dispatchEvent(new Q(r,t,e))},e.prototype.set=function(t,e,r){if(r)this.values_[t]=e;else{var n=this.values_[t];this.values_[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.unset=function(t,e){if(t in this.values_){var r=this.values_[t];delete this.values_[t],e||this.notify(t,r)}},e}(H),tt={};function et(t){return tt.hasOwnProperty(t)?tt[t]:tt[t]="change:"+t}var rt=$,nt=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),it="length",ot=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return nt(e,t),e}(F),at=function(t){function e(e,r){var n=t.call(this)||this,i=r||{};if(n.unique_=!!i.unique,n.array_=e||[],n.unique_)for(var o=0,a=n.array_.length;o<a;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return nt(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(it)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ot(l,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ot(h,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ot(h,n,t)),this.dispatchEvent(new ot(l,e,t))}else{for(var i=r;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(it,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new u(58)},e}(rt);function st(t,e){if(!t)throw new u(e)}var ut=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var lt=function(t){function e(e){var r=t.call(this)||this;if(r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addEventListener(et(r.geometryName_),r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;r.setGeometry(n)}else{var i=e;r.setProperties(i)}return r}return ut(e,t),e.prototype.clone=function(){var t=new e(this.getProperties());t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(v(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=g(t,N,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(st("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeEventListener(et(this.geometryName_),this.handleGeometryChanged_),this.geometryName_=t,this.addEventListener(et(this.geometryName_),this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(rt),ht="bottom-left",ct="bottom-right",pt="top-left",ft="top-right",dt=0,_t=1,gt=2,yt=4,vt=8,mt=16;function xt(t){for(var e=Rt(),r=0,n=t.length;r<n;++r)Nt(e,t[r]);return e}function wt(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function St(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Et(t,e,r){var n,i;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(i=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*i}function Tt(t,e){return bt(t,e[0],e[1])}function Ct(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function bt(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function Pt(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=dt;return a<r?u|=mt:a>i&&(u|=yt),s<n?u|=vt:s>o&&(u|=gt),u===dt&&(u=_t),u}function Rt(){return[1/0,1/0,-1/0,-1/0]}function Ot(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function It(t){return Ot(1/0,1/0,-1/0,-1/0,t)}function Lt(t,e){var r=t[0],n=t[1];return Ot(r,n,r,n,e)}function Ft(t,e,r,n,i){return jt(It(i),t,e,r,n)}function Mt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function At(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function Nt(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function Gt(t,e){for(var r=0,n=e.length;r<n;++r)Nt(t,e[r]);return t}function jt(t,e,r,n,i){for(;r<n;r+=i)Dt(t,e[r],e[r+1]);return t}function Dt(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function kt(t,e){var r;return(r=e(zt(t)))||(r=e(Bt(t)))||(r=e(qt(t)))?r:(r=e(Kt(t)))||!1}function Ut(t){var e=0;return Qt(t)||(e=Ht(t)*Wt(t)),e}function zt(t){return[t[0],t[1]]}function Bt(t){return[t[2],t[1]]}function Yt(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Vt(t,e){var r;return e===ht?r=zt(t):e===ct?r=Bt(t):e===pt?r=Kt(t):e===ft?r=qt(t):st(!1,13),r}function Xt(t,e,r,n,i){var o=e*n[0]/2,a=e*n[1]/2,s=Math.cos(r),u=Math.sin(r),l=o*s,h=o*u,c=a*s,p=a*u,f=t[0],d=t[1],_=f-l+p,g=f-l-p,y=f+l-p,v=f+l+p,m=d-h-c,x=d-h+c,w=d+h+c,S=d+h-c;return Ot(Math.min(_,g,y,v),Math.min(m,x,w,S),Math.max(_,g,y,v),Math.max(m,x,w,S),i)}function Wt(t){return t[3]-t[1]}function Zt(t,e,r){var n=r||[1/0,1/0,-1/0,-1/0];return Jt(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):It(n),n}function Kt(t){return[t[0],t[3]]}function qt(t){return[t[2],t[3]]}function Ht(t){return t[2]-t[0]}function Jt(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Qt(t){return t[2]<t[0]||t[3]<t[1]}function $t(t,e){var r=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=r,t[2]+=r,t[1]-=n,t[3]+=n}function te(t,e,r,n){var i=[];if(n>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<n;++s)i.push(t[0]+o*s/n,t[1],t[2],t[1]+a*s/n,t[2]-o*s/n,t[3],t[0],t[3]-a*s/n);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var u=[],l=[],h=(s=0,i.length);s<h;s+=2)u.push(i[s]),l.push(i[s+1]);return function(t,e,r){return Ot(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(u,l,r)}function ee(t,e){var r=e.getExtent(),n=Yt(t);if(e.canWrapX()&&(n[0]<r[0]||n[0]>=r[2])){var i=Ht(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}var re="XY",ne="XYZ",ie="XYM",oe="XYZM",ae={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};function se(t,e,r,n,i,o){for(var a=o||[],s=0,u=e;u<r;u+=n){var l=t[u],h=t[u+1];a[s++]=i[0]*l+i[2]*h+i[4],a[s++]=i[1]*l+i[3]*h+i[5]}return o&&a.length!=s&&(a.length=s),a}function ue(t,e,r,n,i,o,a){for(var s=a||[],u=Math.cos(i),l=Math.sin(i),h=o[0],c=o[1],p=0,f=e;f<r;f+=n){var d=t[f]-h,_=t[f+1]-c;s[p++]=h+d*u-_*l,s[p++]=c+d*l+_*u;for(var g=f+2;g<f+n;++g)s[p++]=t[g]}return a&&s.length!=p&&(s.length=p),s}function le(t,e,r,n,i,o,a){for(var s=a||[],u=0,l=e;l<r;l+=n){s[u++]=t[l]+i,s[u++]=t[l+1]+o;for(var h=l+2;h<l+n;++h)s[u++]=t[h]}return a&&s.length!=u&&(s.length=u),s}function he(t,e,r){return Math.min(Math.max(t,e),r)}var ce="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function pe(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return fe(t,e,r,n)}function fe(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function de(t){return 180*t/Math.PI}function _e(t){return t*Math.PI/180}function ge(t,e){var r=t%e;return r*e<0?r+e:r}function ye(t,e,r){return t+r*(e-t)}function ve(t,e,r){var n=r||6371008.8,i=_e(t[1]),o=_e(e[1]),a=(o-i)/2,s=_e(e[0]-t[0])/2,u=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(u),Math.sqrt(1-u))}function me(t,e){for(var r=0,n=0,i=t.length;n<i-1;++n)r+=ve(t[n],t[n+1],e);return r}function xe(t,e){for(var r=0,n=t.length,i=t[n-1][0],o=t[n-1][1],a=0;a<n;a++){var s=t[a][0],u=t[a][1];r+=_e(s-i)*(2+Math.sin(_e(o))+Math.sin(_e(u))),i=s,o=u}return r*e*e/2}function we(t,e,r,n){var i=n||6371008.8,o=_e(t[1]),a=_e(t[0]),s=e/i,u=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(r));return[de(a+Math.atan2(Math.sin(r)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(u))),de(u)]}var Se={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Ee={};Ee[Se.DEGREES]=2*Math.PI*6370997/360,Ee[Se.FEET]=.3048,Ee[Se.METERS]=1,Ee[Se.USFEET]=1200/3937;var Te=Se,Ce=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Ee[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),be=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pe=6378137*Math.PI,Re=[-Pe,-Pe,Pe,Pe],Oe=[-180,-85,180,85],Ie=function(t){function e(e){return t.call(this,{code:e,units:Te.METERS,extent:Re,global:!0,worldExtent:Oe,getPointResolution:function(t,e){return t/ce(e[1]/6378137)}})||this}return be(e,t),e}(Ce),Le=[new Ie("EPSG:3857"),new Ie("EPSG:102100"),new Ie("EPSG:102113"),new Ie("EPSG:900913"),new Ie("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Ie("urn:ogc:def:crs:EPSG::3857"),new Ie("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Fe(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=Pe,s=0;s<n;s+=i){o[s]=a*t[s]/180;var u=6378137*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));u>a?u=a:u<-a&&(u=-a),o[s+1]=u}return o}function Me(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a<n;a+=i)o[a]=180*t[a]/Pe,o[a+1]=360*Math.atan(Math.exp(t[a+1]/6378137))/Math.PI-90;return o}var Ae=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ne=[-180,-90,180,90],Ge=6378137*Math.PI/180,je=function(t){function e(e,r){return t.call(this,{code:e,units:Te.DEGREES,extent:Ne,axisOrientation:r,global:!0,metersPerUnit:Ge,worldExtent:Ne})||this}return Ae(e,t),e}(Ce),De=[new je("CRS:84"),new je("EPSG:4326","neu"),new je("urn:ogc:def:crs:EPSG::4326","neu"),new je("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new je("urn:ogc:def:crs:OGC:1.3:CRS84"),new je("urn:ogc:def:crs:OGC:2:84"),new je("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new je("urn:x-ogc:def:crs:EPSG:4326","neu")],ke={};function Ue(t,e,r){var n=t.getCode(),i=e.getCode();n in ke||(ke[n]={}),ke[n][i]=r}function ze(t,e){var r;return t in ke&&e in ke[t]&&(r=ke[t][e]),r}var Be={};function Ye(t,e,r){var n;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];n=e}else n=t.slice();return n}function Ve(t,e,r){if(void 0!==e&&t!==e){for(var n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function Xe(t){!function(t,e){Be[t]=e}(t.getCode(),t),Ue(t,t,Ye)}function We(t){return"string"==typeof t?Be[t]||null:t||null}function Ze(t,e,r,n){var i,o=(t=We(t)).getPointResolutionFunc();if(o)i=o(e,r),n&&n!==t.getUnits()&&(a=t.getMetersPerUnit())&&(i=i*a/Ee[n]);else if(t.getUnits()==Te.DEGREES&&!n||n==Te.DEGREES)i=e;else{var a,s=$e(t,We("EPSG:4326")),u=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];i=(ve((u=s(u,u,2)).slice(0,2),u.slice(2,4))+ve(u.slice(4,6),u.slice(6,8)))/2,void 0!==(a=n?Ee[n]:t.getMetersPerUnit())&&(i/=a)}return i}function Ke(t){!function(t){t.forEach(Xe)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ue(e,t,Ye)}))}))}function qe(t,e){return t?"string"==typeof t?We(t):t:We(e)}function He(t){return function(e,r,n){for(var i=e.length,o=void 0!==n?n:2,a=void 0!==r?r:new Array(i),s=0;s<i;s+=o){var u=t([e[s],e[s+1]]);a[s]=u[0],a[s+1]=u[1];for(var l=o-1;l>=2;--l)a[s+l]=e[s+l]}return a}}function Je(t,e,r,n){var i=We(t),o=We(e);Ue(i,o,He(r)),Ue(o,i,He(n))}function Qe(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||$e(t,e)===Ye)&&r}function $e(t,e){var r=ze(t.getCode(),e.getCode());return r||(r=Ve),r}function tr(t,e){return $e(We(t),We(e))}function er(t,e,r){return tr(e,r)(t,void 0,t.length)}function rr(t,e,r,n){return te(t,tr(e,r),void 0,n)}var nr,ir,or,ar=null;function sr(){return ar}function ur(t,e){return ar?er(t,e,ar):t}function lr(t,e){return ar?er(t,ar,e):t}function hr(t,e){return ar?rr(t,e,ar):t}function cr(t,e){return ar?rr(t,ar,e):t}Ke(Le),Ke(De),nr=Le,ir=Fe,or=Me,De.forEach((function(t){nr.forEach((function(e){Ue(t,e,ir),Ue(e,t,or)}))}));var pr=new Array(6);function fr(t){return _r(t,1,0,0,1,0,0)}function dr(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],l=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=r*u+i*l,t[1]=n*u+o*l,t[2]=r*h+i*c,t[3]=n*h+o*c,t[4]=r*p+i*f+a,t[5]=n*p+o*f+s,t}function _r(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function gr(t,e){var r=e[0],n=e[1];return e[0]=t[0]*r+t[2]*n+t[4],e[1]=t[1]*r+t[3]*n+t[5],e}function yr(t,e,r){return dr(t,_r(pr,e,0,0,r,0,0))}function vr(t,e,r,n,i,o,a,s){var u=Math.sin(o),l=Math.cos(o);return t[0]=n*l,t[1]=i*u,t[2]=-n*u,t[3]=i*l,t[4]=a*n*l-s*n*u+e,t[5]=a*i*u+s*i*l+r,t}function mr(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];st(0!==n,32);var i=e[0],o=e[1],a=e[2],s=e[3],u=e[4],l=e[5];return t[0]=s/n,t[1]=-o/n,t[2]=-a/n,t[3]=i/n,t[4]=(a*l-s*u)/n,t[5]=-(i*l-o*u)/n,t}function xr(t){return"matrix("+t.join(", ")+")"}var wr=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sr=[1,0,0,1,0,0],Er=function(t){function e(){var e,r,n,i,o,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&b(t,n)||(o=!0,i=this,n=t,r=e.apply(this,arguments)),r}),a}return wr(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return n()},e.prototype.closestPointXY=function(t,e,r,i){return n()},e.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},e.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return n()},e.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){n()},e.prototype.scale=function(t,e,r){n()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return n()},e.prototype.getType=function(){return n()},e.prototype.applyTransform=function(t){n()},e.prototype.intersectsExtent=function(t){return n()},e.prototype.translate=function(t,e){n()},e.prototype.transform=function(t,e){var r=We(t),n=r.getUnits()==Te.TILE_PIXELS?function(t,n,i){var o=r.getExtent(),a=r.getWorldExtent(),s=Wt(a)/Wt(o);return vr(Sr,a[0],a[3],s,-s,0,0,0),se(t,0,t.length,i,Sr,n),tr(r,e)(t,n,i)}:tr(r,e);return this.applyTransform(n),this},e}(rt),Tr=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Cr(t){var e;return t==re?e=2:t==ne||t==ie?e=3:t==oe&&(e=4),e}var br=function(t){function e(){var e=t.call(this)||this;return e.layout=re,e.stride=2,e.flatCoordinates=null,e}return Tr(e,t),e.prototype.computeExtent=function(t){return Ft(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return n()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=Cr(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){n()},e.prototype.setLayout=function(t,e,r){var n;if(t)n=Cr(t);else{for(var i=0;i<r;++i){if(0===e.length)return this.layout=re,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=re:3==t?e=ne:4==t&&(e=oe);return(e)}(n=e.length)}this.layout=t,this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();ue(r,0,r.length,n,t,e,r),this.changed()}},e.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var i=r;i||(i=Yt(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,r,n,i,o,a,s){for(var u=s||[],l=a[0],h=a[1],c=0,p=e;p<r;p+=n){var f=t[p]-l,d=t[p+1]-h;u[c++]=l+i*f,u[c++]=h+o*d;for(var _=p+2;_<p+n;++_)u[c++]=t[_]}s&&u.length!=c&&(u.length=c)}(o,0,o.length,a,t,n,i,o),this.changed()}},e.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();le(r,0,r.length,n,t,e,r),this.changed()}},e}(Er);function Pr(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],u=t[e+1];i+=a*s-o*u,o=s,a=u}return i/2}function Rr(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=Pr(t,e,s,n),e=s}return i}function Or(t,e,r,n,i,o,a){var s,u=t[e],l=t[e+1],h=t[r]-u,c=t[r+1]-l;if(0===h&&0===c)s=e;else{var p=((i-u)*h+(o-l)*c)/(h*h+c*c);if(p>1)s=r;else{if(p>0){for(var f=0;f<n;++f)a[f]=ye(t[e+f],t[r+f],p);return void(a.length=n)}s=e}}for(f=0;f<n;++f)a[f]=t[s+f];a.length=n}function Ir(t,e,r,n,i){var o=t[e],a=t[e+1];for(e+=n;e<r;e+=n){var s=t[e],u=t[e+1],l=fe(o,a,s,u);l>i&&(i=l),o=s,a=u}return i}function Lr(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=Ir(t,e,s,n,i),e=s}return i}function Fr(t,e,r,n,i,o,a,s,u,l,h){if(e==r)return l;var c,p;if(0===i){if((p=fe(a,s,t[e],t[e+1]))<l){for(c=0;c<n;++c)u[c]=t[e+c];return u.length=n,p}return l}for(var f=h||[NaN,NaN],d=e+n;d<r;)if(Or(t,d-n,d,n,a,s,f),(p=fe(a,s,f[0],f[1]))<l){for(l=p,c=0;c<n;++c)u[c]=f[c];u.length=n,d+=n}else d+=n*Math.max((Math.sqrt(p)-Math.sqrt(l))/i|0,1);if(o&&(Or(t,r-n,e,n,a,s,f),(p=fe(a,s,f[0],f[1]))<l)){for(l=p,c=0;c<n;++c)u[c]=f[c];u.length=n}return l}function Mr(t,e,r,n,i,o,a,s,u,l,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];l=Fr(t,e,d,n,i,o,a,s,u,l,c),e=d}return l}function Ar(t,e,r,n){for(var i=0,o=r.length;i<o;++i)t[e++]=r[i];return e}function Nr(t,e,r,n){for(var i=0,o=r.length;i<o;++i)for(var a=r[i],s=0;s<n;++s)t[e++]=a[s];return e}function Gr(t,e,r,n,i){for(var o=i||[],a=0,s=0,u=r.length;s<u;++s){var l=Nr(t,e,r[s],n);o[a++]=l,e=l}return o.length=a,o}function jr(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=e;s<r;s+=n)o[a++]=t.slice(s,s+n);return o.length=a,o}function Dr(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,u=r.length;s<u;++s){var l=r[s];o[a++]=jr(t,e,l,n,o[a]),e=l}return o.length=a,o}function kr(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,u=r.length;s<u;++s){var l=r[s];o[a++]=Dr(t,e,l,n,o[a]),e=l[l.length-1]}return o.length=a,o}function Ur(t,e,r,n,i,o,a){var s=(r-e)/n;if(s<3){for(;e<r;e+=n)o[a++]=t[e],o[a++]=t[e+1];return a}var u=new Array(s);u[0]=1,u[s-1]=1;for(var l=[e,r-n],h=0;l.length>0;){for(var c=l.pop(),p=l.pop(),f=0,d=t[p],_=t[p+1],g=t[c],y=t[c+1],v=p+n;v<c;v+=n){var m=pe(t[v],t[v+1],d,_,g,y);m>f&&(h=v,f=m)}f>i&&(u[(h-e)/n]=1,p+n<h&&l.push(p,h),h+n<c&&l.push(h,c))}for(v=0;v<s;++v)u[v]&&(o[a++]=t[e+v*n],o[a++]=t[e+v*n+1]);return a}function zr(t,e,r,n,i,o,a,s){for(var u=0,l=r.length;u<l;++u){var h=r[u];a=Ur(t,e,h,n,i,o,a),s.push(a),e=h}return a}function Br(t,e){return e*Math.round(t/e)}function Yr(t,e,r,n,i,o,a){if(e==r)return a;var s,u,l=Br(t[e],i),h=Br(t[e+1],i);e+=n,o[a++]=l,o[a++]=h;do{if(s=Br(t[e],i),u=Br(t[e+1],i),(e+=n)==r)return o[a++]=s,o[a++]=u,a}while(s==l&&u==h);for(;e<r;){var c=Br(t[e],i),p=Br(t[e+1],i);if(e+=n,c!=s||p!=u){var f=s-l,d=u-h,_=c-l,g=p-h;f*g==d*_&&(f<0&&_<f||f==_||f>0&&_>f)&&(d<0&&g<d||d==g||d>0&&g>d)?(s=c,u=p):(o[a++]=s,o[a++]=u,l=s,h=u,s=c,u=p)}}return o[a++]=s,o[a++]=u,a}function Vr(t,e,r,n,i,o,a,s){for(var u=0,l=r.length;u<l;++u){var h=r[u];a=Yr(t,e,h,n,i,o,a),s.push(a),e=h}return a}var Xr=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wr=function(t){function e(e,r){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return Xr(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<Et(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ir(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.getArea=function(){return Pr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Ur(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,re)},e.prototype.getType=function(){return ae.LINEAR_RING},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(br),Zr=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kr=function(t){function e(e,r){var n=t.call(this)||this;return n.setCoordinates(e,r),n}return Zr(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=fe(t,e,i[0],i[1]);if(o<n){for(var a=this.stride,s=0;s<a;++s)r[s]=i[s];return r.length=a,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return Lt(this.flatCoordinates,t)},e.prototype.getType=function(){return ae.POINT},e.prototype.intersectsExtent=function(t){return bt(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ar(this.flatCoordinates,0,t,this.stride),this.changed()},e}(br);function qr(t,e,r,n,i){return!kt(i,(function(i){return!Hr(t,e,r,n,i[0],i[1])}))}function Hr(t,e,r,n,i,o){for(var a=0,s=t[r-n],u=t[r-n+1];e<r;e+=n){var l=t[e],h=t[e+1];u<=o?h>o&&(l-s)*(o-u)-(i-s)*(h-u)>0&&a++:h<=o&&(l-s)*(o-u)-(i-s)*(h-u)<0&&a--,s=l,u=h}return 0!==a}function Jr(t,e,r,n,i,o){if(0===r.length)return!1;if(!Hr(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a<s;++a)if(Hr(t,r[a-1],r[a],n,i,o))return!1;return!0}function Qr(t,e,r,n,i,o,a){for(var s,u,l,h,c,p,f,d=i[o+1],_=[],g=0,y=r.length;g<y;++g){var v=r[g];for(h=t[v-n],p=t[v-n+1],s=e;s<v;s+=n)c=t[s],f=t[s+1],(d<=p&&f<=d||p<=d&&d<=f)&&(l=(d-p)/(f-p)*(c-h)+h,_.push(l)),h=c,p=f}var m=NaN,w=-1/0;for(_.sort(x),h=_[0],s=1,u=_.length;s<u;++s){c=_[s];var S=Math.abs(c-h);S>w&&Jr(t,e,r,n,l=(h+c)/2,d)&&(m=l,w=S),h=c}return isNaN(m)&&(m=i[o]),a?(a.push(m,d,w),a):[m,d,w]}function $r(t,e,r,n,i){for(var o=[],a=0,s=r.length;a<s;++a){var u=r[a];o=Qr(t,e,u,n,i,2*a,o),e=u[u.length-1]}return o}function tn(t,e,r,n,i){for(var o,a=[t[e],t[e+1]],s=[];e+n<r;e+=n){if(s[0]=t[e+n],s[1]=t[e+n+1],o=i(a,s))return o;a[0]=s[0],a[1]=s[1]}return!1}function en(t,e,r,n,i){var o=jt([1/0,1/0,-1/0,-1/0],t,e,r,n);return!!Jt(i,o)&&(!!Ct(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||tn(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=Pt(t,e),o=Pt(t,r);if(i===_t||o===_t)n=!0;else{var a=t[0],s=t[1],u=t[2],l=t[3],h=e[0],c=e[1],p=r[0],f=r[1],d=(f-c)/(p-h),_=void 0,g=void 0;o>&&!(i>)&&(n=(_=p-(f-l)/d)>=a&&_<=u),n||!(o&yt)||i&yt||(n=(g=f-(p-u)*d)>=s&&g<=l),n||!(o&vt)||i&vt||(n=(_=p-(f-s)/d)>=a&&_<=u),n||!(o&mt)||i&mt||(n=(g=f-(p-a)*d)>=s&&g<=l)}return n}(i,t,e)})))))}function rn(t,e,r,n,i){if(!function(t,e,r,n,i){return!!en(t,e,r,n,i)||(!!Hr(t,e,r,n,i[0],i[1])||(!!Hr(t,e,r,n,i[0],i[3])||(!!Hr(t,e,r,n,i[2],i[1])||!!Hr(t,e,r,n,i[2],i[3]))))}(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;o<a;++o)if(qr(t,r[o-1],r[o],n,i)&&!en(t,r[o-1],r[o],n,i))return!1;return!0}function nn(t,e,r,n){for(;e<r-n;){for(var i=0;i<n;++i){var o=t[e+i];t[e+i]=t[r-n+i],t[r-n+i]=o}e+=n,r-=n}}function on(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],u=t[e+1];i+=(s-o)*(u+a),o=s,a=u}return i>0}function an(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var u=r[a],l=on(t,e,u,n);if(0===a){if(o&&l||!o&&!l)return!1}else if(o&&!l||!o&&l)return!1;e=u}return!0}function sn(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var u=r[a],l=on(t,e,u,n);(0===a?o&&l||!o&&!l:o&&!l||!o&&l)&&nn(t,e,u,n),e=u}return e}function un(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o)e=sn(t,e,r[o],n,i);return e}var ln=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hn=function(t){function e(e,r,n){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==r&&n?(i.setFlatCoordinates(r,e),i.ends_=n):i.setCoordinates(e,r),i}return ln(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?T(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,n){return n<Et(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Lr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Mr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return Jr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return Rr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?sn(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Dr(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Yt(this.getExtent());this.flatInteriorPoint_=Qr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Kr(this.getFlatInteriorPoint(),ie)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Wr(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o],u=new Wr(e.slice(i,s),t);n.push(u),i=s}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;an(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=sn(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=Vr(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,n),new e(r,re,n)},e.prototype.getType=function(){return ae.POLYGON},e.prototype.intersectsExtent=function(t){return rn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=Gr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(br),cn=hn;function pn(t,e,r,n){for(var i=r||32,o=[],a=0;a<i;++a)T(o,we(t,e,2*Math.PI*a/i,n));return o.push(o[0],o[1]),new hn(o,re,[o.length])}function fn(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=[e,r,e,i,n,i,n,r,e,r];return new hn(o,re,[o.length])}function dn(t,e,r){for(var n=e||32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(n+1),u=new Array(s),l=0;l<s;l+=i){u[l]=0,u[l+1]=0;for(var h=2;h<i;h++)u[l+h]=a[h]}var c=[u.length],p=new hn(u,o,c);return _n(p,a,t.getRadius(),r),p}function _n(t,e,r,n){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=n||0,u=0;u<=a;++u){var l=u*o,h=s+2*ge(u,a)*Math.PI/a;i[l]=e[0]+r*Math.cos(h),i[l+1]=e[1]+r*Math.sin(h)}t.changed()}var gn=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yn="accuracy",vn="accuracyGeometry",mn="altitude",xn="altitudeAccuracy",wn="heading",Sn="position",En="projection",Tn="speed",Cn="tracking",bn="trackingOptions",Pn=function(t){function e(e){var r=t.call(this,G)||this;return r.code=e.code,r.message=e.message,r}return gn(e,t),e}(F),Rn=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.position_=null,r.transform_=Ve,r.watchId_=void 0,r.addEventListener(et(En),r.handleProjectionChanged_),r.addEventListener(et(Cn),r.handleTrackingChanged_),void 0!==n.projection&&r.setProjection(n.projection),void 0!==n.trackingOptions&&r.setTrackingOptions(n.trackingOptions),r.setTracking(void 0!==n.tracking&&n.tracking),r}return gn(e,t),e.prototype.disposeInternal=function(){this.setTracking(!1),t.prototype.disposeInternal.call(this)},e.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=$e(We("EPSG:4326"),t),this.position_&&this.set(Sn,this.transform_(this.position_)))},e.prototype.handleTrackingChanged_=function(){if("geolocation"in navigator){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},e.prototype.positionChange_=function(t){var e=t.coords;this.set(yn,e.accuracy),this.set(mn,null===e.altitude?void 0:e.altitude),this.set(xn,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(wn,null===e.heading?void 0:_e(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];var r=this.transform_(this.position_);this.set(Sn,r),this.set(Tn,null===e.speed?void 0:e.speed);var n=pn(this.position_,e.accuracy);n.applyTransform(this.transform_),this.set(vn,n),this.changed()},e.prototype.positionError_=function(t){this.setTracking(!1),this.dispatchEvent(new Pn(t))},e.prototype.getAccuracy=function(){return this.get(yn)},e.prototype.getAccuracyGeometry=function(){return this.get(vn)||null},e.prototype.getAltitude=function(){return this.get(mn)},e.prototype.getAltitudeAccuracy=function(){return this.get(xn)},e.prototype.getHeading=function(){return this.get(wn)},e.prototype.getPosition=function(){return this.get(Sn)},e.prototype.getProjection=function(){return this.get(En)},e.prototype.getSpeed=function(){return this.get(Tn)},e.prototype.getTracking=function(){return this.get(Cn)},e.prototype.getTrackingOptions=function(){return this.get(bn)},e.prototype.setProjection=function(t){this.set(En,We(t))},e.prototype.setTracking=function(t){this.set(Cn,t)},e.prototype.setTrackingOptions=function(t){this.set(bn,t)},e}(rt),On=function(){function t(t,e,r){this.decay_=t,this.minVelocity_=e,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(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var r=e-3;r>0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),In=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ln=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.map=r,i.frameState=void 0!==n?n:null,i}return In(e,t),e}(F),Fn=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mn=function(t){function e(e,r,n,i,o){var a=t.call(this,e,r,o)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a}return Fn(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!0,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(Ln),An=(r(1),"undefined"!=typeof navigator?navigator.userAgent.toLowerCase():""),Nn=-1!==An.indexOf("firefox"),Gn=(-1!==An.indexOf("safari")&&An.indexOf("chrom"),-1!==An.indexOf("webkit")&&-1==An.indexOf("edge")),jn=-1!==An.indexOf("macintosh"),Dn="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,kn="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Un="undefined"!=typeof Image&&Image.prototype.decode,zn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}(),Bn={SINGLECLICK:"singleclick",CLICK:D,DBLCLICK:k,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Yn=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vn=function(t){function e(e,r,n,i,o){var a=t.call(this,e,r,n,i,o)||this;return a.pointerEvent=n,a}return Yn(e,t),e}(Mn),Xn="pointermove",Wn="pointerdown",Zn="pointerup",Kn="pointerout",qn=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hn=function(t){function e(e,r){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=r?r*Dn:Dn,n.down_=null;var i=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=i,n.pointerdownListenerKey_=g(i,Wn,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=g(i,Xn,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(Z,n.boundHandleTouchMove_,!!zn&&{passive:!1}),n}return qn(e,t),e.prototype.emulateClick_=function(t){var e=new Vn(Bn.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Vn(Bn.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Vn(Bn.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Bn.POINTERUP||e.type==Bn.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Bn.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Vn(Bn.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(v),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new Vn(Bn.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&this.dragListenerKeys_.push(g(document,Bn.POINTERMOVE,this.handlePointerMove_,this),g(document,Bn.POINTERUP,this.handlePointerUp_,this),g(this.element_,Bn.POINTERCANCEL,this.handlePointerUp_,this))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Vn(Bn.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Vn(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){this.originalPointerMoveEvent_&&!this.originalPointerMoveEvent_.defaultPrevented||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(v(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Z,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(v(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(v),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(A),Jn="postrender",Qn="movestart",$n="moveend",ti="layergroup",ei="size",ri="target",ni="view",ii="prerender",oi="postrender",ai="precompose",si="postcompose",ui="rendercomplete",li=0,hi=1,ci=2,pi=3,fi=4,di=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,f(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(r);return delete this.queuedElements_[n],r},t.prototype.enqueue=function(t){st(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,n=e.length,i=e[t],o=r[t],a=t;t<n>>1;){var s=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),l=u<n&&r[u]<r[s]?u:s;e[t]=e[l],r[t]=r[l],t=l}e[t]=i,r[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,n=this.priorities_,i=r[e],o=n[e];e>t;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;r[e]=r[a],n[e]=n[a],e=a}r[e]=i,n[e]=o},t.prototype.reprioritize=function(){var t,e,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e<s;++e)(r=n(t=i[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=r,i[a++]=t);i.length=a,o.length=a,this.heapify_()},t}(),_i=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gi=function(t){function e(e,r){var n=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=r,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return _i(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);r&&e[0].addEventListener(N,this.boundHandleTileChange_);return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(e.hifi&&r===ci||r===pi||r===fi){e.removeEventListener(N,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var r,n,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==li||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}(di);function yi(t,e,r){return function(n,i,o,a){if(n){var s=e?0:o[0]*i,u=e?0:o[1]*i,l=t[0]+s/2,h=t[2]-s/2,c=t[1]+u/2,p=t[3]-u/2;l>h&&(h=l=(h+l)/2),c>p&&(p=c=(p+c)/2);var f=he(n[0],l,h),d=he(n[1],c,p),_=30*i;return a&&r&&(f+=-_*Math.log(1+Math.max(0,l-n[0])/_)+_*Math.log(1+Math.max(0,n[0]-h)/_),d+=-_*Math.log(1+Math.max(0,c-n[1])/_)+_*Math.log(1+Math.max(0,n[1]-p)/_)),[f,d]}}}function vi(t){return t}function mi(t,e,r,n){var i=Ht(e)/r[0],o=Wt(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function xi(t,e,r){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(n=Math.max(n,r),n/=Math.log(1+50*Math.max(0,r/t-1))/50+1),he(n,r/2,2*e)}function wi(t,e,r,n,i){return function(o,a,s,u){if(void 0!==o){var l=n?mi(t,n,s,i):t;return(void 0===r||r)&&u?xi(o,l,e):he(o,e,l)}}}function Si(t){return void 0!==t?0:void 0}function Ei(t){return void 0!==t?t:void 0}var Ti=0,Ci=1,bi="center",Pi="resolution",Ri="rotation";function Oi(t,e,r){var n=void 0!==r?t.toFixed(r):""+t,i=n.indexOf(".");return(i=-1===i?n.length:i)>e?n:new Array(1+e-i).join("0")+n}function Ii(t,e){for(var r=(""+t).split("."),n=(""+e).split("."),i=0;i<Math.max(r.length,n.length);i++){var o=parseInt(r[i]||"0",10),a=parseInt(n[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function Li(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Fi(t,e){var r,n,i=t[0],o=t[1],a=e[0],s=e[1],u=a[0],l=a[1],h=s[0],c=s[1],p=h-u,f=c-l,d=0===p&&0===f?0:(p*(i-u)+f*(o-l))/(p*p+f*f||0);return d<=0?(r=u,n=l):d>=1?(r=h,n=c):(r=u+d*p,n=l+d*f),[r,n]}function Mi(t,e,r){var n=ge(e+180,360)-180,i=Math.abs(3600*n),o=r||0,a=Math.pow(10,o),s=Math.floor(i/3600),u=Math.floor((i-3600*s)/60),l=i-3600*s-60*u;return(l=Math.ceil(l*a)/a)>=60&&(l=0,u+=1),u>=60&&(u=0,s+=1),s+"° "+Oi(u,2)+"′ "+Oi(l,2,o)+"″"+(0==n?"":" "+t.charAt(n<0?1:0))}function Ai(t,e,r){return t?e.replace("{x}",t[0].toFixed(r)).replace("{y}",t[1].toFixed(r)):""}function Ni(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function Gi(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function ji(t,e){return t[0]*=e,t[1]*=e,t}function Di(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function ki(t,e){return Math.sqrt(Di(t,e))}function Ui(t,e){return Di(t,Fi(t,e))}function zi(t,e){return Ai(t,"{x}, {y}",e)}function Bi(t,e){var r=e.getExtent();if(e.canWrapX()&&(t[0]<r[0]||t[0]>=r[2])){var n=Ht(r),i=Math.floor((t[0]-r[0])/n);t[0]-=i*n}return t}function Yi(t){return Math.pow(t,3)}function Vi(t){return 1-Yi(1-t)}function Xi(t){return 3*t*t-2*t*t*t}function Wi(t){return t}var Zi=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ki(t,e){setTimeout((function(){t(e)}),0)}function qi(t){return!(t.sourceCenter&&t.targetCenter&&!Ni(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var Hi=function(t){function e(e){var r=t.call(this)||this,n=p({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=qe(n.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.cancelAnchor_=void 0,n.center&&(n.center=lr(n.center,r.projection_)),n.extent&&(n.extent=cr(n.extent,r.projection_)),r.applyOptions_(n),r}return Zi(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,r,n,i=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,a=void 0!==t.zoomFactor?t.zoomFactor:2,s=void 0!==t.multiWorld&&t.multiWorld,u=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,l=void 0!==t.showFullExtent&&t.showFullExtent,h=qe(t.projection,"EPSG:3857"),c=h.getExtent(),p=t.constrainOnlyCenter,f=t.extent;s||f||!h.isGlobal()||(p=!1,f=c);if(void 0!==t.resolutions){var d=t.resolutions;r=d[i],n=void 0!==d[o]?d[o]:d[d.length-1],e=t.constrainResolution?function(t,e,r,n){return function(i,o,a,s){if(void 0!==i){var u=t[0],l=t[t.length-1],h=r?mi(u,r,a,n):u;if(s)return void 0===e||e?xi(i,h,l):he(i,l,h);var c=Math.min(h,i),p=Math.floor(S(t,c,o));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(d,u,!p&&f,l):wi(r,n,u,!p&&f,l)}else{var _=(c?Math.max(Ht(c),Wt(c)):360*Ee[Te.DEGREES]/h.getMetersPerUnit())/256/Math.pow(2,0),g=_/Math.pow(2,28);void 0!==(r=t.maxResolution)?i=0:r=_/Math.pow(a,i),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(a,o):_/Math.pow(a,o):g),o=i+Math.floor(Math.log(r/n)/Math.log(a)),n=r/Math.pow(a,o-i),e=t.constrainResolution?function(t,e,r,n,i,o){return function(a,s,u,l){if(void 0!==a){var h=i?mi(e,i,u,o):e,c=void 0!==r?r:0;if(l)return void 0===n||n?xi(a,h,c):he(a,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-s*(.5-1e-9)+.5,d=Math.min(h,a),_=Math.floor(Math.log(e/d)/Math.log(t)+f),g=Math.max(p,_);return he(e/Math.pow(t,g),c,h)}}}(a,r,n,u,!p&&f,l):wi(r,n,u,!p&&f,l)}return{constraint:e,maxResolution:r,minResolution:n,minZoom:i,zoomFactor:a}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=e.minZoom;var r=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return yi(t.extent,t.constrainOnlyCenter,e)}var r=qe(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var n=r.getExtent().slice();return n[0]=-1/0,n[2]=1/0,yi(n,!1,!1)}return vi}(t),n=e.constraint,i=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=i||_e(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Ei:"number"==typeof e?(r=e,n=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):Ei}return Si;var r,n;var i,o}(t);this.constraints_={center:r,resolution:n,rotation:i},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=p({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),p({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),r=0;r<e.length;++r){var n=arguments[r];n.center&&((n=p({},n)).center=lr(n.center,this.getProjection())),n.anchor&&((n=p({},n)).anchor=lr(n.anchor,this.getProjection())),e[r]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,r=arguments.length;if(r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r),!this.isDef()){var n=arguments[r-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&Ki(e,!0))}for(var i=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,s=this.targetRotation_,u=[],l=0;l<r;++l){var h=arguments[l],c={start:i,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||Xi,callback:e};if(h.center&&(c.sourceCenter=o,c.targetCenter=h.center.slice(),o=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(h.zoom),a=c.targetResolution):h.resolution&&(c.sourceResolution=a,c.targetResolution=h.resolution,a=c.targetResolution),void 0!==h.rotation){c.sourceRotation=s;var p=ge(h.rotation-s+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=s+p,s=c.targetRotation}qi(c)?c.complete=!0:i+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(Ti,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[Ti]>0},e.prototype.getInteracting=function(){return this.hints_[Ci]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Ti,-this.hints_[Ti]);for(var e=0,r=this.animations_.length;e<r;++e){var n=this.animations_[e];if(n[0].callback&&Ki(n[0].callback,!1),!t)for(var i=0,o=n.length;i<o;++i){var a=n[i];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,r=this.animations_.length-1;r>=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o<a;++o){var s=n[o];if(!s.complete){var u=t-s.start,l=s.duration>0?u/s.duration:1;l>=1?(s.complete=!0,l=1):i=!1;var h=s.easing(l);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],f=c+h*(s.targetCenter[0]-c),d=p+h*(s.targetCenter[1]-p);this.targetCenter_=[f,d]}if(s.sourceResolution&&s.targetResolution){var _=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var g=this.getViewportSize_(this.getRotation()),y=this.constraints_.resolution(_,0,g,!0);this.targetCenter_=this.calculateCenterZoom(y,s.anchor)}this.targetResolution_=_,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var v=1===h?ge(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var m=this.constraints_.rotation(v,!0);this.targetCenter_=this.calculateCenterRotate(m,s.anchor)}this.targetRotation_=v}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(i){this.animations_[r]=null,this.setHint(Ti,-1);var x=n[0].callback;x&&Ki(x,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var r,n=this.getCenterInternal();return void 0!==n&&(Gi(r=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),Li(r,e)),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenterInternal(),i=this.getResolution();void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]);return r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],n=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?ur(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(bi)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.constrainResolution},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return hr(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSize_(),r=this.getCenterInternal();st(r,1);var n=this.getResolution();st(void 0!==n,2);var i=this.getRotation();return st(void 0!==i,3),Xt(r,n,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Pi)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(cr(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSize_(),n=Ht(t)/r[0],i=Wt(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return r/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(Ri)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/e;return function(t){return Math.log(r/t)/e/i}},e.prototype.getState=function(){var t=this.getCenterInternal(),e=this.getProjection(),r=this.getResolution(),n=this.getRotation();return{center:t.slice(0),projection:void 0!==e?e:null,resolution:r,rotation:n,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,r,n=this.minZoom_||0;if(this.resolutions_){var i=S(this.resolutions_,t,1);n=i,e=this.resolutions_[i],r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=he(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,he(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r,n=p({size:this.getViewportSize_()},e||{});if(st(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))st(!Qt(t),25),r=fn(i=cr(t,this.getProjection()));else if(t.getType()===ae.CIRCLE){var i;(r=fn(i=cr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),Yt(i))}else{var o=sr();r=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(r,n)},e.prototype.fitInternal=function(t,e){var r=e||{},n=r.size;n||(n=this.getViewportSize_());var i,o=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0!==r.nearest&&r.nearest;i=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;for(var s=t.getFlatCoordinates(),u=this.getRotation(),l=Math.cos(-u),h=Math.sin(-u),c=1/0,p=1/0,f=-1/0,d=-1/0,_=t.getStride(),g=0,y=s.length;g<y;g+=_){var v=s[g]*l-s[g+1]*h,m=s[g]*h+s[g+1]*l;c=Math.min(c,v),p=Math.min(p,m),f=Math.max(f,v),d=Math.max(d,m)}var x=this.getResolutionForExtentInternal([c,p,f,d],[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);x=isNaN(x)?i:Math.max(x,i),x=this.getConstrainedResolution(x,a?0:1),h=-h;var w=(c+f)/2,S=(p+d)/2,E=[(w+=(o[1]-o[3])/2*x)*l-(S+=(o[0]-o[2])/2*x)*h,S*l+w*h],T=r.callback?r.callback:I;void 0!==r.duration?this.animateInternal({resolution:x,center:this.getConstrainedCenter(E,x),duration:r.duration,easing:r.easing},T):(this.targetResolution_=x,this.targetCenter_=E,this.applyTargetState_(!1,!0),Ki(T,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(lr(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){var n=this.getRotation(),i=Math.cos(-n),o=Math.sin(-n),a=t[0]*i-t[1]*o,s=t[1]*i+t[0]*o,u=this.getResolution(),l=(a+=(e[0]/2-r[0])*u)*i-(s+=(r[1]-e[1]/2)*u)*(o=-o),h=s*i+a*o;this.setCenterInternal([l,h])},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=ur(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var r=e&&lr(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,r);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=lr(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(lr(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,r),i=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,i,r),a=this.constraints_.center(this.targetCenter_,o,i,r);this.get(Ri)!==n&&this.set(Ri,n),this.get(Pi)!==o&&this.set(Pi,o),this.get(bi)&&Ni(this.get(bi),a)||this.set(bi,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,r){var n=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,i,a),u=this.constraints_.center(this.targetCenter_,s,a);if(0===n&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=u,void this.applyTargetState_();var l=r||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&Ni(this.getCenterInternal(),u)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:u,resolution:s,duration:n,easing:Vi,anchor:l}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Ci,1)},e.prototype.endInteraction=function(t,e,r){var n=r&&lr(r,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(Ci,-1),this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,n)},e}(rt);function Ji(t,e,r){var n=r&&r.length?r.shift():kn?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(n.width=t),e&&(n.height=e),n.getContext("2d")}function Qi(t){var e=t.offsetWidth,r=getComputedStyle(t);return e+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function $i(t){var e=t.offsetHeight,r=getComputedStyle(t);return e+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function to(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function eo(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function ro(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var no="opacity",io="visible",oo="extent",ao="zIndex",so="maxResolution",uo="minResolution",lo="maxZoom",ho="minZoom",co="source",po=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fo=function(t){function e(e){var r=t.call(this)||this,n=p({},e);return n[no]=void 0!==e.opacity?e.opacity:1,st("number"==typeof n[no],64),n[io]=void 0===e.visible||e.visible,n[ao]=e.zIndex,n[so]=void 0!==e.maxResolution?e.maxResolution:1/0,n[uo]=void 0!==e.minResolution?e.minResolution:0,n[ho]=void 0!==e.minZoom?e.minZoom:-1/0,n[lo]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==n.className?e.className:"ol-layer",delete n.className,r.setProperties(n),r.state_=null,r}return po(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=he(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r?r:!1===e.managed?1/0:0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return n()},e.prototype.getLayerStatesArray=function(t){return n()},e.prototype.getExtent=function(){return this.get(oo)},e.prototype.getMaxResolution=function(){return this.get(so)},e.prototype.getMinResolution=function(){return this.get(uo)},e.prototype.getMinZoom=function(){return this.get(ho)},e.prototype.getMaxZoom=function(){return this.get(lo)},e.prototype.getOpacity=function(){return this.get(no)},e.prototype.getSourceState=function(){return n()},e.prototype.getVisible=function(){return this.get(io)},e.prototype.getZIndex=function(){return this.get(ao)},e.prototype.setExtent=function(t){this.set(oo,t)},e.prototype.setMaxResolution=function(t){this.set(so,t)},e.prototype.setMinResolution=function(t){this.set(uo,t)},e.prototype.setMaxZoom=function(t){this.set(lo,t)},e.prototype.setMinZoom=function(t){this.set(ho,t)},e.prototype.setOpacity=function(t){st("number"==typeof t,64),this.set(no,t)},e.prototype.setVisible=function(t){this.set(io,t)},e.prototype.setZIndex=function(t){this.set(ao,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(rt),_o="undefined",go="loading",yo="ready",vo="error",mo=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xo="layers",wo=function(t){function e(e){var r=this,n=e||{},i=p({},n);delete i.layers;var o=n.layers;return(r=t.call(this,i)||this).layersListenerKeys_=[],r.listenerKeys_={},r.addEventListener(et(xo),r.handleLayersChanged_),o?Array.isArray(o)?o=new at(o.slice(),{unique:!0}):st("function"==typeof o.getArray,43):o=new at(void 0,{unique:!0}),r.setLayers(o),r}return mo(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(v),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(g(t,l,this.handleLayersAdd_,this),g(t,h,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(v);f(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n<i;n++){var a=r[n];this.listenerKeys_[o(a)]=[g(a,c,this.handleLayerChange_,this),g(a,N,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[o(e)]=[g(e,c,this.handleLayerChange_,this),g(e,N,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=o(t.element);this.listenerKeys_[e].forEach(v),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(xo)},e.prototype.setLayers=function(t){this.set(xo,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],r=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));for(var n=this.getLayerState(),i=r,o=e.length;i<o;i++){var a=e[i];a.opacity*=n.opacity,a.visible=a.visible&&n.visible,a.maxResolution=Math.min(a.maxResolution,n.maxResolution),a.minResolution=Math.max(a.minResolution,n.minResolution),a.minZoom=Math.max(a.minZoom,n.minZoom),a.maxZoom=Math.min(a.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==a.extent?a.extent=Zt(a.extent,n.extent):a.extent=n.extent)}return e},e.prototype.getSourceState=function(){return yo},e}(fo);function So(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function Eo(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function To(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Co=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var bo=function(t){function e(e){var r=t.call(this)||this,n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,n,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new wo({layers:t.layers});o[ti]=a,o[ri]=t.target,o[ni]=void 0!==t.view?t.view:new Hi,void 0!==t.controls&&(Array.isArray(t.controls)?r=new at(t.controls.slice()):(st("function"==typeof t.controls.getArray,47),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new at(t.interactions.slice()):(st("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new at(t.overlays.slice()):(st("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new at;return{controls:r,interactions:n,keyboardEventTarget:e,overlays:i,values:o}}(e);r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Dn,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=[1,0,0,1,0,0],r.pixelToCoordinateTransform_=[1,0,0,1,0,0],r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=new Hn(r,e.moveTolerance);var i=r.handleMapBrowserEvent.bind(r);for(var o in Bn)r.mapBrowserEventHandler_.addEventListener(Bn[o],i);r.keyboardEventTarget_=n.keyboardEventTarget,r.keyHandlerKeys_=null;var a=r.handleBrowserEvent.bind(r);return r.viewport_.addEventListener(j,a,!1),r.viewport_.addEventListener(K,a,!!zn&&{passive:!1}),r.controls=n.controls||new at,r.interactions=n.interactions||new at,r.overlays_=n.overlays,r.overlayIdIndex_={},r.renderer_=null,r.handleResize_,r.postRenderFunctions_=[],r.tileQueue_=new gi(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addEventListener(et(ti),r.handleLayerGroupChanged_),r.addEventListener(et(ni),r.handleViewChanged_),r.addEventListener(et(ei),r.handleSizeChanged_),r.addEventListener(et(ri),r.handleTargetChanged_),r.setProperties(n.values),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.controls.addEventListener(l,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(h,function(t){t.element.setMap(null)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.addEventListener(l,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(h,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r.overlays_.addEventListener(l,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(h,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(r)),r}return Co(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),this.viewport_.removeEventListener(j,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(K,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(W,this.handleResize_,!1),this.handleResize_=void 0),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,r){if(this.frameState_){var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance*this.frameState_.pixelRatio:0,o=void 0!==r.layerFilter?r.layerFilter:R,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,(function(t){r.push(t)}),e),r},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance*this.frameState_.pixelRatio:0,o=n.layerFilter||R;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:R,i=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(ri)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return ur(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?gr(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(ti)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer.getSource();if(n&&n.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=lr(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?gr(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ei)},e.prototype.getView=function(){return this.get(ni)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,r,n){return function(t,e,r,n,i){if(!(t&&r in t.wantedTiles))return 1/0;if(!t.wantedTiles[r][e.getKey()])return 1/0;var o=t.viewState.center,a=n[0]-o[0],s=n[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}(this.frameState_,t,e,r,n)},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,n=new Mn(r,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent.target;if(t.dragging||!this.overlayContainerStopEvent_.contains(e)&&(document.body.contains(e)||this.viewport_.getRootNode&&this.viewport_.getRootNode().contains(e))){t.frameState=this.frameState_;var r=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var n=r.length-1;n>=0;n--){var i=r[n];if(i.getActive())if(!i.handleEvent(t))break}}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[Ti]||i[Ci]){var o=!Un&&Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,n))}!t||!this.hasListener(ui)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(ui,t);for(var a=this.postRenderFunctions_,s=0,u=a.length;s<u;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var e=0,r=this.keyHandlerKeys_.length;e<r;++e)v(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer());var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[g(n,Y,this.handleBrowserEvent,this),g(n,V,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(W,this.handleResize_,!1))}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),eo(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(W,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(v(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(v(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=g(t,c,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=g(t,N,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(v),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[g(t,c,this.render,this),g(t,N,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this.getSize(),r=this.getView(),n=this.frameState_,i=null;if(void 0!==e&&function(t){return t[0]>0&&t[1]>0}(e)&&r&&r.isDef()){var o=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterItems:n?n.declutterItems:[],extent:Xt(a.center,a.resolution,a.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{}}}if(this.frameState_=i,this.renderer_.renderFrame(i),i){if(i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),n)(!this.previousExtent_||!Qt(this.previousExtent_)&&!Mt(i.extent,this.previousExtent_))&&(this.dispatchEvent(new Ln(Qn,this,n)),this.previousExtent_=It(this.previousExtent_));this.previousExtent_&&!i.viewHints[Ti]&&!i.viewHints[Ci]&&!Mt(i.extent,this.previousExtent_)&&(this.dispatchEvent(new Ln($n,this,i)),St(i.extent,this.previousExtent_))}this.dispatchEvent(new Ln(Jn,this,i)),this.postRenderTimeoutHandle_=setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(ti,t)},e.prototype.setSize=function(t){this.set(ei,t)},e.prototype.setTarget=function(t){this.set(ri,t)},e.prototype.setView=function(t){this.set(ni,t)},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0);this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(rt),Po=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ro=function(t){function e(e){var r=t.call(this)||this;return r.element=e.element?e.element:null,r.target_=null,r.map_=null,r.listenerKeys=[],r.render_=e.render?e.render:I,e.target&&r.setTarget(e.target),r}return Po(e,t),e.prototype.disposeInternal=function(){eo(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&eo(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)v(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==I&&this.listenerKeys.push(g(t,Jn,this.render,this)),t.render())},e.prototype.render=function(t){this.render_.call(this,t)},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(rt),Oo=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"),Io=["style","variant","weight","size","lineHeight","family"],Lo=function(t){var e=t.match(Oo);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,i=Io.length;n<i;++n){var o=e[n+1];void 0!==o&&(r[Io[n]]=o)}return r.families=r.family.split(/,\s?/),r},Fo=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Mo(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var Ao=function(t){function e(e){var r=this,n=p({},e);delete n.source,(r=t.call(this,n)||this).mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addEventListener(et(co),r.handleSourcePropertyChange_);var i=e.source?e.source:null;return r.setSource(i),r}return Fo(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(co)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():_o},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(v(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=g(t,N,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_.getFeatures(t)},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return r.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(v(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(v(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=g(t,ai,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);st(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=g(this,N,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(co,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.setSource(null),t.prototype.disposeInternal.call(this)},e}(fo),No=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Go(t){this.updateElement_(t.frameState)}var jo=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render||Go,target:n.target})||this).ulElement_=document.createElement("ul"),r.collapsed_=void 0===n.collapsed||n.collapsed,r.overrideCollapsible_=void 0!==n.collapsible,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1);var i=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",a=void 0!==n.collapseLabel?n.collapseLabel:"»";"string"==typeof a?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=a):r.collapseLabel_=a;var s=void 0!==n.label?n.label:"i";"string"==typeof s?(r.label_=document.createElement("span"),r.label_.textContent=s):r.label_=s;var u=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,l=document.createElement("button");l.setAttribute("type","button"),l.title=o,l.appendChild(u),l.addEventListener(D,r.handleClick_.bind(r),!1);var h=i+" ol-unselectable ol-control"+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),c=r.element;return c.className=h,c.appendChild(r.ulElement_),c.appendChild(l),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return No(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],n=t.layerStatesArray,i=0,o=n.length;i<o;++i){var a=n[i];if(Mo(a,t.viewState)){var s=a.layer.getSource();if(s){var u=s.getAttributions();if(u){var l=u(t);if(l)if(this.overrideCollapsible_||!1!==s.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(l))for(var h=0,c=l.length;h<c;++h)l[h]in e||(r.push(l[h]),e[l[h]]=!0);else l in e||(r.push(l),e[l]=!0)}}}}return r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!b(e,this.renderedAttributions_)){ro(this.ulElement_);for(var n=0,i=e.length;n<i;++n){var o=document.createElement("li");o.innerHTML=e[n],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?to(this.collapseLabel_,this.label_):to(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e}(Ro),Do=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ko(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains("ol-hidden");i||0!==r?i&&0!==r&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=n}this.rotation_=r}}var Uo=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),render:n.render||ko,target:n.target})||this;var i=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧";r.label_=null,"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className="ol-compass",r.label_.textContent=o):(r.label_=o,r.label_.classList.add("ol-compass"));var a=n.tipLabel?n.tipLabel:"Reset rotation",s=document.createElement("button");s.className=i+"-reset",s.setAttribute("type","button"),s.title=a,s.appendChild(r.label_),s.addEventListener(D,r.handleClick_.bind(r),!1);var u=i+" ol-unselectable ol-control",l=r.element;return l.className=u,l.appendChild(s),r.callResetNorth_=n.resetNorth?n.resetNorth:void 0,r.duration_=void 0!==n.duration?n.duration:250,r.autoHide_=void 0===n.autoHide||n.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add("ol-hidden"),r}return Do(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:Vi}):t.setRotation(0))}},e}(Ro),zo=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bo=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),target:n.target})||this;var i=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,a=void 0!==n.zoomInLabel?n.zoomInLabel:"+",s=void 0!==n.zoomOutLabel?n.zoomOutLabel:"−",u=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",l=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=i+"-in",h.setAttribute("type","button"),h.title=u,h.appendChild("string"==typeof a?document.createTextNode(a):a),h.addEventListener(D,r.handleClick_.bind(r,o),!1);var c=document.createElement("button");c.className=i+"-out",c.setAttribute("type","button"),c.title=l,c.appendChild("string"==typeof s?document.createTextNode(s):s),c.addEventListener(D,r.handleClick_.bind(r,-o),!1);var p=i+" ol-unselectable ol-control",f=r.element;return f.className=p,f.appendChild(h),f.appendChild(c),r.duration_=void 0!==n.duration?n.duration:250,r}return zo(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getZoom();if(void 0!==r){var n=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:Vi})):e.setZoom(n)}}},e}(Ro);function Yo(t){var e=t||{},r=new at;return(void 0===e.zoom||e.zoom)&&r.push(new Bo(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new Uo(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new jo(e.attributionOptions)),r}var Vo="active",Xo=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Wo(t,e,r,n){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:Vi})}}var Zo=function(t){function e(e){var r=t.call(this)||this;return e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return Xo(e,t),e.prototype.getActive=function(){return this.get(Vo)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Vo,t)},e.prototype.setMap=function(t){this.map_=t},e}(rt),Ko=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function qo(t){var e=!1;if(t.type==Bn.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;Wo(n.getView(),o,i,this.duration_),t.preventDefault(),e=!0}return!e}var Ho=function(t){function e(e){var r=t.call(this,{handleEvent:qo})||this,n=e||{};return r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:250,r}return Ko(e,t),e}(Zo),Jo=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Qo=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},$o=function(t){return t.target.getTargetElement()===document.activeElement},ta=R,ea=function(t){var e=t.originalEvent;return 0==e.button&&!(Gn&&jn&&e.ctrlKey)},ra=O,na=function(t){return t.type==Bn.SINGLECLICK},ia=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},oa=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},aa=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},sa=function(t){var e=t.pointerEvent;return st(void 0!==e,56),"mouse"==e.pointerType},ua=function(t){var e=t.pointerEvent;return st(void 0!==e,56),e.isPrimary&&0===e.button},la=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ha(t){for(var e=t.length,r=0,n=0,i=0;i<e;i++)r+=t[i].clientX,n+=t[i].clientY;return[r/e,n/e]}var ca=function(t){function e(e){var r=this,n=e||{};return r=t.call(this,n)||this,n.handleDownEvent&&(r.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(r.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(r.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(r.handleUpEvent=n.handleUpEvent),n.stopDown&&(r.stopDown=n.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return la(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.pointerEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Bn.POINTERDRAG)this.handleDragEvent(t);else if(t.type==Bn.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==Bn.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Bn.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Bn.POINTERDOWN||e===Bn.POINTERDRAG||e===Bn.POINTERUP}(t)){var e=t.pointerEvent,r=e.pointerId.toString();t.type==Bn.POINTERUP?delete this.trackedPointers_[r]:(t.type==Bn.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=d(this.trackedPointers_)}},e}(Zo),pa=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function fa(t){return ia(t)&&ua(t)}var da=function(t){function e(e){var r=t.call(this,{stopDown:O})||this,n=e||{};return r.kinetic_=n.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1,r.condition_=n.condition?n.condition:fa,r.noKinetic_=!1,r}return pa(e,t),e.prototype.conditionInternal_=function(t){var e=!0;return t.map.getTargetElement().hasAttribute("tabindex")&&(e=$o(t)),e&&this.condition_(t)},e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=ha(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var n=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],i=t.map.getView();ji(n,i.getResolution()),Gi(n,i.getRotation()),i.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=r.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(i),a[1]-n*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(s),duration:500,easing:Vi})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.conditionInternal_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(ca),_a=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ga=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:O})||this).condition_=n.condition?n.condition:Qo,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return _a(e,t),e.prototype.handleDragEvent=function(t){if(sa(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==Si){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;r.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!sa(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!sa(t)&&(!(!ea(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(ca),ya=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),va=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return ya(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r=this.element_.style;r.left=Math.min(t[0],e[0])+"px",r.top=Math.min(t[1],e[1])+"px",r.width=Math.abs(e[0]-t[0])+"px",r.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new cn([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(m),ma=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xa="boxstart",wa="boxdrag",Sa="boxend",Ea=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return ma(e,t),e}(F),Ta=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.box_=new va(n.className||"ol-dragbox"),r.minArea_=void 0!==n.minArea?n.minArea:64,r.onBoxEnd_=n.onBoxEnd?n.onBoxEnd:I,r.startPixel_=null,r.condition_=n.condition?n.condition:ea,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return ma(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ea(wa,t.coordinate,t))},e.prototype.handleUpEvent=function(t){return this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new Ea(Sa,t.coordinate,t))),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ea(xa,t.coordinate,t)),!0)},e}(ca),Ca=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ba(){var t,e,r=this.getMap(),n=r.getView(),i=r.getSize(),o=this.getGeometry().getExtent();if(this.out_){var a=n.calculateExtentInternal(i),s=(t=[r.getPixelFromCoordinateInternal(zt(o)),r.getPixelFromCoordinateInternal(qt(o))],Gt(It(e),t));$t(a,1/n.getResolutionForExtentInternal(s,i)),o=a}var u=n.getConstrainedResolution(n.getResolutionForExtentInternal(o,i)),l=n.getConstrainedCenter(Yt(o),u);n.animateInternal({resolution:u,center:l,duration:this.duration_,easing:Vi})}var Pa=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:oa;return(r=t.call(this,{condition:i,className:n.className||"ol-dragzoom",minArea:n.minArea,onBoxEnd:ba})||this).duration_=void 0!==n.duration?n.duration:200,r.out_=void 0!==n.out&&n.out,r}return Ca(e,t),e}(Ta),Ra=37,Oa=38,Ia=39,La=40,Fa=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ma(t){var e=!1;if(t.type==Y){var r=t.originalEvent.keyCode;if(this.condition_(t)&&(r==La||r==Ra||r==Ia||r==Oa)){var n=t.map.getView(),i=n.getResolution()*this.pixelDelta_,o=0,a=0;r==La?a=-i:r==Ra?o=-i:r==Ia?o=i:a=i;var s=[o,a];Gi(s,n.getRotation()),function(t,e,r){var n=t.getCenterInternal();if(n){var i=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:Wi,center:t.getConstrainedCenter(i)})}}(n,s,this.duration_),t.preventDefault(),e=!0}}return!e}var Aa=function(t){function e(e){var r=t.call(this,{handleEvent:Ma})||this,n=e||{};return r.defaultCondition_=function(t){return ia(t)&&aa(t)},r.condition_=void 0!==n.condition?n.condition:r.defaultCondition_,r.duration_=void 0!==n.duration?n.duration:100,r.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,r}return Fa(e,t),e}(Zo),Na=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ga(t){var e=!1;if(t.type==Y||t.type==V){var r=t.originalEvent.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var n=t.map,i=r=="+".charCodeAt(0)?this.delta_:-this.delta_;Wo(n.getView(),i,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}var ja=function(t){function e(e){var r=t.call(this,{handleEvent:Ga})||this,n=e||{};return r.condition_=n.condition?n.condition:aa,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Na(e,t),e}(Zo),Da=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ka="trackpad",Ua="wheel",za=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,r.duration_=void 0!==n.duration?n.duration:250,r.timeout_=void 0!==n.timeout?n.timeout:80,r.useAnchor_=void 0===n.useAnchor||n.useAnchor,r.condition_=n.condition?n.condition:ta,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return Da(e,t),e.prototype.conditionInternal_=function(t){var e=!0;return t.map.getTargetElement().hasAttribute("tabindex")&&(e=$o(t)),e&&this.condition_(t)},e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.conditionInternal_(t))return!0;if(t.type!==K)return!0;t.preventDefault();var e,r=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==K&&(e=n.deltaY,Nn&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Dn),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?ka:Ua);var o=r.getView();if(this.mode_===ka&&!o.getConstrainResolution())return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-he(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;e.getConstrainResolution()&&(r=r?r>0?1:-1:0),Wo(e,r,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Zo),Ba=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ya=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=O),(r=t.call(this,i)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==n.threshold?n.threshold:.3,r.duration_=void 0!==n.duration?n.duration:250,r}return Ba(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Si){var u=a.getViewport().getBoundingClientRect(),l=ha(this.targetPointers);l[0]-=u.left,l[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(l),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(ca),Va=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xa=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=O),(r=t.call(this,i)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Va(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,u=s.getView();1!=e&&(this.lastScaleDelta_=e);var l=s.getViewport().getBoundingClientRect(),h=ha(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),u.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(ca);function Wa(t){var e=t||{},r=new at,n=new On(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new ga),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new Ho({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new da({condition:e.onFocusOnly?$o:void 0,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Ya),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new Xa({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new Aa),r.push(new ja({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new za({condition:e.onFocusOnly?$o:void 0,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new Pa({duration:e.zoomDuration})),r}var Za=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ka=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=n,o.context=i,o}return Za(e,t),e}(F),qa=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Ha=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ja(t){return"string"==typeof t?t:is(t)}function Qa(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var $a,ts,es=($a={},ts=0,function(t){var e;if($a.hasOwnProperty(t))e=$a[t];else{if(ts>=1024){var r=0;for(var n in $a)0==(3&r++)&&(delete $a[n],--ts)}e=function(t){var e,r,n,i,o;if(Ha.exec(t)&&(t=Qa(t)),qa.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var u=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),r=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),i=u?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,r=(r<<4)+r,n=(n<<4)+n,u&&(i=(i<<4)+i)),o=[e,r,n,i/255]}else 0==t.indexOf("rgba(")?ns(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),ns(o)):st(!1,14);return o}(t),$a[t]=e,++ts}return e});function rs(t){return Array.isArray(t)?t:es(t)}function ns(t){return t[0]=he(t[0]+.5|0,0,255),t[1]=he(t[1]+.5|0,0,255),t[2]=he(t[2]+.5|0,0,255),t[3]=he(t[3],0,1),t}function is(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:t[3])+")"}var os=function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=as(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=as(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function as(t,e,r){return e+":"+t+":"+(r?Ja(r):"null")}var ss=new os;function us(t){return Array.isArray(t)?is(t):t}var ls=function(){function t(){}return t.prototype.drawCustom=function(t,e,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),hs=[],cs=[0,0,0,0],ps=new rt,fs=new A;fs.setSize=function(){console.warn("labelCache is deprecated.")};var ds,_s,gs,ys=null,vs={},ms=function(){var t,e,r=["monospace","serif"],n=r.length,i="wmytzilWMYTZIL@#/&?$%10";function o(t,o,a){for(var s=!0,u=0;u<n;++u){var l=r[u];if(e=Ss(t+" "+o+" 32px "+l,i),a!=l){var h=Ss(t+" "+o+" 32px "+a+","+l,i);s=s&&h!=e}}return!!s}function a(){for(var e=!0,r=ps.getKeys(),n=0,i=r.length;n<i;++n){var a=r[n];ps.get(a)<100&&(o.apply(this,a.split("\n"))?(f(vs),ys=null,ds=void 0,ps.set(a,100)):(ps.set(a,ps.get(a)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var r=Lo(e);if(r)for(var n=r.families,i=0,s=n.length;i<s;++i){var u=n[i],l=r.style+"\n"+r.weight+"\n"+u;void 0===ps.get(l)&&(ps.set(l,100,!0),o(r.style,r.weight,u)||(ps.set(l,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),xs=(gs=vs,function(t){var e=gs[t];if(null==e)if(kn){var r=Lo(t),n=ws(t,"Žg"),i=isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight);vs[t]=i*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else _s||((_s=document.createElement("div")).innerHTML="M",_s.style.margin="0 !important",_s.style.padding="0 !important",_s.style.position="absolute !important",_s.style.left="-99999px !important"),_s.style.font=t,document.body.appendChild(_s),e=_s.offsetHeight,gs[t]=e,document.body.removeChild(_s);return e});function ws(t,e){return ys||(ys=Ji(1,1)),t!=ds&&(ys.font=t,ds=ys.font),ys.measureText(e)}function Ss(t,e){return ws(t,e).width}function Es(t,e,r){if(e in r)return r[e];var n=Ss(t,e);return r[e]=n,n}function Ts(t,e,r,n){0!==e&&(t.translate(r,n),t.rotate(e),t.translate(-r,-n))}function Cs(t,e,r,n,i,o,a,s,u,l,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(u,l),t.scale(h,h),function(t,e){for(var r=t.contextInstructions,n=0,i=r.length;n<i;n+=2)Array.isArray(r[n+1])?e[r[n]].apply(e,r[n+1]):e[r[n]]=r[n+1]}(n,t)):t.drawImage(n,i,o,a,s,u,l,a*h,s*h),t.restore()}var bs=null;function Ps(t){return kn?xr(t):(bs||(bs=Ji(1,1).canvas),bs.style.transform=xr(t),bs.style.transform)}var Rs=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Os=function(t){function e(e,r,n,i,o,a,s){var u=t.call(this)||this;return u.context_=e,u.pixelRatio_=r,u.extent_=n,u.transform_=i,u.viewRotation_=o,u.squaredTolerance_=a,u.userTransform_=s,u.contextFillState_=null,u.contextStrokeState_=null,u.contextTextState_=null,u.fillState_=null,u.strokeState_=null,u.image_=null,u.imageAnchorX_=0,u.imageAnchorY_=0,u.imageHeight_=0,u.imageOpacity_=0,u.imageOriginX_=0,u.imageOriginY_=0,u.imageRotateWithView_=!1,u.imageRotation_=0,u.imageScale_=0,u.imageWidth_=0,u.text_="",u.textOffsetX_=0,u.textOffsetY_=0,u.textRotateWithView_=!1,u.textRotation_=0,u.textScale_=0,u.textFillState_=null,u.textStrokeState_=null,u.textState_=null,u.pixelCoordinates_=[],u.tmpLocalTransform_=[1,0,0,1,0,0],u}return Rs(e,t),e.prototype.drawImages_=function(t,e,r,n){if(this.image_){var i=se(t,e,r,2,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var l=0,h=i.length;l<h;l+=2){var c=i[l]-this.imageAnchorX_,p=i[l+1]-this.imageAnchorY_;if(0!==u||1!=this.imageScale_){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;vr(a,f,d,this.imageScale_,this.imageScale_,u,-f,-d),o.setTransform.apply(o,a)}o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}0===u&&1==this.imageScale_||o.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,r,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=se(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<r;e+=n){var s=i[e]+this.textOffsetX_,u=i[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_){var l=vr(this.tmpLocalTransform_,s,u,this.textScale_,this.textScale_,a,-s,-u);o.setTransform.apply(o,l)}this.textStrokeState_&&o.strokeText(this.text_,s,u),this.textFillState_&&o.fillText(this.text_,s,u)}0===a&&1==this.textScale_||o.setTransform(1,0,0,1,0,0)}},e.prototype.moveToLineTo_=function(t,e,r,n,i){var o=this.context_,a=se(t,e,r,n,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;i&&(s-=2);for(var u=2;u<s;u+=2)o.lineTo(a[u],a[u+1]);return i&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,n){for(var i=0,o=r.length;i<o;++i)e=this.moveToLineTo_(t,e,r[i],n,!0);return e},e.prototype.drawCircle=function(t){if(Jt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,r){var n=t.getFlatCoordinates();if(n){var i=t.getStride();return se(n,0,n.length,i,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],n=e[3]-e[1],i=Math.sqrt(r*r+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case ae.POINT:this.drawPoint(t);break;case ae.LINE_STRING:this.drawLineString(t);break;case ae.POLYGON:this.drawPolygon(t);break;case ae.MULTI_POINT:this.drawMultiPoint(t);break;case ae.MULTI_LINE_STRING:this.drawMultiLineString(t);break;case ae.MULTI_POLYGON:this.drawMultiPolygon(t);break;case ae.GEOMETRY_COLLECTION:this.drawGeometryCollection(t);break;case ae.CIRCLE:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&Jt(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,n=e.length;r<n;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Jt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Jt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,n=t.getFlatCoordinates(),i=0,o=t.getEnds(),a=t.getStride();r.beginPath();for(var s=0,u=o.length;s<u;++s)i=this.moveToLineTo_(n,i,o[s],a,!1);r.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Jt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Jt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getOrientedFlatCoordinates(),n=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=i.length;a<s;++a){var u=i[a];n=this.drawRings_(r,n,u,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(b(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,n=t.textAlign?t.textAlign:"center";r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=n&&(r.textAlign=n,e.textAlign=n),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var r=t.getColor();this.fillState_={fillStyle:us(r||"#000")}}else this.fillState_=null;if(e){var n=e.getColor(),i=e.getLineCap(),o=e.getLineDash(),a=e.getLineDashOffset(),s=e.getLineJoin(),u=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==i?i:"round",lineDash:o||hs,lineDashOffset:a||0,lineJoin:void 0!==s?s:"round",lineWidth:this.pixelRatio_*(void 0!==u?u:1),miterLimit:void 0!==l?l:10,strokeStyle:us(n||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),r=t.getImage(1),n=t.getOrigin(),i=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=i[1],this.image_=r,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageWidth_=i[0]}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:us(r||"#000")}}else this.textFillState_=null;var n=t.getStroke();if(n){var i=n.getColor(),o=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),u=n.getLineJoin(),l=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:a||hs,lineDashOffset:s||0,lineJoin:void 0!==u?u:"round",lineWidth:void 0!==l?l:1,miterLimit:void 0!==h?h:10,strokeStyle:us(i||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),_=t.getRotation(),g=t.getScale(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==y?y:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==_?_:0,this.textScale_=this.pixelRatio_*(void 0!==g?g:1)}else this.text_=""},e}(ls),Is=0,Ls=1,Fs=2,Ms=3,As=4,Ns="Circle",Gs="Default",js="Image",Ds="LineString",ks="Polygon",Us="Text",zs={Point:function(t,e,r,n){var i=r.getImage();if(i){if(i.getImageState()!=Fs)return;var o=t.getBuilder(r.getZIndex(),js);o.setImageStyle(i,t.addDeclutter(!1)),o.drawPoint(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Us);s.setTextStyle(a,t.addDeclutter(!!i)),s.drawText(e,n)}},LineString:function(t,e,r,n){var i=r.getStroke();if(i){var o=t.getBuilder(r.getZIndex(),Ds);o.setFillStrokeStyle(null,i),o.drawLineString(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Us);s.setTextStyle(a,t.addDeclutter(!1)),s.drawText(e,n)}},Polygon:function(t,e,r,n){var i=r.getFill(),o=r.getStroke();if(i||o){var a=t.getBuilder(r.getZIndex(),ks);a.setFillStrokeStyle(i,o),a.drawPolygon(e,n)}var s=r.getText();if(s){var u=t.getBuilder(r.getZIndex(),Us);u.setTextStyle(s,t.addDeclutter(!1)),u.drawText(e,n)}},MultiPoint:function(t,e,r,n){var i=r.getImage();if(i){if(i.getImageState()!=Fs)return;var o=t.getBuilder(r.getZIndex(),js);o.setImageStyle(i,t.addDeclutter(!1)),o.drawMultiPoint(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Us);s.setTextStyle(a,t.addDeclutter(!!i)),s.drawText(e,n)}},MultiLineString:function(t,e,r,n){var i=r.getStroke();if(i){var o=t.getBuilder(r.getZIndex(),Ds);o.setFillStrokeStyle(null,i),o.drawMultiLineString(e,n)}var a=r.getText();if(a){var s=t.getBuilder(r.getZIndex(),Us);s.setTextStyle(a,t.addDeclutter(!1)),s.drawText(e,n)}},MultiPolygon:function(t,e,r,n){var i=r.getFill(),o=r.getStroke();if(o||i){var a=t.getBuilder(r.getZIndex(),ks);a.setFillStrokeStyle(i,o),a.drawMultiPolygon(e,n)}var s=r.getText();if(s){var u=t.getBuilder(r.getZIndex(),Us);u.setTextStyle(s,t.addDeclutter(!1)),u.drawText(e,n)}},GeometryCollection:function(t,e,r,n){var i,o,a=e.getGeometriesArray();for(i=0,o=a.length;i<o;++i){(0,zs[a[i].getType()])(t,a[i],r,n)}},Circle:function(t,e,r,n){var i=r.getFill(),o=r.getStroke();if(i||o){var a=t.getBuilder(r.getZIndex(),Ns);a.setFillStrokeStyle(i,o),a.drawCircle(e,n)}var s=r.getText();if(s){var u=t.getBuilder(r.getZIndex(),Us);u.setTextStyle(s,t.addDeclutter(!1)),u.drawText(e,n)}}};function Bs(t,e){return parseInt(o(t),10)-parseInt(o(e),10)}function Ys(t,e){var r=Vs(t,e);return r*r}function Vs(t,e){return.5*t/e}function Xs(t,e,r,n,i,o){var a=!1,s=r.getImage();if(s){var u=s.getImageState();u==Fs||u==Ms?s.unlistenImageChange(i):(u==Is&&s.load(),u=s.getImageState(),s.listenImageChange(i),a=!0)}return function(t,e,r,n,i){var o=r.getGeometryFunction()(e);if(!o)return;var a=o.simplifyTransformed(n,i);if(r.getRenderer())!function t(e,r,n,i){if(r.getType()==ae.GEOMETRY_COLLECTION){for(var o=r.getGeometries(),a=0,s=o.length;a<s;++a)t(e,o[a],n,i);return}e.getBuilder(n.getZIndex(),Gs).drawCustom(r,i,n.getRenderer())}(t,a,r,e);else{(0,zs[a.getType()])(t,a,r,e)}}(t,e,r,n,o),a}function Ws(t){var e,r=t.frameState,n=dr(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),i=Ys(r.viewState.resolution,r.pixelRatio),o=sr();return o&&(e=$e(o,r.viewState.projection)),new Os(t.context,r.pixelRatio,r.extent,n,r.viewState.rotation,i,e)}function Zs(t,e){e&&e.clear();for(var r=t.declutterItems,n=r.length-1;n>=0;--n)for(var i=r[n],o=i.items,a=0,s=o.length;a<s;a+=3)e=o[a].renderDeclutter(o[a+1],o[a+2],i.opacity,e);return r.length=0,e}var Ks=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function qs(t,e){ss.expire()}var Hs=function(t){function e(e){var r=t.call(this)||this;return r.map_=e,r.declutterTree_=null,r}return Ks(e,t),e.prototype.dispatchRenderEvent=function(t,e){n()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;vr(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),mr(n,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a,s){var u,l=e.viewState;function h(t,e,r){return i.call(o,e,t?r:null)}var c=l.projection,p=Bi(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=Ht(c.getExtent());f.push([-d,0],[d,0])}var _,g=e.layerStatesArray,y=g.length;this.declutterTree_&&(_=this.declutterTree_.all().map((function(t){return t.value})));for(var v=[],m=0;m<f.length;m++)for(var x=y-1;x>=0;--x){var w=g[x],S=w.layer;if(S.hasRenderer()&&Mo(w,l)&&a.call(s,S)){var E=S.getRenderer(),T=S.getSource();if(E&&T){var C=T.getWrapX()?p:t,b=h.bind(null,w.managed);v[0]=C[0]+f[m][0],v[1]=C[1]+f[m][1],u=E.forEachFeatureAtCoordinate(v,e,r,b,_)}if(u)return u}}},e.prototype.forEachLayerAtPixel=function(t,e,r,i,o){return n()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,R,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){this.declutterTree_=Zs(t,this.declutterTree_)},e.prototype.scheduleExpireIconCache=function(t){ss.canExpireCache()&&t.postRenderFunctions.push(qs)},e}(m),Js=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qs=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=g(ps,c,e.redrawText.bind(e)),r.element_=document.createElement("div");var n=r.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",r.element_.className="ol-unselectable ol-layers";var i=e.getViewport();return i.insertBefore(r.element_,i.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return Js(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new Ka(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){v(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(e){if(e){this.calculateMatrices2D(e),this.dispatchRenderEvent(ai,e);var r=e.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=e.viewState;this.children_.length=0;for(var i=null,o=0,a=r.length;o<a;++o){var s=r[o];if(e.layerIndex=o,Mo(s,n)&&(s.sourceState==yo||s.sourceState==_o)){var u=s.layer.render(e,i);u&&u!==i&&(this.children_.push(u),i=u)}}t.prototype.renderFrame.call(this,e),function(t,e){for(var r=t.childNodes,n=0;;++n){var i=r[n],o=e[n];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(si,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var u=a[s],l=u.layer;if(l.hasRenderer()&&Mo(u,o)&&i(l)){var h=l.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(l,h);if(c)return c}}}},e}(Hs),$s=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tu=function(t){function e(e){return(e=p({},e)).controls||(e.controls=Yo()),e.interactions||(e.interactions=Wa()),t.call(this,e)||this}return $s(e,t),e.prototype.createRenderer=function(){return new Qs(this)},e}(bo),eu="bottom-left",ru="bottom-center",nu="bottom-right",iu="center-left",ou="center-center",au="center-right",su="top-left",uu="top-center",lu="top-right",hu=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cu="element",pu="map",fu="offset",du="position",_u="positioning",gu=function(t){function e(e){var r=t.call(this)||this;r.options=e,r.id=e.id,r.insertFirst=void 0===e.insertFirst||e.insertFirst,r.stopEvent=void 0===e.stopEvent||e.stopEvent,r.element=document.createElement("div"),r.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",r.element.style.position="absolute";var n=e.autoPan;return n&&"object"!=typeof n&&(n={animation:e.autoPanAnimation,margin:e.autoPanMargin}),r.autoPan=n||!1,r.rendered={transform_:"",visible:!0},r.mapPostrenderListenerKey=null,r.addEventListener(et(cu),r.handleElementChanged),r.addEventListener(et(pu),r.handleMapChanged),r.addEventListener(et(fu),r.handleOffsetChanged),r.addEventListener(et(du),r.handlePositionChanged),r.addEventListener(et(_u),r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(void 0!==e.positioning?e.positioning:su),void 0!==e.position&&r.setPosition(e.position),r}return hu(e,t),e.prototype.getElement=function(){return this.get(cu)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(pu)},e.prototype.getOffset=function(){return this.get(fu)},e.prototype.getPosition=function(){return this.get(du)},e.prototype.getPositioning=function(){return this.get(_u)},e.prototype.handleElementChanged=function(){ro(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(eo(this.element),v(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=g(t,Jn,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(cu,t)},e.prototype.setMap=function(t){this.set(pu,t)},e.prototype.setOffset=function(t){this.set(fu,t)},e.prototype.setPosition=function(t){this.set(du,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(du)){var r=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),i=this.getRect(n,[Qi(n),$i(n)]),o=void 0===t.margin?20:t.margin;if(!Ct(r,i)){var a=i[0]-r[0],s=r[2]-i[2],u=i[1]-r[1],l=r[3]-i[3],h=[0,0];if(a<0?h[0]=a-o:s<0&&(h[0]=Math.abs(s)+o),u<0?h[1]=u-o:l<0&&(h[1]=Math.abs(l)+o),0!==h[0]||0!==h[1]){var c=e.getView().getCenterInternal(),p=e.getPixelFromCoordinateInternal(c),f=[p[0]+h[0],p[1]+h[1]],d=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(f),duration:d.duration,easing:d.easing})}}}},e.prototype.getRect=function(t,e){var r=t.getBoundingClientRect(),n=r.left+window.pageXOffset,i=r.top+window.pageYOffset;return[n,i,n+e[0],i+e[1]]},e.prototype.setPositioning=function(t){this.set(_u,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var r=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(r,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var r=this.element.style,n=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+n[0])+"px",a=Math.round(t[1]+n[1])+"px",s="0%",u="0%";i==nu||i==au||i==lu?s="-100%":i!=ru&&i!=ou&&i!=uu||(s="-50%"),i==eu||i==ru||i==nu?u="-100%":i!=iu&&i!=ou&&i!=au||(u="-50%");var l="translate("+s+", "+u+") translate("+o+", "+a+")";this.rendered.transform_!=l&&(this.rendered.transform_=l,r.transform=l,r.msTransform=l)},e.prototype.getOptions=function(){return this.options},e}(rt),yu="arraybuffer",vu="json",mu="text",xu="xml",wu=!1;function Su(t,e,r,n){return function(i,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,a):t,!0),e.getType()==yu&&(s.responseType="arraybuffer"),s.withCredentials=wu,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),u=void 0;o==vu||o==mu?u=s.responseText:o==xu?(u=s.responseXML)||(u=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==yu&&(u=s.response),u?r.call(this,e.readFeatures(u,{extent:i,featureProjection:a}),e.readProjection(u)):n.call(this)}else n.call(this)}.bind(this),s.onerror=function(){n.call(this)}.bind(this),s.send()}}function Eu(t,e){return Su(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),I)}function Tu(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Cu=function(){function t(t,e,r,n){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function bu(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new Cu(t,e,r,n)}var Pu=Cu;function Ru(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function Ou(t,e,r){return t+"/"+e+"/"+r}function Iu(t){return Ou(t[0],t[1],t[2])}function Lu(t){return t.split("/").map(Number)}function Fu(t){return(t[1]<<t[0])+t[2]}var Mu=[0,0,0],Au=function(){function t(t){var e,r,n,i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,st((e=this.resolutions_,r=!0,n=function(t,e){return e-t}||x,e.every((function(t,i){if(0===i)return!0;var o=n(e[i-1],t);return!(o>0||r&&0===o)}))),17),!t.origins)for(var o=0,a=this.resolutions_.length-1;o<a;++o)if(i){if(this.resolutions_[o]/this.resolutions_[o+1]!==i){i=void 0;break}}else i=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,st(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Kt(s)),st(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,st(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,st(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){return new Pu(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var a=n.minY,s=n.maxY;a<=s;++a)r([e,i,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?bu(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(a,s,r)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return bu(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=To(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*o[0]*i,s=n[0]+(e.maxX+1)*o[0]*i;return Ot(a,n[1]+e.minY*o[1]*i,s,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=Mu;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),bu(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=To(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=To(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,a=r[1]-(t[2]+1)*i[1]*n;return Ot(o,a,o+i[0]*n,a+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),a=r/this.getResolution(o),s=this.getOrigin(o),u=To(this.getTileSize(o),this.tmpSize_),l=n?.5:0,h=n?.5:0,c=Math.floor((t-s[0])/r+l),p=Math.floor((s[1]-e)/r+h),f=a*c/u[0],d=a*p/u[1];return n?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),Ru(o,f,d,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),a=this.getResolution(r),s=To(this.getTileSize(r),this.tmpSize_),u=n?.5:0,l=n?.5:0,h=Math.floor((t-o[0])/a+u),c=Math.floor((o[1]-e)/a+l),p=h/s[0],f=c/s[1];return n?(p=Math.ceil(p)-1,f=Math.ceil(f)-1):(p=Math.floor(p),f=Math.floor(f)),Ru(r,p,f,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},t.prototype.getZForResolution=function(t,e){return he(S(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}();function Nu(t){var e=t.getDefaultTileGrid();return e||(e=Du(t),t.setDefaultTileGrid(e)),e}function Gu(t){var e=t||{},r=e.extent||We("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:ju(r,e.maxZoom,e.tileSize,e.maxResolution)};return new Au(n)}function ju(t,e,r,n){for(var i=void 0!==e?e:42,o=Wt(t),a=Ht(t),s=To(void 0!==r?r:256),u=n>0?n:Math.max(a/s[0],o/s[1]),l=i+1,h=new Array(l),c=0;c<l;++c)h[c]=u/Math.pow(2,c);return h}function Du(t,e,r,n){return function(t,e,r,n){var i=void 0!==n?n:pt,o=ju(t,e,r);return new Au({extent:t,origin:Vt(t,i),resolutions:o,tileSize:r})}(ku(t),e,r,n)}function ku(t){var e=(t=We(t)).getExtent();if(!e){var r=180*Ee[Te.DEGREES]/t.getMetersPerUnit();e=Ot(-r,-r,r,r)}return e}var Uu,zu=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Bu(t,e){for(var r=zu.length,n=0;n<r;++n)try{var i=t.getContext(zu[n],e);if(i)return i}catch(t){}return null}var Yu="http://www.w3.org/2001/XMLSchema-instance";function Vu(t,e){return cl().createElementNS(t,e)}function Xu(t,e){return function t(e,r,n){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)r?n.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(e.nodeValue);else{var i=void 0;for(i=e.firstChild;i;i=i.nextSibling)t(i,r,n)}return n}(t,e,[]).join("")}function Wu(t){return"documentElement"in t}function Zu(t){return(new DOMParser).parseFromString(t,"application/xml")}function Ku(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&T(n[n.length-1],i)}}function qu(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 Hu(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 Ju(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);if(void 0!==o){var a=i[i.length-1],s=void 0!==e?e:n.localName,u=void 0;s in a?u=a[s]:(u=[],a[s]=u),u.push(o)}}}function Qu(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 $u(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 tl(t,e){var r,n;return function(e,i,o){if(void 0===r){r={};var a={};a[e.localName]=t,r[e.namespaceURI]=a,n=el(e.localName)}sl(r,n,i,o)}}function el(t,e){var r=t;return(function(t,n,i){var o=n[n.length-1].node,a=r;return void 0===a&&(a=i),Vu(void 0!==e?e:o.namespaceURI,a)})}var rl=el();function nl(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function il(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 ol(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var a=o[i.localName];void 0!==a&&a.call(n,i,r)}}}function al(t,e,r,n,i){return n.push(t),ol(e,r,n,i),n.pop()}function sl(t,e,r,n,i,o){for(var a,s,u=(void 0!==i?i:r).length,l=0;l<u;++l)void 0!==(a=r[l])&&void 0!==(s=e.call(void 0!==o?o:this,a,n,void 0!==i?i[l]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,n)}function ul(t,e,r,n,i,o,a){return i.push(t),sl(e,r,n,i,o,a),i.pop()}var ll=void 0;var hl=void 0;function cl(){return void 0===hl&&"undefined"!=typeof document&&(hl=document.implementation.createDocument("","",null)),hl}var pl=35044;function fl(t){switch(t){case 34962:return Float32Array;case 34963:return Uint32Array;default:return Float32Array}}var dl=function(){function t(t,e){this.array=null,this.type=t,st(34962===t||34963===t,62),this.usage=void 0!==e?e:pl}return t.prototype.ofSize=function(t){this.array=new(fl(this.type))(t)},t.prototype.fromArray=function(t){this.array=fl(this.type).from(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(fl(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}(),_l="webglcontextlost",gl="webglcontextrestored";function yl(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var vl=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(r);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,r),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var n=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,r[0],r[1],0,i,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e){var r=this.getGL(),n=t.size;r.bindFramebuffer(r.FRAMEBUFFER,e?e.getFrameBuffer():null),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,this.renderTargetTexture_),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.viewport(0,0,r.drawingBufferWidth,r.drawingBufferHeight),r.bindBuffer(r.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),r.useProgram(this.renderTargetProgram_),r.enableVertexAttribArray(this.renderTargetAttribLocation_),r.vertexAttribPointer(this.renderTargetAttribLocation_,2,r.FLOAT,!1,0,0),r.uniform2f(this.renderTargetUniformLocation_,n[0],n[1]),r.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),r.drawArrays(r.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=1;this.uniforms_.forEach((function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+n]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(i.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(i.location,e[0],e[1]);case 3:return void r.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(i.location,e)}))},t}(),ml=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xl="u_projectionMatrix",wl="u_offsetScaleMatrix",Sl="u_offsetRotateMatrix",El="u_time",Tl="u_zoom",Cl="u_resolution",bl={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126};function Pl(t){for(var e=0,r=0;r<t.length;r++){var n=t[r];e+=n.size*Rl(n.type)}return e}function Rl(t){switch(t){case bl.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case bl.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case bl.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case bl.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var Ol=function(t){function e(e){var r=t.call(this)||this,n=e||{};r.boundHandleWebGLContextLost_=r.handleWebGLContextLost.bind(r),r.boundHandleWebGLContextRestored_=r.handleWebGLContextRestored.bind(r),r.canvas_=document.createElement("canvas"),r.canvas_.style.position="absolute",r.canvas_.style.left="0",r.gl_=Bu(r.canvas_);var i=r.getGL();if(r.bufferCache_={},r.currentProgram_=null,st(w(function(){if(!Uu){var t=Bu(document.createElement("canvas"));t&&(Uu=t.getSupportedExtensions())}return Uu}(),"OES_element_index_uint"),63),i.getExtension("OES_element_index_uint"),r.canvas_.addEventListener(_l,r.boundHandleWebGLContextLost_),r.canvas_.addEventListener(gl,r.boundHandleWebGLContextRestored_),r.offsetRotateMatrix_=[1,0,0,1,0,0],r.offsetScaleMatrix_=[1,0,0,1,0,0],r.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.uniformLocations_={},r.attribLocations_={},r.uniforms_=[],n.uniforms)for(var o in n.uniforms)r.uniforms_.push({name:o,value:n.uniforms[o]});return r.postProcessPasses_=n.postProcesses?n.postProcesses.map((function(t){return new vl({webGlContext:i,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new vl({webGlContext:i})],r.shaderCompileErrors_=null,r.startTime_=Date.now(),r}return ml(e,t),e.prototype.bindBuffer=function(t){var e=this.getGL(),r=o(t),n=this.bufferCache_[r];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=n);e.bindBuffer(t.getType(),n.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),r=o(t),n=this.bufferCache_[r];e.isContextLost()||e.deleteBuffer(n.buffer),delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(_l,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(gl,this.boundHandleWebGLContextRestored_)},e.prototype.prepareDraw=function(t){var e=this.getGL(),r=this.getCanvas(),n=t.size,i=t.pixelRatio;r.width=n[0]*i,r.height=n[1]*i,r.style.width=n[0]+"px",r.style.height=n[1]+"px",e.useProgram(this.currentProgram_);for(var o=this.postProcessPasses_.length-1;o>=0;o--)this.postProcessPasses_[o].init(t);e.bindTexture(e.TEXTURE_2D,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var n=this.getGL(),i=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,i[0],i[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,r?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL(),n=r.UNSIGNED_INT,i=e-t,o=4*t;r.drawElements(r.TRIANGLES,i,n,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,n=fr(this.offsetScaleMatrix_);yr(n,2/e[0],2/e[1]);var i,o,a,s,u=fr(this.offsetRotateMatrix_);0!==r&&(i=u,o=-r,a=Math.cos(o),s=Math.sin(o),dr(i,_r(pr,a,s,-s,a,0,0))),this.setUniformMatrixValue(wl,yl(this.tmpMat4_,n)),this.setUniformMatrixValue(Sl,yl(this.tmpMat4_,u)),this.setUniformFloatValue(El,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Tl,t.viewState.zoom),this.setUniformFloatValue(Cl,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.prevValue=void 0,i.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+n]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),r.uniform1i(this.getUniformLocation(i.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,yl(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(i.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var r=this.getGL(),n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n},e.prototype.getProgram=function(t,e){var r=this.getGL(),n=this.compileShader(t,r.FRAGMENT_SHADER),i=this.compileShader(e,r.VERTEX_SHADER);this.shaderCompileErrors_=null,r.getShaderInfoLog(n)&&(this.shaderCompileErrors_="Fragment shader compilation failed:\n"+r.getShaderInfoLog(n)),r.getShaderInfoLog(i)&&(this.shaderCompileErrors_=(this.shaderCompileErrors_||"")+"Vertex shader compilation failed:\n"+r.getShaderInfoLog(i));var o=r.createProgram();return r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),o},e.prototype.getShaderCompileErrors=function(){return this.shaderCompileErrors_},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var r=t.size,n=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return fr(e),vr(e,0,0,2/(i*r[0]),2/(i*r[1]),-n,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,n,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,n,i))},e.prototype.enableAttributes=function(t){for(var e=Pl(t),r=0,n=0;n<t.length;n++){var i=t[n];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,r),r+=i.size*Rl(i.type)}},e.prototype.handleWebGLContextLost=function(){f(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var n=this.getGL(),i=r||n.createTexture(),o=n.RGBA,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,0,o,a,s,e):n.texImage2D(n.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i},e}(m),Il=new Uint8Array(4),Ll=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){b(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Il[0]=0,Il[1]=0,Il[2]=0,Il[3]=0,Il;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Il[0]=this.data_[4*r],Il[1]=this.data_[4*r+1],Il[2]=this.data_[4*r+2],Il[3]=this.data_[4*r+3],Il},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),Fl=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ml=function(t){function e(e){var r=t.call(this,{extent:e.extent,origin:e.origin,origins:e.origins,resolutions:e.resolutions,tileSize:e.tileSize,tileSizes:e.tileSizes,sizes:e.sizes})||this;return r.matrixIds_=e.matrixIds,r}return Fl(e,t),e.prototype.getMatrixId=function(t){return this.matrixIds_[t]},e.prototype.getMatrixIds=function(){return this.matrixIds_},e}(Au),Al=Ml;function Nl(t,e,r){var n=[],i=[],o=[],a=[],s=[],u=void 0!==r?r:[],l=t.SupportedCRS,h=We(l.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||We(l),c=h.getMetersPerUnit(),p="ne"==h.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,e){return e.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(e){if(!(u.length>0)||C(u,(function(r){return e.Identifier==r.TileMatrix||-1===e.Identifier.indexOf(":")&&t.Identifier+":"+e.Identifier===r.TileMatrix}))){i.push(e.Identifier);var r=28e-5*e.ScaleDenominator/c,l=e.TileWidth,h=e.TileHeight;p?o.push([e.TopLeftCorner[1],e.TopLeftCorner[0]]):o.push(e.TopLeftCorner),n.push(r),a.push(l==h?l:[l,h]),s.push([e.MatrixWidth,e.MatrixHeight])}})),new Ml({extent:e,origins:o,resolutions:n,matrixIds:i,tileSizes:a,sizes:s})}var Gl=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.displacement_=t.displacement}return t.prototype.clone=function(){return new t({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},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.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return n()},t.prototype.getImage=function(t){return n()},t.prototype.getHitDetectionImage=function(t){return n()},t.prototype.getImageState=function(){return n()},t.prototype.getImageSize=function(){return n()},t.prototype.getHitDetectionImageSize=function(){return n()},t.prototype.getOrigin=function(){return n()},t.prototype.getSize=function(){return n()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t},t.prototype.listenImageChange=function(t){n()},t.prototype.load=function(){n()},t.prototype.unlistenImageChange=function(t){n()},t}(),jl=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dl=function(t){function e(e){var r=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=null,r.hitDetectionCanvas_=null,r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.anchor_=null,r.size_=null,r.imageSize_=null,r.hitDetectionImageSize_=null,r.render(),r}return jl(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_},e.prototype.getImage=function(t){return this.canvas_},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return Fs},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.render=function(){var t,e="round",r="round",n=0,i=null,o=0,a=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=us(t),void 0===(a=this.stroke_.getWidth())&&(a=1),i=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(r=this.stroke_.getLineJoin())&&(r="round"),void 0===(e=this.stroke_.getLineCap())&&(e="round"),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=2*(this.radius_+a)+1,u={strokeStyle:t,strokeWidth:a,size:s,lineCap:e,lineDash:i,lineDashOffset:o,lineJoin:r,miterLimit:n},l=Ji(s,s);this.canvas_=l.canvas;var h=s=this.canvas_.width,c=this.getDisplacement();this.draw_(u,l,0,0),this.createHitDetectionCanvas_(u),this.anchor_=[s/2-c[0],s/2+c[1]],this.size_=[s,s],this.imageSize_=[h,h]},e.prototype.draw_=function(t,e,r,n){var i,o,a;e.setTransform(1,0,0,1,0,0),e.translate(r,n),e.beginPath();var s=this.points_;if(s===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var u=void 0!==this.radius2_?this.radius2_:this.radius_;for(u!==this.radius_&&(s*=2),i=0;i<=s;i++)o=2*i*Math.PI/s-Math.PI/2+this.angle_,a=i%2==0?this.radius_:u,e.lineTo(t.size/2+a*Math.cos(o),t.size/2+a*Math.sin(o))}if(this.fill_){var l=this.fill_.getColor();null===l&&(l="#000"),e.fillStyle=us(l),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.hitDetectionCanvas_=this.canvas_,this.fill_){var e=this.fill_.getColor(),r=0;if("string"==typeof e&&(e=rs(e)),null===e?r=1:Array.isArray(e)&&(r=4===e.length?e[3]:1),0===r){var n=Ji(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n,0,0)}}},e.prototype.drawHitDetectionCanvas_=function(t,e,r,n){e.setTransform(1,0,0,1,0,0),e.translate(r,n),e.beginPath();var i=this.points_;if(i===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o=void 0!==this.radius2_?this.radius2_:this.radius_;o!==this.radius_&&(i*=2);var a=void 0,s=void 0,u=void 0;for(a=0;a<=i;a++)u=2*a*Math.PI/i-Math.PI/2+this.angle_,s=a%2==0?this.radius_:o,e.lineTo(t.size/2+s*Math.cos(u),t.size/2+s*Math.sin(u))}e.fillStyle="#000",e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e}(Gl),kl=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ul=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return kl(e,t),e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),displacement:this.getDisplacement().slice()});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Dl),zl=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Bl="fraction",Yl="pixels",Vl=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xl=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=r,o.state=i,o}return Vl(e,t),e.prototype.changed=function(){this.dispatchEvent(N)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return n()},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(){n()},e}(A),Wl=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Zl(t,e,r){var n=t;if(n.src&&Un){var i=n.decode(),o=!0;return i.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():r())})),function(){o=!1}}var a=[y(n,X,e),y(n,G,r)];return function(){a.forEach(v)}}var Kl=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,n,Is)||this;return s.src_=i,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=Is,s.imageLoadFunction_=a,s}return Wl(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ms,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Wt(this.extent)/this.image_.height),this.state=Fs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Is&&this.state!=Ms||(this.state=Ls,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Zl(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Xl),ql=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hl=function(t){function e(e,r,n,i,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==i&&(s.image_.crossOrigin=i),s.canvas_=a?document.createElement("canvas"):null,s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=n,s.src_=r,s.tainted_,s}return ql(e,t),e.prototype.isTainted_=function(t){if(void 0===this.tainted_&&this.imageState_===Fs){t||(t=Ji(1,1)).drawImage(this.image_,0,0);try{t.getImageData(0,0,1,1),this.tainted_=!1}catch(t){this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(N)},e.prototype.handleImageError_=function(){this.imageState_=Ms,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Fs,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.replaceColor_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_)if(this.isTainted_()){var e=this.size_[0],r=this.size_[1],n=Ji(e,r);n.fillRect(0,0,e,r),this.hitDetectionImage_=n.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_==Is){this.imageState_=Ls;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Zl(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(){if(this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");if(t.drawImage(this.image_,0,0),this.isTainted_(t)){var e=this.color_;return t.globalCompositeOperation="multiply",t.fillStyle="rgb("+e[0]+","+e[1]+","+e[2]+")",t.fillRect(0,0,this.image_.width,this.image_.height),t.globalCompositeOperation="destination-in",void t.drawImage(this.image_,0,0)}for(var r=t.getImageData(0,0,this.image_.width,this.image_.height),n=r.data,i=this.color_[0]/255,o=this.color_[1]/255,a=this.color_[2]/255,s=0,u=n.length;s<u;s+=4)n[s]*=i,n[s+1]*=o,n[s+2]*=a;t.putImageData(r,0,0)}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(A);var Jl="bottom-left",Ql="bottom-right",$l="top-left",th="top-right",eh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rh=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.opacity?n.opacity:1,a=void 0!==n.rotation?n.rotation:0,s=void 0!==n.scale?n.scale:1,u=void 0!==n.rotateWithView&&n.rotateWithView;(r=t.call(this,{opacity:i,rotation:a,scale:s,displacement:void 0!==n.displacement?n.displacement:[0,0],rotateWithView:u})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:$l,r.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:Bl,r.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:Bl,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null;var l=void 0!==n.img?n.img:null,h=void 0!==n.imgSize?n.imgSize:null,c=n.src;st(!(void 0!==c&&l),4),st(!l||l&&h,5),void 0!==c&&0!==c.length||!l||(c=l.src||o(l)),st(void 0!==c&&c.length>0,6);var p=void 0!==n.src?Is:Fs;return r.color_=void 0!==n.color?rs(n.color):null,r.iconImage_=function(t,e,r,n,i,o){var a=ss.get(e,n,o);return a||(a=new Hl(t,e,r,n,i,o),ss.set(e,n,o,a)),a}(l,c,h,r.crossOrigin_,p,r.color_),r.offset_=void 0!==n.offset?n.offset:[0,0],r.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:$l,r.origin_=null,r.size_=void 0!==n.size?n.size:null,r}return eh(e,t),e.prototype.clone=function(){return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Bl||this.anchorYUnits_==Bl){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Bl&&(t[0]*=e[0]),this.anchorYUnits_==Bl&&(t[1]*=e[1])}if(this.anchorOrigin_!=$l){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=th&&this.anchorOrigin_!=Ql||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Jl&&this.anchorOrigin_!=Ql||(t[1]=-t[1]+e[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_,e=this.getDisplacement();if(this.offsetOrigin_!=$l){var r=this.getSize(),n=this.iconImage_.getSize();if(!r||!n)return null;t=t.slice(),this.offsetOrigin_!=th&&this.offsetOrigin_!=Ql||(t[0]=n[0]-r[0]-t[0]),this.offsetOrigin_!=Jl&&this.offsetOrigin_!=Ql||(t[1]=n[1]-r[1]-t[1])}return t[0]+=e[0],t[1]+=e[1],this.origin_=t,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(t){this.iconImage_.addEventListener(N,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(N,t)},e}(Gl),nh=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),ih=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=uh,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=uh,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var oh=null;function ah(t,e){if(!oh){var r=new zl({color:"rgba(255,255,255,0.4)"}),n=new nh({color:"#3399CC",width:1.25});oh=[new ih({image:new Ul({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return oh}function sh(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[ae.POLYGON]=[new ih({fill:new zl({color:[255,255,255,.5]})})],t[ae.MULTI_POLYGON]=t[ae.POLYGON],t[ae.LINE_STRING]=[new ih({stroke:new nh({color:e,width:5})}),new ih({stroke:new nh({color:r,width:3})})],t[ae.MULTI_LINE_STRING]=t[ae.LINE_STRING],t[ae.CIRCLE]=t[ae.POLYGON].concat(t[ae.LINE_STRING]),t[ae.POINT]=[new ih({image:new Ul({radius:6,fill:new zl({color:r}),stroke:new nh({color:e,width:1.5})}),zIndex:1/0})],t[ae.MULTI_POINT]=t[ae.POINT],t[ae.GEOMETRY_COLLECTION]=t[ae.POLYGON].concat(t[ae.LINE_STRING],t[ae.POINT]),t}function uh(t){return t.getGeometry()}var lh=ih,hh="point",ch="line",ph=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new zl({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:hh,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}();function fh(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,u){return a?t.replace(r,a[0].toString()).replace(n,a[1].toString()).replace(i,a[2].toString()).replace(o,(function(){var t=a[0],r=e.getFullTileRange(t);return st(r,55),(r.getHeight()-a[2]-1).toString()})):void 0}}function dh(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=fh(t[i],e);return _h(n)}function _h(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=ge(Fu(e),t.length);return t[i](e,r,n)}}}function gh(t,e,r){}function yh(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0;for(o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(r[2],10),s=parseInt(r[1],10);s<=a;s++)e.push(t.replace(r[0],s.toString()));return e}return e.push(t),e}function vh(t,e,r,n){var i=document.createElement("script"),a="olc_"+o(e);function s(){delete window[a],i.parentNode.removeChild(i)}i.async=!0,i.src=t+(-1==t.indexOf("?")?"?":"&")+(n||"callback")+"="+a;var u=setTimeout((function(){s(),r&&r()}),1e4);window[a]=function(t){clearTimeout(u),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(i)}var mh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xh=function(t){function e(e,r,n){var i=t.call(this)||this,o=n||{};return i.tileCoord=e,i.state=r,i.interimTile=null,i.hifi=!0,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i}return mh(e,t),e.prototype.changed=function(){this.dispatchEvent(N)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==ci)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==ci){t.interimTile=null;break}t.getState()==hi?e=t:t.getState()==li?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==pi&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){n()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var n=e-r+1e3/60;return n>=this.transition_?1:Yi(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(A),wh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var Sh=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.crossOrigin_=i,s.src_=n,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return wh(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){var t;this.state=pi,this.unlistenImage_(),this.image_=((t=Ji(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=ci:this.state=fi,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==pi&&(this.state=li,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==li&&(this.state=hi,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Zl(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(xh),Eh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var r=this.entries_[t];return st(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return st(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){st(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),Th=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ch=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Th(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Lu(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Iu(e.tileCoord)),e.release())}.bind(this))}},e}(Eh);function bh(t,e,r,n){var i=er(r,e,t),o=Ze(e,n,r),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var u=t.getExtent();if(!u||Tt(u,i)){var l=Ze(t,o,i)/o;isFinite(l)&&l>0&&(o/=l)}return o}function Ph(t,e,r,n){var i=r-t,o=n-e,a=Math.sqrt(i*i+o*o);return[Math.round(r+i/a),Math.round(n+o/a)]}function Rh(t,e,r,n,i,o,a,s,u,l,h){var c=Ji(Math.round(r*t),Math.round(r*e));if(0===u.length)return c.canvas;c.scale(r,r);var p=[1/0,1/0,-1/0,-1/0];u.forEach((function(t,e,r){At(p,t.extent)}));var f=Ht(p),d=Wt(p),_=Ji(Math.round(r*f/n),Math.round(r*d/n)),g=r/n;u.forEach((function(t,e,r){var n=t.extent[0]-p[0],i=-(t.extent[3]-p[3]),o=Ht(t.extent),a=Wt(t.extent);_.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,n*g,i*g,o*g,a*g)}));var y=Kt(a);return s.getTriangles().forEach((function(t,e,i){var a=t.source,s=t.target,u=a[0][0],l=a[0][1],h=a[1][0],f=a[1][1],d=a[2][0],g=a[2][1],v=(s[0][0]-y[0])/o,m=-(s[0][1]-y[1])/o,x=(s[1][0]-y[0])/o,w=-(s[1][1]-y[1])/o,S=(s[2][0]-y[0])/o,E=-(s[2][1]-y[1])/o,T=u,C=l;u=0,l=0;var b=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var a=Math.abs(t[o][r]);a>i&&(i=a,n=o)}if(0===i)return null;var s=t[n];t[n]=t[r],t[r]=s;for(var u=r+1;u<e;u++)for(var l=-t[u][r]/t[r][r],h=r;h<e+1;h++)r==h?t[u][h]=0:t[u][h]+=l*t[r][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=T,f-=C,0,0,x-v],[d-=T,g-=C,0,0,S-v],[0,0,h,f,w-m],[0,0,d,g,E-m]]);if(b){c.save(),c.beginPath();var P=(v+x+S)/3,R=(m+w+E)/3,O=Ph(P,R,v,m),I=Ph(P,R,x,w),L=Ph(P,R,S,E);c.moveTo(I[0],I[1]),c.lineTo(O[0],O[1]),c.lineTo(L[0],L[1]),c.clip(),c.transform(b[0],b[2],b[1],b[3],v,m),c.translate(p[0]-T,p[3]-C),c.scale(n/r,-n/r),c.drawImage(_.canvas,0,0),c.restore()}})),h&&(c.save(),c.strokeStyle="black",c.lineWidth=1,s.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-y[0])/o,a=-(n[0][1]-y[1])/o,s=(n[1][0]-y[0])/o,u=-(n[1][1]-y[1])/o,l=(n[2][0]-y[0])/o,h=-(n[2][1]-y[1])/o;c.beginPath(),c.moveTo(s,u),c.lineTo(i,a),c.lineTo(l,h),c.closePath(),c.stroke()})),c.restore()),c.canvas}var Oh=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=tr(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Ht(n)==Ht(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Ht(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Ht(this.targetProj_.getExtent()):null;var u=Kt(r),l=qt(r),h=Bt(r),c=zt(r),p=this.transformInv_(u),f=this.transformInv_(l),d=this.transformInv_(h),_=this.transformInv_(c),g=10+(o?Math.max(0,Math.ceil(Math.log2(Ut(r)/(o*o*256*256)))):0);if(this.addQuad_(u,l,h,c,p,f,d,_,g),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,r){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,a,s,u){var l=xt([i,o,a,s]),h=this.sourceWorldWidth_?Ht(l)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=Ht(xt([t,e,r,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(f||!this.maxSourceExtent_||Jt(l,this.maxSourceExtent_)){if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1]))){if(!(u>0))return;f=!0}if(u>0){if(!f){var d=[(t[0]+r[0])/2,(t[1]+r[1])/2],_=this.transformInv_(d),g=void 0;if(p)g=(ge(i[0],c)+ge(a[0],c))/2-ge(_[0],c);else g=(i[0]+a[0])/2-_[0];var y=(i[1]+a[1])/2-_[1];f=g*g+y*y>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var v=[(e[0]+r[0])/2,(e[1]+r[1])/2],m=this.transformInv_(v),x=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(x);this.addQuad_(t,e,v,x,i,o,m,w,u-1),this.addQuad_(x,v,r,n,w,m,a,s,u-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(S),T=[(r[0]+n[0])/2,(r[1]+n[1])/2],C=this.transformInv_(T);this.addQuad_(t,S,T,n,i,E,C,s,u-1),this.addQuad_(S,e,r,T,E,o,a,C,u-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,r,n,i,a,s),this.addTriangle_(t,e,r,i,o,a)}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;Nt(t,i[0]),Nt(t,i[1]),Nt(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Ih=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lh=function(t){function e(e,r,n,i,o,a,s,u,l,h,c){var p=t.call(this,o,li)||this;p.renderEdges_=void 0!==c&&c,p.pixelRatio_=s,p.gutter_=u,p.canvas_=null,p.sourceTileGrid_=r,p.targetTileGrid_=i,p.wrappedTileCoord_=a||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var f=i.getTileCoordExtent(p.wrappedTileCoord_),d=p.targetTileGrid_.getExtent(),_=p.sourceTileGrid_.getExtent(),g=d?Zt(f,d):f;if(0===Ut(g))return p.state=fi,p;var y=e.getExtent();y&&(_=_?Zt(_,y):y);var v=i.getResolution(p.wrappedTileCoord_[0]),m=bh(e,n,Yt(g),v);if(!isFinite(m)||m<=0)return p.state=fi,p;var x=void 0!==h?h:.5;if(p.triangulation_=new Oh(e,n,g,_,m*x,v),0===p.triangulation_.getTriangles().length)return p.state=fi,p;p.sourceZ_=r.getZForResolution(m);var w=p.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(w[1]=he(w[1],_[1],_[3]),w[3]=he(w[3],_[1],_[3])):w=Zt(w,_)),Ut(w)){for(var S=r.getTileRangeForExtentAndZ(w,p.sourceZ_),E=S.minX;E<=S.maxX;E++)for(var T=S.minY;T<=S.maxY;T++){var C=l(p.sourceZ_,E,T,s);C&&p.sourceTiles_.push(C)}0===p.sourceTiles_.length&&(p.state=fi)}else p.state=fi;return p}return Ih(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&e.getState()==ci&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=pi;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Rh(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=ci}this.changed()},e.prototype.load=function(){if(this.state==li){this.state=hi,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==li||i==hi){t++;var o=g(e,N,(function(r){var n=e.getState();n!=ci&&n!=pi&&n!=fi||(v(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,r){t.getState()==li&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(v),this.sourcesListenerKeys_=null},e}(xh),Fh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Mh(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Ah=function(t){function e(e){var r=t.call(this)||this;return r.projection_=We(e.projection),r.attributions_=Mh(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:yo,r.wrapX_=void 0!==e.wrapX&&e.wrapX,r}return Fh(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return n()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Mh(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(rt),Nh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var n=[256,256],i=e.tileGrid;i&&To(i.getTileSize(i.getMinZoom()),n);var o="undefined"!=typeof screen,a=o?screen.availWidth||screen.width:1920,s=o?screen.availHeight||screen.height:1080,u=4*Math.ceil(a/n[0])*Math.ceil(s/n[1]);return r.tileCache=new Ch(Math.max(u,e.cacheSize||0)),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition},r.zDirection=e.zDirection?e.zDirection:0,r}return Nh(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,s,u=!0,l=r.minX;l<=r.maxX;++l)for(var h=r.minY;h<=r.maxY;++h)a=Ou(e,l,h),s=!1,i.containsKey(a)&&(s=(o=i.get(a)).getState()===ci)&&(s=!1!==n(o)),s||(u=!1);return u},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,r,i,o){return n()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Nu(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!Qe(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=To(n.getTileSize(t),this.tmpSize);return 1==i?o:Eo(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=ku(r);if(Tt(o,i))return e;var a=Ht(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o,a=e.getExtent();return!(o=a?e.getTileRangeForExtentAndZ(a,r):e.getFullTileRange(r))||o.containsXY(n,i)}(t,n)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.useTile=function(t,e,r,n){},e}(Ah),jh=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return Nh(e,t),e}(F),Dh=Gh,kh="tileloadstart",Uh="tileloadend",zh="tileloaderror",Bh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return r.generateTileUrlFunction_=!e.tileUrlFunction,r.tileLoadFunction=e.tileLoadFunction,r.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(r):gh,r.urls=null,e.urls?r.setUrls(e.urls):e.url&&r.setUrl(e.url),r.tileLoadingKeys_={},r}return Bh(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,n=o(r),i=r.getState();i==hi?(this.tileLoadingKeys_[n]=!0,e=kh):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=i==pi?zh:i==ci?Uh:void 0),null!=e&&this.dispatchEvent(new jh(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=yh(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(dh(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,r){var n=Ou(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(Dh),Vh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Xh(t,e){t.getImage().src=e}var Wh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Xh,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return r.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:Sh,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return Vh(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Qe(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Qe(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Qe(e,t)){var r=o(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Nu(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Qe(e,t))return this.tileCache;var r=o(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Ch(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),u=s?this.tileUrlFunction(s,n,i):void 0,l=new this.tileClass(a,void 0!==u?li:fi,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=o,l.addEventListener(N,this.handleTileChange.bind(this)),l},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Qe(o,i)){var a=this.getTileCacheForProjection(i),s=[t,e,r],u=void 0,l=Iu(s);a.containsKey(l)&&(u=a.get(l));var h=this.getKey();if(u&&u.key==h)return u;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(s,i),d=new Lh(o,c,i,p,s,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return d.key=h,u?(d.interimTile=u,d.refreshInterimChain(),a.replace(l,d)):a.set(l,d),d}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,a=Ou(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var u=o;o=this.createTile_(t,e,r,n,i,s),u.getState()==li?o.interimTile=u.interimTile:o.interimTile=u,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,r,n,i,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=We(t);if(r){var n=o(r);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Yh),Zh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var Kh=function(t){function e(e){var r=this,n=void 0!==e.hidpi&&e.hidpi;return(r=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:We("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:go,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:n?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this).hidpi_=n,r.culture_=void 0!==e.culture?e.culture:"en-us",r.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,r.apiKey_=e.key,r.imagerySet_=e.imagerySet,vh("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+r.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+r.apiKey_+"&c="+r.culture_,r.handleImageryMetadataResponse.bind(r),void 0,"jsonp"),r}return Zh(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],r=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=ku(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],a=Gu({extent:n,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=a;var s=this.culture_,u=this.hidpi_;if(this.tileUrlFunction=_h(e.imageUrlSubdomains.map((function(t){var r=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,i){if(t){Ru(t[0],t[1],t[2],r);var o=n;return u&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,r,n=t[0],i=new Array(n),o=1<<n-1;for(e=0;e<n;++e)r=48,t[1]&o&&(r+=1),t[2]&o&&(r+=2),i[e]=String.fromCharCode(r),o>>=1;return i.join("")}(r))}}}))),e.imageryProviders){var l=$e(We("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],n=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(n.resolution,this.zDirection),a=i.getTileCoordForCoordAndZ(n.center,o)[0];return e.imageryProviders.map((function(e){for(var n=!1,i=e.coverageAreas,o=0,s=i.length;o<s;++o){var u=i[o];if(a>=u.zoomMin&&a<=u.zoomMax){var h=u.bbox;if(Jt(te([h[1],h[0],h[3],h[2]],l),t.extent)){n=!0;break}}}n&&r.push(e.attribution)})),r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),r}.bind(this))}this.setState(yo)}else this.setState(vo)},e}(Wh),qh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hh=function(t){function e(e){var r=e||{},n=void 0!==r.projection?r.projection:"EPSG:3857",i=void 0!==r.tileGrid?r.tileGrid:Gu({extent:ku(n),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,opaque:r.opaque,projection:n,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return qh(e,t),e}(Wh),Jh=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qh=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,maxZoom:void 0!==e.maxZoom?e.maxZoom:18,minZoom:e.minZoom,projection:e.projection,wrapX:e.wrapX})||this;return r.account_=e.account,r.mapId_=e.map||"",r.config_=e.config||{},r.templateCache_={},r.initializeMap_(),r}return Jh(e,t),e.prototype.getConfig=function(){return this.config_},e.prototype.updateConfig=function(t){p(this.config_,t),this.initializeMap_()},e.prototype.setConfig=function(t){this.config_=t||{},this.initializeMap_()},e.prototype.initializeMap_=function(){var t=JSON.stringify(this.config_);if(this.templateCache_[t])this.applyTemplate_(this.templateCache_[t]);else{var e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);var r=new XMLHttpRequest;r.addEventListener("load",this.handleInitResponse_.bind(this,t)),r.addEventListener("error",this.handleInitError_.bind(this)),r.open("POST",e),r.setRequestHeader("Content-type","application/json"),r.send(JSON.stringify(this.config_))}},e.prototype.handleInitResponse_=function(t,e){var r=e.target;if(!r.status||r.status>=200&&r.status<300){var n=void 0;try{n=JSON.parse(r.responseText)}catch(t){return void this.setState(vo)}this.applyTemplate_(n),this.templateCache_[t]=n,this.setState(yo)}else this.setState(vo)},e.prototype.handleInitError_=function(t){this.setState(vo)},e.prototype.applyTemplate_=function(t){var e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)},e}(Hh),$h="addfeature",tc="changefeature",ec="clear",rc="removefeature",nc=r(0),ic=r.n(nc),oc=function(){function t(t){this.rbush_=new ic.a(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[o(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++){var a=t[n],s=e[n],u={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};r[n]=u,this.items_[o(s)]=u}this.rbush_.load(r)},t.prototype.remove=function(t){var e=o(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[o(e)];Mt([r.minX,r.minY,r.maxX,r.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var r,n=0,i=t.length;n<i;n++)if(r=e(t[n]))return r;return r},t.prototype.isEmpty=function(){return _(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return Ot(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),ac=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sc=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return ac(e,t),e}(F),uc=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,projection:void 0,state:yo,wrapX:void 0===n.wrapX||n.wrapX})||this).loader_=I,r.format_=n.format,r.overlaps_=void 0===n.overlaps||n.overlaps,r.url_=n.url,void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(st(r.format_,7),r.loader_=Eu(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:Tu;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new oc:null,r.loadedExtentsRtree_=new oc,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),a||void 0!==i||(i=new at(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return ac(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=o(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var n=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new sc($h,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[g(e,N,this.handleFeatureChange_,this),g(e,c,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(st(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],n=[],i=0,a=t.length;i<a;i++){var s=o(l=t[i]);this.addToIndex_(s,l)&&r.push(l)}i=0;for(var u=r.length;i<u;i++){var l;s=o(l=r[i]);this.setupChangeEvents_(s,l);var h=l.getGeometry();if(h){var c=h.getExtent();e.push(c),n.push(l)}else this.nullGeometryFeatures_[s]=l}this.featuresRtree_&&this.featuresRtree_.load(e,n);i=0;for(var p=r.length;i<p;i++)this.dispatchEvent(new sc($h,r[i]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener($h,(function(r){e||(e=!0,t.push(r.feature),e=!1)})),this.addEventListener(rc,(function(r){e||(e=!0,t.remove(r.feature),e=!1)})),t.addEventListener(l,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(h,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(v)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var r in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var n=new sc(ec);this.dispatchEvent(n),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,(function(r){return r.getGeometry().intersectsCoordinate(t)?e(r):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(r){if(r.getGeometry().intersectsExtent(t)){var n=e(r);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),_(this.nullGeometryFeatures_)||T(t,d(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray():[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],n=t[1],i=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],u=e||R;return this.featuresRtree_.forEachInExtent(s,(function(t){if(u(t)){var e=t.getGeometry(),l=a;if((a=e.closestPointXY(r,n,o,a))<l){i=t;var h=Math.sqrt(a);s[0]=r-h,s[1]=n-h,s[2]=r+h,s[3]=n+h}}})),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,r=o(e),n=e.getGeometry();if(n){var i=n.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);var a=e.getId();if(void 0!==a){var s=a.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed(),this.dispatchEvent(new sc(tc,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:o(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&_(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,r){var n=this.loadedExtentsRtree_,i=this.strategy_(t,e);this.loading=!1;for(var o=function(t,o){var s=i[t];n.forEachInExtent(s,(function(t){return Ct(t.extent,s)}))||(a.loader_.call(a,s,e,r),n.insert(s,{extent:s.slice()}),a.loading=a.loader_!==I)},a=this,s=0,u=i.length;s<u;++s)o(s)},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(Mt(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){var e=o(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=o(t);this.featureChangeKeys_[e].forEach(v),delete this.featureChangeKeys_[e];var r=t.getId();void 0!==r&&delete this.idIndex_[r.toString()],delete this.uidIndex_[e],this.dispatchEvent(new sc(rc,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){st(this.format_,7),this.setLoader(Eu(t,this.format_))},e}(Ah),lc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hc=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,wrapX:e.wrapX})||this;return r.resolution=void 0,r.distance=void 0!==e.distance?e.distance:20,r.features=[],r.geometryFunction=e.geometryFunction||function(t){var e=t.getGeometry();return st(e.getType()==ae.POINT,10),e},r.boundRefresh_=r.refresh.bind(r),r.setSource(e.source||null),r}return lc(e,t),e.prototype.clear=function(e){this.features.length=0,t.prototype.clear.call(this,e)},e.prototype.getDistance=function(){return this.distance},e.prototype.getSource=function(){return this.source},e.prototype.loadFeatures=function(t,e,r){this.source.loadFeatures(t,e,r),e!==this.resolution&&(this.clear(),this.resolution=e,this.cluster(),this.addFeatures(this.features))},e.prototype.setDistance=function(t){this.distance=t,this.refresh()},e.prototype.setSource=function(t){this.source&&this.source.removeEventListener(N,this.boundRefresh_),this.source=t,t&&t.addEventListener(N,this.boundRefresh_),this.refresh()},e.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},e.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,r=this.source.getFeatures(),n={},i=0,a=r.length;i<a;i++){var s=r[i];if(!(o(s)in n)){var u=this.geometryFunction(s);if(u){Lt(u.getCoordinates(),t),wt(t,e,t);var l=this.source.getFeaturesInExtent(t);l=l.filter((function(t){var e=o(t);return!(e in n)&&(n[e]=!0,!0)})),this.features.push(this.createCluster(l))}}}},e.prototype.createCluster=function(t){for(var e=[0,0],r=t.length-1;r>=0;--r){var n=this.geometryFunction(t[r]);n?Li(e,n.getCoordinates()):t.splice(r,1)}ji(e,1/t.length);var i=new lt(new Kr(e));return i.set("features",t),i},e}(uc),cc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pc="default",fc="truncated",dc=function(t){function e(e,r,n,i,o,a,s){var u=t.call(this,r,n,i,o,a,s)||this;return u.zoomifyImage_=null,u.tileSize_=e,u}return cc(e,t),e.prototype.getImage=function(){if(this.zoomifyImage_)return this.zoomifyImage_;var e=t.prototype.getImage.call(this);if(this.state==ci){var r=this.tileSize_;if(e.width==r[0]&&e.height==r[1])return this.zoomifyImage_=e,e;var n=Ji(r[0],r[1]);return n.drawImage(e,0,0),this.zoomifyImage_=n.canvas,n.canvas}return e},e}(Sh),_c=function(t){function e(e){var r=this,n=e,i=n.size,o=void 0!==n.tierSizeCalculation?n.tierSizeCalculation:pc,a=n.tilePixelRatio||1,s=i[0],u=i[1],l=[],h=n.tileSize||256,c=h*a;switch(o){case pc:for(;s>c||u>c;)l.push([Math.ceil(s/c),Math.ceil(u/c)]),c+=c;break;case fc:for(var p=s,f=u;p>c||f>c;)l.push([Math.ceil(p/c),Math.ceil(f/c)]),p>>=1,f>>=1;break;default:st(!1,53)}l.push([1,1]),l.reverse();for(var d=[a],_=[0],g=1,y=l.length;g<y;g++)d.push(a<<g),_.push(l[g-1][0]*l[g-1][1]+_[g-1]);d.reverse();var v=new Au({tileSize:h,extent:n.extent||[0,-u,s,0],resolutions:d}),m=n.url;m&&-1==m.indexOf("{TileGroup}")&&-1==m.indexOf("{tileIndex}")&&(m+="{TileGroup}/{z}-{x}-{y}.jpg");var x=yh(m),w=h*a;var S=_h(x.map((function(t){return function(e,r,n){if(e){var i=e[0],o=e[1],a=e[2],s=o+a*l[i][0],u={z:i,x:o,y:a,tileIndex:s,TileGroup:"TileGroup"+((s+_[i])/w|0)};return t.replace(/\{(\w+?)\}/g,(function(t,e){return u[e]}))}}}))),E=dc.bind(null,To(h*a));(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,projection:n.projection,tilePixelRatio:a,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:E,tileGrid:v,tileUrlFunction:S,transition:n.transition})||this).zDirection=n.zDirection;var T=S(v.getTileCoordForCoordAndResolution(Yt(v.getExtent()),d[d.length-1]),1,null),C=new Image;return C.addEventListener("error",function(){w=h,this.changed()}.bind(r)),C.src=T,r}return cc(e,t),e}(Wh),gc="version1",yc="version2",vc="version3",mc={};mc[gc]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}},mc[yc]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}},mc[vc]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}},mc.none={none:{supports:[],formats:[],qualities:[]}};var xc=new RegExp("^https?://library.stanford.edu/iiif/image-api/(1.1/)?compliance.html#level[0-2]$"),wc=new RegExp("^https?://iiif.io/api/image/2/level[0-2](.json)?$"),Sc=new RegExp("(^https?://iiif.io/api/image/3/level[0-2](.json)?$)|(^level[0-2]$)");var Ec={};Ec[gc]=function(t){var e=t.getComplianceLevelSupportedFeatures();return void 0===e&&(e=mc[gc].level0),{url:void 0===t.imageInfo["@id"]?void 0:t.imageInfo["@id"].replace(/\/?(info.json)?$/g,""),supports:e.supports,formats:e.formats.concat([void 0===t.imageInfo.formats?[]:t.imageInfo.formats]),qualities:e.qualities.concat([void 0===t.imageInfo.qualities?[]:t.imageInfo.qualities]),resolutions:t.imageInfo.scale_factors,tileSize:void 0!==t.imageInfo.tile_width?void 0!==t.imageInfo.tile_height?[t.imageInfo.tile_width,t.imageInfo.tile_height]:[t.imageInfo.tile_width,t.imageInfo.tile_width]:null!=t.imageInfo.tile_height?[t.imageInfo.tile_height,t.imageInfo.tile_height]:void 0}},Ec[yc]=function(t){var e=t.getComplianceLevelSupportedFeatures(),r=Array.isArray(t.imageInfo.profile)&&t.imageInfo.profile.length>1,n=r&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],i=r&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=r&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(info.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:e.supports.concat(n),formats:e.formats.concat(i),qualities:e.qualities.concat(o)}},Ec[vc]=function(t){var e=t.getComplianceLevelSupportedFeatures(),r=void 0===t.imageInfo.extraFormats?e.formats:e.formats.concat(t.imageInfo.extraFormats),n=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return["jpg","png","gif"].includes(t)})).reduce((function(t,e){return void 0===t&&r.includes(e)?e:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?e.supports:e.supports.concat(t.imageInfo.extraFeatures),formats:r,qualities:void 0===t.imageInfo.extraQualities?e.qualities:e.qualities.concat(t.imageInfo.extraQualities),preferredFormat:n}};var Tc=function(){function t(t){this.setImageInfo(t)}return t.prototype.setImageInfo=function(t){this.imageInfo="string"==typeof t?JSON.parse(t):t},t.prototype.getImageApiVersion=function(){if(void 0!==this.imageInfo){var t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(var e=0;e<t.length;e++)switch(t[e]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return gc;case"http://iiif.io/api/image/2/context.json":return yc;case"http://iiif.io/api/image/3/context.json":return vc;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(gc)&&this.imageInfo.identifier)return gc}st(!1,61)}},t.prototype.getComplianceLevelEntryFromProfile=function(t){if(void 0!==this.imageInfo&&void 0!==this.imageInfo.profile)switch(void 0===t&&(t=this.getImageApiVersion()),t){case gc:if(xc.test(this.imageInfo.profile))return this.imageInfo.profile;break;case vc:if(Sc.test(this.imageInfo.profile))return this.imageInfo.profile;break;case yc:if("string"==typeof this.imageInfo.profile&&wc.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&"string"==typeof this.imageInfo.profile[0]&&wc.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var e=this.getComplianceLevelEntryFromProfile(t);if(void 0!==e){var r=e.match(/level[0-2](\.json)?$/g);return Array.isArray(r)?r[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return void 0===e?mc.none.none:mc[t][e]}},t.prototype.getTileSourceOptions=function(t){var e=t||{},r=this.getImageApiVersion();if(void 0!==r){var n=void 0===r?void 0:Ec[r](this);if(void 0!==n)return{url:n.url,version:r,size:[this.imageInfo.width,this.imageInfo.height],sizes:n.sizes,format:void 0!==e.format&&n.formats.includes(e.format)?e.format:void 0!==n.preferredFormat?n.preferredFormat:"jpg",supports:n.supports,quality:e.quality&&n.qualities.includes(e.quality)?e.quality:n.qualities.includes("native")?"native":"default",resolutions:Array.isArray(n.resolutions)?n.resolutions.sort((function(t,e){return e-t})):void 0,tileSize:n.tileSize}}},t}(),Cc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function bc(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var Pc=function(t){function e(e){var r=this,n=e||{},i=n.url||"";i+=i.lastIndexOf("/")===i.length-1||""===i?"":"/";var o=n.version||yc,a=n.sizes||[],s=n.size;st(null!=s&&Array.isArray(s)&&2==s.length&&!isNaN(s[0])&&s[0]>0&&!isNaN(s[1])&&s[1]>0,60);var u,l,h,c=s[0],p=s[1],f=n.tileSize,d=n.tilePixelRatio||1,_=n.format||"jpg",g=n.quality||(n.version==gc?"native":"default"),y=n.resolutions||[],v=n.supports||[],m=n.extent||[0,-p,c,0],x=null!=a&&Array.isArray(a)&&a.length>0,w=void 0!==f&&("number"==typeof f&&Number.isInteger(f)&&f>0||Array.isArray(f)&&f.length>0),S=null!=v&&Array.isArray(v)&&(v.includes("regionByPx")||v.includes("regionByPct"))&&(v.includes("sizeByWh")||v.includes("sizeByH")||v.includes("sizeByW")||v.includes("sizeByPct"));if(y.sort((function(t,e){return e-t})),w||S)if(null!=f&&("number"==typeof f&&Number.isInteger(f)&&f>0?(u=f,l=f):Array.isArray(f)&&f.length>0&&((1==f.length||null==f[1]&&Number.isInteger(f[0]))&&(u=f[0],l=f[0]),2==f.length&&(Number.isInteger(f[0])&&Number.isInteger(f[1])?(u=f[0],l=f[1]):null==f[0]&&Number.isInteger(f[1])&&(u=f[1],l=f[1])))),void 0!==u&&void 0!==l||(u=256,l=256),0==y.length)for(var E=h=Math.max(Math.ceil(Math.log(c/u)/Math.LN2),Math.ceil(Math.log(p/l)/Math.LN2));E>=0;E--)y.push(Math.pow(2,E));else{var T=Math.max.apply(Math,y);h=Math.round(Math.log(T)/Math.LN2)}else if(u=c,l=p,y=[],x){a.sort((function(t,e){return t[0]-e[0]})),h=-1;var C=[];for(E=0;E<a.length;E++){var b=c/a[E][0];y.length>0&&y[y.length-1]==b?C.push(E):(y.push(b),h++)}if(C.length>0)for(E=0;E<C.length;E++)a.splice(C[E]-E,1)}else y.push(1),a.push([c,p]),h=0;var P=new Au({tileSize:[u,l],extent:m,origin:Kt(m),resolutions:y}),R=dc.bind(null,To(f||256).map((function(t){return t*d})));return(r=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:n.state,tileClass:R,tileGrid:P,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:function(t,e,r){var n,s,f=t[0];if(!(f>h)){var d=t[1],m=t[2],E=y[f];if(!(void 0===d||void 0===m||void 0===E||d<0||Math.ceil(c/E/u)<=d||m<0||Math.ceil(p/E/l)<=m)){if(S||w){var T=d*u*E,C=m*l*E,b=u*E,P=l*E,R=u,O=l;if(T+b>c&&(b=c-T),C+P>p&&(P=p-C),T+u*E>c&&(R=Math.floor((c-T+E-1)/E)),C+l*E>p&&(O=Math.floor((p-C+E-1)/E)),0==T&&b==c&&0==C&&P==p)n="full";else if(!S||v.includes("regionByPx"))n=T+","+C+","+b+","+P;else if(v.includes("regionByPct")){n="pct:"+bc(T/c*100)+","+bc(C/p*100)+","+bc(b/c*100)+","+bc(P/p*100)}o!=vc||S&&!v.includes("sizeByWh")?!S||v.includes("sizeByW")?s=R+",":v.includes("sizeByH")?s=","+O:v.includes("sizeByWh")?s=R+","+O:v.includes("sizeByPct")&&(s="pct:"+bc(100/E)):s=R+","+O}else if(n="full",x){var I=a[f][0],L=a[f][1];s=o==vc?I==c&&L==p?"max":I+","+L:I==c?"full":I+","}else s=o==vc?"max":"full";return i+n+"/"+s+"/0/"+g+"."+_}}},transition:n.transition})||this).zDirection=n.zDirection,r}return Cc(e,t),e}(Wh),Rc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Oc=function(t){function e(e,r,n,i,o,a){var s=this,u=e.getExtent(),l=r.getExtent(),h=l?Zt(n,l):n,c=bh(e,r,Yt(h),i),p=new Oh(e,r,h,u,.5*c,i),f=a(p.calculateSourceExtent(),c,o),d=f?Is:As,_=f?f.getPixelRatio():1;return(s=t.call(this,n,i,_,d)||this).targetProj_=r,s.maxSourceExtent_=u,s.triangulation_=p,s.targetResolution_=i,s.targetExtent_=n,s.sourceImage_=f,s.sourcePixelRatio_=_,s.canvas_=null,s.sourceListenerKey_=null,s}return Rc(e,t),e.prototype.disposeInternal=function(){this.state==Ls&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Fs){var e=Ht(this.targetExtent_)/this.targetResolution_,r=Wt(this.targetExtent_)/this.targetResolution_;this.canvas_=Rh(e,r,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Is){this.state=Ls,this.changed();var t=this.sourceImage_.getState();t==Fs||t==Ms?this.reproject_():(this.sourceListenerKey_=g(this.sourceImage_,N,(function(t){var e=this.sourceImage_.getState();e!=Fs&&e!=Ms||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){v(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(Xl),Ic=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lc="imageloadstart",Fc="imageloadend",Mc="imageloaderror",Ac=function(t){function e(e,r){var n=t.call(this,e)||this;return n.image=r,n}return Ic(e,t),e}(F);function Nc(t,e){t.getImage().src=e}var Gc=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return Ic(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=S(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,r,n){var i=this.getProjection();if(i&&n&&!Qe(i,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Qe(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&Mt(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Oc(i,n,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,i)}.bind(this)),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(n=i),this.getImageInternal(t,e,r,n)},e.prototype.getImageInternal=function(t,e,r,i){return n()},e.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Ls:this.loading=!0,this.dispatchEvent(new Ac(Lc,e));break;case Fs:this.loading=!1,this.dispatchEvent(new Ac(Fc,e));break;case Ms:this.loading=!1,this.dispatchEvent(new Ac(Mc,e))}},e}(Ah);function jc(t,e){var r=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))}));var n=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+n}var Dc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kc=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.hidpi_=void 0===n.hidpi||n.hidpi,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:Nc,r.params_=n.params||{},r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return Dc(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),r=this.hidpi_?r:1;var i=this.image_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==r&&Ct(i.getExtent(),t))return i;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};p(o,this.params_);var a=((t=t.slice())[0]+t[2])/2,s=(t[1]+t[3])/2;if(1!=this.ratio_){var u=this.ratio_*Ht(t)/2,l=this.ratio_*Wt(t)/2;t[0]=a-u,t[1]=s-l,t[2]=a+u,t[3]=s+l}var h=e/r,c=Math.ceil(Ht(t)/h),f=Math.ceil(Wt(t)/h);t[0]=a-h*c/2,t[2]=a+h*c/2,t[1]=s-h*f/2,t[3]=s+h*f/2,this.imageSize_[0]=c,this.imageSize_[1]=f;var d=this.getRequestUrl_(t,this.imageSize_,r,n,o);return this.image_=new Kl(t,e,r,d,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(N,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){var o=n.getCode().split(":").pop();i.SIZE=e[0]+","+e[1],i.BBOX=t.join(","),i.BBOXSR=o,i.IMAGESR=o,i.DPI=Math.round(90*r);var a=this.url_,s=a.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return s==a&&st(!1,50),jc(s,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){p(this.params_,t),this.image_=null,this.changed()},e}(Gc),Uc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zc=function(t){function e(e,r,n,i,o){var a=this,s=void 0!==o?Is:Fs;return(a=t.call(this,e,r,n,s)||this).loader_=void 0!==o?o:null,a.canvas_=i,a.error_=null,a}return Uc(e,t),e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=Ms):this.state=Fs,this.changed()},e.prototype.load=function(){this.state==Is&&(this.state=Ls,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(Xl),Bc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yc=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,projection:n.projection,resolutions:n.resolutions,state:n.state})||this).canvasFunction_=n.canvasFunction,r.canvas_=null,r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return Bc(e,t),e.prototype.getImageInternal=function(t,e,r,n){e=this.findNearestResolution(e);var i=this.canvas_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==r&&Ct(i.getExtent(),t))return i;$t(t=t.slice(),this.ratio_);var o=[Ht(t)/e*r,Wt(t)/e*r],a=this.canvasFunction_.call(this,t,e,r,o,n);return a&&(i=new zc(t,e,r,a)),this.canvas_=i,this.renderedRevision_=this.getRevision(),i},e}(Gc),Vc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var Xc=function(t){function e(e){var r=t.call(this,{projection:e.projection,resolutions:e.resolutions})||this;return r.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null,r.displayDpi_=void 0!==e.displayDpi?e.displayDpi:96,r.params_=e.params||{},r.url_=e.url,r.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:Nc,r.hidpi_=void 0===e.hidpi||e.hidpi,r.metersPerUnit_=void 0!==e.metersPerUnit?e.metersPerUnit:1,r.ratio_=void 0!==e.ratio?e.ratio:1,r.useOverlay_=void 0!==e.useOverlay&&e.useOverlay,r.image_=null,r.renderedRevision_=0,r}return Vc(e,t),e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){e=this.findNearestResolution(e),r=this.hidpi_?r:1;var i=this.image_;if(i&&this.renderedRevision_==this.getRevision()&&i.getResolution()==e&&i.getPixelRatio()==r&&Ct(i.getExtent(),t))return i;1!=this.ratio_&&$t(t=t.slice(),this.ratio_);var o=[Ht(t)/e*r,Wt(t)/e*r];if(void 0!==this.url_){var a=this.getUrl(this.url_,this.params_,t,o,n);(i=new Kl(t,e,r,a,this.crossOrigin_,this.imageLoadFunction_)).addEventListener(N,this.handleImageChange.bind(this))}else i=null;return this.image_=i,this.renderedRevision_=this.getRevision(),i},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.updateParams=function(t){p(this.params_,t),this.changed()},e.prototype.getUrl=function(t,e,r,n,i){var o=function(t,e,r,n){var i=Ht(t),o=Wt(t),a=e[0],s=e[1],u=.0254/n;return s*i>a*o?i*r/(a*u):o*r/(s*u)}(r,n,this.metersPerUnit_,this.displayDpi_),a=Yt(r),s={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(n[0]),SETDISPLAYHEIGHT:Math.round(n[1]),SETVIEWSCALE:o,SETVIEWCENTERX:a[0],SETVIEWCENTERY:a[1]};return p(s,e),jc(t,s)},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e}(Gc),Wc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zc=function(t){function e(e){var r=this,n=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:Nc;return(r=t.call(this,{attributions:e.attributions,projection:We(e.projection)})||this).url_=e.url,r.imageExtent_=e.imageExtent,r.image_=new Kl(r.imageExtent_,void 0,1,r.url_,n,i),r.imageSize_=e.imageSize?e.imageSize:null,r.image_.addEventListener(N,r.handleImageChange.bind(r)),r}return Wc(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,r,n){return Jt(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==Fs){var r=this.image_.getExtent(),n=this.image_.getImage(),i=void 0,o=void 0;this.imageSize_?(i=this.imageSize_[0],o=this.imageSize_[1]):(i=n.width,o=n.height);var a=Wt(r)/o,s=Math.ceil(Ht(r)/a);if(s!=i){var u=Ji(s,o),l=u.canvas;u.drawImage(n,0,0,i,o,0,0,l.width,l.height),this.image_.setImage(l)}}t.prototype.handleImageChange.call(this,e)},e}(Gc),Kc="carmentaserver",qc="geoserver",Hc="mapserver",Jc="qgis",Qc=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$c=[101,101],tp=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:Nc,r.params_=n.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return Qc(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){if(void 0!==this.url_){var i=We(r),o=this.getProjection();o&&o!==i&&(e=bh(o,i,t,e),t=er(t,i,o));var a=Xt(t,e,0,$c),s={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};p(s,this.params_,n);var u=Math.floor((t[0]-a[0])/e),l=Math.floor((a[3]-t[1])/e);return s[this.v13_?"I":"X"]=u,s[this.v13_?"J":"Y"]=l,this.getRequestUrl_(a,$c,1,o||i,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i*39.37*(25.4/.28)}return p(r,e),jc(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var i=e/r,o=Yt(t),a=Xt(o,i,0,[Math.ceil(Ht(t)/i),Math.ceil(Wt(t)/i)]),s=Xt(o,i,0,[Math.ceil(this.ratio_*Ht(t)/i),Math.ceil(this.ratio_*Wt(t)/i)]),u=this.image_;if(u&&this.renderedRevision_==this.getRevision()&&u.getResolution()==e&&u.getPixelRatio()==r&&Ct(u.getExtent(),a))return u;var l={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};p(l,this.params_),this.imageSize_[0]=Math.round(Ht(s)/i),this.imageSize_[1]=Math.round(Wt(s)/i);var h=this.getRequestUrl_(s,this.imageSize_,r,n,l);return this.image_=new Kl(s,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(N,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){if(st(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=r)switch(this.serverType_){case qc:var o=90*r+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case Hc:i.MAP_RESOLUTION=90*r;break;case Kc:case Jc:i.DPI=90*r;break;default:st(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var a,s=n.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=a.join(","),jc(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){p(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=Ii(t,"1.3")>=0},e}(Gc),ep=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rp='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',np=function(t){function e(e){var r,n=e||{};r=void 0!==n.attributions?n.attributions:[rp];var i=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,cacheSize:n.cacheSize,crossOrigin:i,opaque:void 0===n.opaque||n.opaque,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,url:o,wrapX:n.wrapX,attributionsCollapsible:!1})||this}return ep(e,t),e}(Hh),ip=r(3),op=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ap=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return op(e,t),e}(Ao),sp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),up=function(t){function e(e){var r=t.call(this)||this;return r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r}return sp(e,t),e.prototype.getFeatures=function(t){return n()},e.prototype.prepareFrame=function(t){return n()},e.prototype.renderFrame=function(t,e){return n()},e.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},e.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){var o=this.loadedTileCallback.bind(this,r,n);return t.forEachLoadedTile(e,n,i,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){},e.prototype.getDataAtPixel=function(t,e,r){return n()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Fs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Fs&&e!=Ms&&t.addEventListener(N,this.boundHandleImageChange_),e==Is&&(t.load(),e=t.getState()),e==Fs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==yo&&t.changed()},e}(H),lp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hp=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform_=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r}return lp(e,t),e.prototype.useContainer=function(t,e,r){var n,i,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(i=s.getContext("2d")));if(i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(n=document.createElement("div")).className=o;var a=n.style;a.position="absolute",a.width="100%",a.height="100%";var s=(i=Ji()).canvas;n.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=n,this.context=i}},e.prototype.clip=function(t,e,r){var n=e.pixelRatio,i=e.size[0]*n/2,o=e.size[1]*n/2,a=e.viewState.rotation,s=Kt(r),u=qt(r),l=Bt(r),h=zt(r);gr(e.coordinateToPixelTransform,s),gr(e.coordinateToPixelTransform,u),gr(e.coordinateToPixelTransform,l),gr(e.coordinateToPixelTransform,h),t.save(),Ts(t,-a,i,o),t.beginPath(),t.moveTo(s[0]*n,s[1]*n),t.lineTo(u[0]*n,u[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(h[0]*n,h[1]*n),t.clip(),Ts(t,a,i,o)},e.prototype.clipUnrotated=function(t,e,r){var n=Kt(r),i=qt(r),o=Bt(r),a=zt(r);gr(e.coordinateToPixelTransform,n),gr(e.coordinateToPixelTransform,i),gr(e.coordinateToPixelTransform,o),gr(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;gr(s,n),gr(s,i),gr(s,o),gr(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){var i=new Ka(t,this.inversePixelTransform,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(ii,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(oi,t,e)},e.prototype.getRenderTransform=function(t,e,r,n,i,o,a){var s=i/2,u=o/2,l=n/e,h=-l,c=-t[0]+a,p=-t[1];return vr(this.tempTransform_,s,u,l,h,-r,c,p)},e.prototype.getDataAtPixel=function(t,e,r){var n,i=gr(this.inversePixelTransform,t.slice()),o=this.context;try{n=o.getImageData(Math.round(i[0]),Math.round(i[1]),1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:n}return 0===n[3]?null:n},e}(up),cp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pp=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return cp(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,n=t.viewState,i=n.resolution,o=this.getLayer().getSource(),a=t.viewHints,s=t.extent;if(void 0!==e.extent&&(s=Zt(s,cr(e.extent,n.projection))),!a[Ti]&&!a[Ci]&&!Qt(s))if(o){var u=n.projection,l=o.getImage(s,i,r,u);l&&this.loadImage(l)&&(this.image_=l)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var r=this.image_,n=r.getExtent(),i=r.getResolution(),o=r.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,u=t.viewState,l=u.center,h=u.resolution,c=t.size,p=s*i/(h*o),f=Math.round(c[0]*s),d=Math.round(c[1]*s),_=u.rotation;if(_){var g=Math.round(Math.sqrt(f*f+d*d));f=g,d=g}vr(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,_,-f/2,-d/2),mr(this.inversePixelTransform,this.pixelTransform);var y=Ps(this.pixelTransform);this.useContainer(e,y,a.opacity);var v=this.context,m=v.canvas;m.width!=f||m.height!=d?(m.width=f,m.height=d):this.containerReused||v.clearRect(0,0,f,d);var x=!1;if(a.extent){var w=cr(a.extent,u.projection);(x=!Ct(w,t.extent)&&Jt(w,t.extent))&&this.clipUnrotated(v,t,w)}var S=r.getImage(),E=vr(this.tempTransform_,f/2,d/2,p,p,0,o*(n[0]-l[0])/i,o*(l[1]-n[3])/i);this.renderedResolution=i*s/o;var T=E[4],C=E[5],b=S.width*E[0],P=S.height*E[3];if(this.preRender(v,t),b>=.5&&P>=.5){var R=a.opacity,O=void 0;1!==R&&(O=this.context.globalAlpha,this.context.globalAlpha=R),this.context.drawImage(S,0,0,+S.width,+S.height,Math.round(T),Math.round(C),Math.round(b),Math.round(P)),1!==R&&(this.context.globalAlpha=O)}return this.postRender(v,t),x&&v.restore(),y!==m.style.transform&&(m.style.transform=y),this.container},e}(hp),fp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),dp=function(t){function e(e){return t.call(this,e)||this}return fp(e,t),e.prototype.createRenderer=function(){return new pp(this)},e}(ap),_p="preload",gp="useInterimTilesOnError",yp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vp=function(t){function e(e){var r=this,n=e||{},i=p({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return yp(e,t),e.prototype.getPreload=function(){return this.get(_p)},e.prototype.setPreload=function(t){this.set(_p,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(gp)},e.prototype.setUseInterimTilesOnError=function(t){this.set(gp,t)},e}(Ao),mp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xp=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new Pu(0,0,0,0),r}return mp(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==ci||r==fi||r==pi&&!n},e.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,r,i,o);return s.getState()==pi&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(ci)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],n=t.viewState,i=n.projection,a=n.resolution,s=n.center,u=n.rotation,l=t.pixelRatio,h=this.getLayer(),c=h.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(i),d=f.getZForResolution(a,c.zDirection),_=f.getResolution(d),g=t.extent,y=r.extent&&cr(r.extent,i);y&&(g=Zt(g,cr(r.extent,i)));var v=c.getTilePixelRatio(l),m=Math.round(t.size[0]*v),w=Math.round(t.size[1]*v);if(u){var S=Math.round(Math.sqrt(m*m+w*w));m=S,w=S}var E=_*m/2/v,T=_*w/2/v,C=[s[0]-E,s[1]-T,s[0]+E,s[1]+T],b=f.getTileRangeForExtentAndZ(g,d),P={};P[d]={};var R=this.createLoadedTileFinder(c,i,P),O=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var L=b.minX;L<=b.maxX;++L)for(var F=b.minY;F<=b.maxY;++F){var M=this.getTile(d,L,F,t);if(this.isDrawableTile(M)){var A=o(this);if(M.getState()==ci){P[d][M.tileCoord.toString()]=M;var N=M.inTransition(A);this.newTiles_||!N&&-1!==this.renderedTiles.indexOf(M)||(this.newTiles_=!0)}if(1===M.getAlpha(A,t.time))continue}var G=f.getTileCoordChildTileRange(M.tileCoord,I,O),j=!1;G&&(j=R(d+1,G)),j||f.forEachTileCoordParentTileRange(M.tileCoord,R,I,O)}var D=_/a;vr(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,u,-m/2,-w/2);var k=Ps(this.pixelTransform);this.useContainer(e,k,r.opacity);var U=this.context,z=U.canvas;mr(this.inversePixelTransform,this.pixelTransform),vr(this.tempTransform_,m/2,w/2,D,D,0,-m/2,-w/2),z.width!=m||z.height!=w?(z.width=m,z.height=w):this.containerReused||U.clearRect(0,0,m,w),y&&this.clipUnrotated(U,t,y),this.preRender(U,t),this.renderedTiles.length=0;var B,Y,V,X=Object.keys(P).map(Number);X.sort(x),1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(B=[],Y=[]):X=X.reverse();for(var W=X.length-1;W>=0;--W){var Z=X[W],K=c.getTilePixelSize(Z,l,i),q=f.getResolution(Z)/_,H=K[0]*q*D,J=K[1]*q*D,Q=f.getTileCoordForCoordAndZ(Kt(C),Z),$=f.getTileCoordExtent(Q),tt=gr(this.tempTransform_,[v*($[0]-C[0])/_,v*(C[3]-$[3])/_]),et=v*c.getGutterForProjection(i),rt=P[Z];for(var nt in rt){var it=(M=rt[nt]).tileCoord,ot=tt[0]-(Q[1]-it[1])*H,at=Math.round(ot+H),st=tt[1]-(Q[2]-it[2])*J,ut=Math.round(st+J),lt=at-(L=Math.round(ot)),ht=ut-(F=Math.round(st)),ct=d===Z;if(!(N=ct&&1!==M.getAlpha(o(this),t.time)))if(B){U.save(),V=[L,F,L+lt,F,L+lt,F+ht,L,F+ht];for(var pt=0,ft=B.length;pt<ft;++pt)if(d!==Z&&Z<Y[pt]){var dt=B[pt];U.beginPath(),U.moveTo(V[0],V[1]),U.lineTo(V[2],V[3]),U.lineTo(V[4],V[5]),U.lineTo(V[6],V[7]),U.moveTo(dt[6],dt[7]),U.lineTo(dt[4],dt[5]),U.lineTo(dt[2],dt[3]),U.lineTo(dt[0],dt[1]),U.clip()}B.push(V),Y.push(Z)}else U.clearRect(L,F,lt,ht);this.drawTileImage(M,t,L,F,lt,ht,et,ct,r.opacity),B&&!N&&U.restore(),this.renderedTiles.push(M),this.updateUsedTiles(t.usedTiles,c,M)}}return this.renderedRevision=p,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!Mt(this.renderedExtent_,C),this.renderedExtent_=C,this.renderedPixelRatio=l,this.renderedProjection=i,this.manageTilePyramid(t,c,f,l,i,g,d,h.getPreload()),this.scheduleExpireCache(t,c),this.postRender(U,t),r.extent&&U.restore(),k!==z.style.transform&&(z.style.transform=k),this.container},e.prototype.drawTileImage=function(t,e,r,n,i,a,s,u,l){var h=this.getTileImage(t);if(h){var c=o(this),p=u?t.getAlpha(c,e.time):1,f=l*p,d=f!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=f),this.context.drawImage(h,s,s,h.width-2*s,h.height-2*s,r,n,i,a),d&&this.context.restore(),1!==p?e.animate=!0:u&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var n=o(t);n in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var n=o(e);n in t||(t[n]={}),t[n][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,n,i,a,s,u,l){var h=o(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,_,g,y=t.wantedTiles[h],v=t.tileQueue;for(g=r.getMinZoom();g<=s;++g)for(p=r.getTileRangeForExtentAndZ(a,g,p),f=r.getResolution(g),d=p.minX;d<=p.maxX;++d)for(_=p.minY;_<=p.maxY;++_)s-g<=u?((c=e.getTile(g,d,_,n,i)).getState()==li&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==l&&l(c)):e.useTile(g,d,_,i)},e}(hp);xp.prototype.getLayer;var wp=xp,Sp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ep=function(t){function e(e){return t.call(this,e)||this}return Sp(e,t),e.prototype.createRenderer=function(){return new wp(this)},e}(vp),Tp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Cp="beforeoperations",bp="afteroperations",Pp="pixel",Rp="image",Op=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.extent=r.extent,i.resolution=r.viewState.resolution/r.pixelRatio,i.data=n,i}return Tp(e,t),e}(F),Ip=function(t){function e(e){var r=t.call(this,{projection:null})||this;r.worker_=null,r.operationType_=void 0!==e.operationType?e.operationType:Pp,r.threads_=void 0!==e.threads?e.threads:1,r.layers_=function(t){for(var e=t.length,r=new Array(e),n=0;n<e;++n)r[n]=Mp(t[n]);return r}(e.sources);for(var n,i=r.changed.bind(r),o=0,a=r.layers_.length;o<a;++o)r.layers_[o].addEventListener(N,i);return r.tileQueue_=new gi((function(){return 1}),r.changed.bind(r)),r.requestedFrameState_,r.renderedImageCanvas_=null,r.renderedRevision_,r.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],extent:null,index:0,layerIndex:0,layerStatesArray:(n=r.layers_,n.map((function(t){return t.getLayerState()}))),pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],tileQueue:r.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},declutterItems:[]},r.setAttributions((function(t){for(var r=[],n=0,i=e.sources.length;n<i;++n){var o=e.sources[n],a=(o instanceof Ah?o:o.getSource()).getAttributions();if("function"==typeof a){var s=a(t);r.push.apply(r,s)}}return 0!==r.length?r:null})),void 0!==e.operation&&r.setOperation(e.operation,e.lib),r}return Tp(e,t),e.prototype.setOperation=function(t,e){this.worker_=new ip.Processor({operation:t,imageOps:this.operationType_===Rp,queue:1,lib:e,threads:this.threads_}),this.changed()},e.prototype.updateFrameState_=function(t,e,r){var n=p({},this.frameState_);n.viewState=p({},n.viewState);var i=Yt(t);n.extent=t.slice(),n.size[0]=Math.round(Ht(t)/e),n.size[1]=Math.round(Wt(t)/e),n.time=1/0;var o=n.viewState;return o.center=i,o.projection=r,o.resolution=e,n},e.prototype.allSourcesReady_=function(){for(var t=!0,e=0,r=this.layers_.length;e<r;++e)if(this.layers_[e].getSource().getState()!==yo){t=!1;break}return t},e.prototype.getImage=function(t,e,r,n){if(!this.allSourcesReady_())return null;var i=this.updateFrameState_(t,e,n);if(this.requestedFrameState_=i,this.renderedImageCanvas_){var o=this.renderedImageCanvas_.getResolution(),a=this.renderedImageCanvas_.getExtent();e===o&&Mt(t,a)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),i.tileQueue.loadMoreTiles(16,16),i.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_},e.prototype.processSources_=function(){for(var t=this.requestedFrameState_,e=this.layers_.length,r=new Array(e),n=0;n<e;++n){t.layerIndex=n;var i=Fp(this.layers_[n],t);if(!i)return;r[n]=i}var o={};this.dispatchEvent(new Op(Cp,t,o)),this.worker_.process(r,o,this.onWorkerComplete_.bind(this,t))},e.prototype.onWorkerComplete_=function(t,e,r,n){if(!e&&r){var i=t.extent,o=t.viewState.resolution;if(o===this.requestedFrameState_.viewState.resolution&&Mt(i,this.requestedFrameState_.extent)){var a;if(this.renderedImageCanvas_)a=this.renderedImageCanvas_.getImage().getContext("2d");else a=Ji(Math.round(Ht(i)/o),Math.round(Wt(i)/o)),this.renderedImageCanvas_=new zc(i,o,1,a.canvas);a.putImageData(r,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Op(bp,t,n))}}},e.prototype.getImageInternal=function(){return null},e}(Gc),Lp=null;function Fp(t,e){var r=t.getRenderer();if(!r)throw new Error("Unsupported layer type: "+t);if(!r.prepareFrame(e))return null;var n,i=e.size[0],o=e.size[1],a=r.renderFrame(e,null);if(a&&(n=a.firstElementChild),!(n instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+n);if(n.width===i&&n.height===o)return n.getContext("2d").getImageData(0,0,i,o);if(Lp){var s=Lp.canvas;s.width!==i||s.height!==o?Lp=Ji(i,o):Lp.clearRect(0,0,i,o)}else Lp=Ji(i,o);return Lp.drawImage(n,0,0,i,o),Lp.getImageData(0,0,i,o)}function Mp(t){var e;return t instanceof Ah?t instanceof Dh?e=new Ep({source:t}):t instanceof Gc&&(e=new dp({source:t})):e=t,e}var Ap=Ip,Np=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gp=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',rp],jp={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},Dp={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},kp=function(t){function e(e){var r=e.layer.indexOf("-"),n=-1==r?e.layer:e.layer.slice(0,r),i=Dp[n],o=jp[e.layer],a=void 0!==e.url?e.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+e.layer+"/{z}/{x}/{y}."+o.extension;return t.call(this,{attributions:Gp,cacheSize:e.cacheSize,crossOrigin:"anonymous",maxZoom:null!=e.maxZoom?e.maxZoom:i.maxZoom,minZoom:null!=e.minZoom?e.minZoom:i.minZoom,opaque:o.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:a,wrapX:e.wrapX})||this}return Np(e,t),e}(Hh),Up=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function zp(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_||(e=1);var i=n.getTileCoordExtent(t,this.tmpExtent_),o=To(n.getTileSize(t[0]),this.tmpSize);1!=e&&(o=Eo(o,e,this.tmpSize));var a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return p(a,this.params_),this.getRequestUrl_(t,o,i,e,r,a)}}var Bp=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,tileUrlFunction:zp,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this).params_=n.params||{},r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.setKey(r.getKeyForParams_()),r}return Up(e,t),e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){var s,u=i.getCode().split(":").pop();if(o.SIZE=e[0]+","+e[1],o.BBOX=r.join(","),o.BBOXSR=u,o.IMAGESR=u,o.DPI=Math.round(o.DPI?o.DPI*n:90*n),1==a.length)s=a[0];else s=a[ge(Fu(t),a.length)];return jc(s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_?t:1},e.prototype.updateParams=function(t){p(this.params_,t),this.setKey(this.getKeyForParams_())},e}(Wh),Yp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vp=function(t){function e(e,r,n){var i=t.call(this,e,ci)||this;return i.tileSize_=r,i.text_=n,i.canvas_=null,i}return Yp(e,t),e.prototype.getImage=function(){if(this.canvas_)return this.canvas_;var t=this.tileSize_,e=Ji(t[0],t[1]);return e.strokeStyle="grey",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="grey",e.strokeStyle="white",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.lineWidth=4,e.strokeText(this.text_,t[0]/2,t[1]/2,t[0]),e.fillText(this.text_,t[0]/2,t[1]/2,t[0]),this.canvas_=e.canvas,e.canvas},e.prototype.load=function(){},e}(xh),Xp=function(t){function e(e){var r=e||{};return t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection})||this}return Yp(e,t),e.prototype.getTile=function(t,e,r){var n=Ou(t,e,r);if(this.tileCache.containsKey(n))return this.tileCache.get(n);var i=To(this.tileGrid.getTileSize(t)),o=[t,e,r],a=this.getTileCoordForTileUrlFunction(o),s=void 0;s=a?"z:"+a[0]+" x:"+a[1]+" y:"+a[2]:"none";var u=new Vp(o,i,s);return this.tileCache.set(n,u),u},e}(Hh),Wp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zp=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:We("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:go,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition})||this;if(r.tileJSON_=null,r.tileSize_=e.tileSize,e.url)if(e.jsonp)vh(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var n=new XMLHttpRequest;n.addEventListener("load",r.onXHRLoad_.bind(r)),n.addEventListener("error",r.onXHRError_.bind(r)),n.open("GET",e.url),n.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):st(!1,51);return r}return Wp(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,r=We("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=$e(r,n);e=te(t.bounds,i)}var o=t.minzoom||0,a=t.maxzoom||22,s=Gu({extent:ku(n),maxZoom:a,minZoom:o,tileSize:this.tileSize_});if(this.tileGrid=s,this.tileUrlFunction=dh(t.tiles,s),void 0!==t.attribution&&!this.getAttributions()){var u=void 0!==e?e:r.getExtent();this.setAttributions((function(e){return Jt(u,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(yo)},e.prototype.handleTileJSONError=function(){this.setState(vo)},e}(Wh),Kp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function qp(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=To(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=So(a,s,this.tmpSize),o=wt(o,i*s,o)),1!=e&&(a=Eo(a,e,this.tmpSize));var u={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return p(u,this.params_),this.getRequestUrl_(t,a,o,e,r,u)}}var Hp=function(t){function e(e){var r=this,n=e||{},i=n.params||{},o=!("TRANSPARENT"in i)||i.TRANSPARENT;return(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,opaque:!o,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,tileUrlFunction:qp,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this).gutter_=void 0!==n.gutter?n.gutter:0,r.params_=i,r.v13_=!0,r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return Kp(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){var i=We(r),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(i));var s=a.getZForResolution(e,this.zDirection),u=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=u[0])){var l=a.getResolution(u[0]),h=a.getTileCoordExtent(u,this.tmpExtent_),c=To(a.getTileSize(u[0]),this.tmpSize),f=this.gutter_;0!==f&&(c=So(c,f,this.tmpSize),h=wt(h,l*f,h)),o&&o!==i&&(l=bh(o,i,t,l),h=rr(h,i,o),t=er(t,i,o));var d={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};p(d,this.params_,n);var _=Math.floor((t[0]-h[0])/l),g=Math.floor((h[3]-t[1])/l);return d[this.v13_?"I":"X"]=_,d[this.v13_?"J":"Y"]=g,this.getRequestUrl_(u,c,h,1,o||i,d)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i*39.37*(25.4/.28)}return p(r,e),jc(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=n)switch(this.serverType_){case qc:var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case Hc:o.MAP_RESOLUTION=90*n;break;case Kc:case Jc:o.DPI=90*n;break;default:st(!1,52)}var u,l=i.getAxisOrientation(),h=r;if(this.v13_&&"ne"==l.substr(0,2)){var c=void 0;c=r[0],h[0]=r[1],h[1]=c,c=r[2],h[2]=r[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)u=a[0];else u=a[ge(Fu(t),a.length)];return jc(u,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){p(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||"1.3.0";this.v13_=Ii(t,"1.3")>=0},e}(Wh),Jp=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qp=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r)||this;return s.src_=n,s.extent_=i,s.preemptive_=o,s.grid_=null,s.keys_=null,s.data_=null,s.jsonp_=a,s}return Jp(e,t),e.prototype.getImage=function(){return null},e.prototype.getData=function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),r=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),n=this.grid_[Math.floor((1-r)*this.grid_.length)];if("string"!=typeof n)return null;var i=n.charCodeAt(Math.floor(e*n.length));i>=93&&i--,i>=35&&i--;var o=null;if((i-=32)in this.keys_){var a=this.keys_[i];o=this.data_&&a in this.data_?this.data_[a]:a}return o},e.prototype.forDataAtCoordinate=function(t,e,r){this.state==fi&&!0===r?(this.state=li,y(this,N,(function(r){e(this.getData(t))}),this),this.loadInternal_()):!0===r?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))},e.prototype.getKey=function(){return this.src_},e.prototype.handleError_=function(){this.state=pi,this.changed()},e.prototype.handleLoad_=function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=ci,this.changed()},e.prototype.loadInternal_=function(){if(this.state==li)if(this.state=hi,this.jsonp_)vh(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}},e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(r)}else this.handleError_()},e.prototype.onXHRError_=function(t){this.handleError_()},e.prototype.load=function(){this.preemptive_?this.loadInternal_():this.setState(fi)},e}(xh),$p=function(t){function e(e){var r=t.call(this,{projection:We("EPSG:3857"),state:go})||this;if(r.preemptive_=void 0===e.preemptive||e.preemptive,r.tileUrlFunction_=gh,r.template_=void 0,r.jsonp_=e.jsonp||!1,e.url)if(r.jsonp_)vh(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var n=new XMLHttpRequest;n.addEventListener("load",r.onXHRLoad_.bind(r)),n.addEventListener("error",r.onXHRError_.bind(r)),n.open("GET",e.url),n.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):st(!1,51);return r}return Jp(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var r=void 0;try{r=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(r)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTemplate=function(){return this.template_},e.prototype.forDataAtCoordinateAndResolution=function(t,e,r,n){if(this.tileGrid){var i=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,i);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,r,n)}else!0===n?setTimeout((function(){r(null)}),0):r(null)},e.prototype.handleTileJSONError=function(){this.setState(vo)},e.prototype.handleTileJSONResponse=function(t){var e,r=We("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=$e(r,n);e=te(t.bounds,i)}var o=t.minzoom||0,a=t.maxzoom||22,s=Gu({extent:ku(n),maxZoom:a,minZoom:o});this.tileGrid=s,this.template_=t.template;var u=t.grids;if(u){if(this.tileUrlFunction_=dh(u,s),void 0!==t.attribution){var l=void 0!==e?e:r.getExtent();this.setAttributions((function(e){return Jt(l,e.extent)?[t.attribution]:null}))}this.setState(yo)}else this.setState(vo)},e.prototype.getTile=function(t,e,r,n,i){var o=Ou(t,e,r);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),u=this.tileUrlFunction_(s,n,i),l=new Qp(a,void 0!==u?li:fi,void 0!==u?u:"",this.tileGrid.getTileCoordExtent(a),this.preemptive_,this.jsonp_);return this.tileCache.set(o,l),l},e.prototype.useTile=function(t,e,r){var n=Ou(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(Dh),tf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ef=[],rf=function(t){function e(e,r,n,i){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.loadingSourceTiles=0,o.errorSourceTileKeys={},o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=null,o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.sourceZ=-1,o.hifi=!1,o.wrappedTileCoord=n,o}return tf(e,t),e.prototype.getContext=function(t){var e=o(t);return e in this.context_||(this.context_[e]=Ji(1,1,ef)),this.context_[e]},e.prototype.hasContext=function(t){return o(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=o(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedZ:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)ef.push(this.context_[e].canvas);t.prototype.release.call(this)},e}(xh),nf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),of=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.extent=null,s.format_=i,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=n,s}return nf(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.getKey=function(){return this.url_},e.prototype.load=function(){this.state==li&&(this.setState(hi),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(pi)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(ci)},e.prototype.setLoader=function(t){this.loader_=t},e}(xh),af=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sf=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||ku(n),o=e.tileGrid||Gu({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:uf,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.loadingTiles_={},r.sourceTileCache=new Ch(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:of,r.tileGrids_={},r}return af(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var n=Lu(r.peekFirstKey())[0],i=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===n&&r.getState()===ci)for(var o=r.getSourceTiles(),a=0,s=o.length;a<s;++a){var u=o[a],l=u.tileCoord;if(Jt(t,i.getTileCoordExtent(l))){var h=u.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var f=h[c],d=f.getGeometry();Jt(t,d.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache({})},e.prototype.getSourceTiles=function(t,e,r){var n=r.wrappedTileCoord,i=this.getTileGridForProjection(e),o=i.getTileCoordExtent(n),a=n[0],s=i.getResolution(a);wt(o,-s,o);var u=this.tileGrid,l=u.getExtent();l&&Zt(o,l,o);var h,c,p,f=u.getZForResolution(s,1),d=u.getMinZoom(),_=r.sourceTiles;if(_&&_.length>0&&_[0].tileCoord[0]===f)h=_,c=!0,p=f;else{h=[],p=f+1;do{--p,c=!0,u.forEachTileCoord(o,p,function(n){var i,o=this.tileUrlFunction(n,t,e);if(void 0!==o)if(this.sourceTileCache.containsKey(o)){var a=(i=this.sourceTileCache.get(o)).getState();if(a===ci||a===pi||a===fi)return void h.push(i)}else p===f&&((i=new this.tileClass(n,li,o,this.format_,this.tileLoadFunction)).extent=u.getTileCoordExtent(n),i.projection=e,i.resolution=u.getResolution(n[0]),this.sourceTileCache.set(o,i),i.addEventListener(N,this.handleTileChange.bind(this)),i.load());c=c&&i&&i.getState()===ci,i&&i.getState()!==fi&&r.getState()===li&&(r.loadingSourceTiles++,i.addEventListener(N,(function t(){var e=i.getState(),n=i.getKey();if(e===ci||e===pi){e===ci?(i.removeEventListener(N,t),r.loadingSourceTiles--,delete r.errorSourceTileKeys[n]):e===pi&&(r.errorSourceTileKeys[n]=!0);var o=Object.keys(r.errorSourceTileKeys).length;r.loadingSourceTiles-o==0&&(r.hifi=0===o,r.sourceZ=f,r.setState(ci))}})))}.bind(this)),c||(h.length=0)}while(!c&&p>d)}return r.getState()===li&&r.setState(hi),c&&(r.hifi=f===p,r.sourceZ=p,r.getState()<ci?r.setState(ci):_&&b(h,_)||(r.sourceTiles=h)),h},e.prototype.getTile=function(t,e,r,n,i){var o,a=Ou(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)&&(o=this.tileCache.get(a)).key===s)return o;var u=[t,e,r],l=this.getTileCoordForTileUrlFunction(u,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(l&&h){var p=c.getTileCoordExtent(l);wt(p,-c.getResolution(t),p),Jt(h,p)||(l=null)}var f=!0;if(null!==l){var d=this.tileGrid,_=c.getResolution(t),g=d.getZForResolution(_,1),y=c.getTileCoordExtent(l);wt(y,-_,y),d.forEachTileCoord(y,g,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var v=new rf(u,f?fi:li,l,this.getSourceTiles.bind(this,n,i));return v.key=s,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(a,v)):this.tileCache.set(a,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){var n=this.tileGrid;r=Du(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=To(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e}(Yh);function uf(t,e){var r=Su(e,t.getFormat(),t.onLoad.bind(t),t.onError.bind(t));t.setLoader(r)}var lf="KVP",hf="REST",cf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pf=function(t){function e(e){var r=this,n=void 0!==e.requestEncoding?e.requestEncoding:lf,i=e.tileGrid,o=e.urls;return void 0===o&&void 0!==e.url&&(o=yh(e.url)),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileClass:e.tileClass,tileGrid:i,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:gh,urls:o,wrapX:void 0!==e.wrapX&&e.wrapX,transition:e.transition})||this).version_=void 0!==e.version?e.version:"1.0.0",r.format_=void 0!==e.format?e.format:"image/jpeg",r.dimensions_=void 0!==e.dimensions?e.dimensions:{},r.layer_=e.layer,r.matrixSet_=e.matrixSet,r.style_=e.style,r.requestEncoding_=n,r.setKey(r.getKeyForDimensions_()),o&&o.length>0&&(r.tileUrlFunction=_h(o.map(ff.bind(r)))),r}return cf(e,t),e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.setTileUrlFunction(_h(t.map(ff.bind(this))),e)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var r in this.dimensions_)e[t++]=r+"-"+this.dimensions_[r];return e.join("/")},e.prototype.updateDimensions=function(t){p(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e}(Wh);function ff(t){var e=this.requestEncoding_,r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};e==lf&&p(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t=e==lf?jc(t,r):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in r?r[e.toLowerCase()]:t}));var n=this.tileGrid,i=this.dimensions_;return function(r,o,a){if(r){var s={TileMatrix:n.getMatrixId(r[0]),TileCol:r[1],TileRow:r[2]};p(s,i);var u=t;return u=e==lf?jc(u,s):u.replace(/\{(\w+?)\}/g,(function(t,e){return s[e]}))}}}var df=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_f="GENERATE_BUFFERS",gf=function(t){function e(e,r){var n=t.call(this,e)||this,i=r||{};return n.helper=new Ol({postProcesses:i.postProcesses,uniforms:i.uniforms}),n}return df(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getShaderCompileErrors=function(){return this.helper.getShaderCompileErrors()},e}(up);var yf=gf,vf=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),mf=URL.createObjectURL(vf);var xf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wf="renderOrder",Sf=function(t){function e(e){var r=this,n=e||{},i=p({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return xf(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(wf)},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.setRenderOrder=function(t){this.set(wf,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:ah,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;if(Array.isArray(t))r=t;else st("function"==typeof t.getZIndex,41),r=[t];e=function(){return r}}return e}(this.style_),this.changed()},e}(Ao),Ef=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tf=function(t){function e(e,r){var n=this,i=r.uniforms||{},a=[1,0,0,1,0,0];i[xl]=a,(n=t.call(this,e,{uniforms:i,postProcesses:r.postProcesses})||this).sourceRevision_=-1,n.verticesBuffer_=new dl(34962,35048),n.hitVerticesBuffer_=new dl(34962,35048),n.indicesBuffer_=new dl(34963,35048),n.program_=n.helper.getProgram(r.fragmentShader,r.vertexShader),n.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),n.hitProgram_=n.hitDetectionEnabled_&&n.helper.getProgram(r.hitFragmentShader,r.hitVertexShader);var s=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:bl.FLOAT}})):[];n.attributes=[{name:"a_position",size:2,type:bl.FLOAT},{name:"a_index",size:1,type:bl.FLOAT}].concat(s),n.hitDetectionAttributes=[{name:"a_position",size:2,type:bl.FLOAT},{name:"a_index",size:1,type:bl.FLOAT},{name:"a_hitColor",size:4,type:bl.FLOAT},{name:"a_featureUid",size:1,type:bl.FLOAT}].concat(s),n.customAttributes=r.attributes?r.attributes:[],n.previousExtent_=[1/0,1/0,-1/0,-1/0],n.currentTransform_=a,n.renderTransform_=[1,0,0,1,0,0],n.invertRenderTransform_=[1,0,0,1,0,0],n.renderInstructions_=new Float32Array(0),n.hitRenderInstructions_=new Float32Array(0),n.hitRenderTarget_=n.hitDetectionEnabled_&&new Ll(n.helper),n.worker_=new Worker(mf),n.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===_f){var r=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=r,mr(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions),this.getLayer().changed()}}.bind(n)),n.featureCache_={},n.featureCount_=0;var u=n.getLayer().getSource();return n.sourceListenKeys_=[g(u,$h,n.handleSourceFeatureAdded_,n),g(u,tc,n.handleSourceFeatureChanged_,n),g(u,rc,n.handleSourceFeatureDelete_,n),g(u,ec,n.handleSourceFeatureClear_,n)],u.forEachFeature(function(t){this.featureCache_[o(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(n)),n}return Ef(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[o(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[o(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e),this.helper.finalizeDraw(t);var r=this.helper.getCanvas(),n=t.layerStatesArray[t.layerIndex].opacity;return n!==parseFloat(r.style.opacity)&&(r.style.opacity=n),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),r},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewState,i=!t.viewHints[Ti]&&!t.viewHints[Ci],o=!Mt(this.previousExtent_,t.extent),a=this.sourceRevision_<r.getRevision();if(a&&(this.sourceRevision_=r.getRevision()),i&&(o||a)){var s=n.projection,u=n.resolution,l=e instanceof Sf?e.getRenderBuffer():0,h=wt(t.extent,l*u);r.loadFeatures(h,u,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),dr(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var r,n,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s,u,l=[],h=[],c=0,p=0;for(var f in this.featureCache_)if((n=(r=this.featureCache_[f]).geometry)&&n.getType()===ae.POINT){l[0]=n.getFlatCoordinates()[0],l[1]=n.getFlatCoordinates()[1],gr(e,l),s=p+6,u=void 0,(u=h||[])[0]=Math.floor(s/256/256/256)/255,u[1]=Math.floor(s/256/256)%256/255,u[2]=Math.floor(s/256)%256/255,u[3]=s%256/255,a=u,this.renderInstructions_[c++]=l[0],this.renderInstructions_[c++]=l[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=l[0],this.hitRenderInstructions_[p++]=l[1],this.hitRenderInstructions_[p++]=a[0],this.hitRenderInstructions_[p++]=a[1],this.hitRenderInstructions_[p++]=a[2],this.hitRenderInstructions_[p++]=a[3],this.hitRenderInstructions_[p++]=Number(f));for(var d=void 0,_=0;_<this.customAttributes.length;_++)d=this.customAttributes[_].callback(r.feature,r.properties),this.renderInstructions_[c++]=d,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[p++]=d)}var g={type:_f,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(g.projectionTransform=e,this.worker_.postMessage(g,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var y={type:_f,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};y.projectionTransform=e,y.hitDetection=!0,this.worker_.postMessage(y,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(st(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=gr(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0;return e+=Math.round(256*t[0]*256*256*255),e+=Math.round(256*t[1]*256*255),e+=Math.round(256*t[2]*255),e+=Math.round(255*t[3])}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),u=this.hitRenderInstructions_[s],l=Math.floor(u).toString(),h=this.getLayer().getSource().getFeatureByUid(l);return h?n(h,this.getLayer()):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){v(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(yf),Cf={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},bf=[Cf.FILL],Pf=[Cf.STROKE],Rf=[Cf.BEGIN_PATH],Of=[Cf.CLOSE_PATH],If=Cf,Lf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ff=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Lf(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatCoordinates=function(t,e,r,n,i,o){var a=this.coordinates.length,s=this.getBufferedMaxExtent();o&&(e+=n);var u,l,h,c=t[e],p=t[e+1],f=this.tmpCoordinate_,d=!0;for(u=e+n;u<r;u+=n)f[0]=t[u],f[1]=t[u+1],(h=Pt(s,f))!==l?(d&&(this.coordinates[a++]=c,this.coordinates[a++]=p),this.coordinates[a++]=f[0],this.coordinates[a++]=f[1],d=!1):h===_t?(this.coordinates[a++]=f[0],this.coordinates[a++]=f[1],d=!1):d=!0,c=f[0],p=f[1],l=h;return(i&&d||u===e+n)&&(this.coordinates[a++]=c,this.coordinates[a++]=p),a},e.prototype.drawCustomCoordinates_=function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o],u=this.appendFlatCoordinates(t,e,s,n,!1,!1);i.push(u),e=s}return e},e.prototype.drawCustom=function(t,e,r){this.beginGeometry(t,e);var n,i,o,a,s,u=t.getType(),l=t.getStride(),h=this.coordinates.length;if(u==ae.MULTI_POLYGON){n=(t=t).getOrientedFlatCoordinates(),a=[];var c=t.getEndss();s=0;for(var p=0,f=c.length;p<f;++p){var d=[];s=this.drawCustomCoordinates_(n,s,c[p],l,d),a.push(d)}this.instructions.push([If.CUSTOM,h,a,t,r,kr])}else u==ae.POLYGON||u==ae.MULTI_LINE_STRING?(o=[],n=u==ae.POLYGON?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),s=this.drawCustomCoordinates_(n,0,t.getEnds(),l,o),this.instructions.push([If.CUSTOM,h,o,t,r,Dr])):u==ae.LINE_STRING||u==ae.MULTI_POINT?(n=t.getFlatCoordinates(),i=this.appendFlatCoordinates(n,0,n.length,l,!1,!1),this.instructions.push([If.CUSTOM,h,i,t,r,jr])):u==ae.POINT&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),i=this.coordinates.length,this.instructions.push([If.CUSTOM,h,i,t,r]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){var r=t.getExtent();this.beginGeometryInstruction1_=[If.BEGIN_GEOMETRY,e,0,r],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[If.BEGIN_GEOMETRY,e,0,r],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,n,i=e.length,o=-1;for(t=0;t<i;++t)(n=(r=e[t])[0])==If.END_GEOMETRY?o=t:n==If.BEGIN_GEOMETRY&&(r[2]=t,E(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var n=t.getColor();r.fillStyle=us(n||"#000")}else r.fillStyle=void 0;if(e){var i=e.getColor();r.strokeStyle=us(i||"#000");var o=e.getLineCap();r.lineCap=void 0!==o?o:"round";var a=e.getLineDash();r.lineDash=a?a.slice():hs;var s=e.getLineDashOffset();r.lineDashOffset=s||0;var u=e.getLineJoin();r.lineJoin=void 0!==u?u:"round";var l=e.getWidth();r.lineWidth=void 0!==l?l:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10,r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[If.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[If.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!b(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=u)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[If.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=St(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;wt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(ls),Mf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Af=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.declutterGroups_=null,o.hitDetectionImage_=null,o.image_=null,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o}return Mf(e,t),e.prototype.drawCoordinates_=function(t,e,r,n){return this.appendFlatCoordinates(t,e,r,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,n);this.instructions.push([If.DRAW_IMAGE,i,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([If.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,n);this.instructions.push([If.DRAW_IMAGE,i,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([If.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroups_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,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(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getHitDetectionImage(1),o=t.getImage(1),a=t.getOrigin();this.anchorX_=r[0],this.anchorY_=r[1],this.declutterGroups_=e,this.hitDetectionImage_=i,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=n[0]},e}(Ff),Nf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gf=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return Nf(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatCoordinates(t,e,r,n,!1,!1),a=[If.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([If.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Rf);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(Pf),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([If.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Rf);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),u=0,l=0,h=o.length;l<h;++l)u=this.drawFlatCoordinates_(a,u,o[l],s);this.hitDetectionInstructions.push(Pf),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Pf),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Pf),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Rf)},e}(Ff),jf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Df=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return jf(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,n){var i=this.state,o=void 0!==i.fillStyle,a=void 0!==i.strokeStyle,s=r.length;this.instructions.push(Rf),this.hitDetectionInstructions.push(Rf);for(var u=0;u<s;++u){var l=r[u],h=this.coordinates.length,c=this.appendFlatCoordinates(t,e,l,n,!0,!a),p=[If.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(Of),this.hitDetectionInstructions.push(Of)),e=l}return o&&(this.instructions.push(bf),this.hitDetectionInstructions.push(bf)),a&&(this.instructions.push(Pf),this.hitDetectionInstructions.push(Pf)),e},e.prototype.drawCircle=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([If.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([If.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,a,!1,!1);var u=[If.CIRCLE,s];this.instructions.push(Rf,u),this.hitDetectionInstructions.push(Rf,u),void 0!==r.fillStyle&&(this.instructions.push(bf),this.hitDetectionInstructions.push(bf)),void 0!==r.strokeStyle&&(this.instructions.push(Pf),this.hitDetectionInstructions.push(Pf)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([If.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([If.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,o,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([If.SET_FILL_STYLE,"#000"]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([If.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),u=0,l=0,h=o.length;l<h;++l)u=this.drawFlatCoordinatess_(a,u,o[l],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,n=0,i=r.length;n<i;++n)r[n]=Br(r[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Ff);function kf(t,e,r,n,i){var o,a,s,u,l,h,c,p,f,d=r,_=r,g=0,y=0,v=r;for(o=r;o<n;o+=i){var m=e[o],x=e[o+1];void 0!==u&&(p=m-u,f=x-l,s=Math.sqrt(p*p+f*f),void 0!==h&&(y+=a,Math.acos((h*p+c*f)/(a*s))>t&&(y>g&&(g=y,d=v,_=o),y=0,v=o-i)),a=s,h=p,c=f),u=m,l=x}return(y+=s)>g?[v,o]:[d,_]}var Uf=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zf={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Bf={Circle:Df,Default:Ff,Image:Af,LineString:Gf,Polygon:Df,Text:function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.declutterGroups_,o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o}return Uf(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o,a,s=this.coordinates.length,u=t.getType(),l=null,h=2,c=2;if(i.placement===ch){if(!Jt(this.getBufferedMaxExtent(),t.getExtent()))return;var p=void 0;if(l=t.getFlatCoordinates(),c=t.getStride(),u==ae.LINE_STRING)p=[l.length];else if(u==ae.MULTI_LINE_STRING)p=t.getEnds();else if(u==ae.POLYGON)p=t.getEnds().slice(0,1);else if(u==ae.MULTI_POLYGON){var f=t.getEndss();for(p=[],o=0,a=f.length;o<a;++o)p.push(f[o][0])}this.beginGeometry(t,e);for(var d=i.textAlign,_=0,g=void 0,y=0,v=p.length;y<v;++y){if(null==d){var m=kf(i.maxAngle,l,_,p[y],c);_=m[0],g=m[1]}else g=p[y];for(o=_;o<g;o+=c)this.coordinates.push(l[o],l[o+1]);h=this.coordinates.length,_=p[y];var x=this.declutterGroups_?0===y?this.declutterGroups_[0]:[].concat(this.declutterGroups_[0]):null;this.drawChars_(s,h,x),s=h}this.endGeometry(e)}else{var w=null;switch(i.overflow||(w=[]),u){case ae.POINT:case ae.MULTI_POINT:h=(l=t.getFlatCoordinates()).length;break;case ae.LINE_STRING:l=t.getFlatMidpoint();break;case ae.CIRCLE:l=t.getCenter();break;case ae.MULTI_LINE_STRING:h=(l=t.getFlatMidpoints()).length;break;case ae.POLYGON:l=t.getFlatInteriorPoint(),i.overflow||w.push(l[2]/this.resolution),c=3;break;case ae.MULTI_POLYGON:var S=t.getFlatInteriorPoints();for(l=[],o=0,a=S.length;o<a;o+=3)i.overflow||w.push(S[o+2]/this.resolution),l.push(S[o],S[o+1]);if(0==(h=l.length))return}h=this.appendFlatCoordinates(l,0,h,c,!1,!1),this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var E=this.pixelRatio;this.instructions.push([If.DRAW_IMAGE,s,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1,NaN,i.padding==cs?cs:i.padding.map((function(t){return t*E})),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]),this.hitDetectionInstructions.push([If.DRAW_IMAGE,s,h,null,NaN,NaN,this.declutterGroups_,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,1/this.pixelRatio,NaN,i.padding,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,w]),this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e,r){var n=this.textStrokeState_,i=this.textState_,o=this.strokeKey_,a=this.textKey_,s=this.fillKey_;this.saveTextStates_();var u=this.pixelRatio,l=zf[i.textBaseline],h=this.textOffsetY_*u,c=this.text_,p=i.scale,f=n?n.lineWidth*p/2:0;this.instructions.push([If.DRAW_CHARS,t,e,l,r,i.overflow,s,i.maxAngle,u,h,o,f*u,c,a,1]),this.hitDetectionInstructions.push([If.DRAW_CHARS,t,e,l,r,i.overflow,s,i.maxAngle,1,h,o,f,c,a,1/u])},e.prototype.setTextStyle=function(t,e){var r,n,i;if(t){this.declutterGroups_=e;var a=t.getFill();a?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=us(a.getColor()||"#000")):(n=null,this.textFillState_=n);var s=t.getStroke();if(s){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var u=s.getLineDash(),l=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();i.lineCap=s.getLineCap()||"round",i.lineDash=u?u.slice():hs,i.lineDashOffset=void 0===l?0:l,i.lineJoin=s.getLineJoin()||"round",i.lineWidth=void 0===h?1:h,i.miterLimit=void 0===c?10:c,i.strokeStyle=us(s.getColor()||"#000")}else i=null,this.textStrokeState_=i;r=this.textState_;var p=t.getFont()||"10px sans-serif";ms(p);var f=t.getScale();r.overflow=t.getOverflow(),r.font=p,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||"middle",r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||cs,r.scale=void 0===f?1:f;var d=t.getOffsetX(),_=t.getOffsetY(),g=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===_?0:_,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===y?0:y,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:o(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+o(n.fillStyle):""}else this.text_=""},e}(Ff)},Yf=function(){function t(t,e,r,n,i){this.declutter_=i,this.declutterGroups_=null,this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.addDeclutter=function(t){var e=null;return this.declutter_&&(t?(e=this.declutterGroups_)[0][4]++:(e=[[1/0,1/0,-1/0,-1/0]],this.declutterGroups_=e,e[0].push(1))),e},t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var n in r){var i=r[n].finish();t[e][n]=i}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[r];void 0===n&&(n={},this.buildersByZIndex_[r]=n);var i=n[e];void 0===i&&(i=new(0,Bf[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=i);return i},t}();function Vf(t,e,r,n){for(var i=t[e],o=t[e+1],a=0,s=e+n;s<r;s+=n){var u=t[s],l=t[s+1];a+=Math.sqrt((u-i)*(u-i)+(l-o)*(l-o)),i=u,o=l}return a}function Xf(t,e,r,n,i,o,a,s,u,l,h){for(var c,p,f=[],d=t[e]>t[r-n],_=i.length,g=t[e],y=t[e+1],v=t[e+=n],m=t[e+1],x=0,w=Math.sqrt(Math.pow(v-g,2)+Math.pow(m-y,2)),S=!1,E=0;E<_;++E){for(var T=i[c=d?_-E-1:E],C=s*u(l,T,h),b=o+C/2;e<r-n&&x+w<b;)g=v,y=m,v=t[e+=n],m=t[e+1],x+=w,w=Math.sqrt(Math.pow(v-g,2)+Math.pow(m-y,2));var P=b-x,R=Math.atan2(m-y,v-g);if(d&&(R+=R>0?-Math.PI:Math.PI),void 0!==p){var O=R-p;if(S=S||0!==O,O+=O>Math.PI?-2*Math.PI:O<-Math.PI?2*Math.PI:0,Math.abs(O)>a)return null}p=R;var I=P/w,L=ye(g,v,I),F=ye(y,m,I);f[c]=[L,F,C/2,R,T],o+=C}return S?f:[[f[0][0],f[0][1],f[0][2],f[0][3],i]]}var Wf=[1/0,1/0,-1/0,-1/0],Zf=[1,0,0,1,0,0],Kf=[],qf=[],Hf=[],Jf=[],Qf=function(){function t(t,e,r,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.declutterItems=[],this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,n){var i=t+e+r+n;if(this.labels_[i])return this.labels_[i];var o=n?this.strokeStates[n]:null,a=r?this.fillStates[r]:null,s=this.textStates[e],u=this.pixelRatio,l=s.scale*u,h=zf[s.textAlign||"center"],c=n&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),f=p.length,d=[],_=function(t,e,r){for(var n=e.length,i=0,o=0;o<n;++o){var a=Ss(t,e[o]);i=Math.max(i,a),r.push(a)}return i}(s.font,p,d),g=xs(s.font),y=g*f,v=_+c,m=[],x={width:Math.ceil((v+2)*l),height:Math.ceil((y+c)*l),contextInstructions:m};(1!=l&&m.push("scale",[l,l]),m.push("font",s.font),n)&&(m.push("strokeStyle",o.strokeStyle),m.push("lineWidth",c),m.push("lineCap",o.lineCap),m.push("lineJoin",o.lineJoin),m.push("miterLimit",o.miterLimit),(kn?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(m.push("setLineDash",[o.lineDash]),m.push("lineDashOffset",o.lineDashOffset)));r&&m.push("fillStyle",a.fillStyle),m.push("textBaseline","middle"),m.push("textAlign","center");var w,S=.5-h,E=h*v+S*c;if(n)for(w=0;w<f;++w)m.push("strokeText",[p[w],E+S*d[w],.5*(c+g)+w*g]);if(r)for(w=0;w<f;++w)m.push("fillText",[p[w],E+S*d[w],.5*(c+g)+w*g]);return this.labels_[i]=x,x},t.prototype.replayTextBackground_=function(t,e,r,n,i,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,a,s,u,l,h,c,p,f,d,_,g,y){var v=g||y;e-=i*=p,r-=o*=p;var m=d+l>n.width?n.width-l:d,x=s+h>n.height?n.height-h:s,w=_[3]+m*p+_[1],S=_[0]+x*p+_[2],E=e-_[3],T=r-_[0];(v||0!==c)&&(Kf[0]=E,Jf[0]=E,Kf[1]=T,qf[1]=T,qf[0]=E+w,Hf[0]=qf[0],Hf[1]=T+S,Jf[1]=Hf[1]);var C=null;if(0!==c){var b=e+i,P=r+o;C=vr(Zf,b,P,1,1,c,-b,-P),gr(Zf,Kf),gr(Zf,qf),gr(Zf,Hf),gr(Zf,Jf),Ot(Math.min(Kf[0],qf[0],Hf[0],Jf[0]),Math.min(Kf[1],qf[1],Hf[1],Jf[1]),Math.max(Kf[0],qf[0],Hf[0],Jf[0]),Math.max(Kf[1],qf[1],Hf[1],Jf[1]),Wf)}else Ot(E,T,E+w,T+S,Wf);var R=t.canvas,O=y?y[2]*p/2:0,I=Wf[0]-O<=R.width&&Wf[2]+O>=0&&Wf[1]-O<=R.height&&Wf[3]+O>=0;if(f&&(e=Math.round(e),r=Math.round(r)),a){if(!I&&1==a[4])return;At(a,Wf);var L=I?[t,C?C.slice(0):null,u,n,l,h,m,x,e,r,p]:null;L&&(v&&L.push(g,y,Kf.slice(0),qf.slice(0),Hf.slice(0),Jf.slice(0)),a.push(L))}else I&&(v&&this.replayTextBackground_(t,Kf,qf,Hf,Jf,g,y),Cs(t,C,u,n,l,h,m,x,e,r,p))},t.prototype.fill_=function(t){if(this.alignFill_){var e=gr(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.renderDeclutter=function(t,e,r,n){if(t&&t.length>5){var i=t[4];if(1==i||i==t.length-5){var o={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(n||(n=new ic.a(9)),!n.collides(o)){n.insert(o);for(var a=5,s=t.length;a<s;++a){var u=t[a],l=u[0],h=l.globalAlpha;h!==r&&(l.globalAlpha=r),u.length>11&&this.replayTextBackground_(u[0],u[13],u[14],u[15],u[16],u[11],u[12]),Cs.apply(void 0,u),h!==r&&(l.globalAlpha=h)}}t.length=5,It(t)}}return n},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,n){var i=this.textStates[e],o=this.createLabel(t,e,n,r),a=this.strokeStates[r],s=this.pixelRatio,u=zf[i.textAlign||"center"],l=zf[i.textBaseline||"middle"],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:u*(o.width/s-2*i.scale)+2*(.5-u)*h,anchorY:l*o.height/s+2*(.5-l)*h}},t.prototype.execute_=function(t,e,r,n,i,o){var a,s,u;this.declutterItems.length=0,this.pixelCoordinates_&&b(e,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=se(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),s=this.renderedTransform_,u=e,s[0]=u[0],s[1]=u[1],s[2]=u[2],s[3]=u[3],s[4]=u[4],s[5]=u[5]);for(var l,h,c,p,f,d,_,g,y,v,m,x,w,S,E,T,C,P=0,R=r.length,O=0,I=0,L=0,F=null,M=null,A=this.coordinateCache_,N=this.viewRotation_,G=Math.round(1e12*Math.atan2(-e[1],e[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:N},D=this.instructions!=r||this.overlaps?0:200;P<R;){var k=r[P];switch(k[0]){case If.BEGIN_GEOMETRY:(E=k[1]).getGeometry()?void 0===o||Jt(o,k[3])?++P:P=k[2]+1:P=k[2];break;case If.BEGIN_PATH:I>D&&(this.fill_(t),I=0),L>D&&(t.stroke(),L=0),I||L||(t.beginPath(),p=NaN,f=NaN),++P;break;case If.CIRCLE:var U=a[O=k[1]],z=a[O+1],B=a[O+2]-U,Y=a[O+3]-z,V=Math.sqrt(B*B+Y*Y);t.moveTo(U+V,z),t.arc(U,z,V,0,2*Math.PI,!0),++P;break;case If.CLOSE_PATH:t.closePath(),++P;break;case If.CUSTOM:O=k[1],l=k[2];var X=k[3],W=k[4],Z=6==k.length?k[5]:void 0;j.geometry=X,j.feature=E,P in A||(A[P]=[]);var K=A[P];Z?Z(a,O,l,2,K):(K[0]=a[O],K[1]=a[O+1],K.length=2),W(K,j),++P;break;case If.DRAW_IMAGE:O=k[1],l=k[2],v=k[3],h=k[4],c=k[5],y=i?null:k[6];var q=k[7],H=k[8],J=k[9],Q=k[10],$=k[11],tt=k[12],et=k[13],rt=k[14];if(!v&&k.length>=19){m=k[18],x=k[19],w=k[20],S=k[21];var nt=this.drawLabelWithPointPlacement_(m,x,w,S);v=nt.label,k[3]=v;var it=k[22];h=(nt.anchorX-it)*this.pixelRatio,k[4]=h;var ot=k[23];c=(nt.anchorY-ot)*this.pixelRatio,k[5]=c,q=v.height,k[7]=q,rt=v.width,k[14]=rt}var at=void 0;k.length>24&&(at=k[24]);var st=void 0,ut=void 0,lt=void 0;k.length>16?(st=k[15],ut=k[16],lt=k[17]):(st=cs,ut=!1,lt=!1),$&&G?tt+=N:$||G||(tt-=N);for(var ht=0,ct=0;O<l;O+=2)if(!(at&&at[ht++]<rt/this.pixelRatio)){if(y){var pt=Math.floor(ct);y.length<pt+1&&((g=[1/0,1/0,-1/0,-1/0]).push(y[0][4]),y.push(g)),g=y[pt]}this.replayImageOrLabel_(t,a[O],a[O+1],v,h,c,g,q,H,J,Q,tt,et,n,rt,st,ut?F:null,lt?M:null),g&&(ct===Math.floor(ct)&&this.declutterItems.push(this,g,E),ct+=1/g[4])}++P;break;case If.DRAW_CHARS:var ft=k[1],dt=k[2],_t=k[3];g=i?null:k[4];var gt=k[5];S=k[6];var yt=k[7],vt=k[8],mt=k[9];w=k[10];var xt=k[11];m=k[12],x=k[13];var wt=k[14],St=this.textStates[x],Et=St.font,Tt=St.scale*vt,Ct=void 0;Et in this.widths_?Ct=this.widths_[Et]:(Ct={},this.widths_[Et]=Ct);var bt=Vf(a,ft,dt,2),Pt=Tt*Es(Et,m,Ct);if(gt||Pt<=bt){var Rt=this.textStates[x].textAlign,Ot=Xf(a,ft,dt,2,m,(bt-Pt)*zf[Rt],yt,Tt,Es,Et,Ct);if(Ot){var It=void 0,Lt=void 0,Ft=void 0,Mt=void 0,At=void 0;if(w)for(It=0,Lt=Ot.length;It<Lt;++It)Ft=(At=Ot[It])[4],Mt=this.createLabel(Ft,x,"",w),h=At[2]+xt,c=_t*Mt.height+2*(.5-_t)*xt-mt,this.replayImageOrLabel_(t,At[0],At[1],Mt,h,c,g,Mt.height,1,0,0,At[3],wt,!1,Mt.width,cs,null,null);if(S)for(It=0,Lt=Ot.length;It<Lt;++It)Ft=(At=Ot[It])[4],Mt=this.createLabel(Ft,x,S,""),h=At[2],c=_t*Mt.height-mt,this.replayImageOrLabel_(t,At[0],At[1],Mt,h,c,g,Mt.height,1,0,0,At[3],wt,!1,Mt.width,cs,null,null)}}this.declutterItems.push(this,g,E),++P;break;case If.END_GEOMETRY:if(void 0!==i){var Nt=i(E=k[1]);if(Nt)return Nt}++P;break;case If.FILL:D?I++:this.fill_(t),++P;break;case If.MOVE_TO_LINE_TO:for(O=k[1],l=k[2],T=a[O],_=(C=a[O+1])+.5|0,(d=T+.5|0)===p&&_===f||(t.moveTo(T,C),p=d,f=_),O+=2;O<l;O+=2)d=(T=a[O])+.5|0,_=(C=a[O+1])+.5|0,O!=l-2&&d===p&&_===f||(t.lineTo(T,C),p=d,f=_);++P;break;case If.SET_FILL_STYLE:F=k,this.alignFill_=k[2],I&&(this.fill_(t),I=0,L&&(t.stroke(),L=0)),t.fillStyle=k[1],++P;break;case If.SET_STROKE_STYLE:M=k,L&&(t.stroke(),L=0),this.setStrokeStyle_(t,k),++P;break;case If.STROKE:D?L++:t.stroke(),++P;break;default:++P}}I&&this.fill_(t),L&&t.stroke()},t.prototype.execute=function(t,e,r,n){this.viewRotation_=r,this.execute_(t,e,this.instructions,n,void 0,void 0)},t.prototype.executeHitDetection=function(t,e,r,n,i){return this.viewRotation_=r,this.execute_(t,e,this.hitDetectionInstructions,!0,n,i)},t}(),$f=[ks,Ns,Ds,js,Us,Gs],td=function(){function t(t,e,r,n,i,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var n=t[e];for(var i in n){var o=n[i];r[i]=new Qf(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],n=0,i=t.length;n<i;++n)if(t[n]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o){var a=2*(n=Math.round(n))+1,s=vr(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-r,-t[0],-t[1]);this.hitDetectionContext_||(this.hitDetectionContext_=Ji(a,a));var u,l=this.hitDetectionContext_;l.canvas.width!==a||l.canvas.height!==a?(l.canvas.width=a,l.canvas.height=a):l.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(Nt(u=[1/0,1/0,-1/0,-1/0],t),wt(u,e*(this.renderBuffer_+n),u));var h,c=function(t){if(void 0!==ed[t])return ed[t];for(var e=2*t+1,r=new Array(e),n=0;n<e;n++)r[n]=new Array(e);var i=t,o=0,a=0;for(;i>=o;)rd(r,t+i,t+o),rd(r,t+o,t+i),rd(r,t-o,t+i),rd(r,t-i,t+o),rd(r,t-i,t-o),rd(r,t-o,t-i),rd(r,t+o,t-i),rd(r,t+i,t-o),o++,2*((a+=1+2*o)-i)+1>0&&(a+=1-2*(i-=1));return ed[t]=r,r}(n);function p(t){for(var e=l.getImageData(0,0,a,a).data,r=0;r<a;r++)for(var n=0;n<a;n++)if(c[r][n]&&e[4*(n*a+r)+3]>0){var s=void 0;return(!o||h!=js&&h!=Us||-1!==o.indexOf(t))&&(s=i(t)),s||void l.clearRect(0,0,a,a)}}var f,d,_,g,y,v=Object.keys(this.executorsByZIndex_).map(Number);for(v.sort(x),f=v.length-1;f>=0;--f){var m=v[f].toString();for(_=this.executorsByZIndex_[m],d=$f.length-1;d>=0;--d)if(void 0!==(g=_[h=$f[d]])&&(y=g.executeHitDetection(l,s,r,p,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return se(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return _(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(x),this.maxExtent_&&(t.save(),this.clip(t,e));var s,u,l,h,c,p,f=i||$f;for(s=0,u=a.length;s<u;++s){var d=a[s].toString();for(c=this.executorsByZIndex_[d],l=0,h=f.length;l<h;++l){var _=f[l];if(void 0!==(p=c[_]))if(!o||_!=js&&_!=Us)p.execute(t,e,r,n);else{var g=o[d];g?g.push(p,e.slice(0)):o[d]=[p,e.slice(0)]}}}this.maxExtent_&&t.restore()},t}(),ed={0:[[!0]]};function rd(t,e,r){var n,i=Math.floor(t.length/2);if(e>=i)for(n=i;n<e;n++)t[n][r]=!0;else if(e<i)for(n=e+1;n<i;n++)t[n][r]=!0}function nd(t,e,r,n,i,o){for(var a=Object.keys(t).map(Number).sort(x),s=0,u=a.length;s<u;++s)for(var l=t[a[s].toString()],h=void 0,c=0,p=l.length;c<p;){var f=l[c++];f!==h&&(h=f,o.push({items:f.declutterItems,opacity:n}));var d=l[c++];f.execute(e,d,r,i)}}var id=td;function od(t,e,r,n,i,o,a){var s=Ji(t[0]/2,t[1]/2);s.imageSmoothingEnabled=!1;for(var u=s.canvas,l=new Os(s,.5,i,null,a),h=r.length,c=Math.floor(16777215/h),p={},f=1;f<=h;++f){var d=r[f-1],_=d.getStyleFunction()||n;if(n){var g=_(d,o);if(g){Array.isArray(g)||(g=[g]);for(var y="#"+("000000"+(f*c).toString(16)).slice(-6),v=0,m=g.length;v<m;++v){var w=g[v],S=w.clone(),E=S.getFill();E&&E.setColor(y);var T=S.getStroke();T&&T.setColor(y),S.setText(void 0);var C=w.getImage();if(C){var b=C.getImageSize();if(!b)continue;var P=document.createElement("canvas");P.width=b[0],P.height=b[1];var R=P.getContext("2d",{alpha:!1});R.fillStyle=y;var O=R.canvas;R.fillRect(0,0,O.width,O.height),Ji(b?b[0]:O.width,b?b[1]:O.height).drawImage(O,0,0),S.setImage(new rh({img:O,imgSize:b,anchor:C.getAnchor(),anchorXUnits:Yl,anchorYUnits:Yl,offset:C.getOrigin(),size:C.getSize(),opacity:C.getOpacity(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var I=Number(S.getZIndex());(A=p[I])||(A={},p[I]=A,A[ae.POLYGON]=[],A[ae.CIRCLE]=[],A[ae.LINE_STRING]=[],A[ae.POINT]=[]);var L=S.getGeometryFunction()(d);L&&Jt(i,L.getExtent())&&A[L.getType().replace("Multi","")].push(L,S)}}}}for(var F=Object.keys(p).map(Number).sort(x),M=(f=0,F.length);f<M;++f){var A=p[F[f]];for(var N in A){var G=A[N];for(v=0,m=G.length;v<m;v+=2){l.setStyle(G[v+1]);for(var j=0,D=e.length;j<D;++j)l.setTransform(e[j]),l.drawGeometry(G[v])}}}return document.body.appendChild(s.canvas),s.getImageData(0,0,u.width,u.height)}function ad(t,e,r){var n=[];if(r){var i=4*(Math.round(t[0]/2)+Math.round(t[1]/2)*r.width),o=r.data[i],a=r.data[i+1],s=r.data[i+2]+256*(a+256*o),u=Math.floor(16777215/e.length);s&&s%u==0&&n.push(e[s/u-1])}return n}var sd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ud=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r}return sd(e,t),e.prototype.useContainer=function(e,r,n){n<1&&(e=null),t.prototype.useContainer.call(this,e,r,n)},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,r){_r(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),mr(this.inversePixelTransform,this.pixelTransform);var i=xr(this.pixelTransform);this.useContainer(e,i,n.opacity);var o=this.context,a=o.canvas,s=this.replayGroup_;if(!s||s.isEmpty())return!this.containerReused&&a.width>0&&(a.width=0),this.container;var u=Math.round(t.size[0]*r),l=Math.round(t.size[1]*r);a.width!=u||a.height!=l?(a.width=u,a.height=l,a.style.transform!==i&&(a.style.transform=i)):this.containerReused||o.clearRect(0,0,u,l),this.preRender(o,t);var h=t.extent,c=t.viewState,p=c.center,f=c.resolution,d=c.projection,_=c.rotation,g=d.getExtent(),y=this.getLayer().getSource(),v=!1;if(n.extent){var m=cr(n.extent,d);(v=!Ct(m,t.extent)&&Jt(m,t.extent))&&this.clip(o,t,m)}var x=t.viewHints,w=!(x[Ti]||x[Ci]),S=this.getRenderTransform(p,f,_,r,u,l,0),E=this.getLayer().getDeclutter()?{}:null;if(s.execute(o,S,_,w,void 0,E),y.getWrapX()&&d.canWrapX()&&!Ct(g,h)){for(var T=h[0],C=Ht(g),b=0,P=void 0;T<g[0];){P=C*--b;var R=this.getRenderTransform(p,f,_,r,u,l,P);s.execute(o,R,_,w,void 0,E),T+=C}for(b=0,T=h[2];T>g[2];){P=C*++b;var O=this.getRenderTransform(p,f,_,r,u,l,P);s.execute(o,O,_,w,void 0,E),T-=C}}if(E){var I=t.viewHints;nd(E,o,_,1,!(I[Ti]||I[Ci]),t.declutterItems)}v&&o.restore(),this.postRender(o,t);var L=n.opacity,F=this.container;return L!==parseFloat(F.style.opacity)&&(F.style.opacity=1===L?"":L),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e,r){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var n=[this.context.canvas.width,this.context.canvas.height];gr(this.pixelTransform,n);var i=this.renderedCenter_,o=this.renderedResolution_,a=this.renderedRotation_,s=this.renderedProjection_,u=this.renderedExtent_,l=this.getLayer(),h=[],c=n[0]/2,p=n[1]/2;h.push(this.getRenderTransform(i,o,a,.5,c,p,0).slice());var f=l.getSource(),d=s.getExtent();if(f.getWrapX()&&s.canWrapX()&&!Ct(d,u)){for(var _=u[0],g=Ht(d),y=0,v=void 0;_<d[0];)v=g*--y,h.push(this.getRenderTransform(i,o,a,.5,c,p,v).slice()),_+=g;for(y=0,_=u[2];_>d[2];)v=g*++y,h.push(this.getRenderTransform(i,o,a,.5,c,p,v).slice()),_-=g}this.hitDetectionImageData_=od(n,h,this.renderedFeatures_,l.getStyleFunction(),u,o,a)}e(ad(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(this.replayGroup_){var a=e.viewState.resolution,s=e.viewState.rotation,u=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,a,s,r,(function(t){var e=o(t);if(!(e in l))return l[e]=!0,n(t,u)}),u.getDeclutter()?i:null)}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var n=t.viewHints[Ti],i=t.viewHints[Ci],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!a&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,u=t.viewState,l=u.projection,h=u.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Bs);var _=u.center.slice(),g=wt(s,f*h),y=[g.slice()],v=l.getExtent();if(r.getWrapX()&&l.canWrapX()&&!Ct(v,t.extent)){var m=Ht(v),x=Math.max(Ht(g)/2,m);g[0]=v[0]-x,g[2]=v[2]+x,Bi(_,l);var w=ee(y[0],l);w[0]<v[0]&&w[2]<v[2]?y.push([w[0]+m,w[1],w[2]+m,w[3]]):w[0]>v[0]&&w[2]>v[2]&&y.push([w[0]-m,w[1],w[2]-m,w[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&Ct(this.renderedExtent_,g))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,E=new Yf(Vs(h,c),g,h,c,e.getDeclutter()),T=sr();if(T){for(var C=0,b=y.length;C<b;++C)r.loadFeatures(hr(y[C],l),h,T);S=$e(T,l)}else for(C=0,b=y.length;C<b;++C)r.loadFeatures(y[C],h,l);var P=Ys(h,c),R=function(t){var r,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(r=n(t,h)),r){var i=this.renderFeature(t,P,r,E,S);this.dirty_=this.dirty_||i}}.bind(this),O=hr(g,l),I=r.getFeaturesInExtent(O);d&&I.sort(d);for(C=0,b=I.length;C<b;++C)R(I[C]);this.renderedFeatures_=I;var L=E.finish(),F=new id(g,h,c,r.getOverlaps(),L,e.getRenderBuffer());return this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=g,this.renderedRotation_=u.rotation,this.renderedCenter_=_,this.renderedProjection_=l,this.replayGroup_=F,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var a=0,s=r.length;a<s;++a)o=Xs(n,t,r[a],e,this.boundHandleStyleImageChange_,i)||o;else o=Xs(n,t,r,e,this.boundHandleStyleImageChange_,i);return o},e}(hp),ld=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hd=function(t){function e(e){var r=t.call(this,e)||this;return r.vectorRenderer_=new ud(e),r.layerImageRatio_=e.getImageRatio(),r.coordinateToVectorPixelTransform_=[1,0,0,1,0,0],r.renderedPixelToCoordinateTransform_=null,r}return ld(e,t),e.prototype.disposeInternal=function(){this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getFeatures=function(t){if(this.vectorRenderer_){var e=gr(this.coordinateToVectorPixelTransform_,gr(this.renderedPixelToCoordinateTransform_,t.slice()));return this.vectorRenderer_.getFeatures(e)}return new Promise((function(t,e){t([])}))},e.prototype.handleFontsChanged=function(){this.vectorRenderer_.handleFontsChanged()},e.prototype.prepareFrame=function(t){var e=t.pixelRatio,r=t.viewState,n=r.resolution,i=t.viewHints,o=this.vectorRenderer_,a=t.extent;1!==this.layerImageRatio_&&$t(a=a.slice(0),this.layerImageRatio_);var s=Ht(a)/n,u=Wt(a)/n;if(!i[Ti]&&!i[Ci]&&!Qt(a)){o.useContainer(null,null,1);var l=o.context,h=p({},t,{declutterItems:[],extent:a,size:[s,u],viewState:p({},t.viewState,{rotation:0})}),c=new zc(a,n,e,l.canvas,(function(t){o.prepareFrame(h)&&o.replayGroupChanged&&(o.renderFrame(h,null),Zs(h,null),t())}));c.addEventListener(N,function(){c.getState()===Fs&&(this.image_=c)}.bind(this)),c.load()}if(this.image_){var f=this.image_,d=f.getResolution()*e/f.getPixelRatio();this.renderedResolution=d,this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice(),this.coordinateToVectorPixelTransform_=vr(this.coordinateToVectorPixelTransform_,s/2,u/2,1/d,-1/d,0,-r.center[0],-r.center[1])}return!!this.image_},e.prototype.preRender=function(){},e.prototype.postRender=function(){},e.prototype.forEachFeatureAtCoordinate=function(e,r,n,i,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,r,n,i,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,r,n,i,o)},e}(pp),cd="image",pd="hybrid",fd="vector",dd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_d={image:[ks,Ns,Ds,js,Us],hybrid:[ks,Ds],vector:[]},gd={image:[Gs],hybrid:[js,Us,Gs],vector:[ks,Ns,Ds,js,Us,Gs]},yd=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.renderTileImageQueue_={},r.tileListenerKeys_={},r.tmpTransform_=[1,0,0,1,0,0],r}return dd(e,t),e.prototype.prepareTile=function(t,e,r,n){var i,a=o(t),s=t.getState();return(s===ci&&t.hifi||s===pi)&&a in this.tileListenerKeys_&&(v(this.tileListenerKeys_[a]),delete this.tileListenerKeys_[a]),s!==ci&&s!==pi||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t,e,r)&&(i=!0,n&&(this.renderTileImageQueue_[a]=t))),i},e.prototype.getTile=function(e,r,n,i){var a=i.pixelRatio,s=i.viewState,u=s.resolution,l=s.projection,h=this.getLayer(),c=h.getSource().getTile(e,r,n,a,l);if(c.getState()<ci){c.wantedResolution=u;var p=o(c);if(!(p in this.tileListenerKeys_)){var f=g(c,N,this.prepareTile.bind(this,c,a,l,!0));this.tileListenerKeys_[p]=f}}else{var d=i.viewHints;!!(d[Ti]||d[Ci])&&c.wantedResolution||(c.wantedResolution=u),this.prepareTile(c,a,l,!1)&&h.getRenderMode()!==fd&&this.renderTileImage_(c,i)}return t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&r.getRenderMode()===fd||e.hasContext(r)},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var n=this.getLayer(),i=n.getRevision(),a=n.getRenderOrder()||null,s=t.wantedResolution,u=t.getReplayState(n);if(u.dirty||u.renderedResolution!==s||u.renderedRevision!=i||u.renderedRenderOrder!=a||u.renderedZ!==t.sourceZ){var l=n.getSource(),h=l.getTileGrid(),c=l.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),p=l.getSourceTiles(e,r,t),f=o(n);delete t.hitDetectionImageData[f],t.executorGroups[f]=[];for(var d=function(r,i){var o=p[r];if(o.getState()!=ci)return"continue";var d=o.tileCoord,g=h.getTileCoordExtent(d),y=Zt(c,g),v=Mt(g,y)?null:wt(y,n.getRenderBuffer()*s,_.tmpExtent);u.dirty=!1;var m=new Yf(0,y,s,e,n.getDeclutter()),x=Ys(s,e),w=function(t){var e,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(e=r(t,s)),e){var i=this.renderFeature(t,x,e,m);this.dirty_=this.dirty_||i,u.dirty=u.dirty||i}},S=o.getFeatures();a&&a!==u.renderedRenderOrder&&S.sort(a);for(var E=0,T=S.length;E<T;++E){var C=S[E];v&&!Jt(v,C.getGeometry().getExtent())||w.call(_,C)}var b=m.finish(),P=n.getRenderMode()!==fd&&n.getDeclutter()&&1===p.length?null:y,R=new id(P,s,e,l.getOverlaps(),b,n.getRenderBuffer());t.executorGroups[f].push(R)},_=this,g=0,y=p.length;g<y;++g)d(g);u.renderedRevision=i,u.renderedZ=t.sourceZ,u.renderedRenderOrder=a,u.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var a=e.viewState.resolution,s=e.viewState.rotation;r=null==r?0:r;var u,l,h,c=this.getLayer(),p=c.getDeclutter(),f=c.getSource().getTileGridForProjection(e.viewState.projection),d={},_=this.renderedTiles,g=function(){var e=_[l],h=Tt(f.getTileCoordExtent(e.wrappedTileCoord),t);if(!p&&!h)return"continue";for(var g=e.executorGroups[o(c)],y=0,v=g.length;y<v;++y){var m=g[y];u=u||m.forEachFeatureAtCoordinate(t,a,s,r,(function(t){if(h||i&&-1!==i.indexOf(t)){var e=t.getId();if(void 0===e&&(e=o(t)),!(e in d))return d[e]=!0,n(t,c)}}),c.getDeclutter()?i:null)}};for(l=0,h=_.length;l<h;++l)g();return u},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var n,i=this.getLayer(),a=o(i),s=i.getSource(),u=this.renderedProjection,l=u.getExtent(),h=this.renderedResolution,c=s.getTileGridForProjection(u),p=gr(this.renderedPixelToCoordinateTransform_,t.slice()),f=c.getTileCoordForCoordAndResolution(p,h),d=0,_=this.renderedTiles.length;d<_;++d)if(f.toString()===this.renderedTiles[d].tileCoord.toString()){if((n=this.renderedTiles[d]).getState()===ci&&n.hifi){var g=c.getTileCoordExtent(n.tileCoord);s.getWrapX()&&u.canWrapX()&&!Ct(l,g)&&Bi(p,u);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var y=Kt(c.getTileCoordExtent(n.wrappedTileCoord)),v=[(p[0]-y[0])/h,(y[1]-p[1])/h],m=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=n.hitDetectionImageData[a];if(!x&&!this.animatingOrInteracting_){var w=To(c.getTileSize(c.getZForResolution(h))),S=[w[0]/2,w[1]/2],E=this.renderedRotation_;x=od(w,[this.getRenderTransform(c.getTileCoordCenter(n.wrappedTileCoord),h,0,.5,S[0],S[1],0)],m,i.getStyleFunction(),c.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(i).renderedResolution,E),n.hitDetectionImageData[a]=x}e(ad(v,m,x))}}.bind(this))},e.prototype.handleFontsChanged=function(){f(this.renderTileImageQueue_);var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[Ti]||n[Ci]);this.renderQueuedTileImages_(i,e),t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var a=this.getLayer(),s=a.getRenderMode();if(s===cd)return this.container;var u=a.getSource(),l=e.usedTiles[o(u)];for(var h in this.renderTileImageQueue_)l&&h in l||delete this.renderTileImageQueue_[h];for(var c=this.context,p=a.getDeclutter()?{}:null,f=gd[s],d=e.pixelRatio,_=e.viewState,g=_.center,y=_.resolution,v=_.rotation,m=e.size,x=Math.round(m[0]*d),w=Math.round(m[1]*d),S=this.renderedTiles,E=u.getTileGridForProjection(e.viewState.projection),T=[],C=[],b=S.length-1;b>=0;--b)for(var P=S[b],R=P.tileCoord,O=E.getTileCoordExtent(P.wrappedTileCoord),I=E.getTileCoordExtent(R,this.tmpExtent)[0]-O[0],L=dr(yr(this.inversePixelTransform.slice(),1/d,1/d),this.getRenderTransform(g,y,v,d,x,w,I)),F=P.executorGroups[o(a)],M=!1,A=0,N=F.length;A<N;++A){var G=F[A];if(G.hasExecutors(f)){var j=P.tileCoord[0],D=void 0;if(!p&&!M){D=G.getClipCoords(L),c.save();for(var k=0,U=T.length;k<U;++k){var z=T[k];j<C[k]&&(c.beginPath(),c.moveTo(D[0],D[1]),c.lineTo(D[2],D[3]),c.lineTo(D[4],D[5]),c.lineTo(D[6],D[7]),c.moveTo(z[6],z[7]),c.lineTo(z[4],z[5]),c.lineTo(z[2],z[3]),c.lineTo(z[0],z[1]),c.clip())}}G.execute(c,L,v,i,f,p),p||M||(c.restore(),T.push(D),C.push(j),M=!0)}}p&&nd(p,c,v,e.layerStatesArray[e.layerIndex].opacity,i,e.declutterItems);return this.container},e.prototype.renderQueuedTileImages_=function(t,e){for(var r in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}var n=this.renderTileImageQueue_[r];delete this.renderTileImageQueue_[r],this.renderTileImage_(n,e)}},e.prototype.renderFeature=function(t,e,r,n){if(!r)return!1;var i=!1;if(Array.isArray(r))for(var o=0,a=r.length;o<a;++o)i=Xs(n,t,r[o],e,this.boundHandleStyleImageChange_)||i;else i=Xs(n,t,r,e,this.boundHandleStyleImageChange_);return i},e.prototype.tileImageNeedsRender_=function(t,e,r){var n=this.getLayer(),i=t.getReplayState(n),o=n.getRevision(),a=t.sourceZ,s=t.wantedResolution;return i.renderedTileResolution!==s||i.renderedTileRevision!==o||i.renderedTileZ!==a},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),n=t.getReplayState(r),i=r.getRevision(),a=t.executorGroups[o(r)];n.renderedTileRevision=i,n.renderedTileZ=t.sourceZ;var s=t.wrappedTileCoord,u=s[0],l=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=l.getTileGridForProjection(c),f=p.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*f,_=p.getResolution(u),g=t.getContext(r);h=Math.max(h,d/h);var y=l.getTilePixelSize(u,h,c);g.canvas.width=y[0],g.canvas.height=y[1];var v=h/d;if(1!==v){var m=fr(this.tmpTransform_);yr(m,v,v),g.setTransform.apply(g,m)}var x=p.getTileCoordExtent(s,this.tmpExtent),w=d/_,S=fr(this.tmpTransform_);yr(S,w,-w),function(t,e,r){dr(t,_r(pr,1,0,0,1,e,r))}(S,-x[0],-x[3]);for(var E=0,T=a.length;E<T;++E){a[E].execute(g,S,0,!0,_d[r.getRenderMode()])}n.renderedTileResolution=t.wantedResolution},e}(wp);var vd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),md=function(t){function e(e){return t.call(this,e)||this}return vd(e,t),e.prototype.createRenderer=function(){return new ud(this)},e}(Sf);function xd(t,e,r,n,i,o){var a=NaN,s=NaN,u=(r-e)/n;if(1===u)a=t[e],s=t[e+1];else if(2==u)a=(1-i)*t[e]+i*t[e+n],s=(1-i)*t[e+1]+i*t[e+n+1];else if(0!==u){for(var l=t[e],h=t[e+1],c=0,p=[0],f=e+n;f<r;f+=n){var d=t[f],_=t[f+1];c+=Math.sqrt((d-l)*(d-l)+(_-h)*(_-h)),p.push(c),l=d,h=_}var g=i*c,y=function(t,e,r){for(var n,i,o=r||x,a=0,s=t.length,u=!1;a<s;)(i=+o(t[n=a+(s-a>>1)],e))<0?a=n+1:(s=n,u=!i);return u?a:~a}(p,g);if(y<0){var v=(g-p[-y-2])/(p[-y-1]-p[-y-2]),m=e+(-y-2)*n;a=ye(t[m],t[m+n],v),s=ye(t[m+1],t[m+n+1],v)}else a=t[e+y*n],s=t[e+y*n+1]}return o?(o[0]=a,o[1]=s,o):[a,s]}function wd(t,e,r,n,i,o){if(r==e)return null;var a;if(i<t[e+n-1])return o?((a=t.slice(e,e+n))[n-1]=i,a):null;if(t[r-1]<i)return o?((a=t.slice(r-n,r))[n-1]=i,a):null;if(i==t[e+n-1])return t.slice(e,e+n);for(var s=e/n,u=r/n;s<u;){var l=s+u>>1;i<t[(l+1)*n-1]?u=l:s=l+1}var h=t[s*n-1];if(i==h)return t.slice((s-1)*n,(s-1)*n+n);var c=(i-h)/(t[(s+1)*n-1]-h);a=[];for(var p=0;p<n-1;++p)a.push(ye(t[(s-1)*n+p],t[s*n+p],c));return a.push(i),a}var Sd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ed=function(t){function e(e,r){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return Sd(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?T(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<Et(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ir(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.forEachSegment=function(t){return tn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=ie&&this.layout!=oe)return null;var r=void 0!==e&&e;return wd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return xd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e)},e.prototype.getLength=function(){return Vf(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Ur(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,re)},e.prototype.getType=function(){return ae.LINE_STRING},e.prototype.intersectsExtent=function(t){return en(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(br);function Td(t,e,r){for(var n,i,o,a,s,u,l=[],h=t(0),c=t(1),p=e(h),f=e(c),d=[c,h],_=[f,p],g=[1,0],y={},v=1e5;--v>0&&g.length>0;)o=g.pop(),h=d.pop(),p=_.pop(),(u=o.toString())in y||(l.push(p[0],p[1]),y[u]=!0),a=g.pop(),c=d.pop(),f=_.pop(),pe((i=e(n=t(s=(o+a)/2)))[0],i[1],p[0],p[1],f[0],f[1])<r?(l.push(f[0],f[1]),y[u=a.toString()]=!0):(g.push(a,s,s,o),_.push(f,i,i,p),d.push(c,n,n,h));return l}var Cd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bd=new nh({color:"rgba(0,0,0,0.2)"}),Pd=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],Rd=function(t){function e(e){var r=this,n=e||{},i=p({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},n);return delete i.maxLines,delete i.strokeStyle,delete i.targetSize,delete i.showLabels,delete i.lonLabelFormatter,delete i.latLabelFormatter,delete i.lonLabelPosition,delete i.latLabelPosition,delete i.lonLabelStyle,delete i.latLabelStyle,delete i.intervals,(r=t.call(this,i)||this).projection_=null,r.maxLat_=1/0,r.maxLon_=1/0,r.minLat_=-1/0,r.minLon_=-1/0,r.maxX_=1/0,r.maxY_=1/0,r.minX_=-1/0,r.minY_=-1/0,r.targetSize_=void 0!==n.targetSize?n.targetSize:100,r.maxLines_=void 0!==n.maxLines?n.maxLines:100,r.meridians_=[],r.parallels_=[],r.strokeStyle_=void 0!==n.strokeStyle?n.strokeStyle:bd,r.fromLonLatTransform_=void 0,r.toLonLatTransform_=void 0,r.projectionCenterLonLat_=null,r.bottomLeft_=null,r.bottomRight_=null,r.topLeft_=null,r.topRight_=null,r.meridiansLabels_=null,r.parallelsLabels_=null,n.showLabels&&(r.lonLabelFormatter_=null==n.lonLabelFormatter?Mi.bind(r,"EW"):n.lonLabelFormatter,r.latLabelFormatter_=null==n.latLabelFormatter?Mi.bind(r,"NS"):n.latLabelFormatter,r.lonLabelPosition_=null==n.lonLabelPosition?0:n.lonLabelPosition,r.latLabelPosition_=null==n.latLabelPosition?1:n.latLabelPosition,r.lonLabelStyleBase_=new lh({text:void 0!==n.lonLabelStyle?n.lonLabelStyle.clone():new ph({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new zl({color:"rgba(0,0,0,1)"}),stroke:new nh({color:"rgba(255,255,255,1)",width:3})})}),r.lonLabelStyle_=function(t){var e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_}.bind(r),r.latLabelStyleBase_=new lh({text:void 0!==n.latLabelStyle?n.latLabelStyle.clone():new ph({font:"12px Calibri,sans-serif",textAlign:"right",fill:new zl({color:"rgba(0,0,0,1)"}),stroke:new nh({color:"rgba(255,255,255,1)",width:3})})}),r.latLabelStyle_=function(t){var e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_}.bind(r),r.meridiansLabels_=[],r.parallelsLabels_=[],r.addEventListener(oi,r.drawLabels_.bind(r))),r.intervals_=void 0!==n.intervals?n.intervals:Pd,r.setSource(new uc({loader:r.loaderFunction.bind(r),strategy:r.strategyFunction.bind(r),features:new at,overlaps:!1,useSpatialIndex:!1,wrapX:n.wrapX})),r.featurePool_=[],r.lineStyle_=new lh({stroke:r.strokeStyle_}),r.loadedExtent_=null,r.renderedExtent_=null,r.setRenderOrder(null),r}return Cd(e,t),e.prototype.strategyFunction=function(t,e){var r,n,i,o=t.slice();return this.projection_&&this.getSource().getWrapX()&&ee(o,this.projection_),this.loadedExtent_&&(r=this.loadedExtent_,n=o,i=e,Math.abs(r[0]-n[0])<i&&Math.abs(r[2]-n[2])<i&&Math.abs(r[1]-n[1])<i&&Math.abs(r[3]-n[3])<i?o=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[o]},e.prototype.loaderFunction=function(t,e,r){this.loadedExtent_=t;var n=this.getSource(),i=Zt(this.getExtent()||[-1/0,-1/0,1/0,1/0],t);if(!(this.renderedExtent_&&Mt(this.renderedExtent_,i)||(this.renderedExtent_=i,Qt(i)))){var o=Yt(i),a=e*e/4;(!this.projection_||!Qe(this.projection_,r))&&this.updateProjectionInfo_(r),this.createGraticule_(i,o,e,a);var s,u=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(u+=this.meridians_.length),this.parallelsLabels_&&(u+=this.parallels_.length);u>this.featurePool_.length;)s=new lt,this.featurePool_.push(s);var l=n.getFeaturesCollection();l.clear();var h,c,p=0;for(h=0,c=this.meridians_.length;h<c;++h)(s=this.featurePool_[p++]).setGeometry(this.meridians_[h]),s.setStyle(this.lineStyle_),l.push(s);for(h=0,c=this.parallels_.length;h<c;++h)(s=this.featurePool_[p++]).setGeometry(this.parallels_[h]),s.setStyle(this.lineStyle_),l.push(s)}},e.prototype.addMeridian_=function(t,e,r,n,i,o){var a=this.getMeridian_(t,e,r,n,o);if(Jt(a.getExtent(),i)){if(this.meridiansLabels_){var s=this.lonLabelFormatter_(t);o in this.meridiansLabels_?this.meridiansLabels_[o].text=s:this.meridiansLabels_[o]={geom:new Kr([]),text:s}}this.meridians_[o++]=a}return o},e.prototype.addParallel_=function(t,e,r,n,i,o){var a=this.getParallel_(t,e,r,n,o);if(Jt(a.getExtent(),i)){if(this.parallelsLabels_){var s=this.latLabelFormatter_(t);o in this.parallelsLabels_?this.parallelsLabels_[o].text=s:this.parallelsLabels_[o]={geom:new Kr([]),text:s}}this.parallels_[o++]=a}return o},e.prototype.drawLabels_=function(t){var e=t.frameState.viewState.rotation,r=t.frameState.extent,n=Yt(r),i=r;if(e){var o=Ht(r),a=Wt(r),s=Math.abs(Math.cos(e)),u=Math.abs(Math.sin(e)),l=(u*a-s*o)/(u*u-s*s),h=(u*o-s*a)/(u*u-s*s);i=[n[0]-l/2,n[1]-h/2,n[0]+l/2,n[1]+h/2]}var c=0,p=0,f=this.latLabelPosition_<.5,d=this.projection_.getExtent(),_=Ht(d);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Ct(d,r)&&(c=Math.floor((r[0]-d[0])/_),p=Math.ceil((r[2]-d[2])/_),f=f!==Math.abs(e)>Math.PI/2);for(var g=Ws(t),y=c;y<=p;++y){var v=this.meridians_.length+this.parallels_.length,m=void 0,x=void 0,w=void 0,S=void 0;if(this.meridiansLabels_)for(x=0,w=this.meridiansLabels_.length;x<w;++x){var E=this.meridians_[x];if(e||0!==y)(T=E.clone()).translate(y*_,0),T.rotate(-e,n),(S=this.getMeridianPoint_(T,i,x)).rotate(e,n);else S=this.getMeridianPoint_(E,r,x);(m=this.featurePool_[v++]).setGeometry(S),m.set("graticule_label",this.meridiansLabels_[x].text),g.drawFeature(m,this.lonLabelStyle_(m))}if(this.parallelsLabels_&&(y===c&&f||y===p&&!f))for(x=0,w=this.parallels_.length;x<w;++x){var T;E=this.parallels_[x];if(e||0!==y)(T=E.clone()).translate(y*_,0),T.rotate(-e,n),(S=this.getParallelPoint_(T,i,x)).rotate(e,n);else S=this.getParallelPoint_(E,r,x);(m=this.featurePool_[v++]).setGeometry(S),m.set("graticule_label",this.parallelsLabels_[x].text),g.drawFeature(m,this.latLabelStyle_(m))}}},e.prototype.createGraticule_=function(t,e,r,n){var i=this.getInterval_(r);if(-1==i)return this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));var o=!1,a=this.projection_.getExtent(),s=Ht(a);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Ct(a,t)&&(Ht(t)>=s?(t[0]=a[0],t[2]=a[2]):o=!0);var u=[he(e[0],this.minX_,this.maxX_),he(e[1],this.minY_,this.maxY_)],l=this.toLonLatTransform_(u);isNaN(l[1])&&(l[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);var h,c,p,f,d=he(l[0],this.minLon_,this.maxLon_),_=he(l[1],this.minLat_,this.maxLat_),g=this.maxLines_,y=t;o||(y=[he(t[0],this.minX_,this.maxX_),he(t[1],this.minY_,this.maxY_),he(t[2],this.minX_,this.maxX_),he(t[3],this.minY_,this.maxY_)]);var v=te(y,this.toLonLatTransform_,void 0,8),m=v[3],x=v[2],w=v[1],S=v[0];if(o||(Tt(y,this.bottomLeft_)&&(S=this.minLon_,w=this.minLat_),Tt(y,this.bottomRight_)&&(x=this.maxLon_,w=this.minLat_),Tt(y,this.topLeft_)&&(S=this.minLon_,m=this.maxLat_),Tt(y,this.topRight_)&&(x=this.maxLon_,m=this.maxLat_),m=he(m,_,this.maxLat_),x=he(x,d,this.maxLon_),w=he(w,this.minLat_,_),S=he(S,this.minLon_,d)),f=he(d=Math.floor(d/i)*i,this.minLon_,this.maxLon_),c=this.addMeridian_(f,w,m,n,t,0),h=0,o)for(;(f-=i)>=S&&h++<g;)c=this.addMeridian_(f,w,m,n,t,c);else for(;f!=this.minLon_&&h++<g;)f=Math.max(f-i,this.minLon_),c=this.addMeridian_(f,w,m,n,t,c);if(f=he(d,this.minLon_,this.maxLon_),h=0,o)for(;(f+=i)<=x&&h++<g;)c=this.addMeridian_(f,w,m,n,t,c);else for(;f!=this.maxLon_&&h++<g;)f=Math.min(f+i,this.maxLon_),c=this.addMeridian_(f,w,m,n,t,c);for(this.meridians_.length=c,this.meridiansLabels_&&(this.meridiansLabels_.length=c),p=he(_=Math.floor(_/i)*i,this.minLat_,this.maxLat_),c=this.addParallel_(p,S,x,n,t,0),h=0;p!=this.minLat_&&h++<g;)p=Math.max(p-i,this.minLat_),c=this.addParallel_(p,S,x,n,t,c);for(p=he(_,this.minLat_,this.maxLat_),h=0;p!=this.maxLat_&&h++<g;)p=Math.min(p+i,this.maxLat_),c=this.addParallel_(p,S,x,n,t,c);this.parallels_.length=c,this.parallelsLabels_&&(this.parallelsLabels_.length=c)},e.prototype.getInterval_=function(t){for(var e=this.projectionCenterLonLat_[0],r=this.projectionCenterLonLat_[1],n=-1,i=Math.pow(this.targetSize_*t,2),o=[],a=[],s=0,u=this.intervals_.length;s<u;++s){var l=he(this.intervals_[s]/2,0,90),h=he(r,-90+l,90-l);if(o[0]=e-l,o[1]=h-l,a[0]=e+l,a[1]=h+l,this.fromLonLatTransform_(o,o),this.fromLonLatTransform_(a,a),Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)<=i)break;n=this.intervals_[s]}return n},e.prototype.getMeridian_=function(t,e,r,n,i){var o=function(t,e,r,n,i){return Td((function(n){return[t,e+(r-e)*n]}),tr(We("EPSG:4326"),n),i)}(t,e,r,this.projection_,n),a=this.meridians_[i];return a?(a.setFlatCoordinates(re,o),a.changed()):(a=new Ed(o,re),this.meridians_[i]=a),a},e.prototype.getMeridianPoint_=function(t,e,r){var n=t.getFlatCoordinates(),i=1,o=n.length-1;n[i]>n[o]&&(i=o,o=1);var a=Math.max(e[1],n[i]),s=Math.min(e[3],n[o]),u=he(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,a,s),l=[n[i-1]+(n[o-1]-n[i-1])*(u-n[i])/(n[o]-n[i]),u],h=this.meridiansLabels_[r].geom;return h.setCoordinates(l),h},e.prototype.getMeridians=function(){return this.meridians_},e.prototype.getParallel_=function(t,e,r,n,i){var o=function(t,e,r,n,i){return Td((function(n){return[e+(r-e)*n,t]}),tr(We("EPSG:4326"),n),i)}(t,e,r,this.projection_,n),a=this.parallels_[i];return a?(a.setFlatCoordinates(re,o),a.changed()):a=new Ed(o,re),a},e.prototype.getParallelPoint_=function(t,e,r){var n=t.getFlatCoordinates(),i=0,o=n.length-2;n[i]>n[o]&&(i=o,o=0);var a=Math.max(e[0],n[i]),s=Math.min(e[2],n[o]),u=he(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,a,s),l=[u,n[i+1]+(n[o+1]-n[i+1])*(u-n[i])/(n[o]-n[i])],h=this.parallelsLabels_[r].geom;return h.setCoordinates(l),h},e.prototype.getParallels=function(){return this.parallels_},e.prototype.updateProjectionInfo_=function(t){var e=We("EPSG:4326"),r=t.getWorldExtent();this.maxLat_=r[3],this.maxLon_=r[2],this.minLat_=r[1],this.minLon_=r[0];var n=tr(t,e);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=n;else{var i=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(t,e,r){for(var o=r||2,a=n(t,e,o),s=0,u=a.length;s<u;s+=o)a[s]<i&&(a[s]+=360);return a}}this.fromLonLatTransform_=tr(e,t);var o=te([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=o[0],this.maxX_=o[2],this.minY_=o[1],this.maxY_=o[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_(Yt(t.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t},e}(md),Od=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Id="blur",Ld="gradient",Fd="radius",Md=["#00f","#0ff","#0f0","#ff0","#f00"];var Ad=function(t){function e(e){var r=this,n=e||{},i=p({},n);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(r=t.call(this,i)||this).gradient_=null,r.addEventListener(et(Ld),r.handleGradientChanged_),r.setGradient(n.gradient?n.gradient:Md),r.setBlur(void 0!==n.blur?n.blur:15),r.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return Od(e,t),e.prototype.getBlur=function(){return this.get(Id)},e.prototype.getGradient=function(){return this.get(Ld)},e.prototype.getRadius=function(){return this.get(Fd)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=Ji(1,256),r=e.createLinearGradient(0,0,1,256),n=1/(t.length-1),i=0,o=t.length;i<o;++i)r.addColorStop(i*n,t[i]);return e.fillStyle=r,e.fillRect(0,0,1,256),e.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Id,t)},e.prototype.setGradient=function(t){this.set(Ld,t)},e.prototype.setRadius=function(t){this.set(Fd,t)},e.prototype.createRenderer=function(){return new Tf(this,{attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?he(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(Fd)+this.get(Id))}.bind(this),u_blurSlope:function(){return this.get(Fd)/Math.max(1,this.get(Id))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this)}}]})},e}(md),Nd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gd=function(t){function e(e){var r=this,n=e||{},i=p({},n);return delete i.imageRatio,(r=t.call(this,i)||this).imageRatio_=void 0!==n.imageRatio?n.imageRatio:1,r}return Nd(e,t),e.prototype.getImageRatio=function(){return this.imageRatio_},e.prototype.createRenderer=function(){return new hd(this)},e}(Sf),jd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dd=function(t){function e(e){var r=this,n=e||{},i=p({},n);delete i.preload,delete i.useInterimTilesOnError,r=t.call(this,i)||this;var o=n.renderMode||pd;return st(null==o||o==cd||o==pd||o==fd,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return jd(e,t),e.prototype.createRenderer=function(){return new yd(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(_p)},e.prototype.getUseInterimTilesOnError=function(){return this.get(gp)},e.prototype.setPreload=function(t){this.set(_p,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(gp,t)},e}(Sf),kd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ud="addfeatures",zd=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.features=n,o.file=r,o.projection=i,o}return kd(e,t),e}(F);function Bd(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var i=e.item(r),o=new FileReader;o.addEventListener(X,this.handleResult_.bind(this,i)),o.readAsText(i)}}function Yd(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}var Vd=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{handleEvent:R})||this).formatConstructors_=n.formatConstructors?n.formatConstructors:[],r.projection_=n.projection?We(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return kd(e,t),e.prototype.handleResult_=function(t,e){var r=e.target.result,n=this.getMap(),i=this.projection_;i||(i=n.getView().getProjection());for(var o=this.formatConstructors_,a=[],s=0,u=o.length;s<u;++s){var l=new o[s];if((a=this.tryReadFeatures_(l,r,{featureProjection:i}))&&a.length>0)break}this.source_&&(this.source_.clear(),this.source_.addFeatures(a)),this.dispatchEvent(new zd(Ud,t,a,i))},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[g(e,B,Bd,this),g(e,U,Yd,this),g(e,z,Yd,this),g(e,B,Yd,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(v),this.dropListenKeys_=null)},e}(Zo),Xd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wd=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).condition_=n.condition?n.condition:oa,r.lastAngle_=void 0,r.lastMagnitude_=void 0,r.lastScaleDelta_=0,r.duration_=void 0!==n.duration?n.duration:400,r}return Xd(e,t),e.prototype.handleDragEvent=function(t){if(sa(t)){var e=t.map,r=e.getSize(),n=t.pixel,i=n[0]-r[0]/2,o=r[1]/2-n[1],a=Math.atan2(o,i),s=Math.sqrt(i*i+o*o),u=e.getView();if(void 0!==this.lastAngle_){var l=this.lastAngle_-a;u.adjustRotationInternal(l)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&u.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!sa(t))return!0;var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!sa(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(ca),Zd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kd=function(t){function e(e,r,n){var i=t.call(this)||this;if(void 0!==n&&void 0===r)i.setFlatCoordinates(n,e);else{var o=r||0;i.setCenterAndRadius(e,o,n)}return i}return Zd(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s<n){if(0===s)for(var u=0;u<this.stride;++u)r[u]=i[u];else{var l=this.getRadius()/Math.sqrt(s);r[0]=i[0]+l*o,r[1]=i[1]+l*a;for(u=2;u<this.stride;++u)r[u]=i[u]}return r.length=this.stride,s}return n},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,n=t-r[0],i=e-r[1];return n*n+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return Ot(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return ae.CIRCLE},e.prototype.intersectsExtent=function(t){if(Jt(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||kt(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,i=Ar(n,0,t,this.stride);n[i++]=n[0]+e;for(var o=1,a=this.stride;o<a;++o)n[i++]=n[o];n.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(ue(r,0,r.length,n,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(le(r,0,r.length,n,t,e,r)),this.changed()},e}(br);Kd.prototype.transform;var qd=Kd,Hd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jd=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,r);else if(void 0!==r&&n)i.setFlatCoordinates(r,e),i.ends_=n;else{for(var o=i.getLayout(),a=e,s=[],u=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(o=c.getLayout()),T(s,c.getFlatCoordinates()),u.push(s.length)}i.setFlatCoordinates(o,s),i.ends_=u}return i}return Hd(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?T(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,r,n){return n<Et(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Lr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Mr(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=ie&&this.layout!=oe||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,i=void 0!==r&&r;return function(t,e,r,n,i,o,a){if(a)return wd(t,e,r[r.length-1],n,i,o);var s;if(i<t[n-1])return o?((s=t.slice(0,n))[n-1]=i,s):null;if(t[t.length-1]<i)return o?((s=t.slice(t.length-n))[n-1]=i,s):null;for(var u=0,l=r.length;u<l;++u){var h=r[u];if(e!=h){if(i<t[e+n-1])return null;if(i<=t[h-1])return wd(t,e,h,n,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,i)},e.prototype.getCoordinates=function(){return Dr(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Ed(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,n=[],i=0,o=0,a=e.length;o<a;++o){var s=e[o],u=new Ed(t.slice(i,s),r);n.push(u),i=s}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,n=this.ends_,i=this.stride,o=0,a=n.length;o<a;++o){var s=n[o];T(t,xd(e,r,s,i,.5)),r=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=zr(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,n),new e(r,re,n)},e.prototype.getType=function(){return ae.MULTI_LINE_STRING},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){if(en(t,e,r[o],n,i))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=Gr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(br),Qd=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$d=function(t){function e(e,r){var n=t.call(this)||this;return r&&!Array.isArray(e[0])?n.setFlatCoordinates(r,e):n.setCoordinates(e,r),n}return Qd(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?T(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){if(n<Et(this.getExtent(),t,e))return n;for(var i=this.flatCoordinates,o=this.stride,a=0,s=i.length;a<s;a+=o){var u=fe(t,e,i[a],i[a+1]);if(u<n){n=u;for(var l=0;l<o;++l)r[l]=i[a+l];r.length=o}}return n},e.prototype.getCoordinates=function(){return jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Kr(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,n=[],i=0,o=t.length;i<o;i+=r){var a=new Kr(t.slice(i,i+r),e);n.push(a)}return n},e.prototype.getType=function(){return ae.MULTI_POINT},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,n=0,i=e.length;n<i;n+=r){if(bt(t,e[n],e[n+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Nr(this.flatCoordinates,0,t,this.stride),this.changed()},e}(br);function t_(t,e,r,n){for(var i=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=r.length;a<s;++a){var u=r[a];o=Ft(t,e,u[0],n),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=u[u.length-1]}return i}var e_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),r_=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,s=[],u=[],l=0,h=a.length;l<h;++l){var c=a[l];0===l&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),d=0,_=f.length;d<_;++d)f[d]+=p;T(s,c.getFlatCoordinates()),u.push(f)}r=o,e=s,n=u}return void 0!==r&&n?(i.setFlatCoordinates(r,e),i.endss_=n):i.setCoordinates(e,r),i}return e_(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;T(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,i=(e=t.getEnds().slice()).length;n<i;++n)e[n]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),n=0;n<t;++n)r[n]=this.endss_[n].slice();return new e(this.flatCoordinates.slice(),this.layout,r)},e.prototype.closestPointXY=function(t,e,r,n){return n<Et(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=Lr(t,e,s,n,i),e=s[s.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,n,i,o,a,s,u,l,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];l=Mr(t,e,d,n,i,o,a,s,u,l,c),e=d[d.length-1]}return l}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return function(t,e,r,n,i,o){if(0===r.length)return!1;for(var a=0,s=r.length;a<s;++a){var u=r[a];if(Jr(t,e,u,n,i,o))return!0;e=u[u.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=Rr(t,e,s,n),e=s[s.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?un(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,kr(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=t_(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=$r(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new $d(this.getFlatInteriorPoints().slice(),ie)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(!an(t,e,s,n,i))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=un(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var u=0,l=r.length;u<l;++u){var h=r[u],c=[];a=Vr(t,e,h,n,i,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,n),new e(r,re,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(var o=0,a=n.length;o<a;++o)n[o]-=e;return new cn(this.flatCoordinates.slice(e,i),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o].slice(),u=s[s.length-1];if(0!==i)for(var l=0,h=s.length;l<h;++l)s[l]-=i;var c=new cn(e.slice(i,u),t,s);n.push(c),i=u}return n},e.prototype.getType=function(){return ae.MULTI_POLYGON},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(rn(t,e,s,n,i))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=function(t,e,r,n,i){for(var o=i||[],a=0,s=0,u=r.length;s<u;++s){var l=Gr(t,e,r[s],n,o[a]);o[a++]=l,e=l[l.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var n=r[r.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(br),n_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i_="Point",o_="LineString",a_="Polygon",s_="Circle",u_="drawstart",l_="drawend",h_="drawabort",c_=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return n_(e,t),e}(F);var p_=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=O),(r=t.call(this,n)||this).shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.freehand_=!1,r.source_=e.source?e.source:null,r.features_=e.features?e.features:null,r.snapTolerance_=e.snapTolerance?e.snapTolerance:12,r.type_=e.type,r.mode_=function(t){var e;t===ae.POINT||t===ae.MULTI_POINT?e=i_:t===ae.LINE_STRING||t===ae.MULTI_LINE_STRING?e=o_:t===ae.POLYGON||t===ae.MULTI_POLYGON?e=a_:t===ae.CIRCLE&&(e=s_);return(e)}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===a_?3:2,r.maxPoints_=e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:R;var i,o=e.geometryFunction;if(!o)if(r.type_===ae.CIRCLE)o=function(t,e,r){var n=e||new qd([NaN,NaN]),i=lr(t[0],r),o=Di(i,lr(t[1],r));n.setCenterAndRadius(i,Math.sqrt(o));var a=sr();return a&&n.transform(r,a),n};else{var a,s=r.mode_;s===i_?a=Kr:s===o_?a=Ed:s===a_&&(a=cn),o=function(t,e,r){var n=e;return n?s===a_?t[0].length?n.setCoordinates([t[0].concat([t[0][0]])]):n.setCoordinates([]):n.setCoordinates(t):n=new a(t),n}}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new md({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=sh(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:ia,r.freehandCondition_,e.freehand?r.freehandCondition_=ta:r.freehandCondition_=e.freehandCondition?e.freehandCondition:oa,r.addEventListener(et(Vo),r.updateState_),r}return n_(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===j&&e.preventDefault(),this.freehand_=this.mode_!==i_&&this.freehandCondition_(e);var r=e.type===Bn.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Bn.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Bn.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===Bn.POINTERDOWN?n=!1:r?(n=e.type===Bn.POINTERMOVE)&&this.freehand_?n=this.handlePointerMove_(e):("mouse"==e.pointerEvent.pointerType||e.type===Bn.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Bn.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Vn(Bn.POINTERMOVE,t.map,t.pointerEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);var r=this.mode_===s_;return this.shouldHandle_?(this.finishCoordinate_?this.freehand_||r?this.finishDrawing():this.atFinish_(t)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate):(this.startDrawing_(t),this.mode_===i_&&this.finishDrawing()),e=!1):this.freehand_&&this.abortDrawing(),!e&&this.stopClick_&&t.stopPropagation(),e},e.prototype.handlePointerMove_=function(t){if(this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,n=e[0]-r[0],i=e[1]-r[1],o=n*n+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return!0}return this.finishCoordinate_?this.modifyDrawing_(t):this.createOrUpdateSketchPoint_(t),!0},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,n=[this.finishCoordinate_];if(this.mode_===o_)r=this.sketchCoords_.length>this.minPoints_;else if(this.mode_===a_){var i=this.sketchCoords_;r=i[0].length>this.minPoints_,n=[i[0][0],i[0][i[0].length-2]]}if(r)for(var o=t.map,a=0,s=n.length;a<s;a++){var u=n[a],l=o.getPixelFromCoordinate(u),h=t.pixel,c=h[0]-l[0],p=h[1]-l[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=f){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){var e=t.coordinate.slice();this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(e):(this.sketchPoint_=new lt(new Kr(e)),this.updateSketchFeatures_())},e.prototype.startDrawing_=function(t){var e=t.coordinate,r=t.map.getView().getProjection();this.finishCoordinate_=e,this.mode_===i_?this.sketchCoords_=e.slice():this.mode_===a_?(this.sketchCoords_=[[e.slice(),e.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[e.slice(),e.slice()],this.sketchLineCoords_&&(this.sketchLine_=new lt(new Ed(this.sketchLineCoords_)));var n=this.geometryFunction_(this.sketchCoords_,void 0,r);this.sketchFeature_=new lt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new c_(u_,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,r,n,i=t.coordinate,o=this.sketchFeature_.getGeometry(),a=t.map.getView().getProjection();(this.mode_===i_?r=this.sketchCoords_:this.mode_===a_?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(t)&&(i=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=i[0],r[1]=i[1],this.geometryFunction_(this.sketchCoords_,o,a),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(i);if(o.getType()==ae.POLYGON&&this.mode_!==a_){this.sketchLine_||(this.sketchLine_=new lt);var s=o.getLinearRing(0);(n=this.sketchLine_.getGeometry())?(n.setFlatCoordinates(s.getLayout(),s.getFlatCoordinates()),n.changed()):(n=new Ed(s.getFlatCoordinates(),s.getLayout()),this.sketchLine_.setGeometry(n))}else this.sketchLineCoords_&&(n=this.sketchLine_.getGeometry()).setCoordinates(this.sketchLineCoords_);this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,n=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();this.mode_===o_?(this.finishCoordinate_=t.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):this.mode_===a_&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,n,i)),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===o_?((t=this.sketchCoords_).splice(-2,1),this.geometryFunction_(t,e,r),t.length>=2&&(this.finishCoordinate_=t[t.length-2].slice())):this.mode_===a_&&((t=this.sketchCoords_[0]).splice(-2,1),this.sketchLine_.getGeometry().setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)),0===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===o_?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===a_&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),this.type_===ae.MULTI_POINT?t.setGeometry(new $d([e])):this.type_===ae.MULTI_LINE_STRING?t.setGeometry(new Jd([e])):this.type_===ae.MULTI_POLYGON&&t.setGeometry(new r_([e])),this.dispatchEvent(new c_(l_,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new c_(h_,t))},e.prototype.appendCoordinates=function(t){var e=this.mode_,r=[];e===o_?r=this.sketchCoords_:e===a_&&(r=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]);for(var n=r.pop(),i=0;i<t.length;i++)this.addToDrawing_(t[i]);this.addToDrawing_(n)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.updateSketchFeatures_(),this.dispatchEvent(new c_(u_,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(ca),f_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),d_="extentchanged",__=function(t){function e(e){var r=t.call(this,d_)||this;return r.extent=e,r}return f_(e,t),e}(F);function g_(){var t=sh();return function(e,r){return t[ae.POINT]}}function y_(t){return function(e){return xt([t,e])}}function v_(t,e){return t[0]==e[0]?function(r){return xt([t,[r[0],e[1]]])}:t[1]==e[1]?function(r){return xt([t,[e[0],r[1]]])}:null}var m_=function(t){function e(e){var r,n=this,i=e||{};return(n=t.call(this,i)||this).extent_=null,n.pointerHandler_=null,n.pixelTolerance_=void 0!==i.pixelTolerance?i.pixelTolerance:10,n.snappedToVertex_=!1,n.extentFeature_=null,n.vertexFeature_=null,e||(e={}),n.extentOverlay_=new md({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:(r=sh(),function(t,e){return r[ae.POLYGON]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.vertexOverlay_=new md({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:g_(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&n.setExtent(e.extent),n}return f_(e,t),e.prototype.snapToVertex_=function(t,e){var r=e.getCoordinateFromPixelInternal(t),n=this.getExtentInternal();if(n){var i=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(n);i.sort((function(t,e){return Ui(r,t)-Ui(r,e)}));var o=i[0],a=Fi(r,o),s=e.getPixelFromCoordinateInternal(a);if(ki(t,s)<=this.pixelTolerance_){var u=e.getPixelFromCoordinateInternal(o[0]),l=e.getPixelFromCoordinateInternal(o[1]),h=Di(s,u),c=Di(s,l),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,n=this.snapToVertex_(e,r);n||(n=r.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(n)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(fn(t)):e.setGeometry(void 0):(e=new lt(t?fn(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new lt(new Kr(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.pointerEvent||(e.type!=Bn.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,n=this.getExtentInternal(),i=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?r=n[3]:t[1]==n[3]&&(r=n[1]),null!==e&&null!==r?[e,r]:null};if(i&&n){var a=i[0]==n[0]||i[0]==n[2]?i[0]:null,s=i[1]==n[1]||i[1]==n[3]?i[1]:null;null!==a&&null!==s?this.pointerHandler_=y_(o(i)):null!==a?this.pointerHandler_=v_(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=v_(o([n[0],s]),o([n[2],s])))}else i=r.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=y_(i);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}return!0},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==Ut(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return hr(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new __(this.extent_))},e}(ca),x_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),w_=[0,0,0,0],S_=[],E_="modifystart",T_="modifyend",C_=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return x_(e,t),e}(F);function b_(t,e){return t.index-e.index}function P_(t,e,r){var n=e.geometry;if(n.getType()===ae.CIRCLE){var i=n;if(1===e.index){var o=sr();o&&(i=i.clone().transform(o,r));var a=Di(i.getCenter(),lr(t,r)),s=Math.sqrt(a)-i.getRadius();return s*s}}var u=lr(t,r);return S_[0]=lr(e.segment[0],r),S_[1]=lr(e.segment[1],r),Ui(u,S_)}function R_(t,e,r){var n=e.geometry;if(n.getType()===ae.CIRCLE&&1===e.index){var i=n,o=sr();return o&&(i=i.clone().transform(o,r)),ur(i.getClosestPoint(lr(t,r)),r)}var a=lr(t,r);return S_[0]=lr(e.segment[0],r),S_[1]=lr(e.segment[1],r),ur(Fi(a,S_),r)}var O_=function(t){function e(e){var r,n,i=t.call(this,e)||this;if(i.boundHandleFeatureChange_=i.handleFeatureChange_.bind(i),i.condition_=e.condition?e.condition:ua,i.defaultDeleteCondition_=function(t){return Jo(t)&&na(t)},i.deleteCondition_=e.deleteCondition?e.deleteCondition:i.defaultDeleteCondition_,i.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:ta,i.vertexFeature_=null,i.vertexSegments_=null,i.lastPixel_=[0,0],i.ignoreNextSingleClick_=!1,i.modified_=!1,i.rBush_=new oc,i.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,i.snappedToVertex_=!1,i.changingFeature_=!1,i.dragSegments_=[],i.overlay_=new md({source:new uc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(r=sh(),function(t,e){return r[ae.POINT]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i)},i.source_=null,e.source?(i.source_=e.source,n=new at(i.source_.getFeatures()),i.source_.addEventListener($h,i.handleSourceAdd_.bind(i)),i.source_.addEventListener(rc,i.handleSourceRemove_.bind(i))):n=e.features,!n)throw new Error("The modify interaction requires features or a source");return i.features_=n,i.features_.forEach(i.addFeature_.bind(i)),i.features_.addEventListener(l,i.handleFeatureAdd_.bind(i)),i.features_.addEventListener(h,i.handleFeatureRemove_.bind(i)),i.lastPointerEvent_=null,i}return x_(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(N,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t){this.modified_||(this.modified_=!0,this.dispatchEvent(new C_(E_,this.features_,t)))},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(N,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var n=r.length-1;n>=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(xt(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,geometry:e,depth:[n],index:a,segment:u};this.rBush_.insert(xt(u),l)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,geometry:e,depth:[n],index:a,segment:u};this.rBush_.insert(xt(u),l)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var u=o[a],l=0,h=u.length-1;l<h;++l){var c=u.slice(l,l+2),p={feature:t,geometry:e,depth:[a,n],index:l,segment:c};this.rBush_.insert(xt(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[r,r]},i={feature:t,geometry:e,index:1,segment:[r,r]},o=[n,i];n.featureSegments=o,i.featureSegments=o,this.rBush_.insert(Lt(r),n);var a=e,s=sr();if(s&&this.getMap()){var u=this.getMap().getView().getProjection();a=dn(a=a.clone().transform(s,u)).transform(u,s)}this.rBush_.insert(a.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new lt(new Kr(t)),this.vertexFeature_=e,this.overlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.pointerEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Bn.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=Bn.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Bn.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t);for(var e=t.coordinate,r=0,n=this.dragSegments_.length;r<n;++r){for(var i=this.dragSegments_[r],o=i[0],a=o.depth,s=o.geometry,u=void 0,l=o.segment,h=i[1];e.length<s.getStride();)e.push(l[h][e.length]);switch(s.getType()){case ae.POINT:u=e,l[0]=e,l[1]=e;break;case ae.MULTI_POINT:(u=s.getCoordinates())[o.index]=e,l[0]=e,l[1]=e;break;case ae.LINE_STRING:(u=s.getCoordinates())[o.index+h]=e,l[h]=e;break;case ae.MULTI_LINE_STRING:case ae.POLYGON:(u=s.getCoordinates())[a[0]][o.index+h]=e,l[h]=e;break;case ae.MULTI_POLYGON:(u=s.getCoordinates())[a[1]][a[0]][o.index+h]=e,l[h]=e;break;case ae.CIRCLE:if(l[0]=e,l[1]=e,0===o.index)this.changingFeature_=!0,s.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;var c=t.map.getView().getProjection(),p=ki(lr(s.getCenter(),c),lr(e,c)),f=sr();if(f){var d=s.clone().transform(f,c);d.setRadius(p),p=d.transform(c,f).getRadius()}s.setRadius(p),this.changingFeature_=!1}}u&&this.setGeometryCoordinates_(s,u)}this.createOrUpdateVertexFeature_(e)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.modified_=!1;var r=this.vertexFeature_;if(r){var n=t.map.getView().getProjection(),i=[],a=r.getGeometry().getCoordinates(),s=xt([a]),u=this.rBush_.getInExtent(s),l={};u.sort(b_);for(var h=0,c=u.length;h<c;++h){var p=u[h],f=p.segment,d=o(p.feature),_=p.depth;if(_&&(d+="-"+_.join("-")),l[d]||(l[d]=new Array(2)),p.geometry.getType()!==ae.CIRCLE||1!==p.index)if(!Ni(f[0],a)||l[d][0])if(!Ni(f[1],a)||l[d][1])o(f)in this.vertexSegments_&&!l[d][0]&&!l[d][1]&&this.insertVertexCondition_(t)&&i.push([p,a]);else{if((p.geometry.getType()===ae.LINE_STRING||p.geometry.getType()===ae.MULTI_LINE_STRING)&&l[d][0]&&0===l[d][0].index)continue;this.dragSegments_.push([p,1]),l[d][1]=p}else this.dragSegments_.push([p,0]),l[d][0]=p;else Ni(R_(e,p,n),a)&&!l[d][0]&&(this.dragSegments_.push([p,0]),l[d][0]=p)}i.length&&this.willModifyFeatures_(t);for(var g=i.length-1;g>=0;--g)this.insertVertex_.apply(this,i[g])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if(n.getType()===ae.CIRCLE){var i=n.getCenter(),o=r.featureSegments[0],a=r.featureSegments[1];o.segment[0]=i,o.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(Lt(i),o);var s=n,u=sr();if(u){var l=t.map.getView().getProjection();s=dn(s=s.clone().transform(u,l)).transform(l,u)}this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(xt(r.segment),r)}return this.modified_&&(this.dispatchEvent(new C_(T_,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var n=r||e.getCoordinateFromPixel(t),i=e.getView().getProjection(),a=hr(wt(cr(Lt(n,w_),i),e.getView().getResolution()*this.pixelTolerance_,w_),i),s=this.rBush_.getInExtent(a);if(s.length>0){s.sort((function(t,e){return P_(n,t,i)-P_(n,e,i)}));var u=s[0],l=u.segment,h=R_(n,u,i),c=e.getPixelFromCoordinate(h),p=ki(t,c);if(p<=this.pixelTolerance_){var f={};if(u.geometry.getType()===ae.CIRCLE&&1===u.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h);else{var d=e.getPixelFromCoordinate(l[0]),_=e.getPixelFromCoordinate(l[1]),g=Di(c,d),y=Di(c,_);p=Math.sqrt(Math.min(g,y)),this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(h=g>y?l[1]:l[0]),this.createOrUpdateVertexFeature_(h);for(var v=1,m=s.length;v<m;++v){var x=s[v].segment;if(!(Ni(l[0],x[0])&&Ni(l[1],x[1])||Ni(l[0],x[1])&&Ni(l[1],x[0])))break;f[o(x)]=!0}}return f[o(l)]=!0,void(this.vertexSegments_=f)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,n=t.segment,i=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case ae.MULTI_LINE_STRING:case ae.POLYGON:(r=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case ae.MULTI_POLYGON:(r=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case ae.LINE_STRING:(r=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var u=this.rBush_;u.remove(t),this.updateSegmentIndices_(o,s,a,1);var l={segment:[n[0],e],feature:i,geometry:o,depth:a,index:s};u.insert(xt(l.segment),l),this.dragSegments_.push([l,1]);var h={segment:[e,n[1]],feature:i,geometry:o,depth:a,index:s+1};u.insert(xt(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Bn.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t);var e=this.removeVertex_();return this.dispatchEvent(new C_(T_,this.features_,t)),this.modified_=!1,e}return!1},e.prototype.removeVertex_=function(){var t,e,r,n,i,a,s,u,l,h,c,p=this.dragSegments_,f={},d=!1;for(i=p.length-1;i>=0;--i)c=o((h=(r=p[i])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===r[1]?(f[c].right=h,f[c].index=h.index):1==r[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(l=f[c].right,s=f[c].left,(u=(a=f[c].index)-1)<0&&(u=0),t=e=(n=(h=void 0!==s?s:l).geometry).getCoordinates(),d=!1,n.getType()){case ae.MULTI_LINE_STRING:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(a,1),d=!0);break;case ae.LINE_STRING:e.length>2&&(e.splice(a,1),d=!0);break;case ae.MULTI_POLYGON:t=t[h.depth[1]];case ae.POLYGON:(t=t[h.depth[0]]).length>4&&(a==t.length-1&&(a=0),t.splice(a,1),d=!0,0===a&&(t.pop(),t.push(t[0]),u=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var _=[];if(void 0!==s&&(this.rBush_.remove(s),_.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),_.push(l.segment[1])),void 0!==s&&void 0!==l){var g={depth:h.depth,feature:h.feature,geometry:h.geometry,index:u,segment:_};this.rBush_.insert(xt(g.segment),g)}this.updateSegmentIndices_(n,a,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,n){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===r||void 0===i.depth||b(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}(ca),I_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),L_="select",F_=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.selected=r,o.deselected=n,o.mapBrowserEvent=i,o}return I_(e,t),e}(F),M_={};function A_(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),i=!e&&!r&&!n,o=t.map,a=this.getFeatures(),s=[],u=[];if(i){f(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return u.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var l=a.getLength()-1;l>=0;--l){var h=a.item(l),c=u.indexOf(h);c>-1?u.splice(c,1):(a.remove(h),s.push(h))}0!==u.length&&a.extend(u)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||w(a.getArray(),t)?(r||n)&&w(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(u.push(t),this.addFeatureLayerAssociation_(t,i)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=s.length-1;p>=0;--p)a.remove(s[p]);a.extend(u)}return(u.length>0||s.length>0)&&this.dispatchEvent(new F_(L_,u,s,t)),!0}var N_=function(t){function e(e){var r,n,i=t.call(this,{handleEvent:A_})||this,o=e||{};if(i.boundAddFeature_=i.addFeature_.bind(i),i.boundRemoveFeature_=i.removeFeature_.bind(i),i.condition_=o.condition?o.condition:na,i.addCondition_=o.addCondition?o.addCondition:ra,i.removeCondition_=o.removeCondition?o.removeCondition:ra,i.toggleCondition_=o.toggleCondition?o.toggleCondition:oa,i.multi_=!!o.multi&&o.multi,i.filter_=o.filter?o.filter:R,i.hitTolerance_=o.hitTolerance?o.hitTolerance:0,i.style_=void 0!==o.style?o.style:(T((r=sh())[ae.POLYGON],r[ae.LINE_STRING]),T(r[ae.GEOMETRY_COLLECTION],r[ae.LINE_STRING]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.features_=o.features||new at,o.layers)if("function"==typeof o.layers)n=o.layers;else{var a=o.layers;n=function(t){return w(a,t)}}else n=R;return i.layerFilter_=n,i.featureLayerAssociation_={},i}return I_(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[o(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[o(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(l,this.boundAddFeature_),this.features_.addEventListener(h,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(l,this.boundAddFeature_),this.features_.removeEventListener(h,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;this.style_&&this.applySelectedStyle_(e)},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=o(t);e in M_||(M_[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){var r=o(t),n=this.getMap().getInteractions().getArray().filter((function(r){return r instanceof e&&r.getStyle()&&-1!==r.getFeatures().getArray().indexOf(t)}));n.length>0?t.setStyle(n[n.length-1].getStyle()):(t.setStyle(M_[r]),delete M_[r])},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[o(t)]},e}(Zo),G_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function j_(t){return t.feature?t.feature:t.element?t.element:void 0}var D_=[],k_=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=R),i.stopDown||(i.stopDown=O),(r=t.call(this,i)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new oc,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return G_(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,n=o(t),i=t.getGeometry();if(i){var a=this.SEGMENT_WRITERS_[i.getType()];a&&(this.indexedFeaturesExtents_[n]=i.getExtent([1/0,1/0,-1/0,-1/0]),a(t,i))}r&&(this.featureChangeListenerKeys_[n]=g(t,N,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var r=this.snapTo(e.pixel,e.coordinate,e.map);return r.snapped&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=j_(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=j_(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=o(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=d(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,n=o(t),i=this.indexedFeaturesExtents_[n];if(i){var a=this.rBush_,s=[];a.forEachInExtent(i,(function(e){t===e.feature&&s.push(e)}));for(var u=s.length-1;u>=0;--u)a.remove(s[u])}r&&(v(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(v),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(g(this.features_,l,this.handleFeatureAdd_,this),g(this.features_,h,this.handleFeatureRemove_,this)):this.source_&&n.push(g(this.source_,$h,this.handleFeatureAdd_,this),g(this.source_,rc,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=xt([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(n);this.vertex_&&!this.edge_&&(i=i.filter((function(t){return t.feature.getGeometry().getType()!==ae.CIRCLE})));var o=!1,a=null,s=null;if(0===i.length)return{snapped:o,vertex:a,vertexPixel:s};for(var u,l=r.getView().getProjection(),h=lr(e,l),c=1/0,p=0;p<i.length;++p){var f=i[p];D_[0]=lr(f.segment[0],l),D_[1]=lr(f.segment[1],l);var d=Ui(h,D_);d<c&&(u=f,c=d)}var _=u.segment;if(this.vertex_&&!this.edge_){var g=r.getPixelFromCoordinate(_[0]),y=r.getPixelFromCoordinate(_[1]),v=Di(t,g),m=Di(t,y);Math.sqrt(Math.min(v,m))<=this.pixelTolerance_&&(o=!0,a=v>m?_[1]:_[0],s=r.getPixelFromCoordinate(a))}else if(this.edge_){var x=u.feature.getGeometry().getType()===ae.CIRCLE;if(x){var w=u.feature.getGeometry(),S=sr();S&&(w=w.clone().transform(S,l)),a=ur(function(t,e){var r=e.getRadius(),n=e.getCenter(),i=n[0],o=n[1],a=t[0]-i,s=t[1]-o;0===a&&0===s&&(a=1);var u=Math.sqrt(a*a+s*s);return[i+r*a/u,o+r*s/u]}(h,w),l)}else D_[0]=lr(_[0],l),D_[1]=lr(_[1],l),a=ur(Fi(h,D_),l);if(ki(t,s=r.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!x)){g=r.getPixelFromCoordinate(_[0]),y=r.getPixelFromCoordinate(_[1]),v=Di(s,g),m=Di(s,y);Math.sqrt(Math.min(v,m))<=this.pixelTolerance_&&(a=v>m?_[1]:_[0],s=r.getPixelFromCoordinate(a))}}return o&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:o,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){var r=this.getMap().getView().getProjection(),n=e,i=sr();i&&(n=n.clone().transform(i,r));var o=dn(n);i&&o.transform(r,i);for(var a=o.getCoordinates()[0],s=0,u=a.length-1;s<u;++s){var l=a.slice(s,s+2),h={feature:t,segment:l};this.rBush_.insert(xt(l),h)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=this.SEGMENT_WRITERS_[r[n].getType()];i&&i(t,r[n])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,segment:o};this.rBush_.insert(xt(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,segment:u};this.rBush_.insert(xt(u),l)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var u=o[a],l=0,h=u.length-1;l<h;++l){var c=u.slice(l,l+2),p={feature:t,segment:c};this.rBush_.insert(xt(c),p)}},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var u=o.slice(a,a+2),l={feature:t,segment:u};this.rBush_.insert(xt(u),l)}},e}(ca),U_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),z_="translatestart",B_="translating",Y_="translateend",V_=function(t){function e(e,r,n,i,o){var a=t.call(this,e)||this;return a.features=r,a.coordinate=n,a.startCoordinate=i,a.mapBrowserEvent=o,a}return U_(e,t),e}(F),X_=function(t){function e(e){var r,n=this,i=e||{};if((n=t.call(this,i)||this).lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==i.features?i.features:null,i.layers)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return w(o,t)}}else r=R;return n.layerFilter_=r,n.filter_=i.filter?i.filter:R,n.hitTolerance_=i.hitTolerance?i.hitTolerance:0,n.lastFeature_=null,n.addEventListener(et(Vo),n.handleActiveChanged_),n}return U_(e,t),e.prototype.handleDownEvent=function(t){if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new at([this.lastFeature_]);return this.dispatchEvent(new V_(z_,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new at([this.lastFeature_]);return this.dispatchEvent(new V_(Y_,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],i=this.features_||new at([this.lastFeature_]);i.forEach((function(t){var e=t.getGeometry();e.translate(r,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new V_(B_,i,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||w(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(ca),W_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Z_(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}var K_=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return W_(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(v),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(g(this.geometries_[t],N,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<Et(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,a=i.length;o<a;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){It(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)At(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return Z_(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],n=this.geometries_,i=!1,o=0,a=n.length;o<a;++o){var s=n[o],u=s.getSimplifiedGeometry(t);r.push(u),u!==s&&(i=!0)}if(i){var l=new e(null);return l.setGeometriesArray(r),l}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return ae.GEOMETRY_COLLECTION},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=Yt(this.getExtent()));for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Z_(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Er),q_=function(){function t(){this.dataProjection=null,this.defaultFeatureProjection=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var n=e.dataProjection?We(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===Te.TILE_PIXELS&&(n=We(n)).setWorldExtent(e.extent),r={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(t){return p({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return n()},t.prototype.readFeature=function(t,e){return n()},t.prototype.readFeatures=function(t,e){return n()},t.prototype.readGeometry=function(t,e){return n()},t.prototype.readProjection=function(t){return n()},t.prototype.writeFeature=function(t,e){return n()},t.prototype.writeFeatures=function(t,e){return n()},t.prototype.writeGeometry=function(t,e){return n()},t}();function H_(t,e,r){var n,i=r?We(r.featureProjection):null,o=r?We(r.dataProjection):null;if(n=i&&o&&!Qe(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&r&&void 0!==r.decimals){var a=Math.pow(10,r.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return n}function J_(t,e){var r=e?We(e.featureProjection):null,n=e?We(e.dataProjection):null;return r&&n&&!Qe(r,n)?rr(t,n,r):t}var Q_=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function $_(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var tg=function(t){function e(){return t.call(this)||this}return Q_(e,t),e.prototype.getType=function(){return vu},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject($_(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject($_(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return n()},e.prototype.readFeaturesFromObject=function(t,e){return n()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject($_(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return n()},e.prototype.readProjection=function(t){return this.readProjectionFromObject($_(t))},e.prototype.readProjectionFromObject=function(t){return n()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return n()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return n()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return n()},e}(q_),eg=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rg={};rg[ae.POINT]=function(t){var e;e=void 0!==t.m&&void 0!==t.z?new Kr([t.x,t.y,t.z,t.m],oe):void 0!==t.z?new Kr([t.x,t.y,t.z],ne):void 0!==t.m?new Kr([t.x,t.y,t.m],ie):new Kr([t.x,t.y]);return e},rg[ae.LINE_STRING]=function(t){var e=og(t);return new Ed(t.paths[0],e)},rg[ae.POLYGON]=function(t){var e=og(t);return new cn(t.rings,e)},rg[ae.MULTI_POINT]=function(t){var e=og(t);return new $d(t.points,e)},rg[ae.MULTI_LINE_STRING]=function(t){var e=og(t);return new Jd(t.paths,e)},rg[ae.MULTI_POLYGON]=function(t){var e=og(t);return new r_(t.rings,e)};var ng={};function ig(t,e){var r,n,i;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)i=ae.POINT;else if(t.points)i=ae.MULTI_POINT;else if(t.paths){i=1===t.paths.length?ae.LINE_STRING:ae.MULTI_LINE_STRING}else if(t.rings){var o=t,a=og(o),s=function(t,e){var r,n,i=[],o=[],a=[];for(r=0,n=t.length;r<n;++r){i.length=0,Nr(i,0,t[r],e.length),on(i,0,i.length,e.length)?o.push([t[r]]):a.push(t[r])}for(;a.length;){var s=a.shift(),u=!1;for(r=o.length-1;r>=0;r--){var l=o[r][0];if(Ct(new Wr(l).getExtent(),new Wr(s).getExtent())){o[r].push(s),u=!0;break}}u||o.push([s.reverse()])}return o}(o.rings,a);1===s.length?(i=ae.POLYGON,t=Object.assign({},t,((r={}).rings=s[0],r))):(i=ae.MULTI_POLYGON,t=Object.assign({},t,((n={}).rings=s,n)))}return H_((0,rg[i])(t),!1,e)}function og(t){var e=re;return!0===t.hasZ&&!0===t.hasM?e=oe:!0===t.hasZ?e=ne:!0===t.hasM&&(e=ie),e}function ag(t){var e=t.getLayout();return{hasZ:e===ne||e===oe,hasM:e===ie||e===oe}}function sg(t,e){return(0,ng[t.getType()])(H_(t,!0,e),e)}ng[ae.POINT]=function(t,e){var r,n=t.getCoordinates(),i=t.getLayout();i===ne?r={x:n[0],y:n[1],z:n[2]}:i===ie?r={x:n[0],y:n[1],m:n[2]}:i===oe?r={x:n[0],y:n[1],z:n[2],m:n[3]}:i===re?r={x:n[0],y:n[1]}:st(!1,34);return r},ng[ae.LINE_STRING]=function(t,e){var r=ag(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:[t.getCoordinates()]}},ng[ae.POLYGON]=function(t,e){var r=ag(t);return{hasZ:r.hasZ,hasM:r.hasM,rings:t.getCoordinates(!1)}},ng[ae.MULTI_POINT]=function(t,e){var r=ag(t);return{hasZ:r.hasZ,hasM:r.hasM,points:t.getCoordinates()}},ng[ae.MULTI_LINE_STRING]=function(t,e){var r=ag(t);return{hasZ:r.hasZ,hasM:r.hasM,paths:t.getCoordinates()}},ng[ae.MULTI_POLYGON]=function(t,e){for(var r=ag(t),n=t.getCoordinates(!1),i=[],o=0;o<n.length;o++)for(var a=n[o].length-1;a>=0;a--)i.push(n[o][a]);return{hasZ:r.hasZ,hasM:r.hasM,rings:i}};var ug=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).geometryName_=n.geometryName,r}return eg(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=t,n=ig(r.geometry,e),i=new lt;return this.geometryName_&&i.setGeometryName(this.geometryName_),i.setGeometry(n),e&&e.idField&&r.attributes[e.idField]&&i.setId(r.attributes[e.idField]),r.attributes&&i.setProperties(r.attributes,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=e||{};if(t.features){var n=[],i=t.features;r.idField=t.objectIdFieldName;for(var o=0,a=i.length;o<a;++o)n.push(this.readFeatureFromObject(i[o],r));return n}return[this.readFeatureFromObject(t,r)]},e.prototype.readGeometryFromObject=function(t,e){return ig(t,e)},e.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?We("EPSG:"+t.spatialReference.wkid):null},e.prototype.writeGeometryObject=function(t,e){return sg(t,this.adaptOptions(e))},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={},n=t.getGeometry();n&&(r.geometry=sg(n,e),e&&e.featureProjection&&(r.geometry.spatialReference={wkid:Number(We(e.featureProjection).getCode().split(":").pop())}));var i=t.getProperties();return delete i[t.getGeometryName()],_(i)?r.attributes={}:r.attributes=i,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}(tg),lg=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hg=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===ll&&"undefined"!=typeof XMLSerializer&&(ll=new XMLSerializer),ll),e}return lg(e,t),e.prototype.getType=function(){return xu},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=Zu(t);return this.readFeatureFromDocument(r,e)}return Wu(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=Zu(t);return this.readFeaturesFromDocument(r,e)}return Wu(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&&T(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=Zu(t);return this.readGeometryFromDocument(r,e)}return Wu(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=Zu(t);return this.readProjectionFromDocument(e)}return Wu(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}(q_),cg=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pg="http://www.opengis.net/gml",fg=/^[\s\xa0]*$/,dg=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureType=n.featureType,r.featureNS=n.featureNS,r.srsName=n.srsName,r.schemaLocation="",r.FEATURE_COLLECTION_PARSERS={},r.FEATURE_COLLECTION_PARSERS[r.namespace]={featureMember:qu(r.readFeaturesInternal),featureMembers:Hu(r.readFeaturesInternal)},r}return cg(e,t),e.prototype.readFeaturesInternal=function(t,e){var r=t.localName,n=null;if("FeatureCollection"==r)n=al([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==r||"featureMember"==r){var i=e[0],o=i.featureType,a=i.featureNS;if(!o&&t.childNodes){o=[],a={};for(var s=0,u=t.childNodes.length;s<u;++s){var l=t.childNodes[s];if(1===l.nodeType){var h=l.nodeName.split(":").pop();if(-1===o.indexOf(h)){var c="",p=0,f=l.namespaceURI;for(var d in a){if(a[d]===f){c=d;break}++p}c||(a[c="p"+p]=f),o.push(c+":"+h)}}}"featureMember"!=r&&(i.featureType=o,i.featureNS=a)}if("string"==typeof a){var _=a;(a={}).p0=_}var g={},y=Array.isArray(o)?o:[o];for(var v in a){var m={};for(s=0,u=y.length;s<u;++s){(-1===y[s].indexOf(":")?"p0":y[s].split(":")[0])===v&&(m[y[s].split(":").pop()]="featureMembers"==r?qu(this.readFeatureElement,this):Hu(this.readFeatureElement,this))}g[a[v]]=m}n=al("featureMember"==r?void 0:[],g,t,e)}return null===n&&(n=[]),n},e.prototype.readGeometryElement=function(t,e){var r=e[0];r.srsName=t.firstElementChild.getAttribute("srsName"),r.srsDimension=t.firstElementChild.getAttribute("srsDimension");var n=al(null,this.GEOMETRY_PARSERS,t,e,this);return n?Array.isArray(n)?J_(n,r):H_(n,!1,r):void 0},e.prototype.readFeatureElementInternal=function(t,e,r){for(var n,i={},o=t.firstElementChild;o;o=o.nextElementSibling){var a=void 0,s=o.localName;0===o.childNodes.length||1===o.childNodes.length&&(3===o.firstChild.nodeType||4===o.firstChild.nodeType)?(a=Xu(o,!1),fg.test(a)&&(a=void 0)):(r&&(a=this.readGeometryElement(o,e)),a?"boundedBy"!==s&&(n=s):a=this.readFeatureElementInternal(o,e,!1)),i[s]?(i[s]instanceof Array||(i[s]=[i[s]]),i[s].push(a)):i[s]=a;var u=o.attributes.length;if(u>0){i[s]={_content_:i[s]};for(var l=0;l<u;l++){var h=o.attributes[l].name;i[s][h]=o.attributes[l].value}}}if(r){var c=new lt(i);n&&c.setGeometryName(n);var p=t.getAttribute("fid")||function(t,e,r){return t.getAttributeNS(e,r)||""}(t,this.namespace,"id");return p&&c.setId(p),c}return i},e.prototype.readFeatureElement=function(t,e){return this.readFeatureElementInternal(t,e,!0)},e.prototype.readPoint=function(t,e){var r=this.readFlatCoordinatesFromNode_(t,e);if(r)return new Kr(r,ne)},e.prototype.readMultiPoint=function(t,e){var r=al([],this.MULTIPOINT_PARSERS_,t,e,this);return r?new $d(r):void 0},e.prototype.readMultiLineString=function(t,e){var r=al([],this.MULTILINESTRING_PARSERS_,t,e,this);if(r)return new Jd(r)},e.prototype.readMultiPolygon=function(t,e){var r=al([],this.MULTIPOLYGON_PARSERS_,t,e,this);if(r)return new r_(r)},e.prototype.pointMemberParser_=function(t,e){ol(this.POINTMEMBER_PARSERS_,t,e,this)},e.prototype.lineStringMemberParser_=function(t,e){ol(this.LINESTRINGMEMBER_PARSERS_,t,e,this)},e.prototype.polygonMemberParser_=function(t,e){ol(this.POLYGONMEMBER_PARSERS_,t,e,this)},e.prototype.readLineString=function(t,e){var r=this.readFlatCoordinatesFromNode_(t,e);return r?new Ed(r,ne):void 0},e.prototype.readFlatLinearRing_=function(t,e){var r=al(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);return r||void 0},e.prototype.readLinearRing=function(t,e){var r=this.readFlatCoordinatesFromNode_(t,e);if(r)return new Wr(r,ne)},e.prototype.readPolygon=function(t,e){var r=al([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this);if(r&&r[0]){var n,i=r[0],o=[i.length],a=void 0;for(a=1,n=r.length;a<n;++a)T(i,r[a]),o.push(i.length);return new cn(i,ne,o)}},e.prototype.readFlatCoordinatesFromNode_=function(t,e){return al(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.readGeometryFromNode=function(t,e){var r=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){var r={featureType:this.featureType,featureNS:this.featureNS};return e&&p(r,this.getReadOptions(t,e)),this.readFeaturesInternal(t,[r])||[]},e.prototype.readProjectionFromNode=function(t){return We(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},e}(hg);dg.prototype.namespace=pg,dg.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},dg.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},dg.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},dg.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml":{pointMember:qu(dg.prototype.pointMemberParser_),pointMembers:qu(dg.prototype.pointMemberParser_)}},dg.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml":{lineStringMember:qu(dg.prototype.lineStringMemberParser_),lineStringMembers:qu(dg.prototype.lineStringMemberParser_)}},dg.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml":{polygonMember:qu(dg.prototype.polygonMemberParser_),polygonMembers:qu(dg.prototype.polygonMemberParser_)}},dg.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml":{Point:qu(dg.prototype.readFlatCoordinatesFromNode_)}},dg.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:qu(dg.prototype.readLineString)}},dg.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:qu(dg.prototype.readPolygon)}},dg.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:Hu(dg.prototype.readFlatLinearRing_)}};var _g=dg;function gg(t){return yg(Xu(t,!1))}function yg(t){var e=/^\s*(true|1)|(false|0)\s*$/.exec(t);return e?void 0!==e[1]||!1:void 0}function vg(t){var e=Xu(t,!1),r=Date.parse(e);return isNaN(r)?void 0:r/1e3}function mg(t){return xg(Xu(t,!1))}function xg(t){var e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return e?parseFloat(e[1]):void 0}function wg(t){return Sg(Xu(t,!1))}function Sg(t){var e=/^\s*(\d+)\s*$/.exec(t);return e?parseInt(e[1],10):void 0}function Eg(t){return Xu(t,!1).trim()}function Tg(t,e){Pg(t,e?"1":"0")}function Cg(t,e){var r=e.toPrecision();t.appendChild(cl().createTextNode(r))}function bg(t,e){var r=e.toString();t.appendChild(cl().createTextNode(r))}function Pg(t,e){t.appendChild(cl().createTextNode(e))}var Rg=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Og={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},Ig=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).surface_=void 0!==n.surface&&n.surface,r.curve_=void 0!==n.curve&&n.curve,r.multiCurve_=void 0===n.multiCurve||n.multiCurve,r.multiSurface_=void 0===n.multiSurface||n.multiSurface,r.schemaLocation=n.schemaLocation?n.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",r.hasZ=void 0!==n.hasZ&&n.hasZ,r}return Rg(e,t),e.prototype.readMultiCurve_=function(t,e){var r=al([],this.MULTICURVE_PARSERS_,t,e,this);return r?new Jd(r):void 0},e.prototype.readMultiSurface_=function(t,e){var r=al([],this.MULTISURFACE_PARSERS_,t,e,this);if(r)return new r_(r)},e.prototype.curveMemberParser_=function(t,e){ol(this.CURVEMEMBER_PARSERS_,t,e,this)},e.prototype.surfaceMemberParser_=function(t,e){ol(this.SURFACEMEMBER_PARSERS_,t,e,this)},e.prototype.readPatch_=function(t,e){return al([null],this.PATCHES_PARSERS_,t,e,this)},e.prototype.readSegment_=function(t,e){return al([null],this.SEGMENTS_PARSERS_,t,e,this)},e.prototype.readPolygonPatch_=function(t,e){return al([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)},e.prototype.readLineStringSegment_=function(t,e){return al([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)},e.prototype.interiorParser_=function(t,e){var r=al(void 0,this.RING_PARSERS,t,e,this);r&&e[e.length-1].push(r)},e.prototype.exteriorParser_=function(t,e){var r=al(void 0,this.RING_PARSERS,t,e,this);r&&(e[e.length-1][0]=r)},e.prototype.readSurface_=function(t,e){var r=al([null],this.SURFACE_PARSERS_,t,e,this);if(r&&r[0]){var n,i=r[0],o=[i.length],a=void 0;for(a=1,n=r.length;a<n;++a)T(i,r[a]),o.push(i.length);return new cn(i,ne,o)}},e.prototype.readCurve_=function(t,e){var r=al([null],this.CURVE_PARSERS_,t,e,this);return r?new Ed(r,ne):void 0},e.prototype.readEnvelope_=function(t,e){var r=al([null],this.ENVELOPE_PARSERS_,t,e,this);return Ot(r[1][0],r[1][1],r[2][0],r[2][1])},e.prototype.readFlatPos_=function(t,e){for(var r,n=Xu(t,!1),i=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];r=i.exec(n);)o.push(parseFloat(r[1])),n=n.substr(r[0].length);if(""===n){var a=e[0].srsName,s="enu";if(a)s=We(a).getAxisOrientation();if("neu"===s){var u,l=void 0;for(l=0,u=o.length;l<u;l+=3){var h=o[l],c=o[l+1];o[l]=c,o[l+1]=h}}var p=o.length;if(2==p&&o.push(0),0!==p)return o}},e.prototype.readFlatPosList_=function(t,e){var r=Xu(t,!1).replace(/^\s*|\s*$/g,""),n=e[0],i=n.srsName,o=n.srsDimension,a="enu";i&&(a=We(i).getAxisOrientation());var s,u,l,h=r.split(/\s+/),c=2;t.getAttribute("srsDimension")?c=Sg(t.getAttribute("srsDimension")):t.getAttribute("dimension")?c=Sg(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?c=Sg(t.parentNode.getAttribute("srsDimension")):o&&(c=Sg(o));for(var p=[],f=0,d=h.length;f<d;f+=c)s=parseFloat(h[f]),u=parseFloat(h[f+1]),l=3===c?parseFloat(h[f+2]):0,"en"===a.substr(0,2)?p.push(s,u,l):p.push(u,s,l);return p},e.prototype.writePos_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=i?"3":"2";t.setAttribute("srsDimension",o);var a=n.srsName,s="enu";a&&(s=We(a).getAxisOrientation());var u,l=e.getCoordinates();(u="en"===s.substr(0,2)?l[0]+" "+l[1]:l[1]+" "+l[0],i)&&(u+=" "+(l[2]||0));Pg(t,u)},e.prototype.getCoords_=function(t,e,r){var n="enu";e&&(n=We(e).getAxisOrientation());var i="en"===n.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];r&&(i+=" "+(t[2]||0));return i},e.prototype.writePosList_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=i?"3":"2";t.setAttribute("srsDimension",o);for(var a,s=n.srsName,u=e.getCoordinates(),l=u.length,h=new Array(l),c=0;c<l;++c)a=u[c],h[c]=this.getCoords_(a,s,i);Pg(t,h.join(" "))},e.prototype.writePoint_=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=Vu(t.namespaceURI,"pos");t.appendChild(i),this.writePos_(i,e,r)},e.prototype.writeEnvelope=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=[e[0]+" "+e[1],e[2]+" "+e[3]];ul({node:t},this.ENVELOPE_SERIALIZERS_,rl,i,r,["lowerCorner","upperCorner"],this)},e.prototype.writeLinearRing_=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=Vu(t.namespaceURI,"posList");t.appendChild(i),this.writePosList_(i,e,r)},e.prototype.RING_NODE_FACTORY_=function(t,e,r){var n=e[e.length-1],i=n.node,o=n.exteriorWritten;return void 0===o&&(n.exteriorWritten=!0),Vu(i.namespaceURI,void 0!==o?"interior":"exterior")},e.prototype.writeSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var a=e.getLinearRings();ul({node:t,hasZ:i,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,a,r,void 0,this)}else if("Surface"===t.nodeName){var s=Vu(t.namespaceURI,"patches");t.appendChild(s),this.writeSurfacePatches_(s,e,r)}},e.prototype.writeCurveOrLineString_=function(t,e,r){var n=r[r.length-1].srsName;if("LineStringSegment"!==t.nodeName&&n&&t.setAttribute("srsName",n),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var i=Vu(t.namespaceURI,"posList");t.appendChild(i),this.writePosList_(i,e,r)}else if("Curve"===t.nodeName){var o=Vu(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,r)}},e.prototype.writeMultiSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.surface;o&&t.setAttribute("srsName",o);var s=e.getPolygons();ul({node:t,hasZ:i,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeMultiPoint_=function(t,e,r){var n=r[r.length-1],i=n.srsName,o=n.hasZ;i&&t.setAttribute("srsName",i);var a=e.getPoints();ul({node:t,hasZ:o,srsName:i},this.POINTMEMBER_SERIALIZERS_,el("pointMember"),a,r,void 0,this)},e.prototype.writeMultiCurveOrLineString_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.curve;o&&t.setAttribute("srsName",o);var s=e.getLineStrings();ul({node:t,hasZ:i,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeRing_=function(t,e,r){var n=Vu(t.namespaceURI,"LinearRing");t.appendChild(n),this.writeLinearRing_(n,e,r)},e.prototype.writeSurfaceOrPolygonMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeSurfaceOrPolygon_(n,e,r))},e.prototype.writePointMember_=function(t,e,r){var n=Vu(t.namespaceURI,"Point");t.appendChild(n),this.writePoint_(n,e,r)},e.prototype.writeLineStringOrCurveMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeCurveOrLineString_(n,e,r))},e.prototype.writeSurfacePatches_=function(t,e,r){var n=Vu(t.namespaceURI,"PolygonPatch");t.appendChild(n),this.writeSurfaceOrPolygon_(n,e,r)},e.prototype.writeCurveSegments_=function(t,e,r){var n=Vu(t.namespaceURI,"LineStringSegment");t.appendChild(n),this.writeCurveOrLineString_(n,e,r)},e.prototype.writeGeometryElement=function(t,e,r){var n,i=r[r.length-1],o=p({},i);o.node=t,n=Array.isArray(e)?J_(e,i):H_(e,!0,i),ul(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[n],r,void 0,this)},e.prototype.writeFeatureElement=function(t,e,r){var n=e.getId();n&&t.setAttribute("fid",n);var i=r[r.length-1],o=i.featureNS,a=e.getGeometryName();i.serializers||(i.serializers={},i.serializers[o]={});var s=e.getProperties(),u=[],l=[];for(var h in s){var c=s[h];null!==c&&(u.push(h),l.push(c),h==a||"function"==typeof c.getSimplifiedGeometry?h in i.serializers[o]||(i.serializers[o][h]=$u(this.writeGeometryElement,this)):h in i.serializers[o]||(i.serializers[o][h]=$u(Pg)))}var f=p({},i);f.node=t,ul(f,i.serializers,el(void 0,o),l,r,u)},e.prototype.writeFeatureMembers_=function(t,e,r){var n=r[r.length-1],i=n.featureType,o=n.featureNS,a={};a[o]={},a[o][i]=$u(this.writeFeatureElement,this);var s=p({},n);s.node=t,ul(s,a,el(i,o),e,r)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,r){var n=e[e.length-1].node;return Vu(this.namespace,Og[n.nodeName])},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,r){var n,i=e[e.length-1],o=i.multiSurface,a=i.surface,s=i.curve,u=i.multiCurve;return Array.isArray(t)?n="Envelope":"MultiPolygon"===(n=t.getType())&&!0===o?n="MultiSurface":"Polygon"===n&&!0===a?n="Surface":"LineString"===n&&!0===s?n="Curve":"MultiLineString"===n&&!0===u&&(n="MultiCurve"),Vu(this.namespace,n)},e.prototype.writeGeometryNode=function(t,e){e=this.adaptOptions(e);var r=Vu(this.namespace,"geom"),n={node:r,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&p(n,e),this.writeGeometryElement(r,t,[n]),r},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Vu(this.namespace,"featureMembers");r.setAttributeNS(Yu,"xsi:schemaLocation",this.schemaLocation);var n={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&p(n,e),this.writeFeatureMembers_(r,t,[n]),r},e}(_g);Ig.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:Hu(Ig.prototype.readFlatPos_),posList:Hu(Ig.prototype.readFlatPosList_)}},Ig.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:Ig.prototype.interiorParser_,exterior:Ig.prototype.exteriorParser_}},Ig.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:Hu(_g.prototype.readPoint),MultiPoint:Hu(_g.prototype.readMultiPoint),LineString:Hu(_g.prototype.readLineString),MultiLineString:Hu(_g.prototype.readMultiLineString),LinearRing:Hu(_g.prototype.readLinearRing),Polygon:Hu(_g.prototype.readPolygon),MultiPolygon:Hu(_g.prototype.readMultiPolygon),Surface:Hu(Ig.prototype.readSurface_),MultiSurface:Hu(Ig.prototype.readMultiSurface_),Curve:Hu(Ig.prototype.readCurve_),MultiCurve:Hu(Ig.prototype.readMultiCurve_),Envelope:Hu(Ig.prototype.readEnvelope_)}},Ig.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml":{curveMember:qu(Ig.prototype.curveMemberParser_),curveMembers:qu(Ig.prototype.curveMemberParser_)}},Ig.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml":{surfaceMember:qu(Ig.prototype.surfaceMemberParser_),surfaceMembers:qu(Ig.prototype.surfaceMemberParser_)}},Ig.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml":{LineString:qu(_g.prototype.readLineString),Curve:qu(Ig.prototype.readCurve_)}},Ig.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml":{Polygon:qu(_g.prototype.readPolygon),Surface:qu(Ig.prototype.readSurface_)}},Ig.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml":{patches:Hu(Ig.prototype.readPatch_)}},Ig.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml":{segments:Hu(Ig.prototype.readSegment_)}},Ig.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml":{lowerCorner:qu(Ig.prototype.readFlatPosList_),upperCorner:qu(Ig.prototype.readFlatPosList_)}},Ig.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml":{PolygonPatch:Hu(Ig.prototype.readPolygonPatch_)}},Ig.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml":{LineStringSegment:Hu(Ig.prototype.readLineStringSegment_)}},Ig.prototype.writeFeatures,Ig.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{exterior:$u(Ig.prototype.writeRing_),interior:$u(Ig.prototype.writeRing_)}},Ig.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:$u(Pg),upperCorner:$u(Pg)}},Ig.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:$u(Ig.prototype.writeSurfaceOrPolygonMember_),polygonMember:$u(Ig.prototype.writeSurfaceOrPolygonMember_)}},Ig.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:$u(Ig.prototype.writePointMember_)}},Ig.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:$u(Ig.prototype.writeLineStringOrCurveMember_),curveMember:$u(Ig.prototype.writeLineStringOrCurveMember_)}},Ig.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:$u(Ig.prototype.writeCurveOrLineString_),MultiCurve:$u(Ig.prototype.writeMultiCurveOrLineString_),Point:$u(Ig.prototype.writePoint_),MultiPoint:$u(Ig.prototype.writeMultiPoint_),LineString:$u(Ig.prototype.writeCurveOrLineString_),MultiLineString:$u(Ig.prototype.writeMultiCurveOrLineString_),LinearRing:$u(Ig.prototype.writeLinearRing_),Polygon:$u(Ig.prototype.writeSurfaceOrPolygon_),MultiPolygon:$u(Ig.prototype.writeMultiSurfaceOrPolygon_),Surface:$u(Ig.prototype.writeSurfaceOrPolygon_),MultiSurface:$u(Ig.prototype.writeMultiSurfaceOrPolygon_),Envelope:$u(Ig.prototype.writeEnvelope)}};var Lg=Ig,Fg=Lg;Fg.prototype.writeFeatures,Fg.prototype.writeFeaturesNode;var Mg=Fg,Ag=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ng={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},Gg=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).FEATURE_COLLECTION_PARSERS[pg].featureMember=qu(r.readFeaturesInternal),r.schemaLocation=n.schemaLocation?n.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",r}return Ag(e,t),e.prototype.readFlatCoordinates_=function(t,e){var r=Xu(t,!1).replace(/^\s*|\s*$/g,""),n=e[0].srsName,i="enu";if(n){var o=We(n);o&&(i=o.getAxisOrientation())}for(var a=r.trim().split(/\s+/),s=[],u=0,l=a.length;u<l;u++){var h=a[u].split(/,+/),c=parseFloat(h[0]),p=parseFloat(h[1]),f=3===h.length?parseFloat(h[2]):0;"en"===i.substr(0,2)?s.push(c,p,f):s.push(p,c,f)}return s},e.prototype.readBox_=function(t,e){var r=al([null],this.BOX_PARSERS_,t,e,this);return Ot(r[1][0],r[1][1],r[1][3],r[1][4])},e.prototype.innerBoundaryIsParser_=function(t,e){var r=al(void 0,this.RING_PARSERS,t,e,this);r&&e[e.length-1].push(r)},e.prototype.outerBoundaryIsParser_=function(t,e){var r=al(void 0,this.RING_PARSERS,t,e,this);r&&(e[e.length-1][0]=r)},e.prototype.GEOMETRY_NODE_FACTORY_=function(t,e,r){var n,i=e[e.length-1],o=i.multiSurface,a=i.surface,s=i.multiCurve;return Array.isArray(t)?n="Envelope":"MultiPolygon"===(n=t.getType())&&!0===o?n="MultiSurface":"Polygon"===n&&!0===a?n="Surface":"MultiLineString"===n&&!0===s&&(n="MultiCurve"),Vu("http://www.opengis.net/gml",n)},e.prototype.writeFeatureElement=function(t,e,r){var n=e.getId();n&&t.setAttribute("fid",n);var i=r[r.length-1],o=i.featureNS,a=e.getGeometryName();i.serializers||(i.serializers={},i.serializers[o]={});var s=e.getProperties(),u=[],l=[];for(var h in s){var c=s[h];null!==c&&(u.push(h),l.push(c),h==a||"function"==typeof c.getSimplifiedGeometry?h in i.serializers[o]||(i.serializers[o][h]=$u(this.writeGeometryElement,this)):h in i.serializers[o]||(i.serializers[o][h]=$u(Pg)))}var f=p({},i);f.node=t,ul(f,i.serializers,el(void 0,o),l,r,u)},e.prototype.writeCurveOrLineString_=function(t,e,r){var n=r[r.length-1].srsName;if("LineStringSegment"!==t.nodeName&&n&&t.setAttribute("srsName",n),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var i=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(i),this.writeCoordinates_(i,e,r)}else if("Curve"===t.nodeName){var o=Vu(t.namespaceURI,"segments");t.appendChild(o),this.writeCurveSegments_(o,e,r)}},e.prototype.writeLineStringOrCurveMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeCurveOrLineString_(n,e,r))},e.prototype.writeMultiCurveOrLineString_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.curve;o&&t.setAttribute("srsName",o);var s=e.getLineStrings();ul({node:t,hasZ:i,srsName:o,curve:a},this.LINESTRINGORCURVEMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeGeometryElement=function(t,e,r){var n,i=r[r.length-1],o=p({},i);o.node=t,n=Array.isArray(e)?J_(e,i):H_(e,!0,i),ul(o,this.GEOMETRY_SERIALIZERS_,this.GEOMETRY_NODE_FACTORY_,[n],r,void 0,this)},e.prototype.createCoordinatesNode_=function(t){var e=Vu(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e},e.prototype.writeCoordinates_=function(t,e,r){for(var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=e.getCoordinates(),s=a.length,u=new Array(s),l=0;l<s;++l){var h=a[l];u[l]=this.getCoords_(h,o,i)}Pg(t,u.join(" "))},e.prototype.writeCurveSegments_=function(t,e,r){var n=Vu(t.namespaceURI,"LineStringSegment");t.appendChild(n),this.writeCurveOrLineString_(n,e,r)},e.prototype.writeSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var a=e.getLinearRings();ul({node:t,hasZ:i,srsName:o},this.RING_SERIALIZERS_,this.RING_NODE_FACTORY_,a,r,void 0,this)}else if("Surface"===t.nodeName){var s=Vu(t.namespaceURI,"patches");t.appendChild(s),this.writeSurfacePatches_(s,e,r)}},e.prototype.RING_NODE_FACTORY_=function(t,e,r){var n=e[e.length-1],i=n.node,o=n.exteriorWritten;return void 0===o&&(n.exteriorWritten=!0),Vu(i.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},e.prototype.writeSurfacePatches_=function(t,e,r){var n=Vu(t.namespaceURI,"PolygonPatch");t.appendChild(n),this.writeSurfaceOrPolygon_(n,e,r)},e.prototype.writeRing_=function(t,e,r){var n=Vu(t.namespaceURI,"LinearRing");t.appendChild(n),this.writeLinearRing_(n,e,r)},e.prototype.getCoords_=function(t,e,r){var n="enu";e&&(n=We(e).getAxisOrientation());var i="en"===n.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];r&&(i+=","+(t[2]||0));return i},e.prototype.writePoint_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;o&&t.setAttribute("srsName",o);var a=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(a);var s=e.getCoordinates();Pg(a,this.getCoords_(s,o,i))},e.prototype.writeMultiPoint_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName;o&&t.setAttribute("srsName",o);var a=e.getPoints();ul({node:t,hasZ:i,srsName:o},this.POINTMEMBER_SERIALIZERS_,el("pointMember"),a,r,void 0,this)},e.prototype.writePointMember_=function(t,e,r){var n=Vu(t.namespaceURI,"Point");t.appendChild(n),this.writePoint_(n,e,r)},e.prototype.writeLinearRing_=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(i),this.writeCoordinates_(i,e,r)},e.prototype.writeMultiSurfaceOrPolygon_=function(t,e,r){var n=r[r.length-1],i=n.hasZ,o=n.srsName,a=n.surface;o&&t.setAttribute("srsName",o);var s=e.getPolygons();ul({node:t,hasZ:i,srsName:o,surface:a},this.SURFACEORPOLYGONMEMBER_SERIALIZERS_,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,s,r,void 0,this)},e.prototype.writeSurfaceOrPolygonMember_=function(t,e,r){var n=this.GEOMETRY_NODE_FACTORY_(e,r);n&&(t.appendChild(n),this.writeSurfaceOrPolygon_(n,e,r))},e.prototype.writeEnvelope=function(t,e,r){var n=r[r.length-1].srsName;n&&t.setAttribute("srsName",n);var i=[e[0]+" "+e[1],e[2]+" "+e[3]];ul({node:t},this.ENVELOPE_SERIALIZERS_,rl,i,r,["lowerCorner","upperCorner"],this)},e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_=function(t,e,r){var n=e[e.length-1].node;return Vu("http://www.opengis.net/gml",Ng[n.nodeName])},e}(_g);Gg.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:Hu(Gg.prototype.readFlatCoordinates_)}},Gg.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:Gg.prototype.innerBoundaryIsParser_,outerBoundaryIs:Gg.prototype.outerBoundaryIsParser_}},Gg.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:qu(Gg.prototype.readFlatCoordinates_)}},Gg.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:Hu(_g.prototype.readPoint),MultiPoint:Hu(_g.prototype.readMultiPoint),LineString:Hu(_g.prototype.readLineString),MultiLineString:Hu(_g.prototype.readMultiLineString),LinearRing:Hu(_g.prototype.readLinearRing),Polygon:Hu(_g.prototype.readPolygon),MultiPolygon:Hu(_g.prototype.readMultiPolygon),Box:Hu(Gg.prototype.readBox_)}},Gg.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml":{Curve:$u(Gg.prototype.writeCurveOrLineString_),MultiCurve:$u(Gg.prototype.writeMultiCurveOrLineString_),Point:$u(Gg.prototype.writePoint_),MultiPoint:$u(Gg.prototype.writeMultiPoint_),LineString:$u(Gg.prototype.writeCurveOrLineString_),MultiLineString:$u(Gg.prototype.writeMultiCurveOrLineString_),LinearRing:$u(Gg.prototype.writeLinearRing_),Polygon:$u(Gg.prototype.writeSurfaceOrPolygon_),MultiPolygon:$u(Gg.prototype.writeMultiSurfaceOrPolygon_),Surface:$u(Gg.prototype.writeSurfaceOrPolygon_),MultiSurface:$u(Gg.prototype.writeMultiSurfaceOrPolygon_),Envelope:$u(Gg.prototype.writeEnvelope)}},Gg.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{lineStringMember:$u(Gg.prototype.writeLineStringOrCurveMember_),curveMember:$u(Gg.prototype.writeLineStringOrCurveMember_)}},Gg.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml":{outerBoundaryIs:$u(Gg.prototype.writeRing_),innerBoundaryIs:$u(Gg.prototype.writeRing_)}},Gg.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{pointMember:$u(Gg.prototype.writePointMember_)}},Gg.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml":{surfaceMember:$u(Gg.prototype.writeSurfaceOrPolygonMember_),polygonMember:$u(Gg.prototype.writeSurfaceOrPolygonMember_)}},Gg.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml":{lowerCorner:$u(Pg),upperCorner:$u(Pg)}};var jg=Gg,Dg=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kg=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).schemaLocation=n.schemaLocation?n.schemaLocation:r.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd",r}return Dg(e,t),e}(Lg);kg.prototype.namespace="http://www.opengis.net/gml/3.2",kg.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:Hu(Lg.prototype.readFlatPos_),posList:Hu(Lg.prototype.readFlatPosList_)}},kg.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Lg.prototype.interiorParser_,exterior:Lg.prototype.exteriorParser_}},kg.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:Hu(_g.prototype.readPoint),MultiPoint:Hu(_g.prototype.readMultiPoint),LineString:Hu(_g.prototype.readLineString),MultiLineString:Hu(_g.prototype.readMultiLineString),LinearRing:Hu(_g.prototype.readLinearRing),Polygon:Hu(_g.prototype.readPolygon),MultiPolygon:Hu(_g.prototype.readMultiPolygon),Surface:Hu(kg.prototype.readSurface_),MultiSurface:Hu(Lg.prototype.readMultiSurface_),Curve:Hu(kg.prototype.readCurve_),MultiCurve:Hu(Lg.prototype.readMultiCurve_),Envelope:Hu(kg.prototype.readEnvelope_)}},kg.prototype.MULTICURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{curveMember:qu(Lg.prototype.curveMemberParser_),curveMembers:qu(Lg.prototype.curveMemberParser_)}},kg.prototype.MULTISURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:qu(Lg.prototype.surfaceMemberParser_),surfaceMembers:qu(Lg.prototype.surfaceMemberParser_)}},kg.prototype.CURVEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:qu(_g.prototype.readLineString),Curve:qu(Lg.prototype.readCurve_)}},kg.prototype.SURFACEMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:qu(_g.prototype.readPolygon),Surface:qu(Lg.prototype.readSurface_)}},kg.prototype.SURFACE_PARSERS_={"http://www.opengis.net/gml/3.2":{patches:Hu(Lg.prototype.readPatch_)}},kg.prototype.CURVE_PARSERS_={"http://www.opengis.net/gml/3.2":{segments:Hu(Lg.prototype.readSegment_)}},kg.prototype.ENVELOPE_PARSERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:qu(Lg.prototype.readFlatPosList_),upperCorner:qu(Lg.prototype.readFlatPosList_)}},kg.prototype.PATCHES_PARSERS_={"http://www.opengis.net/gml/3.2":{PolygonPatch:Hu(Lg.prototype.readPolygonPatch_)}},kg.prototype.SEGMENTS_PARSERS_={"http://www.opengis.net/gml/3.2":{LineStringSegment:Hu(Lg.prototype.readLineStringSegment_)}},kg.prototype.MULTIPOINT_PARSERS_={"http://www.opengis.net/gml/3.2":{pointMember:qu(_g.prototype.pointMemberParser_),pointMembers:qu(_g.prototype.pointMemberParser_)}},kg.prototype.MULTILINESTRING_PARSERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:qu(_g.prototype.lineStringMemberParser_),lineStringMembers:qu(_g.prototype.lineStringMemberParser_)}},kg.prototype.MULTIPOLYGON_PARSERS_={"http://www.opengis.net/gml/3.2":{polygonMember:qu(_g.prototype.polygonMemberParser_),polygonMembers:qu(_g.prototype.polygonMemberParser_)}},kg.prototype.POINTMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Point:qu(_g.prototype.readFlatCoordinatesFromNode_)}},kg.prototype.LINESTRINGMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{LineString:qu(_g.prototype.readLineString)}},kg.prototype.POLYGONMEMBER_PARSERS_={"http://www.opengis.net/gml/3.2":{Polygon:qu(_g.prototype.readPolygon)}},kg.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:Hu(_g.prototype.readFlatLinearRing_)}},kg.prototype.RING_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{exterior:$u(Lg.prototype.writeRing_),interior:$u(Lg.prototype.writeRing_)}},kg.prototype.ENVELOPE_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lowerCorner:$u(Pg),upperCorner:$u(Pg)}},kg.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{surfaceMember:$u(Lg.prototype.writeSurfaceOrPolygonMember_),polygonMember:$u(Lg.prototype.writeSurfaceOrPolygonMember_)}},kg.prototype.POINTMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{pointMember:$u(Lg.prototype.writePointMember_)}},kg.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{lineStringMember:$u(Lg.prototype.writeLineStringOrCurveMember_),curveMember:$u(Lg.prototype.writeLineStringOrCurveMember_)}},kg.prototype.GEOMETRY_SERIALIZERS_={"http://www.opengis.net/gml/3.2":{Curve:$u(Lg.prototype.writeCurveOrLineString_),MultiCurve:$u(Lg.prototype.writeMultiCurveOrLineString_),Point:$u(kg.prototype.writePoint_),MultiPoint:$u(Lg.prototype.writeMultiPoint_),LineString:$u(Lg.prototype.writeCurveOrLineString_),MultiLineString:$u(Lg.prototype.writeMultiCurveOrLineString_),LinearRing:$u(Lg.prototype.writeLinearRing_),Polygon:$u(Lg.prototype.writeSurfaceOrPolygon_),MultiPolygon:$u(Lg.prototype.writeMultiSurfaceOrPolygon_),Surface:$u(Lg.prototype.writeSurfaceOrPolygon_),MultiSurface:$u(Lg.prototype.writeMultiSurfaceOrPolygon_),Envelope:$u(Lg.prototype.writeEnvelope)}};var Ug=kg,zg=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bg=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],Yg={rte:yy,trk:vy,wpt:my},Vg=il(Bg,{rte:qu(yy),trk:qu(vy),wpt:qu(my)}),Xg=il(Bg,{text:Qu(Eg,"linkText"),type:Qu(Eg,"linkType")}),Wg=il(Bg,{rte:$u((function(t,e,r){var n=r[0],i=e.getProperties(),o={node:t};o.properties=i;var a=e.getGeometry();if(a.getType()==ae.LINE_STRING){var s=H_(a,!0,n);o.geometryLayout=s.getLayout(),i.rtept=s.getCoordinates()}var u=r[r.length-1].node,l=ry[u.namespaceURI],h=nl(i,l);ul(o,ny,rl,h,r,l)})),trk:$u((function(t,e,r){var n=r[0],i=e.getProperties(),o={node:t};o.properties=i;var a=e.getGeometry();if(a.getType()==ae.MULTI_LINE_STRING){var s=H_(a,!0,n);i.trkseg=s.getLineStrings()}var u=r[r.length-1].node,l=oy[u.namespaceURI],h=nl(i,l);ul(o,ay,rl,h,r,l)})),wpt:$u((function(t,e,r){var n=r[0],i=r[r.length-1];i.properties=e.getProperties();var o=e.getGeometry();if(o.getType()==ae.POINT){var a=H_(o,!0,n);i.geometryLayout=a.getLayout(),wy(t,a.getCoordinates(),r)}}))}),Zg=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=We("EPSG:4326"),r.readExtensions_=n.readExtensions,r}return zg(e,t),e.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,r=t.length;e<r;++e){var n=t[e];if(this.readExtensions_){var i=n.get("extensionsNode_")||null;this.readExtensions_(n,i)}n.set("extensionsNode_",void 0)}},e.prototype.readFeatureFromNode=function(t,e){if(!w(Bg,t.namespaceURI))return null;var r=Yg[t.localName];if(!r)return null;var n=r(t,[this.getReadOptions(t,e)]);return n?(this.handleReadExtensions_([n]),n):null},e.prototype.readFeaturesFromNode=function(t,e){if(!w(Bg,t.namespaceURI))return[];if("gpx"==t.localName){var r=al([],Vg,t,[this.getReadOptions(t,e)]);return r?(this.handleReadExtensions_(r),r):[]}return[]},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Vu("http://www.topografix.com/GPX/1/1","gpx");return r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",Yu),r.setAttributeNS(Yu,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),r.setAttribute("version","1.1"),r.setAttribute("creator","OpenLayers"),ul({node:r},Wg,py,t,[e]),r},e}(hg),Kg=il(Bg,{name:Qu(Eg),cmt:Qu(Eg),desc:Qu(Eg),src:Qu(Eg),link:_y,number:Qu(wg),extensions:gy,type:Qu(Eg),rtept:function(t,e){var r=al({},qg,t,e);if(r){var n=e[e.length-1],i=n.flatCoordinates,o=n.layoutOptions;fy(i,o,t,r)}}}),qg=il(Bg,{ele:Qu(mg),time:Qu(vg)}),Hg=il(Bg,{name:Qu(Eg),cmt:Qu(Eg),desc:Qu(Eg),src:Qu(Eg),link:_y,number:Qu(wg),type:Qu(Eg),extensions:gy,trkseg:function(t,e){var r=e[e.length-1];ol(Jg,t,e);var n=r.flatCoordinates;r.ends.push(n.length)}}),Jg=il(Bg,{trkpt:function(t,e){var r=al({},Qg,t,e);if(r){var n=e[e.length-1],i=n.flatCoordinates,o=n.layoutOptions;fy(i,o,t,r)}}}),Qg=il(Bg,{ele:Qu(mg),time:Qu(vg)}),$g=il(Bg,{ele:Qu(mg),time:Qu(vg),magvar:Qu(mg),geoidheight:Qu(mg),name:Qu(Eg),cmt:Qu(Eg),desc:Qu(Eg),src:Qu(Eg),link:_y,sym:Qu(Eg),type:Qu(Eg),fix:Qu(Eg),sat:Qu(wg),hdop:Qu(mg),vdop:Qu(mg),pdop:Qu(mg),ageofdgpsdata:Qu(mg),dgpsid:Qu(wg),extensions:gy}),ty=["text","type"],ey=il(Bg,{text:$u(Pg),type:$u(Pg)}),ry=il(Bg,["name","cmt","desc","src","link","number","type","rtept"]),ny=il(Bg,{name:$u(Pg),cmt:$u(Pg),desc:$u(Pg),src:$u(Pg),link:$u(xy),number:$u(bg),type:$u(Pg),rtept:tl($u(wy))}),iy=il(Bg,["ele","time"]),oy=il(Bg,["name","cmt","desc","src","link","number","type","trkseg"]),ay=il(Bg,{name:$u(Pg),cmt:$u(Pg),desc:$u(Pg),src:$u(Pg),link:$u(xy),number:$u(bg),type:$u(Pg),trkseg:tl($u((function(t,e,r){var n={node:t};n.geometryLayout=e.getLayout(),n.properties={},ul(n,uy,sy,e.getCoordinates(),r)})))}),sy=el("trkpt"),uy=il(Bg,{trkpt:$u(wy)}),ly=il(Bg,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),hy=il(Bg,{ele:$u(Cg),time:$u((function(t,e){var r=new Date(1e3*e),n=r.getUTCFullYear()+"-"+Oi(r.getUTCMonth()+1,2)+"-"+Oi(r.getUTCDate(),2)+"T"+Oi(r.getUTCHours(),2)+":"+Oi(r.getUTCMinutes(),2)+":"+Oi(r.getUTCSeconds(),2)+"Z";t.appendChild(cl().createTextNode(n))})),magvar:$u(Cg),geoidheight:$u(Cg),name:$u(Pg),cmt:$u(Pg),desc:$u(Pg),src:$u(Pg),link:$u(xy),sym:$u(Pg),type:$u(Pg),fix:$u(Pg),sat:$u(bg),hdop:$u(Cg),vdop:$u(Cg),pdop:$u(Cg),ageofdgpsdata:$u(Cg),dgpsid:$u(bg)}),cy={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function py(t,e,r){var n=t.getGeometry();if(n){var i=cy[n.getType()];if(i)return Vu(e[e.length-1].node.namespaceURI,i)}}function fy(t,e,r,n){return t.push(parseFloat(r.getAttribute("lon")),parseFloat(r.getAttribute("lat"))),"ele"in n?(t.push(n.ele),delete n.ele,e.hasZ=!0):t.push(0),"time"in n?(t.push(n.time),delete n.time,e.hasM=!0):t.push(0),t}function dy(t,e,r){var n=re,i=2;if(t.hasZ&&t.hasM?(n=oe,i=4):t.hasZ?(n=ne,i=3):t.hasM&&(n=ie,i=3),4!==i){for(var o=0,a=e.length/4;o<a;o++)e[o*i]=e[4*o],e[o*i+1]=e[4*o+1],t.hasZ&&(e[o*i+2]=e[4*o+2]),t.hasM&&(e[o*i+2]=e[4*o+3]);if(e.length=e.length/4*i,r)for(o=0,a=r.length;o<a;o++)r[o]=r[o]/4*i}return n}function _y(t,e){var r=e[e.length-1],n=t.getAttribute("href");null!==n&&(r.link=n),ol(Xg,t,e)}function gy(t,e){e[e.length-1].extensionsNode_=t}function yy(t,e){var r=e[0],n=al({flatCoordinates:[],layoutOptions:{}},Kg,t,e);if(n){var i=n.flatCoordinates;delete n.flatCoordinates;var o=n.layoutOptions;delete n.layoutOptions;var a=dy(o,i),s=new Ed(i,a);H_(s,!1,r);var u=new lt(s);return u.setProperties(n,!0),u}}function vy(t,e){var r=e[0],n=al({flatCoordinates:[],ends:[],layoutOptions:{}},Hg,t,e);if(n){var i=n.flatCoordinates;delete n.flatCoordinates;var o=n.ends;delete n.ends;var a=n.layoutOptions;delete n.layoutOptions;var s=dy(a,i,o),u=new Jd(i,s,o);H_(u,!1,r);var l=new lt(u);return l.setProperties(n,!0),l}}function my(t,e){var r=e[0],n=al({},$g,t,e);if(n){var i={},o=fy([],i,t,n),a=dy(i,o),s=new Kr(o,a);H_(s,!1,r);var u=new lt(s);return u.setProperties(n,!0),u}}function xy(t,e,r){t.setAttribute("href",e);var n=r[r.length-1].properties,i=[n.linkText,n.linkType];ul({node:t},ey,rl,i,r,ty)}function wy(t,e,r){var n=r[r.length-1],i=n.node.namespaceURI,o=n.properties;switch(t.setAttributeNS(null,"lat",String(e[1])),t.setAttributeNS(null,"lon",String(e[0])),n.geometryLayout){case oe:0!==e[3]&&(o.time=e[3]);case ne:0!==e[2]&&(o.ele=e[2]);break;case ie:0!==e[2]&&(o.time=e[2])}var a="rtept"==t.nodeName?iy[i]:ly[i],s=nl(o,a);ul({node:t,properties:o},hy,rl,s,r,a)}var Sy=Zg,Ey=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ty(t,e){if(!t)return null;var r;switch(t.type){case ae.POINT:r=function(t){return new Kr(t.coordinates)}(t);break;case ae.LINE_STRING:r=function(t){return new Ed(t.coordinates)}(t);break;case ae.POLYGON:r=function(t){return new cn(t.coordinates)}(t);break;case ae.MULTI_POINT:r=function(t){return new $d(t.coordinates)}(t);break;case ae.MULTI_LINE_STRING:r=function(t){return new Jd(t.coordinates)}(t);break;case ae.MULTI_POLYGON:r=function(t){return new r_(t.coordinates)}(t);break;case ae.GEOMETRY_COLLECTION:r=function(t,e){var r=t.geometries.map((function(t){return Ty(t,e)}));return new K_(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return H_(r,!1,e)}function Cy(t,e){var r,n=(t=H_(t,!0,e)).getType();switch(n){case ae.POINT:r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case ae.LINE_STRING:r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case ae.POLYGON:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case ae.MULTI_POINT:r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case ae.MULTI_LINE_STRING:r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case ae.MULTI_POLYGON:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case ae.GEOMETRY_COLLECTION:r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=p({},e);return delete r.featureProjection,Cy(t,r)}))}}(t,e);break;case ae.CIRCLE:r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return r}var by=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=We(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=We(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r}return Ey(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=null,n=Ty((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new lt;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return Ty(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=We(r.properties.name):"EPSG"===r.type?e=We("EPSG:"+r.properties.code):st(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();void 0!==n&&(r.id=n);var i=t.getGeometry();i&&(r.geometry=Cy(i,e));var o=t.getProperties();return delete o[t.getGeometryName()],_(o)||(r.properties=o),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{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return Cy(t,this.adaptOptions(e))},e}(tg),Py=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Ry(t){return"string"==typeof t?t:""}var Oy,Iy,Ly,Fy,My,Ay,Ny,Gy=function(t){function e(){return t.call(this)||this}return Py(e,t),e.prototype.getType=function(){return mu},e.prototype.readFeature=function(t,e){return this.readFeatureFromText(Ry(t),this.adaptOptions(e))},e.prototype.readFeatureFromText=function(t,e){return n()},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromText(Ry(t),this.adaptOptions(e))},e.prototype.readFeaturesFromText=function(t,e){return n()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromText(Ry(t),this.adaptOptions(e))},e.prototype.readGeometryFromText=function(t,e){return n()},e.prototype.readProjection=function(t){return this.readProjectionFromText(Ry(t))},e.prototype.readProjectionFromText=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){return this.writeFeatureText(t,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){return n()},e.prototype.writeFeatures=function(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))},e.prototype.writeFeaturesText=function(t,e){return n()},e.prototype.writeGeometry=function(t,e){return this.writeGeometryText(t,this.adaptOptions(e))},e.prototype.writeGeometryText=function(t,e){return n()},e}(q_),jy=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dy="barometric",ky="gps",Uy="none",zy=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,By=/^H.([A-Z]{3}).*?:(.*)/,Yy=/^HFDTE(\d{2})(\d{2})(\d{2})/,Vy=/\r\n|\r|\n/,Xy=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=We("EPSG:4326"),r.altitudeMode_=n.altitudeMode?n.altitudeMode:Uy,r}return jy(e,t),e.prototype.readFeatureFromText=function(t,e){var r,n,i=this.altitudeMode_,o=t.split(Vy),a={},s=[],u=2e3,l=0,h=1,c=-1;for(r=0,n=o.length;r<n;++r){var p=o[r],f=void 0;if("B"==p.charAt(0)){if(f=zy.exec(p)){var d=parseInt(f[1],10),_=parseInt(f[2],10),g=parseInt(f[3],10),y=parseInt(f[4],10)+parseInt(f[5],10)/6e4;"S"==f[6]&&(y=-y);var v=parseInt(f[7],10)+parseInt(f[8],10)/6e4;if("W"==f[9]&&(v=-v),s.push(v,y),i!=Uy){var m=void 0;m=i==ky?parseInt(f[11],10):i==Dy?parseInt(f[12],10):0,s.push(m)}var x=Date.UTC(u,l,h,d,_,g);x<c&&(x=Date.UTC(u,l,h+1,d,_,g)),s.push(x/1e3),c=x}}else"H"==p.charAt(0)&&((f=Yy.exec(p))?(h=parseInt(f[1],10),l=parseInt(f[2],10)-1,u=2e3+parseInt(f[3],10)):(f=By.exec(p))&&(a[f[1]]=f[2].trim()))}if(0===s.length)return null;var w=new Ed(s,i==Uy?ie:oe),S=new lt(H_(w,!1,e));return S.setProperties(a,!0),S},e.prototype.readFeaturesFromText=function(t,e){var r=this.readFeatureFromText(t,e);return r?[r]:[]},e}(Gy),Wy=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zy=["http://www.google.com/kml/ext/2.2"],Ky=[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"],qy={fraction:Bl,pixels:Yl,insetPixels:Yl},Hy=il(Ky,{ExtendedData:Yv,Region:Vv,MultiGeometry:Qu(Av,"geometry"),LineString:Qu(Lv,"geometry"),LinearRing:Qu(Fv,"geometry"),Point:Qu(Nv,"geometry"),Polygon:Qu(jv,"geometry"),Style:Qu(kv),StyleMap:function(t,e){var r=yv.call(this,t,e);if(!r)return;var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:st(!1,38)},address:Qu(Eg),description:Qu(Eg),name:Qu(Eg),open:Qu(gg),phoneNumber:Qu(Eg),styleUrl:Qu(dv),visibility:Qu(gg)},il(Zy,{MultiTrack:Qu((function(t,e){var r=al([],Tv,t,e);if(!r)return;return new Jd(r)}),"geometry"),Track:Qu(bv,"geometry")})),Jy=il(Ky,{ExtendedData:Yv,Region:Vv,Link:function(t,e){ol(Qy,t,e)},address:Qu(Eg),description:Qu(Eg),name:Qu(Eg),open:Qu(gg),phoneNumber:Qu(Eg),visibility:Qu(gg)}),Qy=il(Ky,{href:Qu(dv)}),$y=il(Ky,{LatLonAltBox:function(t,e){var r=al({},Zv,t,e);if(!r)return;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=al({},Kv,t,e);if(!r)return;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)}}),tv=il(Ky,["Document","Placemark"]),ev=il(Ky,{Document:$u((function(t,e,r){ul({node:t},$v,tm,e,r,void 0,this)})),Placemark:$u(Tm)}),rv=null;var nv,iv=null;var ov,av=null;var sv=null;var uv=null;var lv,hv=null;var cv=function(t){function e(e){var r=t.call(this)||this,n=e||{};return hv||(rv=new zl({color:Oy=[255,255,255,1]}),iv=new rh({anchor:Iy=[20,2],anchorOrigin:Jl,anchorXUnits:Ly=Yl,anchorYUnits:Fy=Yl,crossOrigin:"anonymous",rotation:0,scale:Ny=.5,size:My=[64,64],src:Ay="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),nv="NO_IMAGE",av=new nh({color:Oy,width:1}),ov=new nh({color:[51,51,51,1],width:2}),sv=new ph({font:"bold 16px Helvetica",fill:rv,stroke:ov,scale:.8}),uv=new lh({fill:rv,image:iv,text:sv,stroke:av,zIndex:0}),hv=[uv]),r.dataProjection=We("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:hv,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}return Wy(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=al([],il(Ky,{Document:Ku(this.readDocumentOrFolder_,this),Folder:Ku(this.readDocumentOrFolder_,this),Placemark:qu(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return r||void 0},e.prototype.readPlacemark_=function(t,e){var r=al({geometry:null},Hy,t,e,this);if(r){var n=new lt,i=t.getAttribute("id");null!==i&&n.setId(i);var o=e[0],a=r.geometry;if(a&&H_(a,!1,o),n.setGeometry(a),delete r.geometry,this.extractStyles_){var s=function(t,e,r,n,i){return function(o,a){var s=i,u="",l=[];if(s){var h=o.getGeometry();if(h){var c=h.getType();s=c===ae.GEOMETRY_COLLECTION?(l=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ae.POINT||e===ae.MULTI_POINT}))).length>0:c===ae.POINT||c===ae.MULTI_POINT}}s&&(u=o.get("name"),(s=s&&!!u)&&u.search(/&[^&]+;/)>-1&&(lv||(lv=document.createElement("textarea")),lv.innerHTML=u,u=lv.value));var p=r;if(t?p=t:e&&(p=function t(e,r,n){return Array.isArray(e)?e:"string"==typeof e?(!(e in n)&&"#"+e in n&&(e="#"+e),t(n[e],r,n)):r}(e,r,n)),s){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getImageSize();if(null===o&&(o=My),2==o.length){var a=i.getScale();r[0]=a*o[0]/2,r[1]=-a*o[1]/2,n="left"}}var s=t.getText();s?((s=s.clone()).setFont(s.getFont()||sv.getFont()),s.setScale(s.getScale()||sv.getScale()),s.setFill(s.getFill()||sv.getFill()),s.setStroke(s.getStroke()||ov)):s=sv.clone();return s.setText(e),s.setOffsetX(r[0]),s.setOffsetY(r[1]),s.setTextAlign(n),new lh({image:i,text:s})}(p[0],u);return l.length>0?(f.setGeometry(new K_(l)),[f,new lh({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(s)}return delete r.Style,n.setProperties(r,!0),n}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=kv.call(this,t,e);if(n){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=yv.call(this,t,e);if(n){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){if(!w(Ky,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!w(Ky,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 a=this.readFeaturesFromNode(o,e);a&&T(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Zu(t);return this.readNameFromDocument(e)}return Wu(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(w(Ky,e.namespaceURI)&&"name"==e.localName)return Eg(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(w(Ky,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=Zu(t);T(e,this.readNetworkLinksFromDocument(r))}else Wu(t)?T(e,this.readNetworkLinksFromDocument(t)):T(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&&T(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(w(Ky,r.namespaceURI)&&"NetworkLink"==r.localName){var n=al({},Jy,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!w(Ky,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||T(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Zu(t);T(e,this.readRegionFromDocument(r))}else Wu(t)?T(e,this.readRegionFromDocument(t)):T(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&&T(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(w(Ky,r.namespaceURI)&&"Region"==r.localName){var n=al({},$y,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!w(Ky,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||T(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Vu(Ky[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",Zy[0]),r.setAttributeNS(n,"xmlns:xsi",Yu),r.setAttributeNS(Yu,"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 a=tv[r.namespaceURI],s=nl(o,a);return ul(i,ev,rl,s,[e],a,this),r},e}(hg);function pv(t){var e=Xu(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 fv(t){for(var e,r=Xu(t,!1),n=[],i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=i.exec(r);){var o=parseFloat(e[1]),a=parseFloat(e[2]),s=e[3]?parseFloat(e[3]):0;n.push(o,a,s),r=r.substr(e[0].length)}if(""===r)return n}function dv(t){var e=Xu(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function _v(t){return mg(t)}var gv=il(Ky,{Pair:function(t,e){var r=al({},Xv,t,e,this);if(!r)return;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 yv(t,e){return al(void 0,gv,t,e,this)}var vv=il(Ky,{Icon:Qu((function(t,e){var r=al({},Pv,t,e);return r||null})),color:Qu(pv),heading:Qu(mg),hotSpot:Qu((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Jl:$l:"insetPixels"!==n?Ql:th,{x:parseFloat(t.getAttribute("x")),xunits:qy[r],y:parseFloat(t.getAttribute("y")),yunits:qy[n],origin:e}})),scale:Qu(_v)});var mv=il(Ky,{color:Qu(pv),scale:Qu(_v)});var xv=il(Ky,{color:Qu(pv),width:Qu(mg)});var wv=il(Ky,{color:Qu(pv),fill:Qu(gg),outline:Qu(gg)});var Sv=il(Ky,{coordinates:Hu(fv)});function Ev(t,e){return al(null,Sv,t,e)}var Tv=il(Zy,{Track:qu(bv)});var Cv=il(Ky,{when:function(t,e){var r=e[e.length-1].whens,n=Xu(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},il(Zy,{coord:function(t,e){var r=e[e.length-1].flatCoordinates,n=Xu(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]),a=parseFloat(i[2]),s=parseFloat(i[3]);r.push(o,a,s,0)}else r.push(0,0,0,0)}}));function bv(t,e){var r=al({flatCoordinates:[],whens:[]},Cv,t,e);if(r){for(var n=r.flatCoordinates,i=r.whens,o=0,a=Math.min(n.length,i.length);o<a;++o)n[4*o+3]=i[o];return new Ed(n,oe)}}var Pv=il(Ky,{href:Qu(dv)},il(Zy,{x:Qu(mg),y:Qu(mg),w:Qu(mg),h:Qu(mg)}));var Rv=il(Ky,{coordinates:Hu(fv)});function Ov(t,e){return al(null,Rv,t,e)}var Iv=il(Ky,{extrude:Qu(gg),tessellate:Qu(gg),altitudeMode:Qu(Eg)});function Lv(t,e){var r=al({},Iv,t,e),n=Ov(t,e);if(n){var i=new Ed(n,ne);return i.setProperties(r,!0),i}}function Fv(t,e){var r=al({},Iv,t,e),n=Ov(t,e);if(n){var i=new cn(n,ne,[n.length]);return i.setProperties(r,!0),i}}var Mv=il(Ky,{LineString:qu(Lv),LinearRing:qu(Fv),MultiGeometry:qu(Av),Point:qu(Nv),Polygon:qu(jv)});function Av(t,e){var r,n=al([],Mv,t,e);if(!n)return null;if(0===n.length)return new K_(n);for(var i=!0,o=n[0].getType(),a=1,s=n.length;a<s;++a)if(n[a].getType()!=o){i=!1;break}if(i){var u=void 0,l=void 0;if(o==ae.POINT){var h=n[0];u=h.getLayout(),l=h.getFlatCoordinates();for(a=1,s=n.length;a<s;++a)T(l,n[a].getFlatCoordinates());Uv(r=new $d(l,u),n)}else o==ae.LINE_STRING?Uv(r=new Jd(n),n):o==ae.POLYGON?Uv(r=new r_(n),n):o==ae.GEOMETRY_COLLECTION?r=new K_(n):st(!1,37)}else r=new K_(n);return(r)}function Nv(t,e){var r=al({},Iv,t,e),n=Ov(t,e);if(n){var i=new Kr(n,ne);return i.setProperties(r,!0),i}}var Gv=il(Ky,{innerBoundaryIs:function(t,e){var r=al(void 0,qv,t,e);if(r){e[e.length-1].push(r)}},outerBoundaryIs:function(t,e){var r=al(void 0,Hv,t,e);if(r){e[e.length-1][0]=r}}});function jv(t,e){var r=al({},Iv,t,e),n=al([null],Gv,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],a=1,s=n.length;a<s;++a)T(i,n[a]),o.push(i.length);var u=new cn(i,ne,o);return u.setProperties(r,!0),u}}var Dv=il(Ky,{IconStyle:function(t,e){var r=al({},vv,t,e);if(r){var n,i,o,a,s=e[e.length-1],u="Icon"in r?r.Icon:{},l=!("Icon"in r)||Object.keys(u).length>0,h=u.href;h?n=h:l&&(n=Ay);var c,p=Jl,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):n===Ay?(i=Iy,o=Ly,a=Fy):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(i=[.5,0],o=Bl,a=Bl);var d,_=u.x,g=u.y;void 0!==_&&void 0!==g&&(c=[_,g]);var y,v=u.w,m=u.h;void 0!==v&&void 0!==m&&(d=[v,m]);var x=r.heading;void 0!==x&&(y=_e(x));var w=r.scale,S=r.color;if(l){n==Ay&&(d=My,void 0===w&&(w=Ny));var E=new rh({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Jl,rotation:y,scale:w,size:d,src:n,color:S});s.imageStyle=E}else s.imageStyle=nv}},LabelStyle:function(t,e){var r=al({},mv,t,e);if(r){var n=e[e.length-1],i=new ph({fill:new zl({color:"color"in r?r.color:Oy}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=al({},xv,t,e);if(r){var n=e[e.length-1],i=new nh({color:"color"in r?r.color:Oy,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=al({},wv,t,e);if(r){var n=e[e.length-1],i=new zl({color:"color"in r?r.color:Oy});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function kv(t,e){var r=al({},Dv,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:rv,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=nv&&(n=r.imageStyle):n=iv;var a="textStyle"in r?r.textStyle:sv,s="strokeStyle"in r?r.strokeStyle:av,u=r.outline;return void 0===u||u?[new lh({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]:[new lh({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===ae.GEOMETRY_COLLECTION?new K_(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==ae.POLYGON&&e!==ae.MULTI_POLYGON}))):r!==ae.POLYGON&&r!==ae.MULTI_POLYGON?e:void 0},fill:i,image:n,stroke:s,text:a,zIndex:void 0}),new lh({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===ae.GEOMETRY_COLLECTION?new K_(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ae.POLYGON||e===ae.MULTI_POLYGON}))):r===ae.POLYGON||r===ae.MULTI_POLYGON?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function Uv(t,e){var r,n,i,o=e.length,a=new Array(e.length),s=new Array(e.length),u=new Array(e.length);r=!1,n=!1,i=!1;for(var l=0;l<o;++l){var h=e[l];a[l]=h.get("extrude"),s[l]=h.get("tessellate"),u[l]=h.get("altitudeMode"),r=r||void 0!==a[l],n=n||void 0!==s[l],i=i||u[l]}r&&t.set("extrude",a),n&&t.set("tessellate",s),i&&t.set("altitudeMode",u)}var zv=il(Ky,{displayName:Qu(Eg),value:Qu(Eg)});var Bv=il(Ky,{Data:function(t,e){var r=t.getAttribute("name");ol(zv,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){ol(Wv,t,e)}});function Yv(t,e){ol(Bv,t,e)}function Vv(t,e){ol($y,t,e)}var Xv=il(Ky,{Style:Qu(kv),key:Qu(Eg),styleUrl:Qu(dv)});var Wv=il(Ky,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=Eg(t);e[e.length-1][r]=n}}});var Zv=il(Ky,{altitudeMode:Qu(Eg),minAltitude:Qu(mg),maxAltitude:Qu(mg),north:Qu(mg),south:Qu(mg),east:Qu(mg),west:Qu(mg)});var Kv=il(Ky,{minLodPixels:Qu(mg),maxLodPixels:Qu(mg),minFadeExtent:Qu(mg),maxFadeExtent:Qu(mg)});var qv=il(Ky,{LinearRing:Hu(Ev)});var Hv=il(Ky,{LinearRing:Hu(Ev)});function Jv(t,e){for(var r=rs(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}Pg(t,n.join(""))}var Qv=il(Ky,{Data:$u((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&ul(n,Qv,rl,[i.displayName],r,["displayName"]),null!==i&&i.value&&ul(n,Qv,rl,[i.value],r,["value"])):ul(n,Qv,rl,[i],r,["value"])})),value:$u((function(t,e){Pg(t,e)})),displayName:$u((function(t,e){!function(t,e){t.appendChild(cl().createCDATASection(e))}(t,e)}))});var $v=il(Ky,{Placemark:$u(Tm)}),tm=function(t,e,r){return Vu(e[e.length-1].node.namespaceURI,"Placemark")};var em=el("Data");var rm=il(Ky,["href"],il(Zy,["x","y","w","h"])),nm=il(Ky,{href:$u(Pg)},il(Zy,{x:$u(Cg),y:$u(Cg),w:$u(Cg),h:$u(Cg)})),im=function(t,e,r){return Vu(Zy[0],"gx:"+r)};var om=il(Ky,["scale","heading","Icon","color","hotSpot"]),am=il(Ky,{Icon:$u((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=rm[i.namespaceURI],a=nl(e,o);ul(n,nm,rl,a,r,o),a=nl(e,o=rm[Zy[0]]),ul(n,nm,im,a,r,o)})),color:$u(Jv),heading:$u(Cg),hotSpot:$u((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:$u(Am)});var sm=il(Ky,["color","scale"]),um=il(Ky,{color:$u(Jv),scale:$u(Am)});var lm=il(Ky,["color","width"]),hm=il(Ky,{color:$u(Jv),width:$u(Cg)});var cm={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},pm=function(t,e,r){if(t)return Vu(e[e.length-1].node.namespaceURI,cm[t.getType()])},fm=el("Point"),dm=el("LineString"),_m=el("LinearRing"),gm=el("Polygon"),ym=il(Ky,{LineString:$u(Pm),Point:$u(Pm),Polygon:$u(Fm),GeometryCollection:$u(vm)});function vm(t,e,r){var n,i={node:t},o=e.getType(),a=[];o===ae.GEOMETRY_COLLECTION?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===ae.MULTI_POINT?a=a.concat(t.getPoints()):e===ae.MULTI_LINE_STRING?a=a.concat(t.getLineStrings()):e===ae.MULTI_POLYGON?a=a.concat(t.getPolygons()):e===ae.POINT||e===ae.LINE_STRING||e===ae.POLYGON?a.push(t):st(!1,39)})),n=pm):o===ae.MULTI_POINT?(a=e.getPoints(),n=fm):o===ae.MULTI_LINE_STRING?(a=e.getLineStrings(),n=dm):o===ae.MULTI_POLYGON?(a=e.getPolygons(),n=gm):st(!1,39),ul(i,ym,n,a,r)}var mm=il(Ky,{LinearRing:$u(Pm)});function xm(t,e,r){ul({node:t},mm,_m,[e],r)}var wm=il(Ky,{ExtendedData:$u((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,a=i.length,s=0;s<a;s++)ul(n,Qv,em,[{name:i[s],value:o[s]}],r)})),MultiGeometry:$u(vm),LineString:$u(Pm),LinearRing:$u(Pm),Point:$u(Pm),Polygon:$u(Fm),Style:$u((function(t,e,r){var n={node:t},i={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(i.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(i.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(i.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!i.LineStyle&&(i.LineStyle=s),i.PolyStyle=e.polyStyles[0]}var u=r[r.length-1].node,l=Nm[u.namespaceURI],h=nl(i,l);ul(n,Gm,rl,h,r,l)})),address:$u(Pg),description:$u(Pg),name:$u(Pg),open:$u(Tg),phoneNumber:$u(Pg),styleUrl:$u(Pg),visibility:$u(Tg)}),Sm=il(Ky,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Em=el("ExtendedData");function Tm(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 a=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),s=e.getStyleFunction();if(s){var u=s(e,0);if(u){var l=Array.isArray(u)?u:[u],h=l;if(e.getGeometry()&&(h=l.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===ae.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ae.POINT||e===ae.MULTI_POINT})).length:n===ae.POINT||n===ae.MULTI_POINT}}))),this.writeStyles_){var c=l,p=l;e.getGeometry()&&(c=l.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===ae.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ae.LINE_STRING||e===ae.MULTI_LINE_STRING})).length:n===ae.LINE_STRING||n===ae.MULTI_LINE_STRING}})),p=l.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===ae.GEOMETRY_COLLECTION?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ae.POLYGON||e===ae.MULTI_POLYGON})).length:n===ae.POLYGON||n===ae.MULTI_POLYGON}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var d=r[r.length-1].node,_=Sm[d.namespaceURI],g=nl(i,_);if(ul(n,wm,rl,g,r,_),a.length>0){var y=nl(i,a);ul(n,wm,Em,[{names:a,values:y}],r)}var v=r[0],m=e.getGeometry();m&&(m=H_(m,!0,v)),ul(n,wm,pm,[m],r)}var Cm=il(Ky,["extrude","tessellate","altitudeMode","coordinates"]),bm=il(Ky,{extrude:$u(Tg),tessellate:$u(Tg),altitudeMode:$u(Pg),coordinates:$u((function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==re||o==ie?n=2:o==ne||o==oe?n=3:st(!1,34);var s=e.length,u="";if(s>0){u+=e[0];for(var l=1;l<n;++l)u+=","+e[l];for(var h=a;h<s;h+=a){u+=" "+e[h];for(l=1;l<n;++l)u+=","+e[h+l]}}Pg(t,u)}))});function Pm(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 a=r[r.length-1].node,s=Cm[a.namespaceURI],u=nl(o,s);ul(i,bm,rl,u,r,s)}var Rm=il(Ky,["color","fill","outline"]),Om=il(Ky,{outerBoundaryIs:$u(xm),innerBoundaryIs:$u(xm)}),Im=el("innerBoundaryIs"),Lm=el("outerBoundaryIs");function Fm(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};ul(o,Om,Im,n,r),ul(o,Om,Lm,[i],r)}var Mm=il(Ky,{color:$u(Jv),fill:$u(Tg),outline:$u(Tg)});function Am(t,e){Cg(t,Math.round(1e6*e)/1e6)}var Nm=il(Ky,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Gm=il(Ky,{IconStyle:$u((function(t,e,r){var n={node:t},i={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),u={href:o};if(a){u.w=a[0],u.h=a[1];var l=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(u.x=h[0],u.y=s[1]-(h[1]+a[1])),l&&(l[0]!==a[0]/2||l[1]!==a[1]/2)){var c={x:l[0],xunits:Yl,y:a[1]-l[1],yunits:Yl};i.hotSpot=c}}i.Icon=u;var p=e.getScale();1!==p&&(i.scale=p);var f=e.getRotation();0!==f&&(i.heading=f);var d=e.getColor();d&&(i.color=d);var _=r[r.length-1].node,g=om[_.namespaceURI],y=nl(i,g);ul(n,am,rl,y,r,g)})),LabelStyle:$u((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var a=e.getScale();a&&1!==a&&(i.scale=a);var s=r[r.length-1].node,u=sm[s.namespaceURI],l=nl(i,u);ul(n,um,rl,l,r,u)})),LineStyle:$u((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,a=lm[o.namespaceURI],s=nl(i,a);ul(n,hm,rl,s,r,a)})),PolyStyle:$u((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),a={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},s=r[r.length-1].node,u=Rm[s.namespaceURI],l=nl(a,u);ul(n,Mm,rl,l,r,u)}))});var jm=cv,Dm=r(2),km=r.n(Dm),Um=[1,0,0,1,0,0],zm=function(){function t(t,e,r,n,i){this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===ae.POINT?Lt(this.flatCoordinates_):Ft(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Yt(this.getExtent());this.flatInteriorPoints_=Qr(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=t_(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=$r(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=xd(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n<i;++n){var o=r[n],a=xd(t,e,o,2,.5);T(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t,e){var r=(t=We(t)).getExtent(),n=t.getWorldExtent(),i=Wt(n)/Wt(r);vr(Um,n[0],n[3],i,-i,0,0,0),se(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Um,this.flatCoordinates_)},t}();zm.prototype.getEnds=function(){return this.ends_},zm.prototype.getEndss=zm.prototype.getEnds,zm.prototype.getFlatCoordinates=zm.prototype.getOrientedFlatCoordinates;var Bm=zm,Ym=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Vm(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(Xm,n,i),n.length=n.features.length,n.length&&(e[n.name]=n)}}function Xm(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1===(t=r.readVarint()>>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function Wm(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function Zm(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(Wm,i,n),i}var Km=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new Ce({code:"",units:Te.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:Bm,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r}return Ym(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,a=0,s=0,u=0,l=0,h=0;t.pos<i;){if(!a){var c=t.readVarint();o=7&c,a=c>>3}a--,1===o||2===o?(s+=t.readSVarint(),u+=t.readSVarint(),1===o&&l>h&&(n.push(l),h=l),r.push(s,u),l+=2):7===o?l>h&&(r.push(r[h],r[h+1]),l+=2):st(!1,59)}l>h&&(n.push(l),h=l)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id,a[this.layerName_]=e.layer.name;var s=[],u=[];this.readRawGeometry_(t,e,s,u);var l=function(t,e){var r;1===t?r=1===e?ae.POINT:ae.MULTI_POINT:2===t?r=1===e?ae.LINE_STRING:ae.MULTI_LINE_STRING:3===t&&(r=ae.POLYGON);return r}(i,u.length);if(this.featureClass_===Bm)(n=new this.featureClass_(l,s,u,a,o)).transform(r.dataProjection,r.featureProjection);else{var h=void 0;if(l==ae.POLYGON){for(var c=[],p=0,f=0,d=0,_=u.length;d<_;++d){var g=u[d];on(s,p,g,2)||(c.push(u.slice(f,d)),f=d),p=g}h=c.length>1?new r_(s,re,c):new cn(s,re,u)}else h=l===ae.POINT?new Kr(s,re):l===ae.LINE_STRING?new Ed(s,re):l===ae.POLYGON?new cn(s,re,u):l===ae.MULTI_POINT?new $d(s,re):l===ae.MULTI_LINE_STRING?new Jd(s,re,u):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var y=H_(h,!1,r);n.setGeometry(y),n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return yu},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=We(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new km.a(t),a=o.readFields(Vm,{}),s=[];for(var u in a)if(!r||-1!=r.indexOf(u)){var l=a[u],h=l?[0,0,l.extent,l.extent]:null;i.setExtent(h);for(var c=0,p=l.length;c<p;++c){var f=Zm(o,l,c);s.push(this.createFeature_(o,f,n))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(q_),qm=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hm=[null],Jm=il(Hm,{nd:function(t,e){e[e.length-1].ndrefs.push(t.getAttribute("ref"))},tag:ex}),Qm=il(Hm,{node:function(t,e){var r=e[0],n=e[e.length-1],i=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];n.nodes[i]=o;var a=al({tags:{}},tx,t,e);if(!_(a.tags)){var s=new Kr(o);H_(s,!1,r);var u=new lt(s);u.setId(i),u.setProperties(a.tags,!0),n.features.push(u)}},way:function(t,e){var r=al({id:t.getAttribute("id"),ndrefs:[],tags:{}},Jm,t,e);e[e.length-1].ways.push(r)}}),$m=function(t){function e(){var e=t.call(this)||this;return e.dataProjection=We("EPSG:4326"),e}return qm(e,t),e.prototype.readFeaturesFromNode=function(t,e){var r=this.getReadOptions(t,e);if("osm"==t.localName){for(var n=al({nodes:{},ways:[],features:[]},Qm,t,[r]),i=0;i<n.ways.length;i++){for(var o=n.ways[i],a=[],s=0,u=o.ndrefs.length;s<u;s++){T(a,n.nodes[o.ndrefs[s]])}var l=void 0;H_(l=o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?new cn(a,re,[a.length]):new Ed(a,re),!1,r);var h=new lt(l);h.setId(o.id),h.setProperties(o.tags,!0),n.features.push(h)}if(n.features)return n.features}return[]},e}(hg),tx=il(Hm,{tag:ex});function ex(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}var rx=$m;function nx(t,e,r,n,i,o){var a,s;void 0!==i?(a=i,s=void 0!==o?o:0):(a=[],s=0);for(var u=e;u<r;){var l=t[u++];a[s++]=t[u++],a[s++]=l;for(var h=2;h<n;++h)a[s++]=t[u++]}return a.length=s,a}var ix=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ox(t,e,r){var n,i=r||1e5,o=new Array(e);for(n=0;n<e;++n)o[n]=0;for(var a=0,s=t.length;a<s;)for(n=0;n<e;++n,++a){var u=t[a],l=u-o[n];o[n]=u,t[a]=l}return sx(t,i)}function ax(t,e,r){var n,i=r||1e5,o=new Array(e);for(n=0;n<e;++n)o[n]=0;for(var a=ux(t,i),s=0,u=a.length;s<u;)for(n=0;n<e;++n,++s)o[n]+=a[s],a[s]=o[n];return a}function sx(t,e){for(var r=e||1e5,n=0,i=t.length;n<i;++n)t[n]=Math.round(t[n]*r);return function(t){for(var e=0,r=t.length;e<r;++e){var n=t[e];t[e]=n<0?~(n<<1):n<<1}return function(t){for(var e="",r=0,n=t.length;r<n;++r)e+=lx(t[r]);return e}(t)}(t)}function ux(t,e){for(var r=e||1e5,n=function(t){for(var e=function(t){for(var e=[],r=0,n=0,i=0,o=t.length;i<o;++i){var a=t.charCodeAt(i)-63;r|=(31&a)<<n,a<32?(e.push(r),r=0,n=0):n+=5}return e}(t),r=0,n=e.length;r<n;++r){var i=e[r];e[r]=1&i?~(i>>1):i>>1}return e}(t),i=0,o=n.length;i<o;++i)n[i]/=r;return n}function lx(t){for(var e,r="";t>=32;)e=63+(32|31&t),r+=String.fromCharCode(e),t>>=5;return e=t+63,r+=String.fromCharCode(e)}var hx=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=We("EPSG:4326"),r.factor_=n.factor?n.factor:1e5,r.geometryLayout_=n.geometryLayout?n.geometryLayout:re,r}return ix(e,t),e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);return new lt(r)},e.prototype.readFeaturesFromText=function(t,e){return[this.readFeatureFromText(t,e)]},e.prototype.readGeometryFromText=function(t,e){var r=Cr(this.geometryLayout_),n=ax(t,r,this.factor_);nx(n,0,n.length,r,n);var i=jr(n,0,n.length,r);return H_(new Ed(i,this.geometryLayout_),!1,this.adaptOptions(e))},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):(st(!1,40),"")},e.prototype.writeFeaturesText=function(t,e){return this.writeFeatureText(t[0],e)},e.prototype.writeGeometryText=function(t,e){var r=(t=H_(t,!0,this.adaptOptions(e))).getFlatCoordinates(),n=t.getStride();return nx(r,0,r.length,n,r),ox(r,n,this.factor_)},e}(Gy),cx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),px=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.layerName_=n.layerName,r.layers_=n.layers?n.layers:null,r.dataProjection=We(n.dataProjection?n.dataProjection:"EPSG:4326"),r}return cx(e,t),e.prototype.readFeaturesFromObject=function(t,e){if("Topology"==t.type){var r=t,n=void 0,i=null,o=null;r.transform&&(i=(n=r.transform).scale,o=n.translate);var a=r.arcs;n&&function(t,e,r){for(var n=0,i=t.length;n<i;++n)yx(t[n],e,r)}(a,i,o);var s=[],u=r.objects,l=this.layerName_,h=void 0;for(var c in u)this.layers_&&-1==this.layers_.indexOf(c)||("GeometryCollection"===u[c].type?(h=u[c],s.push.apply(s,_x(h,a,i,o,l,c,e))):(h=u[c],s.push(gx(h,a,i,o,l,c,e))));return s}return[]},e.prototype.readProjectionFromObject=function(t){return this.dataProjection},e}(tg),fx={Point:function(t,e,r){var n=t.coordinates;e&&r&&vx(n,e,r);return new Kr(n)},LineString:function(t,e){var r=dx(t.arcs,e);return new Ed(r)},Polygon:function(t,e){for(var r=[],n=0,i=t.arcs.length;n<i;++n)r[n]=dx(t.arcs[n],e);return new cn(r)},MultiPoint:function(t,e,r){var n=t.coordinates;if(e&&r)for(var i=0,o=n.length;i<o;++i)vx(n[i],e,r);return new $d(n)},MultiLineString:function(t,e){for(var r=[],n=0,i=t.arcs.length;n<i;++n)r[n]=dx(t.arcs[n],e);return new Jd(r)},MultiPolygon:function(t,e){for(var r=[],n=0,i=t.arcs.length;n<i;++n){for(var o=t.arcs[n],a=[],s=0,u=o.length;s<u;++s)a[s]=dx(o[s],e);r[n]=a}return new r_(r)}};function dx(t,e){for(var r,n,i=[],o=0,a=t.length;o<a;++o)r=t[o],o>0&&i.pop(),n=r>=0?e[r]:e[~r].slice().reverse(),i.push.apply(i,n);for(var s=0,u=i.length;s<u;++s)i[s]=i[s].slice();return i}function _x(t,e,r,n,i,o,a){for(var s=t.geometries,u=[],l=0,h=s.length;l<h;++l)u[l]=gx(s[l],e,r,n,i,o,a);return u}function gx(t,e,r,n,i,o,a){var s,u=t.type,l=fx[u];s="Point"===u||"MultiPoint"===u?l(t,r,n):l(t,e);var h=new lt;h.setGeometry(H_(s,!1,a)),void 0!==t.id&&h.setId(t.id);var c=t.properties;return i&&(c||(c={}),c[i]=o),c&&h.setProperties(c,!0),h}function yx(t,e,r){for(var n=0,i=0,o=0,a=t.length;o<a;++o){var s=t[o];n+=s[0],i+=s[1],s[0]=n,s[1]=i,vx(s,e,r)}}function vx(t,e,r){t[0]=t[0]*e[0]+r[0],t[1]=t[1]*e[1]+r[1]}var mx=px,xx=function(){function t(t){this.tagName_=t}return t.prototype.getTagName=function(){return this.tagName_},t}(),wx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sx=function(t){function e(e,r){var n=t.call(this,e)||this;return n.conditions=r,st(n.conditions.length>=2,57),n}return wx(e,t),e}(xx),Ex=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tx=function(t){function e(e){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return Ex(e,t),e}(Sx),Cx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bx=function(t){function e(e,r,n){var i=t.call(this,"BBOX")||this;if(i.geometryName=e,i.extent=r,4!==r.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return i.srsName=n,i}return Cx(e,t),e}(xx),Px=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rx=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.geometryName=r||"the_geom",o.geometry=n,o.srsName=i,o}return Px(e,t),e}(xx),Ox=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ix=function(t){function e(e,r,n){return t.call(this,"Contains",e,r,n)||this}return Ox(e,t),e}(Rx),Lx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fx=function(t){function e(e,r){var n=t.call(this,e)||this;return n.propertyName=r,n}return Lx(e,t),e}(xx),Mx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ax=function(t){function e(e,r,n){var i=t.call(this,"During",e)||this;return i.begin=r,i.end=n,i}return Mx(e,t),e}(Fx),Nx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gx=function(t){function e(e,r,n,i){var o=t.call(this,e,r)||this;return o.expression=n,o.matchCase=i,o}return Nx(e,t),e}(Fx),jx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dx=function(t){function e(e,r,n){return t.call(this,"PropertyIsEqualTo",e,r,n)||this}return jx(e,t),e}(Gx),kx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ux=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThan",e,r)||this}return kx(e,t),e}(Gx),zx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bx=function(t){function e(e,r){return t.call(this,"PropertyIsGreaterThanOrEqualTo",e,r)||this}return zx(e,t),e}(Gx),Yx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vx=function(t){function e(e,r,n){return t.call(this,"Intersects",e,r,n)||this}return Yx(e,t),e}(Rx),Xx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Wx=function(t){function e(e,r,n){var i=t.call(this,"PropertyIsBetween",e)||this;return i.lowerBoundary=r,i.upperBoundary=n,i}return Xx(e,t),e}(Fx),Zx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kx=function(t){function e(e,r,n,i,o,a){var s=t.call(this,"PropertyIsLike",e)||this;return s.pattern=r,s.wildCard=void 0!==n?n:"*",s.singleChar=void 0!==i?i:".",s.escapeChar=void 0!==o?o:"!",s.matchCase=a,s}return Zx(e,t),e}(Fx),qx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hx=function(t){function e(e){return t.call(this,"PropertyIsNull",e)||this}return qx(e,t),e}(Fx),Jx=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qx=function(t){function e(e,r){return t.call(this,"PropertyIsLessThan",e,r)||this}return Jx(e,t),e}(Gx),$x=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tw=function(t){function e(e,r){return t.call(this,"PropertyIsLessThanOrEqualTo",e,r)||this}return $x(e,t),e}(Gx),ew=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rw=function(t){function e(e){var r=t.call(this,"Not")||this;return r.condition=e,r}return ew(e,t),e}(xx),nw=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iw=function(t){function e(e,r,n){return t.call(this,"PropertyIsNotEqualTo",e,r,n)||this}return nw(e,t),e}(Gx),ow=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),aw=function(t){function e(e){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return ow(e,t),e}(Sx),sw=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uw=function(t){function e(e,r,n){return t.call(this,"Within",e,r,n)||this}return sw(e,t),e}(Rx);function lw(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Tx,e))}function hw(t,e,r){return new bx(t,e,r)}var cw=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pw={"http://www.opengis.net/gml":{boundedBy:Qu(_g.prototype.readGeometryElement,"bounds")}},fw={"http://www.opengis.net/wfs":{totalInserted:Qu(wg),totalUpdated:Qu(wg),totalDeleted:Qu(wg)}},dw={"http://www.opengis.net/wfs":{TransactionSummary:Qu((function(t,e){return al({},fw,t,e)}),"transactionSummary"),InsertResults:Qu((function(t,e){return al([],Ew,t,e)}),"insertIds")}},_w={"http://www.opengis.net/wfs":{PropertyName:$u(Pg)}},gw={"http://www.opengis.net/wfs":{Insert:$u((function(t,e,r){var n=r[r.length-1],i=n.featureType,o=n.featureNS,a=n.gmlVersion,s=Vu(o,i);t.appendChild(s),2===a?jg.prototype.writeFeatureElement(s,e,r):Lg.prototype.writeFeatureElement(s,e,r)})),Update:$u((function(t,e,r){var n=r[r.length-1];st(void 0!==e.getId(),27);var i=n.featureType,o=n.featurePrefix,a=n.featureNS,s=Cw(o,i),u=e.getGeometryName();t.setAttribute("typeName",s),t.setAttributeNS(yw,"xmlns:"+o,a);var l=e.getId();if(void 0!==l){for(var h=e.getKeys(),c=[],p=0,f=h.length;p<f;p++){var d=e.get(h[p]);if(void 0!==d){var _=h[p];d&&"function"==typeof d.getSimplifiedGeometry&&(_=u),c.push({name:_,value:d})}}ul({gmlVersion:n.gmlVersion,node:t,hasZ:n.hasZ,srsName:n.srsName},gw,el("Property"),c,r),Tw(t,l,r)}})),Delete:$u((function(t,e,r){var n=r[r.length-1];st(void 0!==e.getId(),26);var i=n.featureType,o=n.featurePrefix,a=n.featureNS,s=Cw(o,i);t.setAttribute("typeName",s),t.setAttributeNS(yw,"xmlns:"+o,a);var u=e.getId();void 0!==u&&Tw(t,u,r)})),Property:$u((function(t,e,r){var n=Vu(mw,"Name"),i=r[r.length-1].gmlVersion;if(t.appendChild(n),Pg(n,e.name),void 0!==e.value&&null!==e.value){var o=Vu(mw,"Value");t.appendChild(o),e.value&&"function"==typeof e.value.getSimplifiedGeometry?2===i?jg.prototype.writeGeometryElement(o,e.value,r):Lg.prototype.writeGeometryElement(o,e.value,r):Pg(o,e.value)}})),Native:$u((function(t,e,r){e.vendorId&&t.setAttribute("vendorId",e.vendorId);void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",String(e.safeToIgnore));void 0!==e.value&&Pg(t,e.value)}))}},yw="http://www.w3.org/2000/xmlns/",vw="http://www.opengis.net/ogc",mw="http://www.opengis.net/wfs",xw={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},ww=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureType_=n.featureType,r.featureNS_=n.featureNS,r.gmlFormat_=n.gmlFormat?n.gmlFormat:new Lg,r.schemaLocation_=n.schemaLocation?n.schemaLocation:xw["1.1.0"],r}return cw(e,t),e.prototype.getFeatureType=function(){return this.featureType_},e.prototype.setFeatureType=function(t){this.featureType_=t},e.prototype.readFeaturesFromNode=function(t,e){var r={node:t};p(r,{featureType:this.featureType_,featureNS:this.featureNS_}),p(r,this.getReadOptions(t,e||{}));var n=[r];this.gmlFormat_.FEATURE_COLLECTION_PARSERS[pg].featureMember=qu(_g.prototype.readFeaturesInternal);var i=al([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,n,this.gmlFormat_);return i||(i=[]),i},e.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var e=Zu(t);return this.readTransactionResponseFromDocument(e)}return Wu(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},e.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var e=Zu(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Wu(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},e.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)},e.prototype.readFeatureCollectionMetadataFromNode=function(t){var e={},r=Sg(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=r,al(e,pw,t,[],this.gmlFormat_)},e.prototype.readTransactionResponseFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)},e.prototype.readTransactionResponseFromNode=function(t){return al({},dw,t,[])},e.prototype.writeGetFeature=function(t){var e,r=Vu(mw,"GetFeature");if(r.setAttribute("service","WFS"),r.setAttribute("version","1.1.0"),t&&(t.handle&&r.setAttribute("handle",t.handle),t.outputFormat&&r.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&r.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&r.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&r.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&r.setAttribute("count",String(t.count)),void 0!==t.viewParams&&r.setAttribute("viewParams",t.viewParams),e=t.filter,t.bbox)){st(t.geometryName,12);var n=hw(t.geometryName,t.bbox,t.srsName);e=e?lw(e,n):n}r.setAttributeNS(Yu,"xsi:schemaLocation",this.schemaLocation_);var i={node:r};return p(i,{srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:e,propertyNames:t.propertyNames?t.propertyNames:[]}),st(Array.isArray(t.featureTypes),11),function(t,e,r){var n=r[r.length-1],i=p({},n);i.node=t,ul(i,bw,el("Query"),e,r)}(r,t.featureTypes,[i]),r},e.prototype.writeTransaction=function(t,e,r,n){var i,o,a=[],s=Vu(mw,"Transaction"),u=n.version?n.version:"1.1.0",l="1.0.0"===u?2:3;s.setAttribute("service","WFS"),s.setAttribute("version",u),n&&(i=n.gmlOptions?n.gmlOptions:{},n.handle&&s.setAttribute("handle",n.handle));var h=xw[u];s.setAttributeNS(Yu,"xsi:schemaLocation",h);var c=n.featurePrefix?n.featurePrefix:"feature";return t&&(o=p({node:s},{featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,hasZ:n.hasZ,srsName:n.srsName}),p(o,i),ul(o,gw,el("Insert"),t,a)),e&&(o=p({node:s},{featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,hasZ:n.hasZ,srsName:n.srsName}),p(o,i),ul(o,gw,el("Update"),e,a)),r&&ul({node:s,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,srsName:n.srsName},gw,el("Delete"),r,a),n.nativeElements&&ul({node:s,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:c,gmlVersion:l,srsName:n.srsName},gw,el("Native"),n.nativeElements,a),s},e.prototype.readProjectionFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null},e.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){var r=[{}];return this.gmlFormat_.readGeometryElement(e,r),We(r.pop().srsName)}return null},e}(hg);var Sw={"http://www.opengis.net/ogc":{FeatureId:qu((function(t,e){return t.getAttribute("fid")}))}};var Ew={"http://www.opengis.net/wfs":{Feature:function(t,e){ol(Sw,t,e)}}};function Tw(t,e,r){var n=Vu(vw,"Filter"),i=Vu(vw,"FeatureId");n.appendChild(i),i.setAttribute("fid",e),t.appendChild(n)}function Cw(t,e){var r=(t=t||"feature")+":";return 0===e.indexOf(r)?e:r+e}var bw={"http://www.opengis.net/wfs":{Query:$u((function(t,e,r){var n,i=r[r.length-1],o=i.featurePrefix,a=i.featureNS,s=i.propertyNames,u=i.srsName;n=o?Cw(o,e):e;t.setAttribute("typeName",n),u&&t.setAttribute("srsName",u);a&&t.setAttributeNS(yw,"xmlns:"+o,a);var l=p({},i);l.node=t,ul(l,_w,el("PropertyName"),s,r);var h=i.filter;if(h){var c=Vu(vw,"Filter");t.appendChild(c),Pw(c,h,r)}}))},"http://www.opengis.net/ogc":{During:$u((function(t,e,r){var n=Vu("http://www.opengis.net/fes","ValueReference");Pg(n,e.propertyName),t.appendChild(n);var i=Vu(pg,"TimePeriod");t.appendChild(i);var o=Vu(pg,"begin");i.appendChild(o),Mw(o,e.begin);var a=Vu(pg,"end");i.appendChild(a),Mw(a,e.end)})),And:$u(Rw),Or:$u(Rw),Not:$u((function(t,e,r){var n={node:t},i=e.condition;ul(n,bw,el(i.getTagName()),[i],r)})),BBOX:$u((function(t,e,r){r[r.length-1].srsName=e.srsName,Lw(t,e.geometryName),Lg.prototype.writeGeometryElement(t,e.extent,r)})),Contains:$u((function(t,e,r){r[r.length-1].srsName=e.srsName,Lw(t,e.geometryName),Lg.prototype.writeGeometryElement(t,e.geometry,r)})),Intersects:$u((function(t,e,r){r[r.length-1].srsName=e.srsName,Lw(t,e.geometryName),Lg.prototype.writeGeometryElement(t,e.geometry,r)})),Within:$u((function(t,e,r){r[r.length-1].srsName=e.srsName,Lw(t,e.geometryName),Lg.prototype.writeGeometryElement(t,e.geometry,r)})),PropertyIsEqualTo:$u(Ow),PropertyIsNotEqualTo:$u(Ow),PropertyIsLessThan:$u(Ow),PropertyIsLessThanOrEqualTo:$u(Ow),PropertyIsGreaterThan:$u(Ow),PropertyIsGreaterThanOrEqualTo:$u(Ow),PropertyIsNull:$u((function(t,e,r){Lw(t,e.propertyName)})),PropertyIsBetween:$u((function(t,e,r){Lw(t,e.propertyName);var n=Vu(vw,"LowerBoundary");t.appendChild(n),Fw(n,""+e.lowerBoundary);var i=Vu(vw,"UpperBoundary");t.appendChild(i),Fw(i,""+e.upperBoundary)})),PropertyIsLike:$u((function(t,e,r){t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString());Lw(t,e.propertyName),Fw(t,""+e.pattern)}))}};function Pw(t,e,r){ul({node:t},bw,el(e.getTagName()),[e],r)}function Rw(t,e,r){for(var n={node:t},i=e.conditions,o=0,a=i.length;o<a;++o){var s=i[o];ul(n,bw,el(s.getTagName()),[s],r)}}function Ow(t,e,r){void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),Lw(t,e.propertyName),Fw(t,""+e.expression)}function Iw(t,e,r){var n=Vu(vw,t);Pg(n,r),e.appendChild(n)}function Lw(t,e){Iw("PropertyName",t,e)}function Fw(t,e){Iw("Literal",t,e)}function Mw(t,e){var r=Vu(pg,"TimeInstant");t.appendChild(r);var n=Vu(pg,"timePosition");r.appendChild(n),Pg(n,e)}var Aw=ww,Nw=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gw={POINT:Kr,LINESTRING:Ed,POLYGON:cn,MULTIPOINT:$d,MULTILINESTRING:Jd,MULTIPOLYGON:r_},jw=1,Dw=2,kw=3,Uw=4,zw=5,Bw=6,Yw={};for(var Vw in ae)Yw[Vw]=ae[Vw].toUpperCase();var Xw=function(){function t(t){this.wkt=t,this.index_=-1}return t.prototype.isAlpha_=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.isNumeric_=function(t,e){return t>="0"&&t<="9"||"."==t&&!(void 0!==e&&e)},t.prototype.isWhiteSpace_=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.nextChar_=function(){return this.wkt.charAt(++this.index_)},t.prototype.nextToken=function(){var t,e=this.nextChar_(),r=this.index_,n=e;if("("==e)t=Dw;else if(","==e)t=zw;else if(")"==e)t=kw;else if(this.isNumeric_(e)||"-"==e)t=Uw,n=this.readNumber_();else if(this.isAlpha_(e))t=jw,n=this.readText_();else{if(this.isWhiteSpace_(e))return this.nextToken();if(""!==e)throw new Error("Unexpected character: "+e);t=Bw}return{position:r,value:n,type:t}},t.prototype.readNumber_=function(){var t,e=this.index_,r=!1,n=!1;do{"."==t?r=!0:"e"!=t&&"E"!=t||(n=!0),t=this.nextChar_()}while(this.isNumeric_(t,r)||!n&&("e"==t||"E"==t)||n&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))},t.prototype.readText_=function(){var t,e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()},t}(),Ww=function(){function t(t){this.lexer_=t,this.token_,this.layout_=re}return t.prototype.consume_=function(){this.token_=this.lexer_.nextToken()},t.prototype.isTokenType=function(t){return this.token_.type==t},t.prototype.match=function(t){var e=this.isTokenType(t);return e&&this.consume_(),e},t.prototype.parse=function(){return this.consume_(),this.parseGeometry_()},t.prototype.parseGeometryLayout_=function(){var t=re,e=this.token_;if(this.isTokenType(jw)){var r=e.value;"Z"===r?t=ne:"M"===r?t=ie:"ZM"===r&&(t=oe),t!==re&&this.consume_()}return t},t.prototype.parseGeometryCollectionText_=function(){if(this.match(Dw)){var t=[];do{t.push(this.parseGeometry_())}while(this.match(zw));if(this.match(kw))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePointText_=function(){if(this.match(Dw)){var t=this.parsePoint_();if(this.match(kw))return t}else if(this.isEmptyGeometry_())return null;throw new Error(this.formatErrorMessage_())},t.prototype.parseLineStringText_=function(){if(this.match(Dw)){var t=this.parsePointList_();if(this.match(kw))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePolygonText_=function(){if(this.match(Dw)){var t=this.parseLineStringTextList_();if(this.match(kw))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPointText_=function(){if(this.match(Dw)){var t=void 0;if(t=this.token_.type==Dw?this.parsePointTextList_():this.parsePointList_(),this.match(kw))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiLineStringText_=function(){if(this.match(Dw)){var t=this.parseLineStringTextList_();if(this.match(kw))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parseMultiPolygonText_=function(){if(this.match(Dw)){var t=this.parsePolygonTextList_();if(this.match(kw))return t}else if(this.isEmptyGeometry_())return[];throw new Error(this.formatErrorMessage_())},t.prototype.parsePoint_=function(){for(var t=[],e=this.layout_.length,r=0;r<e;++r){var n=this.token_;if(!this.match(Uw))break;t.push(n.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())},t.prototype.parsePointList_=function(){for(var t=[this.parsePoint_()];this.match(zw);)t.push(this.parsePoint_());return t},t.prototype.parsePointTextList_=function(){for(var t=[this.parsePointText_()];this.match(zw);)t.push(this.parsePointText_());return t},t.prototype.parseLineStringTextList_=function(){for(var t=[this.parseLineStringText_()];this.match(zw);)t.push(this.parseLineStringText_());return t},t.prototype.parsePolygonTextList_=function(){for(var t=[this.parsePolygonText_()];this.match(zw);)t.push(this.parsePolygonText_());return t},t.prototype.isEmptyGeometry_=function(){var t=this.isTokenType(jw)&&"EMPTY"==this.token_.value;return t&&this.consume_(),t},t.prototype.formatErrorMessage_=function(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"},t.prototype.parseGeometry_=function(){var t=this.token_;if(this.match(jw)){var e=t.value;if(this.layout_=this.parseGeometryLayout_(),"GEOMETRYCOLLECTION"==e){var r=this.parseGeometryCollectionText_();return new K_(r)}var n=Gw[e];if(!n)throw new Error("Invalid geometry type: "+e);var i=void 0;switch(e){case"POINT":i=this.parsePointText_();break;case"LINESTRING":i=this.parseLineStringText_();break;case"POLYGON":i=this.parsePolygonText_();break;case"MULTIPOINT":i=this.parseMultiPointText_();break;case"MULTILINESTRING":i=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":i=this.parseMultiPolygonText_();break;default:throw new Error("Invalid geometry type: "+e)}return i||(i=n===Gw.POINT?[NaN,NaN]:[]),new n(i,this.layout_)}throw new Error(this.formatErrorMessage_())},t}(),Zw=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.splitCollection_=void 0!==n.splitCollection&&n.splitCollection,r}return Nw(e,t),e.prototype.parse_=function(t){var e=new Xw(t);return new Ww(e).parse()},e.prototype.readFeatureFromText=function(t,e){var r=this.readGeometryFromText(t,e);if(r){var n=new lt;return n.setGeometry(r),n}return null},e.prototype.readFeaturesFromText=function(t,e){for(var r=[],n=this.readGeometryFromText(t,e),i=[],o=0,a=(r=this.splitCollection_&&n.getType()==ae.GEOMETRY_COLLECTION?n.getGeometriesArray():[n]).length;o<a;++o){var s=new lt;s.setGeometry(r[o]),i.push(s)}return i},e.prototype.readGeometryFromText=function(t,e){var r=this.parse_(t);return r?H_(r,!1,e):null},e.prototype.writeFeatureText=function(t,e){var r=t.getGeometry();return r?this.writeGeometryText(r,e):""},e.prototype.writeFeaturesText=function(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(t[n].getGeometry());var o=new K_(r);return this.writeGeometryText(o,e)},e.prototype.writeGeometryText=function(t,e){return Qw(H_(t,!0,e))},e}(Gy);function Kw(t){var e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function qw(t){for(var e=t.getCoordinates(),r=[],n=0,i=e.length;n<i;++n)r.push(e[n].join(" "));return r.join(",")}function Hw(t){for(var e=[],r=t.getLinearRings(),n=0,i=r.length;n<i;++n)e.push("("+qw(r[n])+")");return e.join(",")}var Jw={Point:Kw,LineString:qw,Polygon:Hw,MultiPoint:function(t){for(var e=[],r=t.getPoints(),n=0,i=r.length;n<i;++n)e.push("("+Kw(r[n])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],r=t.getLineStrings(),n=0,i=r.length;n<i;++n)e.push("("+qw(r[n])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],r=t.getPolygons(),n=0,i=r.length;n<i;++n)e.push("("+Hw(r[n])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],r=t.getGeometries(),n=0,i=r.length;n<i;++n)e.push(Qw(r[n]));return e.join(",")}};function Qw(t){var e=t.getType(),r=(0,Jw[e])(t);if(e=e.toUpperCase(),"function"==typeof t.getFlatCoordinates){var n=function(t){var e=t.getLayout(),r="";return e!==ne&&e!==oe||(r+="Z"),e!==ie&&e!==oe||(r+="M"),r}(t);n.length>0&&(e+=" "+n)}return 0===r.length?e+" EMPTY":e+"("+r+")"}var $w=Zw;function tS(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}var eS=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var e=Zu(t);return this.readFromDocument(e)}return Wu(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){},t.prototype.readFromNode=function(t){},t}(),rS=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nS=[null,"http://www.opengis.net/wms"],iS=il(nS,{Service:Qu((function(t,e){return al({},sS,t,e)})),Capability:Qu((function(t,e){return al({},oS,t,e)}))}),oS=il(nS,{Request:Qu((function(t,e){return al({},_S,t,e)})),Exception:Qu((function(t,e){return al([],cS,t,e)})),Layer:Qu((function(t,e){return al({},pS,t,e)}))}),aS=function(t){function e(){var e=t.call(this)||this;return e.version=void 0,e}return rS(e,t),e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var e=al({version:this.version},iS,t,[]);return e||null},e}(eS),sS=il(nS,{Name:Qu(Eg),Title:Qu(Eg),Abstract:Qu(Eg),KeywordList:Qu(CS),OnlineResource:Qu(tS),ContactInformation:Qu((function(t,e){return al({},uS,t,e)})),Fees:Qu(Eg),AccessConstraints:Qu(Eg),LayerLimit:Qu(wg),MaxWidth:Qu(wg),MaxHeight:Qu(wg)}),uS=il(nS,{ContactPersonPrimary:Qu((function(t,e){return al({},lS,t,e)})),ContactPosition:Qu(Eg),ContactAddress:Qu((function(t,e){return al({},hS,t,e)})),ContactVoiceTelephone:Qu(Eg),ContactFacsimileTelephone:Qu(Eg),ContactElectronicMailAddress:Qu(Eg)}),lS=il(nS,{ContactPerson:Qu(Eg),ContactOrganization:Qu(Eg)}),hS=il(nS,{AddressType:Qu(Eg),Address:Qu(Eg),City:Qu(Eg),StateOrProvince:Qu(Eg),PostCode:Qu(Eg),Country:Qu(Eg)}),cS=il(nS,{Format:qu(Eg)}),pS=il(nS,{Name:Qu(Eg),Title:Qu(Eg),Abstract:Qu(Eg),KeywordList:Qu(CS),CRS:Ju(Eg),EX_GeographicBoundingBox:Qu((function(t,e){var r=al({},dS,t,e);if(!r)return;var n=r.westBoundLongitude,i=r.southBoundLatitude,o=r.eastBoundLongitude,a=r.northBoundLatitude;if(void 0===n||void 0===i||void 0===o||void 0===a)return;return[n,i,o,a]})),BoundingBox:Ju((function(t,e){var r=[xg(t.getAttribute("minx")),xg(t.getAttribute("miny")),xg(t.getAttribute("maxx")),xg(t.getAttribute("maxy"))],n=[xg(t.getAttribute("resx")),xg(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:r,res:n}})),Dimension:Ju((function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:yg(t.getAttribute("multipleValues")),nearestValue:yg(t.getAttribute("nearestValue")),current:yg(t.getAttribute("current")),values:Eg(t)}})),Attribution:Qu((function(t,e){return al({},fS,t,e)})),AuthorityURL:Ju((function(t,e){var r=SS(t,e);if(r)return r.name=t.getAttribute("name"),r;return})),Identifier:Ju(Eg),MetadataURL:Ju((function(t,e){var r=SS(t,e);if(r)return r.type=t.getAttribute("type"),r;return})),DataURL:Ju(SS),FeatureListURL:Ju(SS),Style:Ju((function(t,e){return al({},mS,t,e)})),MinScaleDenominator:Qu(mg),MaxScaleDenominator:Qu(mg),Layer:Ju((function(t,e){var r=e[e.length-1],n=al({},pS,t,e);if(!n)return;var i=yg(t.getAttribute("queryable"));void 0===i&&(i=r.queryable);n.queryable=void 0!==i&&i;var o=Sg(t.getAttribute("cascaded"));void 0===o&&(o=r.cascaded);n.cascaded=o;var a=yg(t.getAttribute("opaque"));void 0===a&&(a=r.opaque);n.opaque=void 0!==a&&a;var s=yg(t.getAttribute("noSubsets"));void 0===s&&(s=r.noSubsets);n.noSubsets=void 0!==s&&s;var u=xg(t.getAttribute("fixedWidth"));u||(u=r.fixedWidth);n.fixedWidth=u;var l=xg(t.getAttribute("fixedHeight"));l||(l=r.fixedHeight);n.fixedHeight=l,["Style","CRS","AuthorityURL"].forEach((function(t){if(t in r){var e=n[t]||[];n[t]=e.concat(r[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in n)){var e=r[t];n[t]=e}})),n}))}),fS=il(nS,{Title:Qu(Eg),OnlineResource:Qu(tS),LogoURL:Qu(TS)}),dS=il(nS,{westBoundLongitude:Qu(mg),eastBoundLongitude:Qu(mg),southBoundLatitude:Qu(mg),northBoundLatitude:Qu(mg)}),_S=il(nS,{GetCapabilities:Qu(ES),GetMap:Qu(ES),GetFeatureInfo:Qu(ES)}),gS=il(nS,{Format:Ju(Eg),DCPType:Ju((function(t,e){return al({},yS,t,e)}))}),yS=il(nS,{HTTP:Qu((function(t,e){return al({},vS,t,e)}))}),vS=il(nS,{Get:Qu(SS),Post:Qu(SS)}),mS=il(nS,{Name:Qu(Eg),Title:Qu(Eg),Abstract:Qu(Eg),LegendURL:Ju(TS),StyleSheetURL:Qu(SS),StyleURL:Qu(SS)}),xS=il(nS,{Format:Qu(Eg),OnlineResource:Qu(tS)}),wS=il(nS,{Keyword:qu(Eg)});function SS(t,e){return al({},xS,t,e)}function ES(t,e){return al({},gS,t,e)}function TS(t,e){var r=SS(t,e);if(r){var n=[Sg(t.getAttribute("width")),Sg(t.getAttribute("height"))];return r.size=n,r}}function CS(t,e){return al([],wS,t,e)}var bS=aS,PS=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),RS=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.featureNS_="http://mapserver.gis.umn.edu/mapserver",r.gmlFormat_=new jg,r.layers_=n.layers?n.layers:null,r}return PS(e,t),e.prototype.getLayers=function(){return this.layers_},e.prototype.setLayers=function(t){this.layers_=t},e.prototype.readFeatures_=function(t,e){t.setAttribute("namespaceURI",this.featureNS_);var r=t.localName,n=[];if(0===t.childNodes.length)return n;if("msGMLOutput"==r)for(var i=0,o=t.childNodes.length;i<o;i++){var a=t.childNodes[i];if(a.nodeType===Node.ELEMENT_NODE){var s=a,u=e[0],l=s.localName.replace("_layer","");if(!this.layers_||w(this.layers_,l)){var h=l+"_feature";u.featureType=h,u.featureNS=this.featureNS_;var c={};c[h]=qu(this.gmlFormat_.readFeatureElement,this.gmlFormat_);var p=il([u.featureNS,null],c);s.setAttribute("namespaceURI",this.featureNS_);var f=al([],p,s,e,this.gmlFormat_);f&&T(n,f)}}}if("FeatureCollection"==r){var d=al([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);d&&(n=d)}return n},e.prototype.readFeaturesFromNode=function(t,e){var r={};return e&&p(r,this.getReadOptions(t,e)),this.readFeatures_(t,[r])},e}(hg),OS=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),IS=[null,"http://www.opengis.net/ows/1.1"],LS=il(IS,{ServiceIdentification:Qu((function(t,e){return al({},VS,t,e)})),ServiceProvider:Qu((function(t,e){return al({},XS,t,e)})),OperationsMetadata:Qu((function(t,e){return al({},US,t,e)}))}),FS=function(t){function e(){return t.call(this)||this}return OS(e,t),e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=al({},LS,t,[]);return e||null},e}(eS),MS=il(IS,{DeliveryPoint:Qu(Eg),City:Qu(Eg),AdministrativeArea:Qu(Eg),PostalCode:Qu(Eg),Country:Qu(Eg),ElectronicMailAddress:Qu(Eg)}),AS=il(IS,{Value:Ju((function(t,e){return Eg(t)}))}),NS=il(IS,{AllowedValues:Qu((function(t,e){return al({},AS,t,e)}))}),GS=il(IS,{Phone:Qu((function(t,e){return al({},zS,t,e)})),Address:Qu((function(t,e){return al({},MS,t,e)}))}),jS=il(IS,{HTTP:Qu((function(t,e){return al({},DS,t,e)}))}),DS=il(IS,{Get:Ju((function(t,e){var r=tS(t);if(!r)return;return al({href:r},BS,t,e)})),Post:void 0}),kS=il(IS,{DCP:Qu((function(t,e){return al({},jS,t,e)}))}),US=il(IS,{Operation:function(t,e){var r=t.getAttribute("name"),n=al({},kS,t,e);if(!n)return;e[e.length-1][r]=n}}),zS=il(IS,{Voice:Qu(Eg),Facsimile:Qu(Eg)}),BS=il(IS,{Constraint:Ju((function(t,e){var r=t.getAttribute("name");if(!r)return;return al({name:r},NS,t,e)}))}),YS=il(IS,{IndividualName:Qu(Eg),PositionName:Qu(Eg),ContactInfo:Qu((function(t,e){return al({},GS,t,e)}))}),VS=il(IS,{Abstract:Qu(Eg),AccessConstraints:Qu(Eg),Fees:Qu(Eg),Title:Qu(Eg),ServiceTypeVersion:Qu(Eg),ServiceType:Qu(Eg)}),XS=il(IS,{ProviderName:Qu(Eg),ProviderSite:Qu(tS),ServiceContact:Qu((function(t,e){return al({},YS,t,e)}))});var WS=FS,ZS=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),KS=[null,"http://www.opengis.net/wmts/1.0"],qS=[null,"http://www.opengis.net/ows/1.1"],HS=il(KS,{Contents:Qu((function(t,e){return al({},QS,t,e)}))}),JS=function(t){function e(){var e=t.call(this)||this;return e.owsParser_=new WS,e}return ZS(e,t),e.prototype.readFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null},e.prototype.readFromNode=function(t){var e=t.getAttribute("version");e&&(e=e.trim());var r=this.owsParser_.readFromNode(t);return r?(r.version=e,(r=al(r,HS,t,[]))||null):null},e}(eS),QS=il(KS,{Layer:Ju((function(t,e){return al({},$S,t,e)})),TileMatrixSet:Ju((function(t,e){return al({},aE,t,e)}))}),$S=il(KS,{Style:Ju((function(t,e){var r=al({},tE,t,e);if(!r)return;var n="true"===t.getAttribute("isDefault");return r.isDefault=n,r})),Format:Ju(Eg),TileMatrixSetLink:Ju((function(t,e){return al({},eE,t,e)})),Dimension:Ju((function(t,e){return al({},iE,t,e)})),ResourceURL:Ju((function(t,e){var r=t.getAttribute("format"),n=t.getAttribute("template"),i=t.getAttribute("resourceType"),o={};r&&(o.format=r);n&&(o.template=n);i&&(o.resourceType=i);return o}))},il(qS,{Title:Qu(Eg),Abstract:Qu(Eg),WGS84BoundingBox:Qu((function(t,e){var r=al([],oE,t,e);if(2!=r.length)return;return xt(r)})),Identifier:Qu(Eg)})),tE=il(KS,{LegendURL:Ju((function(t,e){var r={};return r.format=t.getAttribute("format"),r.href=tS(t),r}))},il(qS,{Title:Qu(Eg),Identifier:Qu(Eg)})),eE=il(KS,{TileMatrixSet:Qu(Eg),TileMatrixSetLimits:Qu((function(t,e){return al([],rE,t,e)}))}),rE=il(KS,{TileMatrixLimits:qu((function(t,e){return al({},nE,t,e)}))}),nE=il(KS,{TileMatrix:Qu(Eg),MinTileRow:Qu(wg),MaxTileRow:Qu(wg),MinTileCol:Qu(wg),MaxTileCol:Qu(wg)}),iE=il(KS,{Default:Qu(Eg),Value:Ju(Eg)},il(qS,{Identifier:Qu(Eg)})),oE=il(qS,{LowerCorner:qu(uE),UpperCorner:qu(uE)}),aE=il(KS,{WellKnownScaleSet:Qu(Eg),TileMatrix:Ju((function(t,e){return al({},sE,t,e)}))},il(qS,{SupportedCRS:Qu(Eg),Identifier:Qu(Eg)})),sE=il(KS,{TopLeftCorner:Qu(uE),ScaleDenominator:Qu(mg),TileWidth:Qu(wg),TileHeight:Qu(wg),MatrixWidth:Qu(wg),MatrixHeight:Qu(wg)},il(qS,{Identifier:Qu(Eg)}));function uE(t,e){var r=Eg(t).split(/\s+/);if(r&&2==r.length){var n=+r[0],i=+r[1];if(!isNaN(n)&&!isNaN(i))return[n,i]}}var lE=JS,hE=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cE=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],pE="enterfullscreen",fE="leavefullscreen";function dE(){var t=document.body;return!!(t.webkitRequestFullscreen||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function _E(){return!!(document.webkitIsFullScreen||document.msFullscreenElement||document.fullscreenElement)}function gE(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var yE=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),target:n.target})||this).cssClassName_=void 0!==n.className?n.className:"ol-full-screen";var i=void 0!==n.label?n.label:"⤢";r.labelNode_="string"==typeof i?document.createTextNode(i):i;var o=void 0!==n.labelActive?n.labelActive:"×";r.labelActiveNode_="string"==typeof o?document.createTextNode(o):o,r.button_=document.createElement("button");var a=n.tipLabel?n.tipLabel:"Toggle full-screen";r.setClassName_(r.button_,_E()),r.button_.setAttribute("type","button"),r.button_.title=a,r.button_.appendChild(r.labelNode_),r.button_.addEventListener(D,r.handleClick_.bind(r),!1);var s=r.cssClassName_+" ol-unselectable ol-control "+(dE()?"":"ol-unsupported"),u=r.element;return u.className=s,u.appendChild(r.button_),r.keys_=void 0!==n.keys&&n.keys,r.source_=n.source,r}return hE(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},e.prototype.handleFullScreen_=function(){if(dE()){var t=this.getMap();if(t)if(_E())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else{var e=void 0;e=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:t.getTargetElement(),this.keys_?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():gE(t)}(e):gE(e)}}},e.prototype.handleFullScreenChange_=function(){var t=this.getMap();_E()?(this.setClassName_(this.button_,!0),to(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(pE)):(this.setClassName_(this.button_,!1),to(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(fE)),t&&t.updateSize()},e.prototype.setClassName_=function(t,e){var r=this.cssClassName_+"-true",n=this.cssClassName_+"-false",i=e?r:n;t.classList.remove(r),t.classList.remove(n),t.classList.add(i)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e)for(var r=0,n=cE.length;r<n;++r)this.listenerKeys.push(g(document,cE[r],this.handleFullScreenChange_,this))},e}(Ro),vE=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function mE(t){var e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}var xE=function(t){function e(e){var r=this,n=e||{},i=document.createElement("div");return i.className=void 0!==n.className?n.className:"ol-mouse-position",(r=t.call(this,{element:i,render:n.render||mE,target:n.target})||this).addEventListener(et("projection"),r.handleProjectionChanged_),n.coordinateFormat&&r.setCoordinateFormat(n.coordinateFormat),n.projection&&r.setProjection(n.projection),r.undefinedHTML_=void 0!==n.undefinedHTML?n.undefinedHTML:" ",r.renderOnMouseOut_=!!r.undefinedHTML_,r.renderedHTML_=i.innerHTML,r.mapProjection_=null,r.transform_=null,r}return vE(e,t),e.prototype.handleProjectionChanged_=function(){this.transform_=null},e.prototype.getCoordinateFormat=function(){return this.get("coordinateFormat")},e.prototype.getProjection=function(){return this.get("projection")},e.prototype.handleMouseMove=function(t){var e=this.getMap();this.updateHTML_(e.getEventPixel(t))},e.prototype.handleMouseOut=function(t){this.updateHTML_(null)},e.prototype.setMap=function(e){if(t.prototype.setMap.call(this,e),e){var r=e.getViewport();this.listenerKeys.push(g(r,Xn,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(g(r,Kn,this.handleMouseOut,this))}},e.prototype.setCoordinateFormat=function(t){this.set("coordinateFormat",t)},e.prototype.setProjection=function(t){this.set("projection",We(t))},e.prototype.updateHTML_=function(t){var e=this.undefinedHTML_;if(t&&this.mapProjection_){if(!this.transform_){var r=this.getProjection();this.transform_=r?$e(this.mapProjection_,r):Ve}var n=this.getMap().getCoordinateFromPixelInternal(t);if(n){var i=sr();i&&(this.transform_=$e(this.mapProjection_,i)),this.transform_(n,n);var o=this.getCoordinateFormat();e=o?o(n):n.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)},e}(Ro),wE=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),SE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wE(e,t),e.prototype.createRenderer=function(){return new Qs(this)},e}(bo);function EE(t){this.validateExtent_(),this.updateBox_()}var TE=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render||EE,target:n.target})||this).boundHandleRotationChanged_=r.handleRotationChanged_.bind(r),r.collapsed_=void 0===n.collapsed||n.collapsed,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1),r.rotateWithView_=void 0!==n.rotateWithView&&n.rotateWithView,r.viewExtent_=void 0;var i=void 0!==n.className?n.className:"ol-overviewmap",o=void 0!==n.tipLabel?n.tipLabel:"Overview map",a=void 0!==n.collapseLabel?n.collapseLabel:"«";"string"==typeof a?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=a):r.collapseLabel_=a;var s=void 0!==n.label?n.label:"»";"string"==typeof s?(r.label_=document.createElement("span"),r.label_.textContent=s):r.label_=s;var u=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_,l=document.createElement("button");l.setAttribute("type","button"),l.title=o,l.appendChild(u),l.addEventListener(D,r.handleClick_.bind(r),!1),r.ovmapDiv_=document.createElement("div"),r.ovmapDiv_.className="ol-overviewmap-map",r.view_=n.view,r.ovmap_=new SE({view:n.view});var h=r.ovmap_;n.layers&&n.layers.forEach((function(t){h.addLayer(t)}));var c=document.createElement("div");c.className="ol-overviewmap-box",c.style.boxSizing="border-box",r.boxOverlay_=new gu({position:[0,0],positioning:ou,element:c}),r.ovmap_.addOverlay(r.boxOverlay_);var p=i+" ol-unselectable ol-control"+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),f=r.element;f.className=p,f.appendChild(r.ovmapDiv_),f.appendChild(l);var d=r,_=r.boxOverlay_,g=r.boxOverlay_.getElement(),y=function(t){var e,r={clientX:(e=t).clientX,clientY:e.clientY},n=h.getEventCoordinateInternal(r);_.setPosition(n)},v=function(t){var e=h.getEventCoordinateInternal(t);d.getMap().getView().setCenterInternal(e),window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",v)};return g.addEventListener("mousedown",(function(){window.addEventListener("mousemove",y),window.addEventListener("mouseup",v)})),r}return wE(e,t),e.prototype.setMap=function(e){var r=this.getMap();if(e!==r){if(r){var n=r.getView();n&&this.unbindView_(n),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(g(e,c,this.handleMapPropertyChange_,this));var i=e.getView();i&&(this.bindView_(i),i.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===ni){var e=t.oldValue;e&&this.unbindView_(e);var r=this.getMap().getView();this.bindView_(r)}},e.prototype.bindView_=function(t){if(!this.view_){var e=new Hi({projection:t.getProjection()});this.ovmap_.setView(e)}t.addEventListener(et(Ri),this.boundHandleRotationChanged_),this.handleRotationChanged_()},e.prototype.unbindView_=function(t){t.removeEventListener(et(Ri),this.boundHandleRotationChanged_)},e.prototype.handleRotationChanged_=function(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView().calculateExtentInternal(r);if(!this.viewExtent_||!Mt(n,this.viewExtent_)){this.viewExtent_=n;var i=e.getSize(),o=e.getView().calculateExtentInternal(i),a=e.getPixelFromCoordinateInternal(Kt(n)),s=e.getPixelFromCoordinateInternal(Bt(n)),u=Math.abs(a[0]-s[0]),l=Math.abs(a[1]-s[1]),h=i[0],c=i[1];u<.1*h||l<.1*c||u>.75*h||l>.75*c?this.resetExtent_():Ct(o,n)||this.recenter_()}}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getSize(),n=t.getView().calculateExtentInternal(r),i=e.getView(),o=Math.log(7.5)/Math.LN2;$t(n,1/(.1*Math.pow(2,o/2))),i.fitInternal(fn(n))},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,r=t.getView();e.getView().setCenterInternal(r.getCenterInternal())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var r=t.getSize(),n=t.getView(),i=e.getView(),o=this.rotateWithView_?0:-n.getRotation(),a=this.boxOverlay_,s=this.boxOverlay_.getElement(),u=n.getCenterInternal(),l=n.getResolution(),h=i.getResolution(),c=r[0]*l/h,p=r[1]*l/h;if(a.setPosition(u),s){s.style.width=c+"px",s.style.height=p+"px";var f="rotate("+o+"rad)";s.style.transform=f}}},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?to(this.collapseLabel_,this.label_):to(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),y(t,Jn,(function(t){this.updateBox_()}),this)}},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getRotateWithView=function(){return this.rotateWithView_},e.prototype.setRotateWithView=function(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))},e.prototype.getOverviewMap=function(){return this.ovmap_},e}(Ro),CE=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bE="degrees",PE="imperial",RE="nautical",OE="metric",IE="us",LE=[1,2,5];function FE(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}var ME=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render||FE,target:n.target})||this).innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" ol-unselectable",r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addEventListener(et("units"),r.handleUnitsChanged_),r.setUnits(n.units||OE),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r}return CE(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==bE?Te.DEGREES:Te.METERS,o=Ze(r,t.resolution,e,i),a=this.minWidth_*o,s="";if(n==bE){var u=Ee[Te.DEGREES];(a*=u)<u/60?(s="″",o*=3600):a<u?(s="′",o*=60):s="°"}else n==PE?a<.9144?(s="in",o/=.0254):a<1609.344?(s="ft",o/=.3048):(s="mi",o/=1609.344):n==RE?(o/=1852,s="nm"):n==OE?a<.001?(s="μm",o*=1e6):a<1?(s="mm",o*=1e3):a<1e3?s="m":(s="km",o/=1e3):n==IE?a<.9144?(s="in",o*=39.37):a<1609.344?(s="ft",o/=.30480061):(s="mi",o/=1609.3472):st(!1,33);for(var l,h,c,p,f=3*Math.floor(Math.log(this.minWidth_*o)/Math.log(10));;){c=Math.floor(f/3);var d=Math.pow(10,c);if(l=LE[(f%3+3)%3]*d,h=Math.round(l/o),isNaN(h))return this.element.style.display="none",void(this.renderedVisible_=!1);if(h>=this.minWidth_)break;++f}p=this.scaleBar_?this.createScaleBar(h,l,s):l.toFixed(c<0?-c:0)+" "+s,this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=h&&(this.innerElement_.style.width=h+"px",this.renderedWidth_=h),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&i.push(this.createMarker("absolute",s)),i.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+"</div>"),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(r?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=this.getMap().getView().getResolution(),e=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*e*39.37*(25.4/.28)},e}(Ro),AE=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),NE=0,GE=1;function jE(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}}var DE=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render||jE})||this).dragListenerKeys_=[],r.currentResolution_=void 0,r.direction_=NE,r.dragging_,r.heightLimit_=0,r.widthLimit_=0,r.startX_,r.startY_,r.thumbSize_=null,r.sliderInitialized_=!1,r.duration_=void 0!==n.duration?n.duration:200;var i=void 0!==n.className?n.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=i+"-thumb ol-unselectable";var a=r.element;return a.className=i+" ol-unselectable ol-control",a.appendChild(o),a.addEventListener(Wn,r.handleDraggerStart_.bind(r),!1),a.addEventListener(Xn,r.handleDraggerDrag_.bind(r),!1),a.addEventListener(Zn,r.handleDraggerEnd_.bind(r),!1),a.addEventListener(D,r.handleContainerClick_.bind(r),!1),o.addEventListener(D,L,!1),r}return AE(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,r=t.offsetHeight,n=t.firstElementChild,i=getComputedStyle(n),o=n.offsetWidth+parseFloat(i.marginRight)+parseFloat(i.marginLeft),a=n.offsetHeight+parseFloat(i.marginTop)+parseFloat(i.marginBottom);this.thumbSize_=[o,a],e>r?(this.direction_=GE,this.widthLimit_=e-o):(this.direction_=NE,this.heightLimit_=r-a),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),r=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(r),i=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:i,duration:this.duration_,easing:Vi})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){var r=this.handleDraggerDrag_,n=this.handleDraggerEnd_;this.dragListenerKeys_.push(g(document,Xn,r,this),g(document,Zn,n,this))}}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,r=t.clientY-this.startY_,n=this.getRelativePosition_(e,r);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_)}},e.prototype.handleDraggerEnd_=function(t){this.dragging_&&(this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(v),this.dragListenerKeys_.length=0)},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),r=this.element.firstElementChild;this.direction_==GE?r.style.left=this.widthLimit_*e+"px":r.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return he(this.direction_===GE?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return he(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},e}(Ro),kE=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),UE=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),target:n.target})||this).extent=n.extent?n.extent:null;var i=void 0!==n.className?n.className:"ol-zoom-extent",o=void 0!==n.label?n.label:"E",a=void 0!==n.tipLabel?n.tipLabel:"Fit to extent",s=document.createElement("button");s.setAttribute("type","button"),s.title=a,s.appendChild("string"==typeof o?document.createTextNode(o):o),s.addEventListener(D,r.handleClick_.bind(r),!1);var u=i+" ol-unselectable ol-control",l=r.element;return l.className=u,l.appendChild(s),r}return kE(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),this.handleZoomToExtent()},e.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(fn(e))},e}(Ro),zE={array:{},color:{},colorlike:{},control:{},coordinate:{},easing:{},events:{}};zE.events.condition={},zE.extent={},zE.featureloader={},zE.format={},zE.format.filter={},zE.geom={},zE.has={},zE.interaction={},zE.layer={},zE.loadingstrategy={},zE.proj={},zE.proj.Units={},zE.proj.proj4={},zE.render={},zE.render.canvas={},zE.renderer={},zE.renderer.canvas={},zE.renderer.webgl={},zE.size={},zE.source={},zE.sphere={},zE.style={},zE.style.IconImageCache={},zE.tilegrid={},zE.transform={},zE.util={},zE.webgl={},zE.xml={},zE.Collection=at,zE.Feature=lt,zE.Geolocation=Rn,zE.Kinetic=On,zE.Map=tu,zE.Object=rt,zE.Observable=H,zE.Observable.unByKey=function(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)v(t[e]);else v(t)},zE.Overlay=gu,zE.PluggableMap=bo,zE.View=Hi,zE.array.stableSort=function(t,e){var r,n=t.length,i=Array(t.length);for(r=0;r<n;r++)i[r]={index:r,value:t[r]};for(i.sort((function(t,r){return e(t.value,r.value)||t.index-r.index})),r=0;r<t.length;r++)t[r]=i[r].value},zE.color.asArray=rs,zE.color.asString=Ja,zE.colorlike.asColorLike=us,zE.control.Attribution=jo,zE.control.Control=Ro,zE.control.FullScreen=yE,zE.control.MousePosition=xE,zE.control.OverviewMap=TE,zE.control.Rotate=Uo,zE.control.ScaleLine=ME,zE.control.Zoom=Bo,zE.control.ZoomSlider=DE,zE.control.ZoomToExtent=UE,zE.control.defaults=Yo,zE.coordinate.add=Li,zE.coordinate.createStringXY=function(t){return function(e){return zi(e,t)}},zE.coordinate.format=Ai,zE.coordinate.rotate=Gi,zE.coordinate.toStringHDMS=function(t,e){return t?Mi("NS",t[1],e)+" "+Mi("EW",t[0],e):""},zE.coordinate.toStringXY=zi,zE.easing.easeIn=Yi,zE.easing.easeOut=Vi,zE.easing.inAndOut=Xi,zE.easing.linear=Wi,zE.easing.upAndDown=function(t){return t<.5?Xi(2*t):1-Xi(2*(t-.5))},zE.events.condition.altKeyOnly=Jo,zE.events.condition.altShiftKeysOnly=Qo,zE.events.condition.always=ta,zE.events.condition.click=function(t){return t.type==Bn.CLICK},zE.events.condition.doubleClick=function(t){return t.type==Bn.DBLCLICK},zE.events.condition.focus=$o,zE.events.condition.mouseOnly=sa,zE.events.condition.never=ra,zE.events.condition.noModifierKeys=ia,zE.events.condition.penOnly=function(t){var e=t.pointerEvent;return st(void 0!==e,56),"pen"===e.pointerType},zE.events.condition.platformModifierKeyOnly=function(t){var e=t.originalEvent;return!e.altKey&&(jn?e.metaKey:e.ctrlKey)&&!e.shiftKey},zE.events.condition.pointerMove=function(t){return"pointermove"==t.type},zE.events.condition.primaryAction=ua,zE.events.condition.shiftKeyOnly=oa,zE.events.condition.singleClick=na,zE.events.condition.targetNotEditable=aa,zE.events.condition.touchOnly=function(t){var e=t.pointerEvent;return st(void 0!==e,56),"touch"===e.pointerType},zE.extent.applyTransform=te,zE.extent.boundingExtent=xt,zE.extent.buffer=wt,zE.extent.containsCoordinate=Tt,zE.extent.containsExtent=Ct,zE.extent.containsXY=bt,zE.extent.createEmpty=Rt,zE.extent.equals=Mt,zE.extent.extend=At,zE.extent.getArea=Ut,zE.extent.getBottomLeft=zt,zE.extent.getBottomRight=Bt,zE.extent.getCenter=Yt,zE.extent.getHeight=Wt,zE.extent.getIntersection=Zt,zE.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},zE.extent.getTopLeft=Kt,zE.extent.getTopRight=qt,zE.extent.getWidth=Ht,zE.extent.intersects=Jt,zE.extent.isEmpty=Qt,zE.featureloader.setWithCredentials=function(t){wu=t},zE.featureloader.xhr=Eu,zE.format.EsriJSON=ug,zE.format.Feature=q_,zE.format.GML=Mg,zE.format.GML2=jg,zE.format.GML3=Lg,zE.format.GML32=Ug,zE.format.GPX=Sy,zE.format.GeoJSON=by,zE.format.IGC=Xy,zE.format.IIIFInfo=Tc,zE.format.KML=jm,zE.format.MVT=Km,zE.format.OSMXML=rx,zE.format.Polyline=hx,zE.format.Polyline.decodeDeltas=ax,zE.format.Polyline.decodeFloats=ux,zE.format.Polyline.encodeDeltas=ox,zE.format.Polyline.encodeFloats=sx,zE.format.TopoJSON=mx,zE.format.WFS=Aw,zE.format.WFS.writeFilter=function(t){var e=Vu(vw,"Filter");return Pw(e,t,[]),e},zE.format.WKT=$w,zE.format.WMSCapabilities=bS,zE.format.WMSGetFeatureInfo=RS,zE.format.WMTSCapabilities=lE,zE.format.filter.Bbox=bx,zE.format.filter.Contains=Ix,zE.format.filter.During=Ax,zE.format.filter.EqualTo=Dx,zE.format.filter.GreaterThan=Ux,zE.format.filter.GreaterThanOrEqualTo=Bx,zE.format.filter.Intersects=Vx,zE.format.filter.IsBetween=Wx,zE.format.filter.IsLike=Kx,zE.format.filter.IsNull=Hx,zE.format.filter.LessThan=Qx,zE.format.filter.LessThanOrEqualTo=tw,zE.format.filter.Not=rw,zE.format.filter.NotEqualTo=iw,zE.format.filter.Or=aw,zE.format.filter.Within=uw,zE.format.filter.and=lw,zE.format.filter.bbox=hw,zE.format.filter.between=function(t,e,r){return new Wx(t,e,r)},zE.format.filter.contains=function(t,e,r){return new Ix(t,e,r)},zE.format.filter.during=function(t,e,r){return new Ax(t,e,r)},zE.format.filter.equalTo=function(t,e,r){return new Dx(t,e,r)},zE.format.filter.greaterThan=function(t,e){return new Ux(t,e)},zE.format.filter.greaterThanOrEqualTo=function(t,e){return new Bx(t,e)},zE.format.filter.intersects=function(t,e,r){return new Vx(t,e,r)},zE.format.filter.isNull=function(t){return new Hx(t)},zE.format.filter.lessThan=function(t,e){return new Qx(t,e)},zE.format.filter.lessThanOrEqualTo=function(t,e){return new tw(t,e)},zE.format.filter.like=function(t,e,r,n,i,o){return new Kx(t,e,r,n,i,o)},zE.format.filter.not=function(t){return new rw(t)},zE.format.filter.notEqualTo=function(t,e,r){return new iw(t,e,r)},zE.format.filter.or=function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(aw,e))},zE.format.filter.within=function(t,e,r){return new uw(t,e,r)},zE.geom.Circle=qd,zE.geom.Geometry=Er,zE.geom.GeometryCollection=K_,zE.geom.LineString=Ed,zE.geom.LinearRing=Wr,zE.geom.MultiLineString=Jd,zE.geom.MultiPoint=$d,zE.geom.MultiPolygon=r_,zE.geom.Point=Kr,zE.geom.Polygon=cn,zE.geom.Polygon.circular=pn,zE.geom.Polygon.fromCircle=dn,zE.geom.Polygon.fromExtent=fn,zE.geom.SimpleGeometry=br,zE.has.DEVICE_PIXEL_RATIO=Dn,zE.interaction.DoubleClickZoom=Ho,zE.interaction.DragAndDrop=Vd,zE.interaction.DragBox=Ta,zE.interaction.DragPan=da,zE.interaction.DragRotate=ga,zE.interaction.DragRotateAndZoom=Wd,zE.interaction.DragZoom=Pa,zE.interaction.Draw=p_,zE.interaction.Draw.createBox=function(){return function(t,e,r){var n=xt(t.map((function(t){return lr(t,r)}))),i=[[zt(n),Bt(n),qt(n),Kt(n),zt(n)]],o=e;o?o.setCoordinates(i):o=new cn(i);var a=sr();return a&&o.transform(r,a),o}},zE.interaction.Draw.createRegularPolygon=function(t,e){return function(r,n,i){var o=lr(r[0],i),a=lr(r[1],i),s=Math.sqrt(Di(o,a)),u=n||dn(new qd(o),t),l=e;if(!e){var h=a[0]-o[0],c=a[1]-o[1];l=Math.atan(c/h)-(h<0?Math.PI:0)}_n(u,o,s,l);var p=sr();return p&&u.transform(i,p),u}},zE.interaction.Extent=m_,zE.interaction.Interaction=Zo,zE.interaction.KeyboardPan=Aa,zE.interaction.KeyboardZoom=ja,zE.interaction.Modify=O_,zE.interaction.MouseWheelZoom=za,zE.interaction.PinchRotate=Ya,zE.interaction.PinchZoom=Xa,zE.interaction.Pointer=ca,zE.interaction.Select=N_,zE.interaction.Snap=k_,zE.interaction.Translate=X_,zE.interaction.defaults=Wa,zE.layer.Base=fo,zE.layer.BaseImage=ap,zE.layer.BaseTile=vp,zE.layer.BaseVector=Sf,zE.layer.Graticule=Rd,zE.layer.Group=wo,zE.layer.Heatmap=Ad,zE.layer.Image=dp,zE.layer.Layer=Ao,zE.layer.Tile=Ep,zE.layer.Vector=md,zE.layer.VectorImage=Gd,zE.layer.VectorTile=Dd,zE.loadingstrategy.all=Tu,zE.loadingstrategy.bbox=function(t,e){return[t]},zE.loadingstrategy.tile=function(t){return function(e,r){var n=t.getZForResolution(r),i=t.getTileRangeForExtentAndZ(e,n),o=[],a=[n,0,0];for(a[1]=i.minX;a[1]<=i.maxX;++a[1])for(a[2]=i.minY;a[2]<=i.maxY;++a[2])o.push(t.getTileCoordExtent(a));return o}},zE.proj.Projection=Ce,zE.proj.Units.METERS_PER_UNIT=Ee,zE.proj.addCoordinateTransforms=Je,zE.proj.addEquivalentProjections=Ke,zE.proj.addProjection=Xe,zE.proj.equivalent=Qe,zE.proj.fromLonLat=function(t,e){return er(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},zE.proj.get=We,zE.proj.getPointResolution=Ze,zE.proj.getTransform=tr,zE.proj.proj4.register=function(t){var e,r,n=Object.keys(t.defs),i=n.length;for(e=0;e<i;++e){var o=n[e];if(!We(o)){var a=t.defs(o);Xe(new Ce({code:o,axisOrientation:a.axis,metersPerUnit:a.to_meter,units:a.units}))}}for(e=0;e<i;++e){var s=n[e],u=We(s);for(r=0;r<i;++r){var l=n[r],h=We(l);if(!ze(s,l))if(t.defs[s]===t.defs[l])Ke([u,h]);else{var c=t(s,l);Je(u,h,c.forward,c.inverse)}}}},zE.proj.toLonLat=function(t,e){var r=er(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=ge(n+180,360)-180),r},zE.proj.transform=er,zE.proj.transformExtent=rr,zE.render.VectorContext=ls,zE.render.canvas.labelCache=fs,zE.render.getRenderPixel=function(t,e){var r=e.slice(0);return gr(t.inversePixelTransform.slice(),r),r},zE.render.getVectorContext=Ws,zE.render.toContext=function(t,e){var r=t.canvas,n=e||{},i=n.pixelRatio||Dn,o=n.size;o&&(r.width=o[0]*i,r.height=o[1]*i,r.style.width=o[0]+"px",r.style.height=o[1]+"px");var a=[0,0,r.width,r.height],s=yr([1,0,0,1,0,0],i,i);return new Os(t,i,a,s,0)},zE.renderer.Composite=Qs,zE.renderer.canvas.ImageLayer=pp,zE.renderer.canvas.TileLayer=wp,zE.renderer.canvas.VectorImageLayer=hd,zE.renderer.canvas.VectorLayer=ud,zE.renderer.canvas.VectorTileLayer=yd,zE.renderer.webgl.PointsLayer=Tf,zE.size.toSize=To,zE.source.BingMaps=Kh,zE.source.CartoDB=Qh,zE.source.Cluster=hc,zE.source.IIIF=Pc,zE.source.Image=Gc,zE.source.ImageArcGISRest=kc,zE.source.ImageCanvas=Yc,zE.source.ImageMapGuide=Xc,zE.source.ImageStatic=Zc,zE.source.ImageWMS=tp,zE.source.OSM=np,zE.source.OSM.ATTRIBUTION=rp,zE.source.Raster=Ap,zE.source.Source=Ah,zE.source.Stamen=kp,zE.source.Tile=Dh,zE.source.TileArcGISRest=Bp,zE.source.TileDebug=Xp,zE.source.TileImage=Wh,zE.source.TileJSON=Zp,zE.source.TileWMS=Hp,zE.source.UTFGrid=$p,zE.source.Vector=uc,zE.source.VectorTile=sf,zE.source.WMTS=pf,zE.source.WMTS.optionsFromCapabilities=function(t,e){var r=C(t.Contents.Layer,(function(t,r,n){return t.Identifier==e.layer}));if(null===r)return null;var n,i=t.Contents.TileMatrixSet;(n=r.TileMatrixSetLink.length>1?P(r.TileMatrixSetLink,"projection"in e?function(t,r,n){var o=C(i,(function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,a=We(o.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||We(o),s=We(e.projection);return a&&s?Qe(a,s):o==e.projection}:function(t,r,n){return t.TileMatrixSet==e.matrixSet}):0)<0&&(n=0);var o=r.TileMatrixSetLink[n].TileMatrixSet,a=r.TileMatrixSetLink[n].TileMatrixSetLimits,s=r.Format[0];"format"in e&&(s=e.format),(n=P(r.Style,(function(t,r,n){return"style"in e?t.Title==e.style:t.isDefault})))<0&&(n=0);var u=r.Style[n].Identifier,l={};"Dimension"in r&&r.Dimension.forEach((function(t,e,r){var n=t.Identifier,i=t.Default;void 0===i&&(i=t.Value[0]),l[n]=i}));var h,c=C(t.Contents.TileMatrixSet,(function(t,e,r){return t.Identifier==o})),p=c.SupportedCRS;if(p&&(h=We(p.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||We(p)),"projection"in e){var f=We(e.projection);f&&(h&&!Qe(f,h)||(h=f))}var d=c.TileMatrix[0],_=28e-5*d.ScaleDenominator,g=h===We("EPSG:4326")?[d.TopLeftCorner[1],d.TopLeftCorner[0]]:d.TopLeftCorner,y=d.TileWidth*_,v=d.TileHeight*_,m=[g[0],g[1]-v*d.MatrixHeight,g[0]+y*d.MatrixWidth,g[1]];null===h.getExtent()&&h.setExtent(m);var x=Nl(c,m,a),S=[],E=e.requestEncoding;if(E=void 0!==E?E:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var T=t.OperationsMetadata.GetTile.DCP.HTTP.Get,b=0,R=T.length;b<R;++b)if(T[b].Constraint){var O=C(T[b].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===E&&(E=O[0]),E!==lf)break;w(O,lf)&&S.push(T[b].href)}else T[b].href&&(E=lf,S.push(T[b].href));return 0===S.length&&(E=hf,r.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(s=t.format,S.push(t.template))}))),{urls:S,layer:e.layer,matrixSet:o,format:s,projection:h,requestEncoding:E,tileGrid:x,style:u,dimensions:l,wrapX:!1,crossOrigin:e.crossOrigin}},zE.source.XYZ=Hh,zE.source.Zoomify=_c,zE.sphere.getArea=function t(e,r){var n=r||{},i=n.radius||6371008.8,o=n.projection||"EPSG:3857",a=e.getType();a!==ae.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var s,u,l,h,c,p,f=0;switch(a){case ae.POINT:case ae.MULTI_POINT:case ae.LINE_STRING:case ae.MULTI_LINE_STRING:case ae.LINEAR_RING:break;case ae.POLYGON:for(s=e.getCoordinates(),f=Math.abs(xe(s[0],i)),l=1,h=s.length;l<h;++l)f-=Math.abs(xe(s[l],i));break;case ae.MULTI_POLYGON:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)for(u=s[l],f+=Math.abs(xe(u[0],i)),c=1,p=u.length;c<p;++c)f-=Math.abs(xe(u[c],i));break;case ae.GEOMETRY_COLLECTION:var d=e.getGeometries();for(l=0,h=d.length;l<h;++l)f+=t(d[l],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},zE.sphere.getDistance=ve,zE.sphere.getLength=function t(e,r){var n=r||{},i=n.radius||6371008.8,o=n.projection||"EPSG:3857",a=e.getType();a!==ae.GEOMETRY_COLLECTION&&(e=e.clone().transform(o,"EPSG:4326"));var s,u,l,h,c,p,f=0;switch(a){case ae.POINT:case ae.MULTI_POINT:break;case ae.LINE_STRING:case ae.LINEAR_RING:f=me(s=e.getCoordinates(),i);break;case ae.MULTI_LINE_STRING:case ae.POLYGON:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)f+=me(s[l],i);break;case ae.MULTI_POLYGON:for(l=0,h=(s=e.getCoordinates()).length;l<h;++l)for(c=0,p=(u=s[l]).length;c<p;++c)f+=me(u[c],i);break;case ae.GEOMETRY_COLLECTION:var d=e.getGeometries();for(l=0,h=d.length;l<h;++l)f+=t(d[l],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},zE.style.Circle=Ul,zE.style.Fill=zl,zE.style.Icon=rh,zE.style.IconImageCache.shared=ss,zE.style.Image=Gl,zE.style.RegularShape=Dl,zE.style.Stroke=nh,zE.style.Style=lh,zE.style.Text=ph,zE.tilegrid.TileGrid=Au,zE.tilegrid.WMTS=Al,zE.tilegrid.WMTS.createFromCapabilitiesMatrixSet=Nl,zE.tilegrid.createXYZ=Gu,zE.transform.composeCssTransform=function(t,e,r,n,i,o,a){return xr(vr([1,0,0,1,0,0],t,e,r,n,i,o,a))},zE.util.getUid=o,zE.webgl.ARRAY_BUFFER=34962,zE.webgl.Buffer=dl,zE.webgl.DYNAMIC_DRAW=35048,zE.webgl.ELEMENT_ARRAY_BUFFER=34963,zE.webgl.Helper=Ol,zE.webgl.Helper.computeAttributesStride=Pl,zE.webgl.PostProcessingPass=vl,zE.webgl.RenderTarget=Ll,zE.webgl.STATIC_DRAW=35044,zE.webgl.STREAM_DRAW=35040,zE.xml.getAllTextContent=Xu,zE.xml.parse=Zu,zE.xml.registerDocument=function(t){hl=t},zE.xml.registerXMLSerializer=function(t){ll=t};e.default=zE}]).default}));
|
||
//# sourceMappingURL=ol.js.map
|