gridtracker/package.nw/lib/ol.js

5 wiersze
928 KiB
JavaScript

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/* eslint-disable */
/*! For license information please see ol.js.LICENSE.txt */
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ol=n():t.ol=n()}(self,(function(){return function(){var t,n={226:function(t,n){n.read=function(t,n,i,r,e){var o,s,u=8*e-r-1,a=(1<<u)-1,h=a>>1,f=-7,c=i?e-1:0,l=i?-1:1,v=t[n+c];for(c+=l,o=v&(1<<-f)-1,v>>=-f,f+=u;f>0;o=256*o+t[n+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[n+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===a)return s?NaN:1/0*(v?-1:1);s+=Math.pow(2,r),o-=h}return(v?-1:1)*s*Math.pow(2,o-r)},n.write=function(t,n,i,r,e,o){var s,u,a,h=8*o-e-1,f=(1<<h)-1,c=f>>1,l=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,v=r?0:o-1,d=r?1:-1,p=n<0||0===n&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(u=isNaN(n)?1:0,s=f):(s=Math.floor(Math.log(n)/Math.LN2),n*(a=Math.pow(2,-s))<1&&(s--,a*=2),(n+=s+c>=1?l/a:l*Math.pow(2,1-c))*a>=2&&(s++,a/=2),s+c>=f?(u=0,s=f):s+c>=1?(u=(n*a-1)*Math.pow(2,e),s+=c):(u=n*Math.pow(2,c-1)*Math.pow(2,e),s=0));e>=8;t[i+v]=255&u,v+=d,u/=256,e-=8);for(s=s<<e|u,h+=e;h>0;t[i+v]=255&s,v+=d,s/=256,h-=8);t[i+v-d]|=128*p}},875:function(t,n,i){"use strict";const r=i(692),e=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),u=Symbol("allowStale"),a=Symbol("maxAge"),h=Symbol("dispose"),f=Symbol("noDisposeOnSet"),c=Symbol("lruList"),l=Symbol("cache"),v=Symbol("updateAgeOnGet"),d=()=>1;const p=(t,n,i)=>{const r=t[l].get(n);if(r){const n=r.value;if(y(t,n)){if(w(t,r),!t[u])return}else i&&(t[v]&&(r.value.now=Date.now()),t[c].unshiftNode(r));return n.value}},y=(t,n)=>{if(!n||!n.maxAge&&!t[a])return!1;const i=Date.now()-n.now;return n.maxAge?i>n.maxAge:t[a]&&i>t[a]},m=t=>{if(t[o]>t[e])for(let n=t[c].tail;t[o]>t[e]&&null!==n;){const i=n.prev;w(t,n),n=i}},w=(t,n)=>{if(n){const i=n.value;t[h]&&t[h](i.key,i.value),t[o]-=i.length,t[l].delete(i.key),t[c].removeNode(n)}};class g{constructor(t,n,i,r,e){this.key=t,this.value=n,this.length=i,this.now=r,this.maxAge=e||0}}const b=(t,n,i,r)=>{let e=i.value;y(t,e)&&(w(t,i),t[u]||(e=void 0)),e&&n.call(r,e.value,e.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[e]=t.max||1/0;const n=t.length||d;if(this[s]="function"!=typeof n?d:n,this[u]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[a]=t.maxAge||0,this[h]=t.dispose,this[f]=t.noDisposeOnSet||!1,this[v]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[e]=t||1/0,m(this)}get max(){return this[e]}set allowStale(t){this[u]=!!t}get allowStale(){return this[u]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[a]=t,m(this)}get maxAge(){return this[a]}set lengthCalculator(t){"function"!=typeof t&&(t=d),t!==this[s]&&(this[s]=t,this[o]=0,this[c].forEach((t=>{t.length=this[s](t.value,t.key),this[o]+=t.length}))),m(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[c].length}rforEach(t,n){n=n||this;for(let i=this[c].tail;null!==i;){const r=i.prev;b(this,t,i,n),i=r}}forEach(t,n){n=n||this;for(let i=this[c].head;null!==i;){const r=i.next;b(this,t,i,n),i=r}}keys(){return this[c].toArray().map((t=>t.key))}values(){return this[c].toArray().map((t=>t.value))}reset(){this[h]&&this[c]&&this[c].length&&this[c].forEach((t=>this[h](t.key,t.value))),this[l]=new Map,this[c]=new r,this[o]=0}dump(){return this[c].map((t=>!y(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[c]}set(t,n,i){if((i=i||this[a])&&"number"!=typeof i)throw new TypeError("maxAge must be a number");const r=i?Date.now():0,u=this[s](n,t);if(this[l].has(t)){if(u>this[e])return w(this,this[l].get(t)),!1;const s=this[l].get(t).value;return this[h]&&(this[f]||this[h](t,s.value)),s.now=r,s.maxAge=i,s.value=n,this[o]+=u-s.length,s.length=u,this.get(t),m(this),!0}const v=new g(t,n,u,r,i);return v.length>this[e]?(this[h]&&this[h](t,n),!1):(this[o]+=v.length,this[c].unshift(v),this[l].set(t,this[c].head),m(this),!0)}has(t){if(!this[l].has(t))return!1;const n=this[l].get(t).value;return!y(this,n)}get(t){return p(this,t,!0)}peek(t){return p(this,t,!1)}pop(){const t=this[c].tail;return t?(w(this,t),t.value):null}del(t){w(this,this[l].get(t))}load(t){this.reset();const n=Date.now();for(let i=t.length-1;i>=0;i--){const r=t[i],e=r.e||0;if(0===e)this.set(r.k,r.v);else{const t=e-n;t>0&&this.set(r.k,r.v,t)}}}prune(){this[l].forEach(((t,n)=>p(this,n,!1)))}}},98:function(t,n,i){"use strict";t.exports=e;var r=i(226);function e(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var o=4294967296,s=1/o,u="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===e.Bytes?t.readVarint()+t.pos:t.pos+1}function h(t,n,i){return i?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function f(t,n,i){var r=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));i.realloc(r);for(var e=i.pos-1;e>=t;e--)i.buf[e+r]=i.buf[e]}function c(t,n){for(var i=0;i<t.length;i++)n.writeVarint(t[i])}function l(t,n){for(var i=0;i<t.length;i++)n.writeSVarint(t[i])}function v(t,n){for(var i=0;i<t.length;i++)n.writeFloat(t[i])}function d(t,n){for(var i=0;i<t.length;i++)n.writeDouble(t[i])}function p(t,n){for(var i=0;i<t.length;i++)n.writeBoolean(t[i])}function y(t,n){for(var i=0;i<t.length;i++)n.writeFixed32(t[i])}function m(t,n){for(var i=0;i<t.length;i++)n.writeSFixed32(t[i])}function w(t,n){for(var i=0;i<t.length;i++)n.writeFixed64(t[i])}function g(t,n){for(var i=0;i<t.length;i++)n.writeSFixed64(t[i])}function b(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function x(t,n,i){t[i]=n,t[i+1]=n>>>8,t[i+2]=n>>>16,t[i+3]=n>>>24}function M(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}e.prototype={destroy:function(){this.buf=null},readFields:function(t,n,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),e=r>>3,o=this.pos;this.type=7&r,t(e,n,this),this.pos===o&&this.skip(r)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=M(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=b(this.buf,this.pos)+b(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=b(this.buf,this.pos)+M(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,i,r=this.buf;return n=127&(i=r[this.pos++]),i<128?n:(n|=(127&(i=r[this.pos++]))<<7,i<128?n:(n|=(127&(i=r[this.pos++]))<<14,i<128?n:(n|=(127&(i=r[this.pos++]))<<21,i<128?n:function(t,n,i){var r,e,o=i.buf;if(e=o[i.pos++],r=(112&e)>>4,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<3,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<10,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<17,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(127&e)<<24,e<128)return h(t,r,n);if(e=o[i.pos++],r|=(1&e)<<31,e<128)return h(t,r,n);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(i=r[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,n=this.pos;return this.pos=t,t-n>=12&&u?function(t,n,i){return u.decode(t.subarray(n,i))}(this.buf,n,t):function(t,n,i){var r="",e=n;for(;e<i;){var o,s,u,a=t[e],h=null,f=a>239?4:a>223?3:a>191?2:1;if(e+f>i)break;1===f?a<128&&(h=a):2===f?128==(192&(o=t[e+1]))&&(h=(31&a)<<6|63&o)<=127&&(h=null):3===f?(o=t[e+1],s=t[e+2],128==(192&o)&&128==(192&s)&&((h=(15&a)<<12|(63&o)<<6|63&s)<=2047||h>=55296&&h<=57343)&&(h=null)):4===f&&(o=t[e+1],s=t[e+2],u=t[e+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&((h=(15&a)<<18|(63&o)<<12|(63&s)<<6|63&u)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,f=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),e+=f}return r}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==e.Bytes)return t.push(this.readVarint(n));var i=a(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==e.Bytes)return t.push(this.readSVarint());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==e.Bytes)return t.push(this.readBoolean());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==e.Bytes)return t.push(this.readFloat());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==e.Bytes)return t.push(this.readDouble());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed32());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed32());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readFixed64());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==e.Bytes)return t.push(this.readSFixed64());var n=a(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===e.Varint)for(;this.buf[this.pos++]>127;);else if(n===e.Bytes)this.pos=this.readVarint()+this.pos;else if(n===e.Fixed32)this.pos+=4;else{if(n!==e.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n<this.pos+t;)n*=2;if(n!==this.length){var i=new Uint8Array(n);i.set(this.buf),this.buf=i,this.length=n}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),x(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),x(this.buf,-1&t,this.pos),x(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,n){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(t,n,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,n),function(t,n){var i=(7&t)<<4;if(n.buf[n.pos++]|=i|((t>>>=3)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(n.buf[n.pos++]=127&t|((t>>>=7)?128:0),!t)return;n.buf[n.pos++]=127&t}(r,n)}(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 n=this.pos;this.pos=function(t,n,i){for(var r,e,o=0;o<n.length;o++){if((r=n.charCodeAt(o))>55295&&r<57344){if(!e){r>56319||o+1===n.length?(t[i++]=239,t[i++]=191,t[i++]=189):e=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(t[i++]=239,t[i++]=191,t[i++]=189,e=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-n;i>=128&&f(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var i=0;i<n;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,n){this.pos++;var i=this.pos;t(n,this);var r=this.pos-i;r>=128&&f(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,n,i){this.writeTag(t,e.Bytes),this.writeRawMessage(n,i)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,c,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,l,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,p,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,v,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,d,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,y,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,m,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,w,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,g,n)},writeBytesField:function(t,n){this.writeTag(t,e.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,e.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,e.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,e.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,e.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,e.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,e.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}}},72:function(t){t.exports=function(){"use strict";function t(t,r,e,o,s){!function t(i,r,e,o,s){for(;o>e;){if(o-e>600){var u=o-e+1,a=r-e+1,h=Math.log(u),f=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*f*(u-f)/u)*(a-u/2<0?-1:1);t(i,r,Math.max(e,Math.floor(r-a*f/u+c)),Math.min(o,Math.floor(r+(u-a)*f/u+c)),s)}var l=i[r],v=e,d=o;for(n(i,e,r),s(i[o],l)>0&&n(i,e,o);v<d;){for(n(i,v,d),v++,d--;s(i[v],l)<0;)v++;for(;s(i[d],l)>0;)d--}0===s(i[e],l)?n(i,e,d):n(i,++d,o),d<=r&&(e=d+1),r<=d&&(o=d-1)}}(t,r,e||0,o||t.length-1,s||i)}function n(t,n,i){var r=t[n];t[n]=t[i],t[i]=r}function i(t,n){return t<n?-1:t>n?1:0}var r=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 e(t,n,i){if(!i)return n.indexOf(t);for(var r=0;r<n.length;r++)if(i(t,n[r]))return r;return-1}function o(t,n){s(t,0,t.children.length,n,t)}function s(t,n,i,r,e){e||(e=d(null)),e.minX=1/0,e.minY=1/0,e.maxX=-1/0,e.maxY=-1/0;for(var o=n;o<i;o++){var s=t.children[o];u(e,t.leaf?r(s):s)}return e}function u(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function a(t,n){return t.minX-n.minX}function h(t,n){return t.minY-n.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function v(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.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 p(n,i,r,e,o){for(var s=[i,r];s.length;)if(!((r=s.pop())-(i=s.pop())<=e)){var u=i+Math.ceil((r-i)/e/2)*e;t(n,u,i,r,o),s.push(i,u,u,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var n=this.data,i=[];if(!v(t,n))return i;for(var r=this.toBBox,e=[];n;){for(var o=0;o<n.children.length;o++){var s=n.children[o],u=n.leaf?r(s):s;v(t,u)&&(n.leaf?i.push(s):l(t,u)?this._all(s,i):e.push(s))}n=e.pop()}return i},r.prototype.collides=function(t){var n=this.data;if(!v(t,n))return!1;for(var i=[];n;){for(var r=0;r<n.children.length;r++){var e=n.children[r],o=n.leaf?this.toBBox(e):e;if(v(t,o)){if(n.leaf||l(t,o))return!0;i.push(e)}}n=i.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var n=0;n<t.length;n++)this.insert(t[n]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=d([]),this},r.prototype.remove=function(t,n){if(!t)return this;for(var i,r,o,s=this.data,u=this.toBBox(t),a=[],h=[];s||a.length;){if(s||(s=a.pop(),r=a[a.length-1],i=h.pop(),o=!0),s.leaf){var f=e(t,s.children,n);if(-1!==f)return s.children.splice(f,1),a.push(s),this._condense(a),this}o||s.leaf||!l(s,u)?r?(i++,s=r.children[i],o=!1):s=null:(a.push(s),h.push(i),i=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,n){return t.minX-n.minX},r.prototype.compareMinY=function(t,n){return t.minY-n.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,n){for(var i=[];t;)t.leaf?n.push.apply(n,t.children):i.push.apply(i,t.children),t=i.pop();return n},r.prototype._build=function(t,n,i,r){var e,s=i-n+1,u=this._maxEntries;if(s<=u)return o(e=d(t.slice(n,i+1)),this.toBBox),e;r||(r=Math.ceil(Math.log(s)/Math.log(u)),u=Math.ceil(s/Math.pow(u,r-1))),(e=d([])).leaf=!1,e.height=r;var a=Math.ceil(s/u),h=a*Math.ceil(Math.sqrt(u));p(t,n,i,h,this.compareMinX);for(var f=n;f<=i;f+=h){var c=Math.min(f+h-1,i);p(t,f,c,a,this.compareMinY);for(var l=f;l<=c;l+=a){var v=Math.min(l+a-1,c);e.children.push(this._build(t,l,v,r-1))}}return o(e,this.toBBox),e},r.prototype._chooseSubtree=function(t,n,i,r){for(;r.push(n),!n.leaf&&r.length-1!==i;){for(var e=1/0,o=1/0,s=void 0,u=0;u<n.children.length;u++){var a=n.children[u],h=f(a),c=(l=t,v=a,(Math.max(v.maxX,l.maxX)-Math.min(v.minX,l.minX))*(Math.max(v.maxY,l.maxY)-Math.min(v.minY,l.minY))-h);c<o?(o=c,e=h<e?h:e,s=a):c===o&&h<e&&(e=h,s=a)}n=s||n.children[0]}var l,v;return n},r.prototype._insert=function(t,n,i){var r=i?t:this.toBBox(t),e=[],o=this._chooseSubtree(r,this.data,n,e);for(o.children.push(t),u(o,r);n>=0&&e[n].children.length>this._maxEntries;)this._split(e,n),n--;this._adjustParentBBoxes(r,e,n)},r.prototype._split=function(t,n){var i=t[n],r=i.children.length,e=this._minEntries;this._chooseSplitAxis(i,e,r);var s=this._chooseSplitIndex(i,e,r),u=d(i.children.splice(s,i.children.length-s));u.height=i.height,u.leaf=i.leaf,o(i,this.toBBox),o(u,this.toBBox),n?t[n-1].children.push(u):this._splitRoot(i,u)},r.prototype._splitRoot=function(t,n){this.data=d([t,n]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,n,i){for(var r,e,o,u,a,h,c,l=1/0,v=1/0,d=n;d<=i-n;d++){var p=s(t,0,d,this.toBBox),y=s(t,d,i,this.toBBox),m=(e=p,o=y,u=void 0,a=void 0,h=void 0,c=void 0,u=Math.max(e.minX,o.minX),a=Math.max(e.minY,o.minY),h=Math.min(e.maxX,o.maxX),c=Math.min(e.maxY,o.maxY),Math.max(0,h-u)*Math.max(0,c-a)),w=f(p)+f(y);m<l?(l=m,r=d,v=w<v?w:v):m===l&&w<v&&(v=w,r=d)}return r||i-n},r.prototype._chooseSplitAxis=function(t,n,i){var r=t.leaf?this.compareMinX:a,e=t.leaf?this.compareMinY:h;this._allDistMargin(t,n,i,r)<this._allDistMargin(t,n,i,e)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,n,i,r){t.children.sort(r);for(var e=this.toBBox,o=s(t,0,n,e),a=s(t,i-n,i,e),h=c(o)+c(a),f=n;f<i-n;f++){var l=t.children[f];u(o,t.leaf?e(l):l),h+=c(o)}for(var v=i-n-1;v>=n;v--){var d=t.children[v];u(a,t.leaf?e(d):d),h+=c(a)}return h},r.prototype._adjustParentBBoxes=function(t,n,i){for(var r=i;r>=0;r--)u(n[r],t)},r.prototype._condense=function(t){for(var n=t.length-1,i=void 0;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children).splice(i.indexOf(t[n]),1):this.clear():o(t[n],this.toBBox)},r}()},760:function(t){var n=function(t){"use strict";var n,i=Object.prototype,r=i.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",s=e.asyncIterator||"@@asyncIterator",u=e.toStringTag||"@@toStringTag";function a(t,n,i){return Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{a({},"")}catch(t){a=function(t,n,i){return t[n]=i}}function h(t,n,i,r){var e=n&&n.prototype instanceof y?n:y,o=Object.create(e.prototype),s=new T(r||[]);return o._invoke=function(t,n,i){var r=c;return function(e,o){if(r===v)throw new Error("Generator is already running");if(r===d){if("throw"===e)throw o;return P()}for(i.method=e,i.arg=o;;){var s=i.delegate;if(s){var u=O(s,i);if(u){if(u===p)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===c)throw r=d,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=v;var a=f(t,n,i);if("normal"===a.type){if(r=i.done?d:l,a.arg===p)continue;return{value:a.arg,done:i.done}}"throw"===a.type&&(r=d,i.method="throw",i.arg=a.arg)}}}(t,i,s),o}function f(t,n,i){try{return{type:"normal",arg:t.call(n,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var c="suspendedStart",l="suspendedYield",v="executing",d="completed",p={};function y(){}function m(){}function w(){}var g={};a(g,o,(function(){return this}));var b=Object.getPrototypeOf,x=b&&b(b(A([])));x&&x!==i&&r.call(x,o)&&(g=x);var M=w.prototype=y.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(n){a(t,n,(function(t){return this._invoke(n,t)}))}))}function S(t,n){function i(e,o,s,u){var a=f(t[e],t,o);if("throw"!==a.type){var h=a.arg,c=h.value;return c&&"object"==typeof c&&r.call(c,"__await")?n.resolve(c.__await).then((function(t){i("next",t,s,u)}),(function(t){i("throw",t,s,u)})):n.resolve(c).then((function(t){h.value=t,s(h)}),(function(t){return i("throw",t,s,u)}))}u(a.arg)}var e;this._invoke=function(t,r){function o(){return new n((function(n,e){i(t,r,n,e)}))}return e=e?e.then(o,o):o()}}function O(t,i){var r=t.iterator[i.method];if(r===n){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=n,O(t,i),"throw"===i.method))return p;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var e=f(r,t.iterator,i.arg);if("throw"===e.type)return i.method="throw",i.arg=e.arg,i.delegate=null,p;var o=e.arg;return o?o.done?(i[t.resultName]=o.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=n),i.delegate=null,p):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,p)}function j(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function E(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function A(t){if(t){var i=t[o];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,s=function i(){for(;++e<t.length;)if(r.call(t,e))return i.value=t[e],i.done=!1,i;return i.value=n,i.done=!0,i};return s.next=s}}return{next:P}}function P(){return{value:n,done:!0}}return m.prototype=w,a(M,"constructor",w),a(w,"constructor",m),m.displayName=a(w,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===m||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,a(t,u,"GeneratorFunction")),t.prototype=Object.create(M),t},t.awrap=function(t){return{__await:t}},_(S.prototype),a(S.prototype,s,(function(){return this})),t.AsyncIterator=S,t.async=function(n,i,r,e,o){void 0===o&&(o=Promise);var s=new S(h(n,i,r,e),o);return t.isGeneratorFunction(i)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(M),a(M,u,"Generator"),a(M,o,(function(){return this})),a(M,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=[];for(var i in t)n.push(i);return n.reverse(),function i(){for(;n.length;){var r=n.pop();if(r in t)return i.value=r,i.done=!1,i}return i.done=!0,i}},t.values=A,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!t)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function e(r,e){return u.type="throw",u.arg=t,i.next=r,e&&(i.method="next",i.arg=n),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],u=s.completion;if("root"===s.tryLoc)return e("end");if(s.tryLoc<=this.prev){var a=r.call(s,"catchLoc"),h=r.call(s,"finallyLoc");if(a&&h){if(this.prev<s.catchLoc)return e(s.catchLoc,!0);if(this.prev<s.finallyLoc)return e(s.finallyLoc)}else if(a){if(this.prev<s.catchLoc)return e(s.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return e(s.finallyLoc)}}}},abrupt:function(t,n){for(var i=this.tryEntries.length-1;i>=0;--i){var e=this.tryEntries[i];if(e.tryLoc<=this.prev&&r.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var o=e;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=n,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(s)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),p},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),E(i),p}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var e=r.arg;E(i)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,r){return this.delegate={iterator:A(t),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=n),p}},t}(t.exports);try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},617:function(t,n,i){const r=i(279);t.exports=function(t,n,i){const e=i&&i.debug||!1,o=i&&i.startIndex||0;e&&console.log("starting findTagByName with",n," and ",i);const s=r(t,`<${n}[ >]`,o);if(e&&console.log("start:",s),-1===s)return;const u=t.slice(s+n.length);let a=r(u,"[ /]"+n+">",0);const h=-1===a;h&&(a=r(u,"[ /]>",0));const f=s+n.length+a+1+(h?0:n.length)+1;if(e&&console.log("end:",f),-1===f)return;const c=t.slice(s,f);let l;return l=h?null:c.slice(c.indexOf(">")+1,c.lastIndexOf("<")),{inner:l,outer:c,start:s,end:f}}},51:function(t,n,i){const r=i(617);t.exports=function(t,n,i){const e=[],o=i&&i.debug||!1;let s,u=i&&i.startIndex||0;for(;s=r(t,n,{debug:o,startIndex:u});)u=s.end,e.push(s);return o&&console.log("findTagsByName found",e.length,"tags"),e}},802:function(t){t.exports=function(t,n,i){const r=i&&i.debug||!1;r&&console.log("getting "+n+" in "+t);const e="object"==typeof t?t.outer:t,o=`${n}\\="([^"]*)"`;r&&console.log("pattern:",o);const s=new RegExp(o).exec(e);if(r&&console.log("match:",s),s)return s[1]}},279:function(t){t.exports=function(t,n,i){const r=new RegExp(n).exec(t.slice(i));return r?i+r.index:-1}},518:function(t){"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},692:function(t,n,i){"use strict";function r(t){var n=this;if(n instanceof r||(n=new r),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){n.push(t)}));else if(arguments.length>0)for(var i=0,e=arguments.length;i<e;i++)n.push(arguments[i]);return n}function e(t,n,i){var r=n===t.head?new u(i,null,n,t):new u(i,n,n.next,t);return null===r.next&&(t.tail=r),null===r.prev&&(t.head=r),t.length++,r}function o(t,n){t.tail=new u(n,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function s(t,n){t.head=new u(n,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function u(t,n,i,r){if(!(this instanceof u))return new u(t,n,i,r);this.list=r,this.value=t,n?(n.next=this,this.prev=n):this.prev=null,i?(i.prev=this,this.next=i):this.next=null}t.exports=r,r.Node=u,r.create=r,r.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var n=t.next,i=t.prev;return n&&(n.prev=i),i&&(i.next=n),t===this.head&&(this.head=n),t===this.tail&&(this.tail=i),t.list.length--,t.next=null,t.prev=null,t.list=null,n},r.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var n=this.head;t.list=this,t.next=n,n&&(n.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},r.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var n=this.tail;t.list=this,t.prev=n,n&&(n.next=t),this.tail=t,this.head||(this.head=t),this.length++}},r.prototype.push=function(){for(var t=0,n=arguments.length;t<n;t++)o(this,arguments[t]);return this.length},r.prototype.unshift=function(){for(var t=0,n=arguments.length;t<n;t++)s(this,arguments[t]);return this.length},r.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},r.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},r.prototype.forEach=function(t,n){n=n||this;for(var i=this.head,r=0;null!==i;r++)t.call(n,i.value,r,this),i=i.next},r.prototype.forEachReverse=function(t,n){n=n||this;for(var i=this.tail,r=this.length-1;null!==i;r--)t.call(n,i.value,r,this),i=i.prev},r.prototype.get=function(t){for(var n=0,i=this.head;null!==i&&n<t;n++)i=i.next;if(n===t&&null!==i)return i.value},r.prototype.getReverse=function(t){for(var n=0,i=this.tail;null!==i&&n<t;n++)i=i.prev;if(n===t&&null!==i)return i.value},r.prototype.map=function(t,n){n=n||this;for(var i=new r,e=this.head;null!==e;)i.push(t.call(n,e.value,this)),e=e.next;return i},r.prototype.mapReverse=function(t,n){n=n||this;for(var i=new r,e=this.tail;null!==e;)i.push(t.call(n,e.value,this)),e=e.prev;return i},r.prototype.reduce=function(t,n){var i,r=this.head;if(arguments.length>1)i=n;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,i=this.head.value}for(var e=0;null!==r;e++)i=t(i,r.value,e),r=r.next;return i},r.prototype.reduceReverse=function(t,n){var i,r=this.tail;if(arguments.length>1)i=n;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,i=this.tail.value}for(var e=this.length-1;null!==r;e--)i=t(i,r.value,e),r=r.prev;return i},r.prototype.toArray=function(){for(var t=new Array(this.length),n=0,i=this.head;null!==i;n++)t[n]=i.value,i=i.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),n=0,i=this.tail;null!==i;n++)t[n]=i.value,i=i.prev;return t},r.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var i=new r;if(n<t||n<0)return i;t<0&&(t=0),n>this.length&&(n=this.length);for(var e=0,o=this.head;null!==o&&e<t;e++)o=o.next;for(;null!==o&&e<n;e++,o=o.next)i.push(o.value);return i},r.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var i=new r;if(n<t||n<0)return i;t<0&&(t=0),n>this.length&&(n=this.length);for(var e=this.length,o=this.tail;null!==o&&e>n;e--)o=o.prev;for(;null!==o&&e>t;e--,o=o.prev)i.push(o.value);return i},r.prototype.splice=function(t,n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,r=this.head;null!==r&&i<t;i++)r=r.next;var o=[];for(i=0;r&&i<n;i++)o.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(i=0;i<(arguments.length<=2?0:arguments.length-2);i++)r=e(this,r,i+2<2||arguments.length<=i+2?void 0:arguments[i+2]);return o},r.prototype.reverse=function(){for(var t=this.head,n=this.tail,i=t;null!==i;i=i.prev){var r=i.prev;i.prev=i.next,i.next=r}return this.head=n,this.tail=t,this};try{i(518)(r)}catch(t){}},752:function(){},640:function(){},630:function(){},429:function(t,n,i){"use strict";function r(){return function(){throw new Error("Unimplemented abstract method.")}()}i.d(n,{default:function(){return TI}});var e=0;function o(t){return t.ol_uid||(t.ol_uid=String(++e))}var s,u="6.15.1",a=(s=function(t,n){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}s(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),h=function(t){function n(n){var i=this,r="Assertion failed. See https://openlayers.org/en/"+("v"+u.split("-")[0])+"/doc/errors/#"+n+" for details.";return(i=t.call(this,r)||this).code=n,i.name="AssertionError",i.message=r,i}return a(n,t),n}(Error);function f(t){t.stopPropagation()}var c=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),l="propertychange",v=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function d(t,n,i){for(var r,e,o=i||p,s=0,u=t.length,a=!1;s<u;)(e=+o(t[r=s+(u-s>>1)],n))<0?s=r+1:(u=r,a=!e);return a?s:~s}function p(t,n){return t>n?1:t<n?-1:0}function y(t,n){return t.indexOf(n)>=0}function m(t,n,i){var r=t.length;if(t[0]<=n)return 0;if(n<=t[r-1])return r-1;var e=void 0;if(i>0){for(e=1;e<r;++e)if(t[e]<n)return e-1}else if(i<0){for(e=1;e<r;++e)if(t[e]<=n)return e}else for(e=1;e<r;++e){if(t[e]==n)return e;if(t[e]<n)return"function"==typeof i?i(n,t[e-1],t[e])>0?e-1:e:t[e-1]-n<n-t[e]?e-1:e}return r-1}function w(t,n,i){for(;n<i;){var r=t[n];t[n]=t[i],t[i]=r,++n,--i}}function g(t,n){for(var i=Array.isArray(n)?n:[n],r=i.length,e=0;e<r;e++)t[t.length]=i[e]}function b(t,n){for(var i,r=t.length>>>0,e=0;e<r;e++)if(n(i=t[e],e,t))return i;return null}function x(t,n){var i=t.length;if(i!==n.length)return!1;for(var r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0}function M(t,n){var i;return!t.every((function(r,e){return i=e,!n(r,e,t)}))?i:-1}function _(t,n,i){var r=n||p;return t.every((function(n,e){if(0===e)return!0;var o=r(t[e-1],n);return!(o>0||i&&0===o)}))}function S(){return!0}function O(){return!1}function j(){}function E(t){var n,i,r,e=!1;return function(){var o=Array.prototype.slice.call(arguments);return e&&this===r&&x(o,i)||(e=!0,r=this,i=o,n=t.apply(this,arguments)),n}}function T(t){return function(){var n;try{n=t()}catch(t){return Promise.reject(t)}return n instanceof Promise?n:Promise.resolve(n)}()}var A="function"==typeof Object.assign?Object.assign:function(t,n){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1,e=arguments.length;r<e;++r){var o=arguments[r];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(i[s]=o[s])}return i};function P(t){for(var n in t)delete t[n]}var C="function"==typeof Object.values?Object.values:function(t){var n=[];for(var i in t)n.push(t[i]);return n};function k(t){var n;for(n in t)return!1;return!n}var I=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),N=function(t){function n(n){var i=t.call(this)||this;return i.t=n,i._=null,i.S=null,i.O=null,i}return I(n,t),n.prototype.addEventListener=function(t,n){if(t&&n){var i=this.O||(this.O={}),r=i[t]||(i[t]=[]);-1===r.indexOf(n)&&r.push(n)}},n.prototype.dispatchEvent=function(t){var n="string"==typeof t,i=n?t:t.type,r=this.O&&this.O[i];if(r){var e=n?new c(t):t;e.target||(e.target=this.t||this);var o,s=this.S||(this.S={}),u=this._||(this._={});i in s||(s[i]=0,u[i]=0),++s[i];for(var a=0,h=r.length;a<h;++a)if(!1===(o="handleEvent"in r[a]?r[a].handleEvent(e):r[a].call(this,e))||e.propagationStopped){o=!1;break}if(0==--s[i]){var f=u[i];for(delete u[i];f--;)this.removeEventListener(i,j);delete s[i]}return o}},n.prototype.disposeInternal=function(){this.O&&P(this.O)},n.prototype.getListeners=function(t){return this.O&&this.O[t]||void 0},n.prototype.hasListener=function(t){return!!this.O&&(t?t in this.O:Object.keys(this.O).length>0)},n.prototype.removeEventListener=function(t,n){var i=this.O&&this.O[t];if(i){var r=i.indexOf(n);-1!==r&&(this._&&t in this._?(i[r]=j,++this._[t]):(i.splice(r,1),0===i.length&&delete this.O[t]))}},n}(v),L="change",z="error",R="contextmenu",F="click",G="dblclick",D="dragenter",q="dragover",U="drop",B="keydown",X="keypress",V="load",W="resize",Y="touchmove",Z="wheel";function $(t,n,i,r,e){if(r&&r!==t&&(i=i.bind(r)),e){var o=i;i=function(){t.removeEventListener(n,i),o.apply(this,arguments)}}var s={target:t,type:n,listener:i};return t.addEventListener(n,i),s}function K(t,n,i,r){return $(t,n,i,r,!0)}function H(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),P(t))}var J=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Q=function(t){function n(){var n=t.call(this)||this;return n.on=n.onInternal,n.once=n.onceInternal,n.un=n.unInternal,n.T=0,n}return J(n,t),n.prototype.changed=function(){++this.T,this.dispatchEvent(L)},n.prototype.getRevision=function(){return this.T},n.prototype.onInternal=function(t,n){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),e=0;e<i;++e)r[e]=$(this,t[e],n);return r}return $(this,t,n)},n.prototype.onceInternal=function(t,n){var i;if(Array.isArray(t)){var r=t.length;i=new Array(r);for(var e=0;e<r;++e)i[e]=K(this,t[e],n)}else i=K(this,t,n);return n.ol_key=i,i},n.prototype.unInternal=function(t,n){var i=n.ol_key;if(i)tt(i);else if(Array.isArray(t))for(var r=0,e=t.length;r<e;++r)this.removeEventListener(t[r],n);else this.removeEventListener(t,n)},n}(N);function tt(t){if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)H(t[n]);else H(t)}Q.prototype.on,Q.prototype.once,Q.prototype.un;var nt=Q,it=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rt=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.key=i,e.oldValue=r,e}return it(n,t),n}(c),et=function(t){function n(n){var i=t.call(this)||this;return i.on,i.once,i.un,o(i),i.A=null,void 0!==n&&i.setProperties(n),i}return it(n,t),n.prototype.get=function(t){var n;return this.A&&this.A.hasOwnProperty(t)&&(n=this.A[t]),n},n.prototype.getKeys=function(){return this.A&&Object.keys(this.A)||[]},n.prototype.getProperties=function(){return this.A&&A({},this.A)||{}},n.prototype.hasProperties=function(){return!!this.A},n.prototype.notify=function(t,n){var i;i="change:".concat(t),this.hasListener(i)&&this.dispatchEvent(new rt(i,t,n)),i=l,this.hasListener(i)&&this.dispatchEvent(new rt(i,t,n))},n.prototype.addChangeListener=function(t,n){this.addEventListener("change:".concat(t),n)},n.prototype.removeChangeListener=function(t,n){this.removeEventListener("change:".concat(t),n)},n.prototype.set=function(t,n,i){var r=this.A||(this.A={});if(i)r[t]=n;else{var e=r[t];r[t]=n,e!==n&&this.notify(t,e)}},n.prototype.setProperties=function(t,n){for(var i in t)this.set(i,t[i],n)},n.prototype.applyProperties=function(t){t.A&&A(this.A||(this.A={}),t.A)},n.prototype.unset=function(t,n){if(this.A&&t in this.A){var i=this.A[t];delete this.A[t],k(this.A)&&(this.A=null),n||this.notify(t,i)}},n}(nt),ot="add",st="remove",ut=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),at="length",ht=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.element=i,e.index=r,e}return ut(n,t),n}(c),ft=function(t){function n(n,i){var r=t.call(this)||this;r.on,r.once,r.un;var e=i||{};if(r.P=!!e.unique,r.C=n||[],r.P)for(var o=0,s=r.C.length;o<s;++o)r.R(r.C[o],o);return r.G(),r}return ut(n,t),n.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},n.prototype.extend=function(t){for(var n=0,i=t.length;n<i;++n)this.push(t[n]);return this},n.prototype.forEach=function(t){for(var n=this.C,i=0,r=n.length;i<r;++i)t(n[i],i,n)},n.prototype.getArray=function(){return this.C},n.prototype.item=function(t){return this.C[t]},n.prototype.getLength=function(){return this.get(at)},n.prototype.insertAt=function(t,n){this.P&&this.R(n),this.C.splice(t,0,n),this.G(),this.dispatchEvent(new ht(ot,n,t))},n.prototype.pop=function(){return this.removeAt(this.getLength()-1)},n.prototype.push=function(t){this.P&&this.R(t);var n=this.getLength();return this.insertAt(n,t),this.getLength()},n.prototype.remove=function(t){for(var n=this.C,i=0,r=n.length;i<r;++i)if(n[i]===t)return this.removeAt(i)},n.prototype.removeAt=function(t){var n=this.C[t];return this.C.splice(t,1),this.G(),this.dispatchEvent(new ht(st,n,t)),n},n.prototype.setAt=function(t,n){var i=this.getLength();if(t<i){this.P&&this.R(n,t);var r=this.C[t];this.C[t]=n,this.dispatchEvent(new ht(st,r,t)),this.dispatchEvent(new ht(ot,n,t))}else{for(var e=i;e<t;++e)this.insertAt(e,void 0);this.insertAt(t,n)}},n.prototype.G=function(){this.set(at,this.C.length)},n.prototype.R=function(t,n){for(var i=0,r=this.C.length;i<r;++i)if(this.C[i]===t&&i!==n)throw new h(58)},n}(et),ct=0,lt=1,vt=2,dt=3,pt=4;function yt(t){return Math.pow(t,3)}function mt(t){return 1-yt(1-t)}function wt(t){return 3*t*t-2*t*t*t}function gt(t){return t}var bt=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xt=function(t){function n(n,i,r){var e=t.call(this)||this,o=r||{};return e.tileCoord=n,e.state=i,e.interimTile=null,e.key="",e.D=void 0===o.transition?250:o.transition,e.q={},e.interpolate=!!o.interpolate,e}return bt(n,t),n.prototype.changed=function(){this.dispatchEvent(L)},n.prototype.release=function(){},n.prototype.getKey=function(){return this.key+"/"+this.tileCoord},n.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==vt)return this.D=0,t;t=t.interimTile}while(t);return this},n.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,n=this;do{if(t.getState()==vt){t.interimTile=null;break}t.getState()==lt?n=t:t.getState()==ct?n.interimTile=t.interimTile:n=t,t=n.interimTile}while(t)}},n.prototype.getTileCoord=function(){return this.tileCoord},n.prototype.getState=function(){return this.state},n.prototype.setState=function(t){if(this.state!==dt&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){r()},n.prototype.getAlpha=function(t,n){if(!this.D)return 1;var i=this.q[t];if(i){if(-1===i)return 1}else i=n,this.q[t]=i;var r=n-i+1e3/60;return r>=this.D?1:yt(r/this.D)},n.prototype.inTransition=function(t){return!!this.D&&-1!==this.q[t]},n.prototype.endTransition=function(t){this.D&&(this.q[t]=-1)},n}(N),Mt=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_t=function(t){function n(n){var i=this,r=ct;return(i=t.call(this,n.tileCoord,r,{transition:n.transition,interpolate:n.interpolate})||this).U=n.loader,i.B=null,i.V=null,i.W=n.size||[256,256],i}return Mt(n,t),n.prototype.getSize=function(){return this.W},n.prototype.getData=function(){return this.B},n.prototype.getError=function(){return this.V},n.prototype.load=function(){if(this.state===ct||this.state===dt){this.state=lt,this.changed();var t=this;this.U().then((function(n){t.B=n,t.state=vt,t.changed()})).catch((function(n){t.V=n,t.state=dt,t.changed()}))}},n}(xt);function St(t,n){if(!t)throw new h(n)}var Ot=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function jt(t){return"function"==typeof t?t:(Array.isArray(t)?n=t:(St("function"==typeof t.getZIndex,41),n=[t]),function(){return n});var n}var Et=function(t){function n(n){var i=t.call(this)||this;if(i.on,i.once,i.un,i.$=void 0,i.K="geometry",i.H=null,i.tt=void 0,i.nt=null,i.addChangeListener(i.K,i.it),n)if("function"==typeof n.getSimplifiedGeometry){var r=n;i.setGeometry(r)}else{var e=n;i.setProperties(e)}return i}return Ot(n,t),n.prototype.clone=function(){var t=new n(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var r=this.getStyle();return r&&t.setStyle(r),t},n.prototype.getGeometry=function(){return this.get(this.K)},n.prototype.getId=function(){return this.$},n.prototype.getGeometryName=function(){return this.K},n.prototype.getStyle=function(){return this.H},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.rt=function(){this.changed()},n.prototype.it=function(){this.nt&&(H(this.nt),this.nt=null);var t=this.getGeometry();t&&(this.nt=$(t,L,this.rt,this)),this.changed()},n.prototype.setGeometry=function(t){this.set(this.K,t)},n.prototype.setStyle=function(t){this.H=t,this.tt=t?jt(t):void 0,this.changed()},n.prototype.setId=function(t){this.$=t,this.changed()},n.prototype.setGeometryName=function(t){this.removeChangeListener(this.K,this.it),this.K=t,this.addChangeListener(this.K,this.it),this.it()},n}(et),Tt="XY",At="XYZ",Pt="XYM",Ct="XYZM",kt={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},It={9001:kt.METERS,9002:kt.FEET,9003:kt.USFEET,9101:kt.RADIANS,9102:kt.DEGREES};function Nt(t){return It[t]}var Lt={};Lt[kt.RADIANS]=6370997/(2*Math.PI),Lt[kt.DEGREES]=2*Math.PI*6370997/360,Lt[kt.FEET]=.3048,Lt[kt.METERS]=1,Lt[kt.USFEET]=1200/3937;var zt,Rt=kt,Ft="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Gt=-1!==Ft.indexOf("firefox"),Dt=-1!==Ft.indexOf("safari")&&-1==Ft.indexOf("chrom"),qt=Dt&&!!(Ft.indexOf("version/15.4")>=0||Ft.match(/cpu (os|iphone os) 15_4 like mac os x/)),Ut=-1!==Ft.indexOf("webkit")&&-1==Ft.indexOf("edge"),Bt=-1!==Ft.indexOf("macintosh"),Xt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Vt="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Wt="undefined"!=typeof Image&&Image.prototype.decode,Yt=function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(t){}return t}(),Zt=new Array(6);function $t(){return[1,0,0,1,0,0]}function Kt(t){return Jt(t,1,0,0,1,0,0)}function Ht(t,n){var i=t[0],r=t[1],e=t[2],o=t[3],s=t[4],u=t[5],a=n[0],h=n[1],f=n[2],c=n[3],l=n[4],v=n[5];return t[0]=i*a+e*h,t[1]=r*a+o*h,t[2]=i*f+e*c,t[3]=r*f+o*c,t[4]=i*l+e*v+s,t[5]=r*l+o*v+u,t}function Jt(t,n,i,r,e,o,s){return t[0]=n,t[1]=i,t[2]=r,t[3]=e,t[4]=o,t[5]=s,t}function Qt(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t}function tn(t,n){var i=n[0],r=n[1];return n[0]=t[0]*i+t[2]*r+t[4],n[1]=t[1]*i+t[3]*r+t[5],n}function nn(t,n){var i=Math.cos(n),r=Math.sin(n);return Ht(t,Jt(Zt,i,r,-r,i,0,0))}function rn(t,n,i){return Ht(t,Jt(Zt,n,0,0,i,0,0))}function en(t,n,i){return Jt(t,n,0,0,i,0,0)}function on(t,n,i){return Ht(t,Jt(Zt,1,0,0,1,n,i))}function sn(t,n,i,r,e,o,s,u){var a=Math.sin(o),h=Math.cos(o);return t[0]=r*h,t[1]=e*a,t[2]=-r*a,t[3]=e*h,t[4]=s*r*h-u*r*a+n,t[5]=s*e*a+u*e*h+i,t}function un(t,n){var i=an(n);St(0!==i,32);var r=n[0],e=n[1],o=n[2],s=n[3],u=n[4],a=n[5];return t[0]=s/i,t[1]=-e/i,t[2]=-o/i,t[3]=r/i,t[4]=(o*a-s*u)/i,t[5]=-(r*a-e*u)/i,t}function an(t){return t[0]*t[3]-t[1]*t[2]}function hn(t){var n="matrix("+t.join(", ")+")";if(Vt)return n;var i=zt||(zt=document.createElement("div"));return i.style.transform=n,i.style.transform}var fn=0,cn=1,ln=2,vn=4,dn=8,pn=16;function yn(t){for(var n=Sn(),i=0,r=t.length;i<r;++i)kn(n,t[i]);return n}function mn(t,n,i){return i?(i[0]=t[0]-n,i[1]=t[1]-n,i[2]=t[2]+n,i[3]=t[3]+n,i):[t[0]-n,t[1]-n,t[2]+n,t[3]+n]}function wn(t,n){return n?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):t.slice()}function gn(t,n,i){var r,e;return(r=n<t[0]?t[0]-n:t[2]<n?n-t[2]:0)*r+(e=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*e}function bn(t,n){return Mn(t,n[0],n[1])}function xn(t,n){return t[0]<=n[0]&&n[2]<=t[2]&&t[1]<=n[1]&&n[3]<=t[3]}function Mn(t,n,i){return t[0]<=n&&n<=t[2]&&t[1]<=i&&i<=t[3]}function _n(t,n){var i=t[0],r=t[1],e=t[2],o=t[3],s=n[0],u=n[1],a=fn;return s<i?a|=pn:s>e&&(a|=vn),u<r?a|=dn:u>o&&(a|=ln),a===fn&&(a=cn),a}function Sn(){return[1/0,1/0,-1/0,-1/0]}function On(t,n,i,r,e){return e?(e[0]=t,e[1]=n,e[2]=i,e[3]=r,e):[t,n,i,r]}function jn(t){return On(1/0,1/0,-1/0,-1/0,t)}function En(t,n){var i=t[0],r=t[1];return On(i,r,i,r,n)}function Tn(t,n,i,r,e){return Nn(jn(e),t,n,i,r)}function An(t,n){return t[0]==n[0]&&t[2]==n[2]&&t[1]==n[1]&&t[3]==n[3]}function Pn(t,n,i){return Math.abs(t[0]-n[0])<i&&Math.abs(t[2]-n[2])<i&&Math.abs(t[1]-n[1])<i&&Math.abs(t[3]-n[3])<i}function Cn(t,n){return n[0]<t[0]&&(t[0]=n[0]),n[2]>t[2]&&(t[2]=n[2]),n[1]<t[1]&&(t[1]=n[1]),n[3]>t[3]&&(t[3]=n[3]),t}function kn(t,n){n[0]<t[0]&&(t[0]=n[0]),n[0]>t[2]&&(t[2]=n[0]),n[1]<t[1]&&(t[1]=n[1]),n[1]>t[3]&&(t[3]=n[1])}function In(t,n){for(var i=0,r=n.length;i<r;++i)kn(t,n[i]);return t}function Nn(t,n,i,r,e){for(;i<r;i+=e)zn(t,n[i],n[i+1]);return t}function Ln(t,n){for(var i=0,r=n.length;i<r;++i)In(t,n[i]);return t}function zn(t,n,i){t[0]=Math.min(t[0],n),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],n),t[3]=Math.max(t[3],i)}function Rn(t,n){var i;return(i=n(Gn(t)))||(i=n(Dn(t)))||(i=n(Zn(t)))?i:(i=n(Yn(t)))||!1}function Fn(t){var n=0;return Hn(t)||(n=$n(t)*Vn(t)),n}function Gn(t){return[t[0],t[1]]}function Dn(t){return[t[2],t[1]]}function qn(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Un(t,n){var i;return"bottom-left"===n?i=Gn(t):"bottom-right"===n?i=Dn(t):"top-left"===n?i=Yn(t):"top-right"===n?i=Zn(t):St(!1,13),i}function Bn(t,n,i,r,e){var o=Xn(t,n,i,r),s=o[0],u=o[1],a=o[2],h=o[3],f=o[4],c=o[5],l=o[6],v=o[7];return On(Math.min(s,a,f,l),Math.min(u,h,c,v),Math.max(s,a,f,l),Math.max(u,h,c,v),e)}function Xn(t,n,i,r){var e=n*r[0]/2,o=n*r[1]/2,s=Math.cos(i),u=Math.sin(i),a=e*s,h=e*u,f=o*s,c=o*u,l=t[0],v=t[1];return[l-a+c,v-h-f,l-a-c,v-h+f,l+a-c,v+h+f,l+a+c,v+h-f,l-a+c,v-h-f]}function Vn(t){return t[3]-t[1]}function Wn(t,n,i){var r=i||[1/0,1/0,-1/0,-1/0];return Kn(t,n)?(t[0]>n[0]?r[0]=t[0]:r[0]=n[0],t[1]>n[1]?r[1]=t[1]:r[1]=n[1],t[2]<n[2]?r[2]=t[2]:r[2]=n[2],t[3]<n[3]?r[3]=t[3]:r[3]=n[3]):jn(r),r}function Yn(t){return[t[0],t[3]]}function Zn(t){return[t[2],t[3]]}function $n(t){return t[2]-t[0]}function Kn(t,n){return t[0]<=n[2]&&t[2]>=n[0]&&t[1]<=n[3]&&t[3]>=n[1]}function Hn(t){return t[2]<t[0]||t[3]<t[1]}function Jn(t,n){return n?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):t}function Qn(t,n){var i=(t[2]-t[0])/2*(n-1),r=(t[3]-t[1])/2*(n-1);t[0]-=i,t[2]+=i,t[1]-=r,t[3]+=r}function ti(t,n,i){var r=!1,e=_n(t,n),o=_n(t,i);if(e===cn||o===cn)r=!0;else{var s=t[0],u=t[1],a=t[2],h=t[3],f=n[0],c=n[1],l=i[0],v=i[1],d=(v-c)/(l-f),p=void 0,y=void 0;o&ln&&!(e&ln)&&(r=(p=l-(v-h)/d)>=s&&p<=a),r||!(o&vn)||e&vn||(r=(y=v-(l-a)*d)>=u&&y<=h),r||!(o&dn)||e&dn||(r=(p=l-(v-u)/d)>=s&&p<=a),r||!(o&pn)||e&pn||(r=(y=v-(l-s)*d)>=u&&y<=h)}return r}function ni(t,n,i,r){var e=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],u=0;u<r;++u)e.push(t[0]+o*u/r,t[1],t[2],t[1]+s*u/r,t[2]-o*u/r,t[3],t[0],t[3]-s*u/r);else e=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];n(e,e,2);for(var a=[],h=[],f=(u=0,e.length);u<f;u+=2)a.push(e[u]),h.push(e[u+1]);return function(t,n,i){return On(Math.min.apply(null,t),Math.min.apply(null,n),Math.max.apply(null,t),Math.max.apply(null,n),i)}(a,h,i)}function ii(t,n){var i=n.getExtent(),r=qn(t);if(n.canWrapX()&&(r[0]<i[0]||r[0]>=i[2])){var e=$n(i),o=Math.floor((r[0]-i[0])/e)*e;t[0]-=o,t[2]-=o}return t}function ri(t,n){if(n.canWrapX()){var i=n.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];ii(t,n);var r=$n(i);if($n(t)>r)return[[i[0],t[1],i[2],t[3]]];if(t[0]<i[0])return[[t[0]+r,t[1],i[2],t[3]],[i[0],t[1],t[2],t[3]]];if(t[2]>i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-r,t[3]]]}return[t]}var ei=function(){function t(t){this.et=t.code,this.ot=t.units,this.st=void 0!==t.extent?t.extent:null,this.ut=void 0!==t.worldExtent?t.worldExtent:null,this.ht=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.ft=void 0!==t.global&&t.global,this.ct=!(!this.ft||!this.st),this.lt=t.getPointResolution,this.vt=null,this.dt=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.ct},t.prototype.getCode=function(){return this.et},t.prototype.getExtent=function(){return this.st},t.prototype.getUnits=function(){return this.ot},t.prototype.getMetersPerUnit=function(){return this.dt||Lt[this.ot]},t.prototype.getWorldExtent=function(){return this.ut},t.prototype.getAxisOrientation=function(){return this.ht},t.prototype.isGlobal=function(){return this.ft},t.prototype.setGlobal=function(t){this.ft=t,this.ct=!(!t||!this.st)},t.prototype.getDefaultTileGrid=function(){return this.vt},t.prototype.setDefaultTileGrid=function(t){this.vt=t},t.prototype.setExtent=function(t){this.st=t,this.ct=!(!this.ft||!t)},t.prototype.setWorldExtent=function(t){this.ut=t},t.prototype.setGetPointResolution=function(t){this.lt=t},t.prototype.getPointResolutionFunc=function(){return this.lt},t}();function oi(t,n,i){return Math.min(Math.max(t,n),i)}var si="cosh"in Math?Math.cosh:function(t){var n=Math.exp(t);return(n+1/n)/2},ui="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function ai(t,n,i,r,e,o){var s=e-i,u=o-r;if(0!==s||0!==u){var a=((t-i)*s+(n-r)*u)/(s*s+u*u);a>1?(i=e,r=o):a>0&&(i+=s*a,r+=u*a)}return hi(t,n,i,r)}function hi(t,n,i,r){var e=i-t,o=r-n;return e*e+o*o}function fi(t){for(var n=t.length,i=0;i<n;i++){for(var r=i,e=Math.abs(t[i][i]),o=i+1;o<n;o++){var s=Math.abs(t[o][i]);s>e&&(e=s,r=o)}if(0===e)return null;var u=t[r];t[r]=t[i],t[i]=u;for(var a=i+1;a<n;a++)for(var h=-t[a][i]/t[i][i],f=i;f<n+1;f++)i==f?t[a][f]=0:t[a][f]+=h*t[i][f]}for(var c=new Array(n),l=n-1;l>=0;l--){c[l]=t[l][n]/t[l][l];for(var v=l-1;v>=0;v--)t[v][n]-=t[v][l]*c[l]}return c}function ci(t){return 180*t/Math.PI}function li(t){return t*Math.PI/180}function vi(t,n){var i=t%n;return i*n<0?i+n:i}function di(t,n,i){return t+i*(n-t)}function pi(t,n){var i=Math.pow(10,n);return Math.round(t*i)/i}function yi(t,n){return Math.round(pi(t,n))}function mi(t,n){return Math.floor(pi(t,n))}function wi(t,n){return Math.ceil(pi(t,n))}var gi=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),bi=6378137,xi=Math.PI*bi,Mi=[-xi,-xi,xi,xi],_i=[-180,-85,180,85],Si=bi*Math.log(Math.tan(Math.PI/2)),Oi=function(t){function n(n){return t.call(this,{code:n,units:Rt.METERS,extent:Mi,global:!0,worldExtent:_i,getPointResolution:function(t,n){return t/si(n[1]/bi)}})||this}return gi(n,t),n}(ei),ji=[new Oi("EPSG:3857"),new Oi("EPSG:102100"),new Oi("EPSG:102113"),new Oi("EPSG:900913"),new Oi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Oi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ei(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;s<r;s+=e){o[s]=xi*t[s]/180;var u=bi*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));u>Si?u=Si:u<-Si&&(u=-Si),o[s+1]=u}return o}function Ti(t,n,i){var r=t.length,e=i>1?i:2,o=n;void 0===o&&(o=e>2?t.slice():new Array(r));for(var s=0;s<r;s+=e)o[s]=180*t[s]/xi,o[s+1]=360*Math.atan(Math.exp(t[s+1]/bi))/Math.PI-90;return o}var Ai=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pi=6378137,Ci=[-180,-90,180,90],ki=Math.PI*Pi/180,Ii=function(t){function n(n,i){return t.call(this,{code:n,units:Rt.DEGREES,extent:Ci,axisOrientation:i,global:!0,metersPerUnit:ki,worldExtent:Ci})||this}return Ai(n,t),n}(ei),Ni=[new Ii("CRS:84"),new Ii("EPSG:4326","neu"),new Ii("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ii("urn:ogc:def:crs:OGC:2:84"),new Ii("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Ii("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ii("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Li={};function zi(){Li={}}function Ri(t){return Li[t]||Li[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Fi(t,n){Li[t]=n}var Gi={};function Di(){Gi={}}function qi(t,n,i){var r=t.getCode(),e=n.getCode();r in Gi||(Gi[r]={}),Gi[r][e]=i}function Ui(t,n){var i;return t in Gi&&n in Gi[t]&&(i=Gi[t][n]),i}function Bi(t,n,i){var r=void 0!==i?t.toFixed(i):""+t,e=r.indexOf(".");return(e=-1===e?r.length:e)>n?r:new Array(1+n-e).join("0")+r}function Xi(t,n){for(var i=(""+t).split("."),r=(""+n).split("."),e=0;e<Math.max(i.length,r.length);e++){var o=parseInt(i[e]||"0",10),s=parseInt(r[e]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}function Vi(t,n){return t[0]+=+n[0],t[1]+=+n[1],t}function Wi(t,n){var i=n.getRadius(),r=n.getCenter(),e=r[0],o=r[1],s=t[0]-e,u=t[1]-o;0===s&&0===u&&(s=1);var a=Math.sqrt(s*s+u*u);return[e+i*s/a,o+i*u/a]}function Yi(t,n){var i,r,e=t[0],o=t[1],s=n[0],u=n[1],a=s[0],h=s[1],f=u[0],c=u[1],l=f-a,v=c-h,d=0===l&&0===v?0:(l*(e-a)+v*(o-h))/(l*l+v*v||0);return d<=0?(i=a,r=h):d>=1?(i=f,r=c):(i=a+d*l,r=h+d*v),[i,r]}function Zi(t,n,i){var r=vi(n+180,360)-180,e=Math.abs(3600*r),o=i||0,s=Math.pow(10,o),u=Math.floor(e/3600),a=Math.floor((e-3600*u)/60),h=e-3600*u-60*a;return(h=Math.ceil(h*s)/s)>=60&&(h=0,a+=1),a>=60&&(a=0,u+=1),u+"° "+Bi(a,2)+" "+Bi(h,2,o)+"″"+(0==r?"":" "+t.charAt(r<0?1:0))}function $i(t,n,i){return t?n.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function Ki(t,n){for(var i=!0,r=t.length-1;r>=0;--r)if(t[r]!=n[r]){i=!1;break}return i}function Hi(t,n){var i=Math.cos(n),r=Math.sin(n),e=t[0]*i-t[1]*r,o=t[1]*i+t[0]*r;return t[0]=e,t[1]=o,t}function Ji(t,n){return t[0]*=n,t[1]*=n,t}function Qi(t,n){var i=t[0]-n[0],r=t[1]-n[1];return i*i+r*r}function tr(t,n){return Math.sqrt(Qi(t,n))}function nr(t,n){return Qi(t,Yi(t,n))}function ir(t,n){return $i(t,"{x}, {y}",n)}function rr(t,n){if(n.canWrapX()){var i=$n(n.getExtent()),r=er(t,n,i);r&&(t[0]-=r*i)}return t}function er(t,n,i){var r=n.getExtent(),e=0;if(n.canWrapX()&&(t[0]<r[0]||t[0]>r[2])){var o=i||$n(r);e=Math.floor((t[0]-r[0])/o)}return e}var or=6371008.8;function sr(t,n,i){var r=i||or,e=li(t[1]),o=li(n[1]),s=(o-e)/2,u=li(n[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(u)*Math.sin(u)*Math.cos(e)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function ur(t,n){for(var i=0,r=0,e=t.length;r<e-1;++r)i+=sr(t[r],t[r+1],n);return i}function ar(t,n){for(var i=0,r=t.length,e=t[r-1][0],o=t[r-1][1],s=0;s<r;s++){var u=t[s][0],a=t[s][1];i+=li(u-e)*(2+Math.sin(li(o))+Math.sin(li(a))),e=u,o=a}return i*n*n/2}function hr(t,n,i,r){var e=r||or,o=li(t[1]),s=li(t[0]),u=n/e,a=Math.asin(Math.sin(o)*Math.cos(u)+Math.cos(o)*Math.sin(u)*Math.cos(i));return[ci(s+Math.atan2(Math.sin(i)*Math.sin(u)*Math.cos(o),Math.cos(u)-Math.sin(o)*Math.sin(a))),ci(a)]}var fr=!0;function cr(t){fr=!(void 0===t||t)}function lr(t,n,i){var r;if(void 0!==n){for(var e=0,o=t.length;e<o;++e)n[e]=t[e];r=n}else r=t.slice();return r}function vr(t,n,i){if(void 0!==n&&t!==n){for(var r=0,e=t.length;r<e;++r)n[r]=t[r];t=n}return t}function dr(t){Fi(t.getCode(),t),qi(t,t,lr)}function pr(t){t.forEach(dr)}function yr(t){return"string"==typeof t?Ri(t):t||null}function mr(t,n,i,r){var e,o=(t=yr(t)).getPointResolutionFunc();if(o){if(e=o(n,i),r&&r!==t.getUnits())(u=t.getMetersPerUnit())&&(e=e*u/Lt[r])}else{var s=t.getUnits();if(s==Rt.DEGREES&&!r||r==Rt.DEGREES)e=n;else{var u,a=Or(t,yr("EPSG:4326"));if(a===vr&&s!==Rt.DEGREES)e=n*t.getMetersPerUnit();else{var h=[i[0]-n/2,i[1],i[0]+n/2,i[1],i[0],i[1]-n/2,i[0],i[1]+n/2];e=(sr((h=a(h,h,2)).slice(0,2),h.slice(2,4))+sr(h.slice(4,6),h.slice(6,8)))/2}void 0!==(u=r?Lt[r]:t.getMetersPerUnit())&&(e/=u)}}return e}function wr(t){pr(t),t.forEach((function(n){t.forEach((function(t){n!==t&&qi(n,t,lr)}))}))}function gr(t,n,i,r){t.forEach((function(t){n.forEach((function(n){qi(t,n,i),qi(n,t,r)}))}))}function br(t,n){return t?"string"==typeof t?yr(t):t:yr(n)}function xr(t){return function(n,i,r){for(var e=n.length,o=void 0!==r?r:2,s=void 0!==i?i:new Array(e),u=0;u<e;u+=o)for(var a=t(n.slice(u,u+o)),h=a.length,f=0,c=o;f<c;++f)s[u+f]=f>=h?n[u+f]:a[f];return s}}function Mr(t,n,i,r){var e=yr(t),o=yr(n);qi(e,o,xr(i)),qi(o,e,xr(r))}function _r(t,n){return cr(),Er(t,"EPSG:4326",void 0!==n?n:"EPSG:3857")}function Sr(t,n){if(t===n)return!0;var i=t.getUnits()===n.getUnits();return(t.getCode()===n.getCode()||Or(t,n)===lr)&&i}function Or(t,n){var i=Ui(t.getCode(),n.getCode());return i||(i=vr),i}function jr(t,n){return Or(yr(t),yr(n))}function Er(t,n,i){return jr(n,i)(t,void 0,t.length)}function Tr(t,n,i,r){return ni(t,jr(n,i),void 0,r)}var Ar=null;function Pr(t){Ar=yr(t)}function Cr(){return Ar}function kr(t,n){return Ar?Er(t,n,Ar):t}function Ir(t,n){return Ar?Er(t,Ar,n):(fr&&!Ki(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(fr=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function Nr(t,n){return Ar?Tr(t,n,Ar):t}function Lr(t,n){return Ar?Tr(t,Ar,n):t}function zr(t,n){if(!Ar)return t;var i=yr(n).getUnits(),r=Ar.getUnits();return i&&r?t*Lt[i]/Lt[r]:t}function Rr(t,n){if(!Ar)return t;var i=yr(n).getUnits(),r=Ar.getUnits();return i&&r?t*Lt[r]/Lt[i]:t}function Fr(t,n,i){return function(r){var e,o;if(t.canWrapX()){var s=t.getExtent(),u=$n(s);(o=er(r=r.slice(0),t,u))&&(r[0]=r[0]-o*u),r[0]=oi(r[0],s[0],s[2]),r[1]=oi(r[1],s[1],s[3]),e=i(r)}else e=i(r);return o&&n.canWrapX()&&(e[0]+=o*$n(n.getExtent())),e}}function Gr(){wr(ji),wr(Ni),gr(Ni,ji,Ei,Ti)}function Dr(t,n,i,r,e,o){for(var s=o||[],u=0,a=n;a<i;a+=r){var h=t[a],f=t[a+1];s[u++]=e[0]*h+e[2]*f+e[4],s[u++]=e[1]*h+e[3]*f+e[5]}return o&&s.length!=u&&(s.length=u),s}function qr(t,n,i,r,e,o,s){for(var u=s||[],a=Math.cos(e),h=Math.sin(e),f=o[0],c=o[1],l=0,v=n;v<i;v+=r){var d=t[v]-f,p=t[v+1]-c;u[l++]=f+d*a-p*h,u[l++]=c+d*h+p*a;for(var y=v+2;y<v+r;++y)u[l++]=t[y]}return s&&u.length!=l&&(u.length=l),u}function Ur(t,n,i,r,e,o,s,u){for(var a=u||[],h=s[0],f=s[1],c=0,l=n;l<i;l+=r){var v=t[l]-h,d=t[l+1]-f;a[c++]=h+e*v,a[c++]=f+o*d;for(var p=l+2;p<l+r;++p)a[c++]=t[p]}return u&&a.length!=c&&(a.length=c),a}function Br(t,n,i,r,e,o,s){for(var u=s||[],a=0,h=n;h<i;h+=r){u[a++]=t[h]+e,u[a++]=t[h+1]+o;for(var f=h+2;f<h+r;++f)u[a++]=t[f]}return s&&u.length!=a&&(u.length=a),u}Gr();var Xr=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vr=[1,0,0,1,0,0],Wr=function(t){function n(){var n=t.call(this)||this;return n.st=[1/0,1/0,-1/0,-1/0],n.yt=-1,n.simplifiedGeometryMaxMinSquaredTolerance=0,n.simplifiedGeometryRevision=0,n.simplifyTransformedInternal=E((function(t,n,i){if(!i)return this.getSimplifiedGeometry(n);var r=this.clone();return r.applyTransform(i),r.getSimplifiedGeometry(n)})),n}return Xr(n,t),n.prototype.simplifyTransformed=function(t,n){return this.simplifyTransformedInternal(this.getRevision(),t,n)},n.prototype.clone=function(){return r()},n.prototype.closestPointXY=function(t,n,i,e){return r()},n.prototype.containsXY=function(t,n){var i=this.getClosestPoint([t,n]);return i[0]===t&&i[1]===n},n.prototype.getClosestPoint=function(t,n){var i=n||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},n.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},n.prototype.computeExtent=function(t){return r()},n.prototype.getExtent=function(t){if(this.yt!=this.getRevision()){var n=this.computeExtent(this.st);(isNaN(n[0])||isNaN(n[1]))&&jn(n),this.yt=this.getRevision()}return Jn(this.st,t)},n.prototype.rotate=function(t,n){r()},n.prototype.scale=function(t,n,i){r()},n.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},n.prototype.getSimplifiedGeometry=function(t){return r()},n.prototype.getType=function(){return r()},n.prototype.applyTransform=function(t){r()},n.prototype.intersectsExtent=function(t){return r()},n.prototype.translate=function(t,n){r()},n.prototype.transform=function(t,n){var i=yr(t),r=i.getUnits()==Rt.TILE_PIXELS?function(t,r,e){var o=i.getExtent(),s=i.getWorldExtent(),u=Vn(s)/Vn(o);return sn(Vr,s[0],s[3],u,-u,0,0,0),Dr(t,0,t.length,e,Vr,r),jr(i,n)(t,r,e)}:jr(i,n);return this.applyTransform(r),this},n}(et),Yr=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Zr(t){var n;return t==Tt?n=2:t==At||t==Pt?n=3:t==Ct&&(n=4),n}function $r(t,n,i){var r=t.getFlatCoordinates();if(r){var e=t.getStride();return Dr(r,0,r.length,e,n,i)}return null}var Kr=function(t){function n(){var n=t.call(this)||this;return n.layout=Tt,n.stride=2,n.flatCoordinates=null,n}return Yr(n,t),n.prototype.computeExtent=function(t){return Tn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinates=function(){return r()},n.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.getFlatCoordinates=function(){return this.flatCoordinates},n.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},n.prototype.getLayout=function(){return this.layout},n.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 n=this.getSimplifiedGeometryInternal(t);return n.getFlatCoordinates().length<this.flatCoordinates.length?n:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},n.prototype.getSimplifiedGeometryInternal=function(t){return this},n.prototype.getStride=function(){return this.stride},n.prototype.setFlatCoordinates=function(t,n){this.stride=Zr(t),this.layout=t,this.flatCoordinates=n},n.prototype.setCoordinates=function(t,n){r()},n.prototype.setLayout=function(t,n,i){var r;if(t)r=Zr(t);else{for(var e=0;e<i;++e){if(0===n.length)return this.layout=Tt,void(this.stride=2);n=n[0]}t=function(t){var n;2==t?n=Tt:3==t?n=At:4==t&&(n=Ct);return n}(r=n.length)}this.layout=t,this.stride=r},n.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},n.prototype.rotate=function(t,n){var i=this.getFlatCoordinates();if(i){var r=this.getStride();qr(i,0,i.length,r,t,n,i),this.changed()}},n.prototype.scale=function(t,n,i){var r=n;void 0===r&&(r=t);var e=i;e||(e=qn(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();Ur(o,0,o.length,s,t,r,e,o),this.changed()}},n.prototype.translate=function(t,n){var i=this.getFlatCoordinates();if(i){var r=this.getStride();Br(i,0,i.length,r,t,n,i),this.changed()}},n}(Wr);function Hr(t,n,i,r,e,o,s){var u,a=t[n],h=t[n+1],f=t[i]-a,c=t[i+1]-h;if(0===f&&0===c)u=n;else{var l=((e-a)*f+(o-h)*c)/(f*f+c*c);if(l>1)u=i;else{if(l>0){for(var v=0;v<r;++v)s[v]=di(t[n+v],t[i+v],l);return void(s.length=r)}u=n}}for(v=0;v<r;++v)s[v]=t[u+v];s.length=r}function Jr(t,n,i,r,e){var o=t[n],s=t[n+1];for(n+=r;n<i;n+=r){var u=t[n],a=t[n+1],h=hi(o,s,u,a);h>e&&(e=h),o=u,s=a}return e}function Qr(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var u=i[o];e=Jr(t,n,u,r,e),n=u}return e}function te(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var u=i[o];e=Qr(t,n,u,r,e),n=u[u.length-1]}return e}function ne(t,n,i,r,e,o,s,u,a,h,f){if(n==i)return h;var c,l;if(0===e){if((l=hi(s,u,t[n],t[n+1]))<h){for(c=0;c<r;++c)a[c]=t[n+c];return a.length=r,l}return h}for(var v=f||[NaN,NaN],d=n+r;d<i;)if(Hr(t,d-r,d,r,s,u,v),(l=hi(s,u,v[0],v[1]))<h){for(h=l,c=0;c<r;++c)a[c]=v[c];a.length=r,d+=r}else d+=r*Math.max((Math.sqrt(l)-Math.sqrt(h))/e|0,1);if(o&&(Hr(t,i-r,n,r,s,u,v),(l=hi(s,u,v[0],v[1]))<h)){for(h=l,c=0;c<r;++c)a[c]=v[c];a.length=r}return h}function ie(t,n,i,r,e,o,s,u,a,h,f){for(var c=f||[NaN,NaN],l=0,v=i.length;l<v;++l){var d=i[l];h=ne(t,n,d,r,e,o,s,u,a,h,c),n=d}return h}function re(t,n,i,r,e,o,s,u,a,h,f){for(var c=f||[NaN,NaN],l=0,v=i.length;l<v;++l){var d=i[l];h=ie(t,n,d,r,e,o,s,u,a,h,c),n=d[d.length-1]}return h}function ee(t,n,i,r){for(var e=0,o=i.length;e<o;++e)t[n++]=i[e];return n}function oe(t,n,i,r){for(var e=0,o=i.length;e<o;++e)for(var s=i[e],u=0;u<r;++u)t[n++]=s[u];return n}function se(t,n,i,r,e){for(var o=e||[],s=0,u=0,a=i.length;u<a;++u){var h=oe(t,n,i[u],r);o[s++]=h,n=h}return o.length=s,o}function ue(t,n,i,r,e){for(var o=e||[],s=0,u=0,a=i.length;u<a;++u){var h=se(t,n,i[u],r,o[s]);o[s++]=h,n=h[h.length-1]}return o.length=s,o}function ae(t,n,i,r,e,o,s){var u=(i-n)/r;if(u<3){for(;n<i;n+=r)o[s++]=t[n],o[s++]=t[n+1];return s}var a=new Array(u);a[0]=1,a[u-1]=1;for(var h=[n,i-r],f=0;h.length>0;){for(var c=h.pop(),l=h.pop(),v=0,d=t[l],p=t[l+1],y=t[c],m=t[c+1],w=l+r;w<c;w+=r){var g=ai(t[w],t[w+1],d,p,y,m);g>v&&(f=w,v=g)}v>e&&(a[(f-n)/r]=1,l+r<f&&h.push(l,f),f+r<c&&h.push(f,c))}for(w=0;w<u;++w)a[w]&&(o[s++]=t[n+w*r],o[s++]=t[n+w*r+1]);return s}function he(t,n,i,r,e,o,s,u){for(var a=0,h=i.length;a<h;++a){var f=i[a];s=ae(t,n,f,r,e,o,s),u.push(s),n=f}return s}function fe(t,n,i,r,e,o,s){if(i<=n+r){for(;n<i;n+=r)o[s++]=t[n],o[s++]=t[n+1];return s}var u=t[n],a=t[n+1];o[s++]=u,o[s++]=a;var h=u,f=a;for(n+=r;n<i;n+=r)hi(u,a,h=t[n],f=t[n+1])>e&&(o[s++]=h,o[s++]=f,u=h,a=f);return h==u&&f==a||(o[s++]=h,o[s++]=f),s}function ce(t,n){return n*Math.round(t/n)}function le(t,n,i,r,e,o,s){if(n==i)return s;var u,a,h=ce(t[n],e),f=ce(t[n+1],e);n+=r,o[s++]=h,o[s++]=f;do{if(u=ce(t[n],e),a=ce(t[n+1],e),(n+=r)==i)return o[s++]=u,o[s++]=a,s}while(u==h&&a==f);for(;n<i;){var c=ce(t[n],e),l=ce(t[n+1],e);if(n+=r,c!=u||l!=a){var v=u-h,d=a-f,p=c-h,y=l-f;v*y==d*p&&(v<0&&p<v||v==p||v>0&&p>v)&&(d<0&&y<d||d==y||d>0&&y>d)?(u=c,a=l):(o[s++]=u,o[s++]=a,h=u,f=a,u=c,a=l)}}return o[s++]=u,o[s++]=a,s}function ve(t,n,i,r,e,o,s,u){for(var a=0,h=i.length;a<h;++a){var f=i[a];s=le(t,n,f,r,e,o,s),u.push(s),n=f}return s}function de(t,n,i,r,e,o,s,u){for(var a=0,h=i.length;a<h;++a){var f=i[a],c=[];s=ve(t,n,f,r,e,o,s,c),u.push(c),n=f[f.length-1]}return s}function pe(t,n,i,r,e){for(var o=void 0!==e?e:[],s=0,u=n;u<i;u+=r)o[s++]=t.slice(u,u+r);return o.length=s,o}function ye(t,n,i,r,e){for(var o=void 0!==e?e:[],s=0,u=0,a=i.length;u<a;++u){var h=i[u];o[s++]=pe(t,n,h,r,o[s]),n=h}return o.length=s,o}function me(t,n,i,r,e){for(var o=void 0!==e?e:[],s=0,u=0,a=i.length;u<a;++u){var h=i[u];o[s++]=ye(t,n,h,r,o[s]),n=h[h.length-1]}return o.length=s,o}function we(t,n,i,r){for(var e=0,o=t[i-r],s=t[i-r+1];n<i;n+=r){var u=t[n],a=t[n+1];e+=s*u-o*a,o=u,s=a}return e/2}function ge(t,n,i,r){for(var e=0,o=0,s=i.length;o<s;++o){var u=i[o];e+=we(t,n,u,r),n=u}return e}function be(t,n,i,r){for(var e=0,o=0,s=i.length;o<s;++o){var u=i[o];e+=ge(t,n,u,r),n=u[u.length-1]}return e}var xe=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Me=function(t){function n(n,i){var r=t.call(this)||this;return r.wt=-1,r.gt=-1,void 0===i||Array.isArray(n[0])?r.setCoordinates(n,i):r.setFlatCoordinates(i,n),r}return xe(n,t),n.prototype.clone=function(){return new n(this.flatCoordinates.slice(),this.layout)},n.prototype.closestPointXY=function(t,n,i,r){return r<gn(this.getExtent(),t,n)?r:(this.gt!=this.getRevision()&&(this.wt=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.gt=this.getRevision()),ne(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.wt,!0,t,n,i,r))},n.prototype.getArea=function(){return we(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getCoordinates=function(){return pe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ae(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new n(i,Tt)},n.prototype.getType=function(){return"LinearRing"},n.prototype.intersectsExtent=function(t){return!1},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=oe(this.flatCoordinates,0,t,this.stride),this.changed()},n}(Kr),_e=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Se=function(t){function n(n,i){var r=t.call(this)||this;return r.setCoordinates(n,i),r}return _e(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){var e=this.flatCoordinates,o=hi(t,n,e[0],e[1]);if(o<r){for(var s=this.stride,u=0;u<s;++u)i[u]=e[u];return i.length=s,o}return r},n.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},n.prototype.computeExtent=function(t){return En(this.flatCoordinates,t)},n.prototype.getType=function(){return"Point"},n.prototype.intersectsExtent=function(t){return Mn(t,this.flatCoordinates[0],this.flatCoordinates[1])},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=ee(this.flatCoordinates,0,t,this.stride),this.changed()},n}(Kr);function Oe(t,n,i,r,e){return!Rn(e,(function(e){return!je(t,n,i,r,e[0],e[1])}))}function je(t,n,i,r,e,o){for(var s=0,u=t[i-r],a=t[i-r+1];n<i;n+=r){var h=t[n],f=t[n+1];a<=o?f>o&&(h-u)*(o-a)-(e-u)*(f-a)>0&&s++:f<=o&&(h-u)*(o-a)-(e-u)*(f-a)<0&&s--,u=h,a=f}return 0!==s}function Ee(t,n,i,r,e,o){if(0===i.length)return!1;if(!je(t,n,i[0],r,e,o))return!1;for(var s=1,u=i.length;s<u;++s)if(je(t,i[s-1],i[s],r,e,o))return!1;return!0}function Te(t,n,i,r,e,o){if(0===i.length)return!1;for(var s=0,u=i.length;s<u;++s){var a=i[s];if(Ee(t,n,a,r,e,o))return!0;n=a[a.length-1]}return!1}function Ae(t,n,i,r,e,o,s){for(var u,a,h,f,c,l,v,d=e[o+1],y=[],m=0,w=i.length;m<w;++m){var g=i[m];for(f=t[g-r],l=t[g-r+1],u=n;u<g;u+=r)c=t[u],v=t[u+1],(d<=l&&v<=d||l<=d&&d<=v)&&(h=(d-l)/(v-l)*(c-f)+f,y.push(h)),f=c,l=v}var b=NaN,x=-1/0;for(y.sort(p),f=y[0],u=1,a=y.length;u<a;++u){c=y[u];var M=Math.abs(c-f);M>x&&Ee(t,n,i,r,h=(f+c)/2,d)&&(b=h,x=M),f=c}return isNaN(b)&&(b=e[o]),s?(s.push(b,d,x),s):[b,d,x]}function Pe(t,n,i,r,e){for(var o=[],s=0,u=i.length;s<u;++s){var a=i[s];o=Ae(t,n,a,r,e,2*s,o),n=a[a.length-1]}return o}function Ce(t,n,i,r,e){var o;for(n+=r;n<i;n+=r)if(o=e(t.slice(n-r,n),t.slice(n,n+r)))return o;return!1}function ke(t,n,i,r,e){var o=Nn([1/0,1/0,-1/0,-1/0],t,n,i,r);return!!Kn(e,o)&&(!!xn(e,o)||(o[0]>=e[0]&&o[2]<=e[2]||(o[1]>=e[1]&&o[3]<=e[3]||Ce(t,n,i,r,(function(t,n){return ti(e,t,n)})))))}function Ie(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){if(ke(t,n,i[o],r,e))return!0;n=i[o]}return!1}function Ne(t,n,i,r,e){return!!ke(t,n,i,r,e)||(!!je(t,n,i,r,e[0],e[1])||(!!je(t,n,i,r,e[0],e[3])||(!!je(t,n,i,r,e[2],e[1])||!!je(t,n,i,r,e[2],e[3]))))}function Le(t,n,i,r,e){if(!Ne(t,n,i[0],r,e))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;o<s;++o)if(Oe(t,i[o-1],i[o],r,e)&&!ke(t,i[o-1],i[o],r,e))return!1;return!0}function ze(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var u=i[o];if(Le(t,n,u,r,e))return!0;n=u[u.length-1]}return!1}function Re(t,n,i,r){for(;n<i-r;){for(var e=0;e<r;++e){var o=t[n+e];t[n+e]=t[i-r+e],t[i-r+e]=o}n+=r,i-=r}}function Fe(t,n,i,r){for(var e=0,o=t[i-r],s=t[i-r+1];n<i;n+=r){var u=t[n],a=t[n+1];e+=(u-o)*(a+s),o=u,s=a}return 0===e?void 0:e>0}function Ge(t,n,i,r,e){for(var o=void 0!==e&&e,s=0,u=i.length;s<u;++s){var a=i[s],h=Fe(t,n,a,r);if(0===s){if(o&&h||!o&&!h)return!1}else if(o&&!h||!o&&h)return!1;n=a}return!0}function De(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var u=i[o];if(!Ge(t,n,u,r,e))return!1;u.length&&(n=u[u.length-1])}return!0}function qe(t,n,i,r,e){for(var o=void 0!==e&&e,s=0,u=i.length;s<u;++s){var a=i[s],h=Fe(t,n,a,r);(0===s?o&&h||!o&&!h:o&&!h||!o&&h)&&Re(t,n,a,r),n=a}return n}function Ue(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o)n=qe(t,n,i[o],r,e);return n}function Be(t,n){for(var i=[],r=0,e=0,o=0,s=n.length;o<s;++o){var u=n[o];if(Fe(t,r,u,2)){if(0===i.length)continue;i[i.length-1].push(n[e])}else i.push(n.slice(e,o+1));e=o+1,r=u}return i}var Xe=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ve=function(t){function n(n,i,r){var e=t.call(this)||this;return e.bt=[],e.xt=-1,e.Mt=null,e.wt=-1,e.gt=-1,e._t=-1,e.St=null,void 0!==i&&r?(e.setFlatCoordinates(i,n),e.bt=r):e.setCoordinates(n,i),e}return Xe(n,t),n.prototype.appendLinearRing=function(t){this.flatCoordinates?g(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.bt.push(this.flatCoordinates.length),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout,this.bt.slice());return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){return r<gn(this.getExtent(),t,n)?r:(this.gt!=this.getRevision()&&(this.wt=Math.sqrt(Qr(this.flatCoordinates,0,this.bt,this.stride,0)),this.gt=this.getRevision()),ie(this.flatCoordinates,0,this.bt,this.stride,this.wt,!0,t,n,i,r))},n.prototype.containsXY=function(t,n){return Ee(this.getOrientedFlatCoordinates(),0,this.bt,this.stride,t,n)},n.prototype.getArea=function(){return ge(this.getOrientedFlatCoordinates(),0,this.bt,this.stride)},n.prototype.getCoordinates=function(t){var n;return void 0!==t?qe(n=this.getOrientedFlatCoordinates().slice(),0,this.bt,this.stride,t):n=this.flatCoordinates,ye(n,0,this.bt,this.stride)},n.prototype.getEnds=function(){return this.bt},n.prototype.getFlatInteriorPoint=function(){if(this.xt!=this.getRevision()){var t=qn(this.getExtent());this.Mt=Ae(this.getOrientedFlatCoordinates(),0,this.bt,this.stride,t,0),this.xt=this.getRevision()}return this.Mt},n.prototype.getInteriorPoint=function(){return new Se(this.getFlatInteriorPoint(),Pt)},n.prototype.getLinearRingCount=function(){return this.bt.length},n.prototype.getLinearRing=function(t){return t<0||this.bt.length<=t?null:new Me(this.flatCoordinates.slice(0===t?0:this.bt[t-1],this.bt[t]),this.layout)},n.prototype.getLinearRings=function(){for(var t=this.layout,n=this.flatCoordinates,i=this.bt,r=[],e=0,o=0,s=i.length;o<s;++o){var u=i[o],a=new Me(n.slice(e,u),t);r.push(a),e=u}return r},n.prototype.getOrientedFlatCoordinates=function(){if(this._t!=this.getRevision()){var t=this.flatCoordinates;Ge(t,0,this.bt,this.stride)?this.St=t:(this.St=t.slice(),this.St.length=qe(this.St,0,this.bt,this.stride)),this._t=this.getRevision()}return this.St},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=ve(this.flatCoordinates,0,this.bt,this.stride,Math.sqrt(t),i,0,r),new n(i,Tt,r)},n.prototype.getType=function(){return"Polygon"},n.prototype.intersectsExtent=function(t){return Le(this.getOrientedFlatCoordinates(),0,this.bt,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=se(this.flatCoordinates,0,t,this.stride,this.bt);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},n}(Kr),We=Ve;function Ye(t,n,i,r){for(var e=i||32,o=[],s=0;s<e;++s)g(o,hr(t,n,2*Math.PI*s/e,r));return o.push(o[0],o[1]),new Ve(o,Tt,[o.length])}function Ze(t){var n=t[0],i=t[1],r=t[2],e=t[3],o=[n,i,n,e,r,e,r,i,n,i];return new Ve(o,Tt,[o.length])}function $e(t,n,i){for(var r=n||32,e=t.getStride(),o=t.getLayout(),s=t.getCenter(),u=e*(r+1),a=new Array(u),h=0;h<u;h+=e){a[h]=0,a[h+1]=0;for(var f=2;f<e;f++)a[h+f]=s[f]}var c=[a.length],l=new Ve(a,o,c);return Ke(l,s,t.getRadius(),i),l}function Ke(t,n,i,r){for(var e=t.getFlatCoordinates(),o=t.getStride(),s=e.length/o-1,u=r||0,a=0;a<=s;++a){var h=a*o,f=u+2*vi(a,s)*Math.PI/s;e[h]=n[0]+i*Math.cos(f),e[h+1]=n[1]+i*Math.sin(f)}t.changed()}var He=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Je="accuracy",Qe="accuracyGeometry",to="altitude",no="altitudeAccuracy",io="heading",ro="position",eo="projection",oo="speed",so="tracking",uo="trackingOptions",ao=function(t){function n(n){var i=t.call(this,z)||this;return i.code=n.code,i.message=n.message,i}return He(n,t),n}(c),ho=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};return i.Ot=null,i.jt=vr,i.Et=void 0,i.addChangeListener(eo,i.Tt),i.addChangeListener(so,i.At),void 0!==r.projection&&i.setProjection(r.projection),void 0!==r.trackingOptions&&i.setTrackingOptions(r.trackingOptions),i.setTracking(void 0!==r.tracking&&r.tracking),i}return He(n,t),n.prototype.disposeInternal=function(){this.setTracking(!1),t.prototype.disposeInternal.call(this)},n.prototype.Tt=function(){var t=this.getProjection();t&&(this.jt=Or(yr("EPSG:4326"),t),this.Ot&&this.set(ro,this.jt(this.Ot)))},n.prototype.At=function(){if("geolocation"in navigator){var t=this.getTracking();t&&void 0===this.Et?this.Et=navigator.geolocation.watchPosition(this.Pt.bind(this),this.Ct.bind(this),this.getTrackingOptions()):t||void 0===this.Et||(navigator.geolocation.clearWatch(this.Et),this.Et=void 0)}},n.prototype.Pt=function(t){var n=t.coords;this.set(Je,n.accuracy),this.set(to,null===n.altitude?void 0:n.altitude),this.set(no,null===n.altitudeAccuracy?void 0:n.altitudeAccuracy),this.set(io,null===n.heading?void 0:li(n.heading)),this.Ot?(this.Ot[0]=n.longitude,this.Ot[1]=n.latitude):this.Ot=[n.longitude,n.latitude];var i=this.jt(this.Ot);this.set(ro,i),this.set(oo,null===n.speed?void 0:n.speed);var r=Ye(this.Ot,n.accuracy);r.applyTransform(this.jt),this.set(Qe,r),this.changed()},n.prototype.Ct=function(t){this.dispatchEvent(new ao(t))},n.prototype.getAccuracy=function(){return this.get(Je)},n.prototype.getAccuracyGeometry=function(){return this.get(Qe)||null},n.prototype.getAltitude=function(){return this.get(to)},n.prototype.getAltitudeAccuracy=function(){return this.get(no)},n.prototype.getHeading=function(){return this.get(io)},n.prototype.getPosition=function(){return this.get(ro)},n.prototype.getProjection=function(){return this.get(eo)},n.prototype.getSpeed=function(){return this.get(oo)},n.prototype.getTracking=function(){return this.get(so)},n.prototype.getTrackingOptions=function(){return this.get(uo)},n.prototype.setProjection=function(t){this.set(eo,yr(t))},n.prototype.setTracking=function(t){this.set(so,t)},n.prototype.setTrackingOptions=function(t){this.set(uo,t)},n}(et),fo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),co=function(t){function n(n,i,r,e){var o=t.call(this)||this;return o.extent=n,o.kt=r,o.resolution=i,o.state=e,o}return fo(n,t),n.prototype.changed=function(){this.dispatchEvent(L)},n.prototype.getExtent=function(){return this.extent},n.prototype.getImage=function(){return r()},n.prototype.getPixelRatio=function(){return this.kt},n.prototype.getResolution=function(){return this.resolution},n.prototype.getState=function(){return this.state},n.prototype.load=function(){r()},n}(N),lo=0,vo=1,po=2,yo=3,mo=4,wo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function go(t,n,i){var r=t,e=!0,o=!1,s=!1,u=[K(r,V,(function(){s=!0,o||n()}))];return r.src&&Wt?(o=!0,r.decode().then((function(){e&&n()})).catch((function(t){e&&(s?n():i())}))):u.push(K(r,z,i)),function(){e=!1,u.forEach(H)}}var bo=function(t){function n(n,i,r,e,o,s){var u=t.call(this,n,i,r,lo)||this;return u.Nt=e,u.Lt=new Image,null!==o&&(u.Lt.crossOrigin=o),u.zt=null,u.state=lo,u.Rt=s,u}return wo(n,t),n.prototype.getImage=function(){return this.Lt},n.prototype.Ft=function(){this.state=yo,this.Gt(),this.changed()},n.prototype.Dt=function(){void 0===this.resolution&&(this.resolution=Vn(this.extent)/this.Lt.height),this.state=po,this.Gt(),this.changed()},n.prototype.load=function(){this.state!=lo&&this.state!=yo||(this.state=vo,this.changed(),this.Rt(this,this.Nt),this.zt=go(this.Lt,this.Dt.bind(this),this.Ft.bind(this)))},n.prototype.setImage=function(t){this.Lt=t,this.resolution=Vn(this.extent)/this.Lt.height},n.prototype.Gt=function(){this.zt&&(this.zt(),this.zt=null)},n}(co),xo=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Mo=function(t){function n(n,i,r,e,o){var s=this,u=void 0!==o?lo:po;return(s=t.call(this,n,i,r,u)||this).U=void 0!==o?o:null,s.qt=e,s.V=null,s}return xo(n,t),n.prototype.getError=function(){return this.V},n.prototype.Ut=function(t){t?(this.V=t,this.state=yo):this.state=po,this.changed()},n.prototype.load=function(){this.state==lo&&(this.state=vo,this.changed(),this.U(this.Ut.bind(this)))},n.prototype.getImage=function(){return this.qt},n}(co);function _o(t,n,i,r){var e;return e=i&&i.length?i.shift():Vt?new OffscreenCanvas(t||300,n||300):document.createElement("canvas"),t&&(e.width=t),n&&(e.height=n),e.getContext("2d",r)}function So(t){var n=t.canvas;n.width=1,n.height=1,t.clearRect(0,0,1,1)}function Oo(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10)}function jo(t){var n=t.offsetHeight,i=getComputedStyle(t);return n+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10)}function Eo(t,n){var i=n.parentNode;i&&i.replaceChild(t,n)}function To(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Ao(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function Po(t,n){for(var i=t.childNodes,r=0;;++r){var e=i[r],o=n[r];if(!e&&!o)break;e!==o&&(e?o?t.insertBefore(o,e):(t.removeChild(e),--r):t.appendChild(o))}}var Co=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var ko=function(t){function n(n,i,r,e,o,s){var u=t.call(this,n,i,s)||this;return u.Bt=e,u.Nt=r,u.key=r,u.Lt=new Image,null!==e&&(u.Lt.crossOrigin=e),u.zt=null,u.Xt=o,u}return Co(n,t),n.prototype.getImage=function(){return this.Lt},n.prototype.setImage=function(t){this.Lt=t,this.state=vt,this.Gt(),this.changed()},n.prototype.Ft=function(){var t;this.state=dt,this.Gt(),this.Lt=((t=_o(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},n.prototype.Dt=function(){var t=this.Lt;t.naturalWidth&&t.naturalHeight?this.state=vt:this.state=pt,this.Gt(),this.changed()},n.prototype.load=function(){this.state==dt&&(this.state=ct,this.Lt=new Image,null!==this.Bt&&(this.Lt.crossOrigin=this.Bt)),this.state==ct&&(this.state=lt,this.changed(),this.Xt(this,this.Nt),this.zt=go(this.Lt,this.Dt.bind(this),this.Ft.bind(this)))},n.prototype.Gt=function(){this.zt&&(this.zt(),this.zt=null)},n}(xt),Io=function(){function t(t,n,i){this.Vt=t,this.Wt=n,this.Yt=i,this.Zt=[],this.$t=0,this.Kt=0}return t.prototype.begin=function(){this.Zt.length=0,this.$t=0,this.Kt=0},t.prototype.update=function(t,n){this.Zt.push(t,n,Date.now())},t.prototype.end=function(){if(this.Zt.length<6)return!1;var t=Date.now()-this.Yt,n=this.Zt.length-3;if(this.Zt[n+2]<t)return!1;for(var i=n-3;i>0&&this.Zt[i+2]>t;)i-=3;var r=this.Zt[n+2]-this.Zt[i+2];if(r<1e3/60)return!1;var e=this.Zt[n]-this.Zt[i],o=this.Zt[n+1]-this.Zt[i+1];return this.$t=Math.atan2(o,e),this.Kt=Math.sqrt(e*e+o*o)/r,this.Kt>this.Wt},t.prototype.getDistance=function(){return(this.Wt-this.Kt)/this.Vt},t.prototype.getAngle=function(){return this.$t},t}(),No=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Lo=/^([a-z]*)$|^hsla?\(.*\)$/i;function zo(t){return"string"==typeof t?t:qo(t)}function Ro(t){var n=document.createElement("div");if(n.style.color=t,""!==n.style.color){document.body.appendChild(n);var i=getComputedStyle(n).color;return document.body.removeChild(n),i}return""}var Fo=function(){var t={},n=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(n>=1024){var e=0;for(var o in t)0==(3&e++)&&(delete t[o],--n)}r=function(t){var n,i,r,e,o;Lo.exec(t)&&(t=Ro(t));if(No.exec(t)){var s=t.length-1,u=void 0;u=s<=4?1:2;var a=4===s||8===s;n=parseInt(t.substr(1+0*u,u),16),i=parseInt(t.substr(1+1*u,u),16),r=parseInt(t.substr(1+2*u,u),16),e=a?parseInt(t.substr(1+3*u,u),16):255,1==u&&(n=(n<<4)+n,i=(i<<4)+i,r=(r<<4)+r,a&&(e=(e<<4)+e)),o=[n,i,r,e/255]}else 0==t.indexOf("rgba(")?Do(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Do(o)):St(!1,14);return o}(i),t[i]=r,++n}return r}}();function Go(t){return Array.isArray(t)?t:Fo(t)}function Do(t){return t[0]=oi(t[0]+.5|0,0,255),t[1]=oi(t[1]+.5|0,0,255),t[2]=oi(t[2]+.5|0,0,255),t[3]=oi(t[3],0,1),t}function qo(t){var n=t[0];n!=(0|n)&&(n=n+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+n+","+i+","+r+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function Uo(t){return Lo.test(t)&&(t=Ro(t)),No.test(t)||0===t.indexOf("rgba(")||0===t.indexOf("rgb(")}var Bo=function(){function t(){this.Ht={},this.Jt=0,this.Qt=32}return t.prototype.clear=function(){this.Ht={},this.Jt=0},t.prototype.canExpireCache=function(){return this.Jt>this.Qt},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var n in this.Ht){var i=this.Ht[n];0!=(3&t++)||i.hasListener()||(delete this.Ht[n],--this.Jt)}}},t.prototype.get=function(t,n,i){var r=Xo(t,n,i);return r in this.Ht?this.Ht[r]:null},t.prototype.set=function(t,n,i,r){var e=Xo(t,n,i);this.Ht[e]=r,++this.Jt},t.prototype.setSize=function(t){this.Qt=t,this.expire()},t}();function Xo(t,n,i){return n+":"+t+":"+(i?zo(i):"null")}var Vo=Bo,Wo=new Bo,Yo="opacity",Zo="visible",$o="extent",Ko="zIndex",Ho="maxResolution",Jo="minResolution",Qo="maxZoom",ts="minZoom",ns="source",is="map",rs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),es=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.tn=n.background;var r=A({},n);return"object"==typeof n.properties&&(delete r.properties,A(r,n.properties)),r[Yo]=void 0!==n.opacity?n.opacity:1,St("number"==typeof r[Yo],64),r[Zo]=void 0===n.visible||n.visible,r[Ko]=n.zIndex,r[Ho]=void 0!==n.maxResolution?n.maxResolution:1/0,r[Jo]=void 0!==n.minResolution?n.minResolution:0,r[ts]=void 0!==n.minZoom?n.minZoom:-1/0,r[Qo]=void 0!==n.maxZoom?n.maxZoom:1/0,i.nn=void 0!==r.className?r.className:"ol-layer",delete r.className,i.setProperties(r),i.rn=null,i}return rs(n,t),n.prototype.getBackground=function(){return this.tn},n.prototype.getClassName=function(){return this.nn},n.prototype.getLayerState=function(t){var n=this.rn||{layer:this,managed:void 0===t||t},i=this.getZIndex();return n.opacity=oi(Math.round(100*this.getOpacity())/100,0,1),n.visible=this.getVisible(),n.extent=this.getExtent(),n.zIndex=void 0!==i||n.managed?i:1/0,n.maxResolution=this.getMaxResolution(),n.minResolution=Math.max(this.getMinResolution(),0),n.minZoom=this.getMinZoom(),n.maxZoom=this.getMaxZoom(),this.rn=n,n},n.prototype.getLayersArray=function(t){return r()},n.prototype.getLayerStatesArray=function(t){return r()},n.prototype.getExtent=function(){return this.get($o)},n.prototype.getMaxResolution=function(){return this.get(Ho)},n.prototype.getMinResolution=function(){return this.get(Jo)},n.prototype.getMinZoom=function(){return this.get(ts)},n.prototype.getMaxZoom=function(){return this.get(Qo)},n.prototype.getOpacity=function(){return this.get(Yo)},n.prototype.getSourceState=function(){return r()},n.prototype.getVisible=function(){return this.get(Zo)},n.prototype.getZIndex=function(){return this.get(Ko)},n.prototype.setBackground=function(t){this.tn=t,this.changed()},n.prototype.setExtent=function(t){this.set($o,t)},n.prototype.setMaxResolution=function(t){this.set(Ho,t)},n.prototype.setMinResolution=function(t){this.set(Jo,t)},n.prototype.setMaxZoom=function(t){this.set(Qo,t)},n.prototype.setMinZoom=function(t){this.set(ts,t)},n.prototype.setOpacity=function(t){St("number"==typeof t,64),this.set(Yo,t)},n.prototype.setVisible=function(t){this.set(Zo,t)},n.prototype.setZIndex=function(t){this.set(Ko,t)},n.prototype.disposeInternal=function(){this.rn&&(this.rn.layer=null,this.rn=null),t.prototype.disposeInternal.call(this)},n}(et),os="prerender",ss="postrender",us="precompose",as="postcompose",hs="rendercomplete",fs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function cs(t,n){if(!t.visible)return!1;var i=n.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var r=n.zoom;return r>t.minZoom&&r<=t.maxZoom}var ls=function(t){function n(n){var i=this,r=A({},n);delete r.source,(i=t.call(this,r)||this).on,i.once,i.un,i.en=null,i.sn=null,i.an=null,i.hn=null,i.rendered=!1,n.render&&(i.render=n.render),n.map&&i.setMap(n.map),i.addChangeListener(ns,i.fn);var e=n.source?n.source:null;return i.setSource(e),i}return fs(n,t),n.prototype.getLayersArray=function(t){var n=t||[];return n.push(this),n},n.prototype.getLayerStatesArray=function(t){var n=t||[];return n.push(this.getLayerState()),n},n.prototype.getSource=function(){return this.get(ns)||null},n.prototype.getRenderSource=function(){return this.getSource()},n.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},n.prototype.cn=function(){this.changed()},n.prototype.fn=function(){this.an&&(H(this.an),this.an=null);var t=this.getSource();t&&(this.an=$(t,L,this.cn,this)),this.changed()},n.prototype.getFeatures=function(t){return this.hn?this.hn.getFeatures(t):new Promise((function(t){return t([])}))},n.prototype.getData=function(t){return this.hn&&this.rendered?this.hn.getData(t):null},n.prototype.render=function(t,n){var i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,n)},n.prototype.unrender=function(){this.rendered=!1},n.prototype.setMapInternal=function(t){t||this.unrender(),this.set(is,t)},n.prototype.getMapInternal=function(){return this.get(is)},n.prototype.setMap=function(t){this.en&&(H(this.en),this.en=null),t||this.changed(),this.sn&&(H(this.sn),this.sn=null),t&&(this.en=$(t,us,(function(t){var n=t.frameState.layerStatesArray,i=this.getLayerState(!1);St(!n.some((function(t){return t.layer===i.layer})),67),n.push(i)}),this),this.sn=$(this,L,t.render,t),this.changed())},n.prototype.setSource=function(t){this.set(ns,t)},n.prototype.getRenderer=function(){return this.hn||(this.hn=this.createRenderer()),this.hn},n.prototype.hasRenderer=function(){return!!this.hn},n.prototype.createRenderer=function(){return null},n.prototype.disposeInternal=function(){this.hn&&(this.hn.dispose(),delete this.hn),this.setSource(null),t.prototype.disposeInternal.call(this)},n}(es),vs=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function ds(t,n){Wo.expire()}var ps=function(t){function n(n){var i=t.call(this)||this;return i.vn=n,i}return vs(n,t),n.prototype.dispatchRenderEvent=function(t,n){r()},n.prototype.calculateMatrices2D=function(t){var n=t.viewState,i=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;sn(i,t.size[0]/2,t.size[1]/2,1/n.resolution,-1/n.resolution,-n.rotation,-n.center[0],-n.center[1]),un(r,i)},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e,o,s,u){var a,h=n.viewState;function f(t,n,i,r){return e.call(o,n,t?i:null,r)}var c=h.projection,l=rr(t.slice(),c),v=[[0,0]];if(c.canWrapX()&&r){var d=$n(c.getExtent());v.push([-d,0],[d,0])}for(var p=n.layerStatesArray,y=p.length,m=[],w=[],g=0;g<v.length;g++)for(var b=y-1;b>=0;--b){var x=p[b],M=x.layer;if(M.hasRenderer()&&cs(x,h)&&s.call(u,M)){var _=M.getRenderer(),S=M.getSource();if(_&&S){var O=S.getWrapX()?l:t,j=f.bind(null,x.managed);w[0]=O[0]+v[g][0],w[1]=O[1]+v[g][1],a=_.forEachFeatureAtCoordinate(w,n,i,j,m)}if(a)return a}}if(0!==m.length){var E=1/m.length;return m.forEach((function(t,n){return t.distanceSq+=n*E})),m.sort((function(t,n){return t.distanceSq-n.distanceSq})),m.some((function(t){return a=t.callback(t.feature,t.layer,t.geometry)})),a}},n.prototype.forEachLayerAtPixel=function(t,n,i,e,o){return r()},n.prototype.hasFeatureAtCoordinate=function(t,n,i,r,e,o){return void 0!==this.forEachFeatureAtCoordinate(t,n,i,r,S,this,e,o)},n.prototype.getMap=function(){return this.vn},n.prototype.renderFrame=function(t){r()},n.prototype.scheduleExpireIconCache=function(t){Wo.canExpireCache()&&t.postRenderFunctions.push(ds)},n}(v),ys=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ms=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.inversePixelTransform=i,o.frameState=r,o.context=e,o}return ys(n,t),n}(c),ws="ol-hidden",gs="ol-selectable",bs="ol-unselectable",xs="ol-unsupported",Ms="ol-control",_s="ol-collapsed",Ss=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"),Os=["style","variant","weight","size","lineHeight","family"],js=function(t){var n=t.match(Ss);if(!n)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,e=Os.length;r<e;++r){var o=n[r+1];void 0!==o&&(i[Os[r]]=o)}return i.families=i.family.split(/,\s?/),i},Es="10px sans-serif",Ts="#000",As="round",Ps=[],Cs="round",ks=10,Is="#000",Ns="center",Ls="middle",zs=[0,0,0,0],Rs=new et,Fs=new N;Fs.setSize=function(){console.warn("labelCache is deprecated.")};var Gs,Ds,qs=null,Us={},Bs=function(){var t,n,i="32px ",r=["monospace","serif"],e=r.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,u){for(var a=!0,h=0;h<e;++h){var f=r[h];if(n=Ws(t+" "+s+" "+i+f,o),u!=f){var c=Ws(t+" "+s+" "+i+u+","+f,o);a=a&&c!=n}}return!!a}function u(){for(var n=!0,i=Rs.getKeys(),r=0,e=i.length;r<e;++r){var o=i[r];Rs.get(o)<100&&(s.apply(this,o.split("\n"))?(P(Us),qs=null,Gs=void 0,Rs.set(o,100)):(Rs.set(o,Rs.get(o)+1,!0),n=!1))}n&&(clearInterval(t),t=void 0)}return function(n){var i=js(n);if(i)for(var r=i.families,e=0,o=r.length;e<o;++e){var a=r[e],h=i.style+"\n"+i.weight+"\n"+a;void 0===Rs.get(h)&&(Rs.set(h,100,!0),s(i.style,i.weight,a)||(Rs.set(h,0,!0),void 0===t&&(t=setInterval(u,32))))}}}(),Xs=function(t){var n=Us[t];if(null==n){if(Vt){var i=js(t),r=Vs(t,"Žg");n=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else Ds||((Ds=document.createElement("div")).innerHTML="M",Ds.style.minHeight="0",Ds.style.maxHeight="none",Ds.style.height="auto",Ds.style.padding="0",Ds.style.border="none",Ds.style.position="absolute",Ds.style.display="block",Ds.style.left="-99999px"),Ds.style.font=t,document.body.appendChild(Ds),n=Ds.offsetHeight,document.body.removeChild(Ds);Us[t]=n}return n};function Vs(t,n){return qs||(qs=_o(1,1)),t!=Gs&&(qs.font=t,Gs=qs.font),qs.measureText(n)}function Ws(t,n){return Vs(t,n).width}function Ys(t,n,i){if(n in i)return i[n];var r=n.split("\n").reduce((function(n,i){return Math.max(n,Ws(t,i))}),0);return i[n]=r,r}function Zs(t,n){for(var i=[],r=[],e=[],o=0,s=0,u=0,a=0,h=0,f=n.length;h<=f;h+=2){var c=n[h];if("\n"!==c&&h!==f){var l=n[h+1]||t.font,v=Ws(l,c);i.push(v),s+=v;var d=Xs(l);r.push(d),a=Math.max(a,d)}else o=Math.max(o,s),e.push(s),s=0,u+=a}return{width:o,height:u,widths:i,heights:r,lineWidths:e}}function $s(t,n,i,r,e,o,s,u,a,h,f){t.save(),1!==i&&(t.globalAlpha*=i),n&&t.setTransform.apply(t,n),r.contextInstructions?(t.translate(a,h),t.scale(f[0],f[1]),function(t,n){for(var i=t.contextInstructions,r=0,e=i.length;r<e;r+=2)Array.isArray(i[r+1])?n[i[r]].apply(n,i[r+1]):n[i[r]]=i[r+1]}(r,t)):f[0]<0||f[1]<0?(t.translate(a,h),t.scale(f[0],f[1]),t.drawImage(r,e,o,s,u,0,0,s,u)):t.drawImage(r,e,o,s,u,a,h,s*f[0],u*f[1]),t.restore()}var Ks=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hs=function(t){function n(n){var i=t.call(this,n)||this;i.dn=$(Rs,l,n.redrawText.bind(n)),i.pn=document.createElement("div");var r=i.pn.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",i.pn.className="ol-unselectable ol-layers";var e=n.getViewport();return e.insertBefore(i.pn,e.firstChild||null),i.yn=[],i.mn=!0,i}return Ks(n,t),n.prototype.dispatchRenderEvent=function(t,n){var i=this.getMap();if(i.hasListener(t)){var r=new ms(t,void 0,n);i.dispatchEvent(r)}},n.prototype.disposeInternal=function(){H(this.dn),this.pn.parentNode.removeChild(this.pn),t.prototype.disposeInternal.call(this)},n.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(us,t);var n=t.layerStatesArray.sort((function(t,n){return t.zIndex-n.zIndex})),i=t.viewState;this.yn.length=0;for(var r=[],e=null,o=0,s=n.length;o<s;++o){var u=n[o];t.layerIndex=o;var a=u.layer,h=a.getSourceState();if(!cs(u,i)||"ready"!=h&&"undefined"!=h)a.unrender();else{var f=a.render(t,e);f&&(f!==e&&(this.yn.push(f),e=f),"getDeclutter"in a&&r.push(a))}}for(o=r.length-1;o>=0;--o)r[o].renderDeclutter(t);Po(this.pn,this.yn),this.dispatchRenderEvent(as,t),this.mn||(this.pn.style.display="",this.mn=!0),this.scheduleExpireIconCache(t)}else this.mn&&(this.pn.style.display="none",this.mn=!1)},n.prototype.forEachLayerAtPixel=function(t,n,i,r,e){for(var o=n.viewState,s=n.layerStatesArray,u=s.length-1;u>=0;--u){var a=s[u],h=a.layer;if(h.hasRenderer()&&cs(a,o)&&e(h)){var f=h.getRenderer().getDataAtPixel(t,n,i);if(f){var c=r(h,f);if(c)return c}}}},n}(ps),Js=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qs=function(t){function n(n,i){var r=t.call(this,n)||this;return r.layer=i,r}return Js(n,t),n}(c),tu="layers",nu=function(t){function n(n){var i=this,r=n||{},e=A({},r);delete e.layers;var o=r.layers;return(i=t.call(this,e)||this).on,i.once,i.un,i.wn=[],i.gn={},i.addChangeListener(tu,i.bn),o?Array.isArray(o)?o=new ft(o.slice(),{unique:!0}):St("function"==typeof o.getArray,43):o=new ft(void 0,{unique:!0}),i.setLayers(o),i}return Js(n,t),n.prototype.xn=function(){this.changed()},n.prototype.bn=function(){this.wn.forEach(H),this.wn.length=0;var t=this.getLayers();for(var n in this.wn.push($(t,ot,this.Mn,this),$(t,st,this._n,this)),this.gn)this.gn[n].forEach(H);P(this.gn);for(var i=t.getArray(),r=0,e=i.length;r<e;r++){var o=i[r];this.Sn(o),this.dispatchEvent(new Qs("addlayer",o))}this.changed()},n.prototype.Sn=function(t){var i=[$(t,l,this.xn,this),$(t,L,this.xn,this)];t instanceof n&&i.push($(t,"addlayer",this.On,this),$(t,"removelayer",this.jn,this)),this.gn[o(t)]=i},n.prototype.On=function(t){this.dispatchEvent(new Qs("addlayer",t.layer))},n.prototype.jn=function(t){this.dispatchEvent(new Qs("removelayer",t.layer))},n.prototype.Mn=function(t){var n=t.element;this.Sn(n),this.dispatchEvent(new Qs("addlayer",n)),this.changed()},n.prototype._n=function(t){var n=t.element,i=o(n);this.gn[i].forEach(H),delete this.gn[i],this.dispatchEvent(new Qs("removelayer",n)),this.changed()},n.prototype.getLayers=function(){return this.get(tu)},n.prototype.setLayers=function(t){var n=this.getLayers();if(n)for(var i=n.getArray(),r=0,e=i.length;r<e;++r)this.dispatchEvent(new Qs("removelayer",i[r]));this.set(tu,t)},n.prototype.getLayersArray=function(t){var n=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(n)})),n},n.prototype.getLayerStatesArray=function(t){var n=void 0!==t?t:[],i=n.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(n)}));var r=this.getLayerState(),e=r.zIndex;t||void 0!==r.zIndex||(e=0);for(var o=i,s=n.length;o<s;o++){var u=n[o];u.opacity*=r.opacity,u.visible=u.visible&&r.visible,u.maxResolution=Math.min(u.maxResolution,r.maxResolution),u.minResolution=Math.max(u.minResolution,r.minResolution),u.minZoom=Math.max(u.minZoom,r.minZoom),u.maxZoom=Math.min(u.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==u.extent?u.extent=Wn(u.extent,r.extent):u.extent=r.extent),void 0===u.zIndex&&(u.zIndex=e)}return n},n.prototype.getSourceState=function(){return"ready"},n}(es),iu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ru=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.map=i,e.frameState=void 0!==r?r:null,e}return iu(n,t),n}(c),eu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ou=function(t){function n(n,i,r,e,o,s){var u=t.call(this,n,i,o)||this;return u.originalEvent=r,u.En=null,u.Tn=null,u.dragging=void 0!==e&&e,u.activePointers=s,u}return eu(n,t),Object.defineProperty(n.prototype,"pixel",{get:function(){return this.En||(this.En=this.map.getEventPixel(this.originalEvent)),this.En},set:function(t){this.En=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.Tn||(this.Tn=this.map.getCoordinateFromPixel(this.pixel)),this.Tn},set:function(t){this.Tn=t},enumerable:!1,configurable:!0}),n.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},n.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},n}(ru),su={SINGLECLICK:"singleclick",CLICK:F,DBLCLICK:G,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},uu="pointermove",au="pointerdown",hu="pointerup",fu="pointerout",cu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lu=function(t){function n(n,i){var r=t.call(this,n)||this;r.vn=n,r.An,r.Pn=!1,r.Cn=!1,r.kn=[],r.In=void 0===i?1:i,r.Nn=null;var e=r.vn.getViewport();return r.Ln=[],r.zn={},r.pn=e,r.Rn=$(e,au,r.Fn,r),r.Gn,r.Dn=$(e,uu,r.qn,r),r.Un=r.Bn.bind(r),r.pn.addEventListener(Y,r.Un,!!Yt&&{passive:!1}),r}return cu(n,t),n.prototype.Xn=function(t){var n=new ou(su.CLICK,this.vn,t);this.dispatchEvent(n),void 0!==this.An?(clearTimeout(this.An),this.An=void 0,n=new ou(su.DBLCLICK,this.vn,t),this.dispatchEvent(n)):this.An=setTimeout(function(){this.An=void 0;var n=new ou(su.SINGLECLICK,this.vn,t);this.dispatchEvent(n)}.bind(this),250)},n.prototype.Vn=function(t){var n=t,i=n.pointerId;if(n.type==su.POINTERUP||n.type==su.POINTERCANCEL){for(var r in delete this.zn[i],this.zn)if(this.zn[r].target!==n.target){delete this.zn[r];break}}else n.type!=su.POINTERDOWN&&n.type!=su.POINTERMOVE||(this.zn[i]=n);this.Ln=C(this.zn)},n.prototype.Wn=function(t){this.Vn(t);var n=new ou(su.POINTERUP,this.vn,t,void 0,void 0,this.Ln);this.dispatchEvent(n),this.Pn&&!n.defaultPrevented&&!this.Cn&&this.Yn(t)&&this.Xn(this.Nn),0===this.Ln.length&&(this.kn.forEach(H),this.kn.length=0,this.Cn=!1,this.Nn=null)},n.prototype.Yn=function(t){return 0===t.button},n.prototype.Fn=function(t){this.Pn=0===this.Ln.length,this.Vn(t);var n=new ou(su.POINTERDOWN,this.vn,t,void 0,void 0,this.Ln);for(var i in this.dispatchEvent(n),this.Nn={},t){var r=t[i];this.Nn[i]="function"==typeof r?j:r}if(0===this.kn.length){var e=this.vn.getOwnerDocument();this.kn.push($(e,su.POINTERMOVE,this.Zn,this),$(e,su.POINTERUP,this.Wn,this),$(this.pn,su.POINTERCANCEL,this.Wn,this)),this.pn.getRootNode&&this.pn.getRootNode()!==e&&this.kn.push($(this.pn.getRootNode(),su.POINTERUP,this.Wn,this))}},n.prototype.Zn=function(t){if(this.$n(t)){this.Vn(t),this.Cn=!0;var n=new ou(su.POINTERDRAG,this.vn,t,this.Cn,void 0,this.Ln);this.dispatchEvent(n)}},n.prototype.qn=function(t){this.Gn=t;var n=!(!this.Nn||!this.$n(t));this.dispatchEvent(new ou(su.POINTERMOVE,this.vn,t,n))},n.prototype.Bn=function(t){var n=this.Gn;n&&!n.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},n.prototype.$n=function(t){return this.Cn||Math.abs(t.clientX-this.Nn.clientX)>this.In||Math.abs(t.clientY-this.Nn.clientY)>this.In},n.prototype.disposeInternal=function(){this.Dn&&(H(this.Dn),this.Dn=null),this.pn.removeEventListener(Y,this.Un),this.Rn&&(H(this.Rn),this.Rn=null),this.kn.forEach(H),this.kn.length=0,this.pn=null,t.prototype.disposeInternal.call(this)},n}(N),vu="postrender",du="movestart",pu="moveend",yu="loadstart",mu="loadend",wu="layergroup",gu="size",bu="target",xu="view",Mu=1/0,_u=function(){function t(t,n){this.Kn=t,this.Hn=n,this.Jn=[],this.Qn=[],this.ti={}}return t.prototype.clear=function(){this.Jn.length=0,this.Qn.length=0,P(this.ti)},t.prototype.dequeue=function(){var t=this.Jn,n=this.Qn,i=t[0];1==t.length?(t.length=0,n.length=0):(t[0]=t.pop(),n[0]=n.pop(),this.ni(0));var r=this.Hn(i);return delete this.ti[r],i},t.prototype.enqueue=function(t){St(!(this.Hn(t)in this.ti),31);var n=this.Kn(t);return n!=Mu&&(this.Jn.push(t),this.Qn.push(n),this.ti[this.Hn(t)]=!0,this.ii(0,this.Jn.length-1),!0)},t.prototype.getCount=function(){return this.Jn.length},t.prototype.ri=function(t){return 2*t+1},t.prototype.ei=function(t){return 2*t+2},t.prototype.oi=function(t){return t-1>>1},t.prototype.si=function(){var t;for(t=(this.Jn.length>>1)-1;t>=0;t--)this.ni(t)},t.prototype.isEmpty=function(){return 0===this.Jn.length},t.prototype.isKeyQueued=function(t){return t in this.ti},t.prototype.isQueued=function(t){return this.isKeyQueued(this.Hn(t))},t.prototype.ni=function(t){for(var n=this.Jn,i=this.Qn,r=n.length,e=n[t],o=i[t],s=t;t<r>>1;){var u=this.ri(t),a=this.ei(t),h=a<r&&i[a]<i[u]?a:u;n[t]=n[h],i[t]=i[h],t=h}n[t]=e,i[t]=o,this.ii(s,t)},t.prototype.ii=function(t,n){for(var i=this.Jn,r=this.Qn,e=i[n],o=r[n];n>t;){var s=this.oi(n);if(!(r[s]>o))break;i[n]=i[s],r[n]=r[s],n=s}i[n]=e,r[n]=o},t.prototype.reprioritize=function(){var t,n,i,r=this.Kn,e=this.Jn,o=this.Qn,s=0,u=e.length;for(n=0;n<u;++n)(i=r(t=e[n]))==Mu?delete this.ti[this.Hn(t)]:(o[s]=i,e[s++]=t);e.length=s,o.length=s,this.si()},t}(),Su=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ou=function(t){function n(n,i){var r=t.call(this,(function(t){return n.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return r.ui=r.handleTileChange.bind(r),r.ai=i,r.hi=0,r.fi={},r}return Su(n,t),n.prototype.enqueue=function(n){var i=t.prototype.enqueue.call(this,n);i&&n[0].addEventListener(L,this.ui);return i},n.prototype.getTilesLoading=function(){return this.hi},n.prototype.handleTileChange=function(t){var n=t.target,i=n.getState();if(i===vt||i===dt||i===pt){n.removeEventListener(L,this.ui);var r=n.getKey();r in this.fi&&(delete this.fi[r],--this.hi),this.ai()}},n.prototype.loadMoreTiles=function(t,n){for(var i,r,e=0;this.hi<t&&e<n&&this.getCount()>0;)r=(i=this.dequeue()[0]).getKey(),i.getState()!==ct||r in this.fi||(this.fi[r]=!0,++this.hi,++e,i.load())},n}(_u);function ju(t,n,i,r,e){if(!t||!(i in t.wantedTiles))return Mu;if(!t.wantedTiles[i][n.getKey()])return Mu;var o=t.viewState.center,s=r[0]-o[0],u=r[1]-o[1];return 65536*Math.log(e)+Math.sqrt(s*s+u*u)/e}var Eu=0,Tu=1,Au={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Pu=256;function Cu(t,n,i){return function(r,e,o,s,u){if(r){if(!e&&!n)return r;var a=n?0:o[0]*e,h=n?0:o[1]*e,f=u?u[0]:0,c=u?u[1]:0,l=t[0]+a/2+f,v=t[2]-a/2+f,d=t[1]+h/2+c,p=t[3]-h/2+c;l>v&&(v=l=(v+l)/2),d>p&&(p=d=(p+d)/2);var y=oi(r[0],l,v),m=oi(r[1],d,p);if(s&&i&&e){var w=30*e;y+=-w*Math.log(1+Math.max(0,l-r[0])/w)+w*Math.log(1+Math.max(0,r[0]-v)/w),m+=-w*Math.log(1+Math.max(0,d-r[1])/w)+w*Math.log(1+Math.max(0,r[1]-p)/w)}return[y,m]}}}function ku(t){return t}function Iu(t,n,i,r){var e=$n(n)/i[0],o=Vn(n)/i[1];return r?Math.min(t,Math.max(e,o)):Math.min(t,Math.min(e,o))}function Nu(t,n,i){var r=Math.min(t,n);return r*=Math.log(1+50*Math.max(0,t/n-1))/50+1,i&&(r=Math.max(r,i),r/=Math.log(1+50*Math.max(0,i/t-1))/50+1),oi(r,i/2,2*n)}function Lu(t,n,i,r){return function(e,o,s,u){if(void 0!==e){var a=t[0],h=t[t.length-1],f=i?Iu(a,i,s,r):a;if(u)return void 0===n||n?Nu(e,f,h):oi(e,h,f);var c=Math.min(f,e),l=Math.floor(m(t,c,o));return t[l]>f&&l<t.length-1?t[l+1]:t[l]}}}function zu(t,n,i,r,e,o){return function(s,u,a,h){if(void 0!==s){var f=e?Iu(n,e,a,o):n,c=void 0!==i?i:0;if(h)return void 0===r||r?Nu(s,f,c):oi(s,c,f);var l=Math.ceil(Math.log(n/f)/Math.log(t)-1e-9),v=-u*(.5-1e-9)+.5,d=Math.min(f,s),p=Math.floor(Math.log(n/d)/Math.log(t)+v),y=Math.max(l,p);return oi(n/Math.pow(t,y),c,f)}}}function Ru(t,n,i,r,e){return function(o,s,u,a){if(void 0!==o){var h=r?Iu(t,r,u,e):t;return(void 0===i||i)&&a?Nu(o,h,n):oi(o,n,h)}}}function Fu(t){return void 0!==t?0:void 0}function Gu(t){return void 0!==t?t:void 0}function Du(t){var n=2*Math.PI/t;return function(t,i){return i?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}}function qu(t){var n=t||li(5);return function(t,i){return i?t:void 0!==t?Math.abs(t)<=n?0:t:void 0}}var Uu=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Bu(t,n){setTimeout((function(){t(n)}),0)}function Xu(t){if(void 0!==t.extent){var n=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Cu(t.extent,t.constrainOnlyCenter,n)}var i=br(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var r=i.getExtent().slice();return r[0]=-1/0,r[2]=1/0,Cu(r,!1,!1)}return ku}function Vu(t){var n,i,r,e=void 0!==t.minZoom?t.minZoom:0,o=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2,u=void 0!==t.multiWorld&&t.multiWorld,a=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,h=void 0!==t.showFullExtent&&t.showFullExtent,f=br(t.projection,"EPSG:3857"),c=f.getExtent(),l=t.constrainOnlyCenter,v=t.extent;if(u||v||!f.isGlobal()||(l=!1,v=c),void 0!==t.resolutions){var d=t.resolutions;i=d[e],r=void 0!==d[o]?d[o]:d[d.length-1],n=t.constrainResolution?Lu(d,a,!l&&v,h):Ru(i,r,a,!l&&v,h)}else{var p=(c?Math.max($n(c),Vn(c)):360*Lt[Rt.DEGREES]/f.getMetersPerUnit())/Pu/Math.pow(2,0),y=p/Math.pow(2,28);void 0!==(i=t.maxResolution)?e=0:i=p/Math.pow(s,e),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(s,o):p/Math.pow(s,o):y),o=e+Math.floor(Math.log(i/r)/Math.log(s)),r=i/Math.pow(s,o-e),n=t.constrainResolution?zu(s,i,r,a,!l&&v,h):Ru(i,r,a,!l&&v,h)}return{constraint:n,maxResolution:i,minResolution:r,minZoom:e,zoomFactor:s}}function Wu(t){if(void 0===t.enableRotation||t.enableRotation){var n=t.constrainRotation;return void 0===n||!0===n?qu():!1===n?Gu:"number"==typeof n?Du(n):Gu}return Fu}function Yu(t){return!(t.sourceCenter&&t.targetCenter&&!Ki(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Zu(t,n,i,r,e){var o=Math.cos(-e),s=Math.sin(-e),u=t[0]*o-t[1]*s,a=t[1]*o+t[0]*s;return[(u+=(n[0]/2-i[0])*r)*o-(a+=(i[1]-n[1]/2)*r)*(s=-s),a*o+u*s]}var $u=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=A({},n);return i.ci=[0,0],i.li=[],i.vi,i.di=br(r.projection,"EPSG:3857"),i.yi=[100,100],i.mi=null,i.wi,i.gi,i.bi=null,i.xi,i.Mi,i._i=void 0,r.projection&&cr(),r.center&&(r.center=Ir(r.center,i.di)),r.extent&&(r.extent=Lr(r.extent,i.di)),i.Si(r),i}return Uu(n,t),n.prototype.Si=function(t){var n=A({},t);for(var i in Au)delete n[i];this.setProperties(n,!0);var r=Vu(t);this.Oi=r.maxResolution,this.ji=r.minResolution,this.Ei=r.zoomFactor,this.Ti=t.resolutions,this.Ai=t.padding,this.Pi=r.minZoom;var e=Xu(t),o=r.constraint,s=Wu(t);this.Ci={center:e,resolution:o,rotation:s},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)},Object.defineProperty(n.prototype,"padding",{get:function(){return this.Ai},set:function(t){var n=this.Ai;this.Ai=t;var i=this.getCenter();if(i){var r=t||[0,0,0,0];n=n||[0,0,0,0];var e=this.getResolution(),o=e/2*(r[3]-n[3]+n[1]-r[1]),s=e/2*(r[0]-n[0]+n[2]-r[2]);this.setCenterInternal([i[0]+o,i[1]-s])}},enumerable:!1,configurable:!0}),n.prototype.ki=function(t){var n=this.getProperties();return void 0!==n.resolution?n.resolution=this.getResolution():n.zoom=this.getZoom(),n.center=this.getCenterInternal(),n.rotation=this.getRotation(),A({},n,t)},n.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var n=new Array(arguments.length),i=0;i<n.length;++i){var r=arguments[i];r.center&&((r=A({},r)).center=Ir(r.center,this.getProjection())),r.anchor&&((r=A({},r)).anchor=Ir(r.anchor,this.getProjection())),n[i]=r}this.animateInternal.apply(this,n)},n.prototype.animateInternal=function(t){var n,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(n=arguments[i-1],--i);for(var r=0;r<i&&!this.isDef();++r){var e=arguments[r];e.center&&this.setCenterInternal(e.center),void 0!==e.zoom?this.setZoom(e.zoom):e.resolution&&this.setResolution(e.resolution),void 0!==e.rotation&&this.setRotation(e.rotation)}if(r!==i){for(var o=Date.now(),s=this.mi.slice(),u=this.wi,a=this.gi,h=[];r<i;++r){var f=arguments[r],c={start:o,complete:!1,anchor:f.anchor,duration:void 0!==f.duration?f.duration:1e3,easing:f.easing||wt,callback:n};if(f.center&&(c.sourceCenter=s,c.targetCenter=f.center.slice(),s=c.targetCenter),void 0!==f.zoom?(c.sourceResolution=u,c.targetResolution=this.getResolutionForZoom(f.zoom),u=c.targetResolution):f.resolution&&(c.sourceResolution=u,c.targetResolution=f.resolution,u=c.targetResolution),void 0!==f.rotation){c.sourceRotation=a;var l=vi(f.rotation-a+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=a+l,a=c.targetRotation}Yu(c)?c.complete=!0:o+=c.duration,h.push(c)}this.li.push(h),this.setHint(Eu,1),this.Ii()}else n&&Bu(n,!0)},n.prototype.getAnimating=function(){return this.ci[Eu]>0},n.prototype.getInteracting=function(){return this.ci[Tu]>0},n.prototype.cancelAnimations=function(){var t;this.setHint(Eu,-this.ci[Eu]);for(var n=0,i=this.li.length;n<i;++n){var r=this.li[n];if(r[0].callback&&Bu(r[0].callback,!1),!t)for(var e=0,o=r.length;e<o;++e){var s=r[e];if(!s.complete){t=s.anchor;break}}}this.li.length=0,this._i=t,this.bi=null,this.xi=NaN,this.Mi=NaN},n.prototype.Ii=function(){if(void 0!==this.vi&&(cancelAnimationFrame(this.vi),this.vi=void 0),this.getAnimating()){for(var t=Date.now(),n=!1,i=this.li.length-1;i>=0;--i){for(var r=this.li[i],e=!0,o=0,s=r.length;o<s;++o){var u=r[o];if(!u.complete){var a=t-u.start,h=u.duration>0?a/u.duration:1;h>=1?(u.complete=!0,h=1):e=!1;var f=u.easing(h);if(u.sourceCenter){var c=u.sourceCenter[0],l=u.sourceCenter[1],v=u.targetCenter[0],d=u.targetCenter[1];this.bi=u.targetCenter;var p=c+f*(v-c),y=l+f*(d-l);this.mi=[p,y]}if(u.sourceResolution&&u.targetResolution){var m=1===f?u.targetResolution:u.sourceResolution+f*(u.targetResolution-u.sourceResolution);if(u.anchor){var w=this.Ni(this.getRotation()),g=this.Ci.resolution(m,0,w,!0);this.mi=this.calculateCenterZoom(g,u.anchor)}this.xi=u.targetResolution,this.wi=m,this.Li(!0)}if(void 0!==u.sourceRotation&&void 0!==u.targetRotation){var b=1===f?vi(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+f*(u.targetRotation-u.sourceRotation);if(u.anchor){var x=this.Ci.rotation(b,!0);this.mi=this.calculateCenterRotate(x,u.anchor)}this.Mi=u.targetRotation,this.gi=b}if(this.Li(!0),n=!0,!u.complete)break}}if(e){this.li[i]=null,this.setHint(Eu,-1),this.bi=null,this.xi=NaN,this.Mi=NaN;var M=r[0].callback;M&&Bu(M,!0)}}this.li=this.li.filter(Boolean),n&&void 0===this.vi&&(this.vi=requestAnimationFrame(this.Ii.bind(this)))}},n.prototype.calculateCenterRotate=function(t,n){var i,r=this.getCenterInternal();return void 0!==r&&(Hi(i=[r[0]-n[0],r[1]-n[1]],t-this.getRotation()),Vi(i,n)),i},n.prototype.calculateCenterZoom=function(t,n){var i,r=this.getCenterInternal(),e=this.getResolution();void 0!==r&&void 0!==e&&(i=[n[0]-t*(n[0]-r[0])/e,n[1]-t*(n[1]-r[1])/e]);return i},n.prototype.Ni=function(t){var n=this.yi;if(t){var i=n[0],r=n[1];return[Math.abs(i*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(r*Math.cos(t))]}return n},n.prototype.setViewportSize=function(t){this.yi=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},n.prototype.getCenter=function(){var t=this.getCenterInternal();return t?kr(t,this.getProjection()):t},n.prototype.getCenterInternal=function(){return this.get(Au.CENTER)},n.prototype.getConstraints=function(){return this.Ci},n.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},n.prototype.getHints=function(t){return void 0!==t?(t[0]=this.ci[0],t[1]=this.ci[1],t):this.ci.slice()},n.prototype.calculateExtent=function(t){return Nr(this.calculateExtentInternal(t),this.getProjection())},n.prototype.calculateExtentInternal=function(t){var n=t||this.zi(),i=this.getCenterInternal();St(i,1);var r=this.getResolution();St(void 0!==r,2);var e=this.getRotation();return St(void 0!==e,3),Bn(i,r,e,n)},n.prototype.getMaxResolution=function(){return this.Oi},n.prototype.getMinResolution=function(){return this.ji},n.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.ji)},n.prototype.setMaxZoom=function(t){this.Si(this.ki({maxZoom:t}))},n.prototype.getMinZoom=function(){return this.getZoomForResolution(this.Oi)},n.prototype.setMinZoom=function(t){this.Si(this.ki({minZoom:t}))},n.prototype.setConstrainResolution=function(t){this.Si(this.ki({constrainResolution:t}))},n.prototype.getProjection=function(){return this.di},n.prototype.getResolution=function(){return this.get(Au.RESOLUTION)},n.prototype.getResolutions=function(){return this.Ti},n.prototype.getResolutionForExtent=function(t,n){return this.getResolutionForExtentInternal(Lr(t,this.getProjection()),n)},n.prototype.getResolutionForExtentInternal=function(t,n){var i=n||this.zi(),r=$n(t)/i[0],e=Vn(t)/i[1];return Math.max(r,e)},n.prototype.getResolutionForValueFunction=function(t){var n=t||2,i=this.getConstrainedResolution(this.Oi),r=this.ji,e=Math.log(i/r)/Math.log(n);return function(t){return i/Math.pow(n,t*e)}},n.prototype.getRotation=function(){return this.get(Au.ROTATION)},n.prototype.getValueForResolutionFunction=function(t){var n=Math.log(t||2),i=this.getConstrainedResolution(this.Oi),r=this.ji,e=Math.log(i/r)/n;return function(t){return Math.log(i/t)/n/e}},n.prototype.zi=function(t){var n=this.Ni(t),i=this.Ai;return i&&(n=[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]),n},n.prototype.getState=function(){var t=this.getProjection(),n=this.getResolution(),i=this.getRotation(),r=this.getCenterInternal(),e=this.Ai;if(e){var o=this.zi();r=Zu(r,this.Ni(),[o[0]/2+e[3],o[1]/2+e[0]],n,i)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:n,nextCenter:this.bi,nextResolution:this.xi,nextRotation:this.Mi,rotation:i,zoom:this.getZoom()}},n.prototype.getZoom=function(){var t,n=this.getResolution();return void 0!==n&&(t=this.getZoomForResolution(n)),t},n.prototype.getZoomForResolution=function(t){var n,i,r=this.Pi||0;if(this.Ti){var e=m(this.Ti,t,1);r=e,n=this.Ti[e],i=e==this.Ti.length-1?2:n/this.Ti[e+1]}else n=this.Oi,i=this.Ei;return r+Math.log(n/t)/Math.log(i)},n.prototype.getResolutionForZoom=function(t){if(this.Ti){if(this.Ti.length<=1)return 0;var n=oi(Math.floor(t),0,this.Ti.length-2),i=this.Ti[n]/this.Ti[n+1];return this.Ti[n]/Math.pow(i,oi(t-n,0,1))}return this.Oi/Math.pow(this.Ei,t-this.Pi)},n.prototype.fit=function(t,n){var i;if(St(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))St(!Hn(t),25),i=Ze(r=Lr(t,this.getProjection()));else if("Circle"===t.getType()){var r;(i=Ze(r=Lr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),qn(r))}else{var e=Cr();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,n)},n.prototype.rotatedExtentForGeometry=function(t){for(var n=this.getRotation(),i=Math.cos(n),r=Math.sin(-n),e=t.getFlatCoordinates(),o=t.getStride(),s=1/0,u=1/0,a=-1/0,h=-1/0,f=0,c=e.length;f<c;f+=o){var l=e[f]*i-e[f+1]*r,v=e[f]*r+e[f+1]*i;s=Math.min(s,l),u=Math.min(u,v),a=Math.max(a,l),h=Math.max(h,v)}return[s,u,a,h]},n.prototype.fitInternal=function(t,n){var i=n||{},r=i.size;r||(r=this.zi());var e,o=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;e=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var u=this.rotatedExtentForGeometry(t),a=this.getResolutionForExtentInternal(u,[r[0]-o[1]-o[3],r[1]-o[0]-o[2]]);a=isNaN(a)?e:Math.max(a,e),a=this.getConstrainedResolution(a,s?0:1);var h=this.getRotation(),f=Math.sin(h),c=Math.cos(h),l=qn(u);l[0]+=(o[1]-o[3])/2*a,l[1]+=(o[0]-o[2])/2*a;var v=l[0]*c-l[1]*f,d=l[1]*c+l[0]*f,p=this.getConstrainedCenter([v,d],a),y=i.callback?i.callback:j;void 0!==i.duration?this.animateInternal({resolution:a,center:p,duration:i.duration,easing:i.easing},y):(this.wi=a,this.mi=p,this.Li(!1,!0),Bu(y,!0))},n.prototype.centerOn=function(t,n,i){this.centerOnInternal(Ir(t,this.getProjection()),n,i)},n.prototype.centerOnInternal=function(t,n,i){this.setCenterInternal(Zu(t,n,i,this.getResolution(),this.getRotation()))},n.prototype.calculateCenterShift=function(t,n,i,r){var e,o=this.Ai;if(o&&t){var s=this.zi(-i),u=Zu(t,r,[s[0]/2+o[3],s[1]/2+o[0]],n,i);e=[t[0]-u[0],t[1]-u[1]]}return e},n.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},n.prototype.adjustCenter=function(t){var n=kr(this.mi,this.getProjection());this.setCenter([n[0]+t[0],n[1]+t[1]])},n.prototype.adjustCenterInternal=function(t){var n=this.mi;this.setCenterInternal([n[0]+t[0],n[1]+t[1]])},n.prototype.adjustResolution=function(t,n){var i=n&&Ir(n,this.getProjection());this.adjustResolutionInternal(t,i)},n.prototype.adjustResolutionInternal=function(t,n){var i=this.getAnimating()||this.getInteracting(),r=this.Ni(this.getRotation()),e=this.Ci.resolution(this.wi*t,0,r,i);n&&(this.mi=this.calculateCenterZoom(e,n)),this.wi*=t,this.Li()},n.prototype.adjustZoom=function(t,n){this.adjustResolution(Math.pow(this.Ei,-t),n)},n.prototype.adjustRotation=function(t,n){n&&(n=Ir(n,this.getProjection())),this.adjustRotationInternal(t,n)},n.prototype.adjustRotationInternal=function(t,n){var i=this.getAnimating()||this.getInteracting(),r=this.Ci.rotation(this.gi+t,i);n&&(this.mi=this.calculateCenterRotate(r,n)),this.gi+=t,this.Li()},n.prototype.setCenter=function(t){this.setCenterInternal(t?Ir(t,this.getProjection()):t)},n.prototype.setCenterInternal=function(t){this.mi=t,this.Li()},n.prototype.setHint=function(t,n){return this.ci[t]+=n,this.changed(),this.ci[t]},n.prototype.setResolution=function(t){this.wi=t,this.Li()},n.prototype.setRotation=function(t){this.gi=t,this.Li()},n.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},n.prototype.Li=function(t,n){var i=this.getAnimating()||this.getInteracting()||n,r=this.Ci.rotation(this.gi,i),e=this.Ni(r),o=this.Ci.resolution(this.wi,0,e,i),s=this.Ci.center(this.mi,o,e,i,this.calculateCenterShift(this.mi,o,r,e));this.get(Au.ROTATION)!==r&&this.set(Au.ROTATION,r),this.get(Au.RESOLUTION)!==o&&(this.set(Au.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),s&&this.get(Au.CENTER)&&Ki(this.get(Au.CENTER),s)||this.set(Au.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this._i=void 0},n.prototype.resolveConstraints=function(t,n,i){var r=void 0!==t?t:200,e=n||0,o=this.Ci.rotation(this.gi),s=this.Ni(o),u=this.Ci.resolution(this.wi,e,s),a=this.Ci.center(this.mi,u,s,!1,this.calculateCenterShift(this.mi,u,o,s));if(0===r&&!this._i)return this.wi=u,this.gi=o,this.mi=a,void this.Li();var h=i||(0===r?this._i:void 0);this._i=void 0,this.getResolution()===u&&this.getRotation()===o&&this.getCenterInternal()&&Ki(this.getCenterInternal(),a)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:a,resolution:u,duration:r,easing:mt,anchor:h}))},n.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Tu,1)},n.prototype.endInteraction=function(t,n,i){var r=i&&Ir(i,this.getProjection());this.endInteractionInternal(t,n,r)},n.prototype.endInteractionInternal=function(t,n,i){this.setHint(Tu,-1),this.resolveConstraints(t,n,i)},n.prototype.getConstrainedCenter=function(t,n){var i=this.Ni(this.getRotation());return this.Ci.center(t,n||this.getResolution(),i)},n.prototype.getConstrainedZoom=function(t,n){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,n))},n.prototype.getConstrainedResolution=function(t,n){var i=n||0,r=this.Ni(this.getRotation());return this.Ci.resolution(t,i,r)},n}(et);function Ku(t,n,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*n,i[1]=t[1]+2*n,i}function Hu(t){return t[0]>0&&t[1]>0}function Ju(t,n,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*n+.5|0,i[1]=t[1]*n+.5|0,i}function Qu(t,n){return Array.isArray(t)?t:(void 0===n?n=[t,t]:(n[0]=t,n[1]=t),n)}var ta=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function na(t){t instanceof ls?t.setMapInternal(null):t instanceof nu&&t.getLayers().forEach(na)}function ia(t,n){if(t instanceof ls)t.setMapInternal(n);else if(t instanceof nu)for(var i=t.getLayers().getArray(),r=0,e=i.length;r<e;++r)ia(i[r],n)}var ra=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=function(t){var n=null;void 0!==t.keyboardEventTarget&&(n="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,r,e,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new nu({layers:t.layers});o[wu]=s,o[bu]=t.target,o[xu]=t.view instanceof $u?t.view:new $u,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ft(t.controls.slice()):(St("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new ft(t.interactions.slice()):(St("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?e=new ft(t.overlays.slice()):(St("function"==typeof t.overlays.getArray,49),e=t.overlays):e=new ft;return{controls:i,interactions:r,keyboardEventTarget:n,overlays:e,values:o}}(n);i.Ri,i.Fi=!0,i.Gi=i.handleBrowserEvent.bind(i),i.Di=void 0!==n.maxTilesLoading?n.maxTilesLoading:16,i.kt=void 0!==n.pixelRatio?n.pixelRatio:Xt,i.qi,i.Ui,i.Bi=function(){this.Ui=void 0,this.Xi(Date.now())}.bind(i),i.Vi=[1,0,0,1,0,0],i.Wi=[1,0,0,1,0,0],i.Yi=0,i.Zi=null,i.$i=null,i.Ki=null,i.Hi=null,i.Ji=null,i.Qi=document.createElement("div"),i.Qi.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.Qi.style.position="relative",i.Qi.style.overflow="hidden",i.Qi.style.width="100%",i.Qi.style.height="100%",i.tr=document.createElement("div"),i.tr.style.position="absolute",i.tr.style.zIndex="0",i.tr.style.width="100%",i.tr.style.height="100%",i.tr.style.pointerEvents="none",i.tr.className="ol-overlaycontainer",i.Qi.appendChild(i.tr),i.nr=document.createElement("div"),i.nr.style.position="absolute",i.nr.style.zIndex="0",i.nr.style.width="100%",i.nr.style.height="100%",i.nr.style.pointerEvents="none",i.nr.className="ol-overlaycontainer-stopevent",i.Qi.appendChild(i.nr),i.ir=null,i.In=n.moveTolerance,i.rr=r.keyboardEventTarget,i.er=null,i.controls=r.controls||new ft,i.interactions=r.interactions||new ft,i.sr=r.overlays,i.ur={},i.hn=null,i.ar=[],i.hr=new Ou(i.getTilePriority.bind(i),i.cr.bind(i)),i.addChangeListener(wu,i.lr),i.addChangeListener(xu,i.vr),i.addChangeListener(gu,i.dr),i.addChangeListener(bu,i.pr),i.setProperties(r.values);var e=i;return!n.view||n.view instanceof $u||n.view.then((function(t){e.setView(new $u(t))})),i.controls.addEventListener(ot,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(st,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ot,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(st,function(t){t.element.setMap(null)}.bind(i)),i.sr.addEventListener(ot,function(t){this.yr(t.element)}.bind(i)),i.sr.addEventListener(st,function(t){var n=t.element.getId();void 0!==n&&delete this.ur[n.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.sr.forEach(i.yr.bind(i)),i}return ta(n,t),n.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},n.prototype.addControl=function(t){this.getControls().push(t)},n.prototype.addInteraction=function(t){this.getInteractions().push(t)},n.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},n.prototype.mr=function(t){ia(t.layer,this)},n.prototype.addOverlay=function(t){this.getOverlays().push(t)},n.prototype.yr=function(t){var n=t.getId();void 0!==n&&(this.ur[n.toString()]=t),t.setMap(this)},n.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.sr.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},n.prototype.forEachFeatureAtPixel=function(t,n,i){if(this.Zi&&this.hn){var r=this.getCoordinateFromPixelInternal(t),e=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,o=void 0!==i.layerFilter?i.layerFilter:S,s=!1!==i.checkWrapped;return this.hn.forEachFeatureAtCoordinate(r,this.Zi,e,s,n,null,o,null)}},n.prototype.getFeaturesAtPixel=function(t,n){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),n),i},n.prototype.getAllLayers=function(){var t=[];return function n(i){i.forEach((function(i){i instanceof nu?n(i.getLayers()):t.push(i)}))}(this.getLayers()),t},n.prototype.forEachLayerAtPixel=function(t,n,i){if(this.Zi&&this.hn){var r=i||{},e=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||S;return this.hn.forEachLayerAtPixel(t,this.Zi,e,n,o)}},n.prototype.hasFeatureAtPixel=function(t,n){if(!this.Zi||!this.hn)return!1;var i=this.getCoordinateFromPixelInternal(t),r=void 0!==(n=void 0!==n?n:{}).layerFilter?n.layerFilter:S,e=void 0!==n.hitTolerance?n.hitTolerance:0,o=!1!==n.checkWrapped;return this.hn.hasFeatureAtCoordinate(i,this.Zi,e,o,r,null)},n.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},n.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},n.prototype.getEventPixel=function(t){var n=this.Qi.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-n.left,i.clientY-n.top]},n.prototype.getTarget=function(){return this.get(bu)},n.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},n.prototype.getCoordinateFromPixel=function(t){return kr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},n.prototype.getCoordinateFromPixelInternal=function(t){var n=this.Zi;return n?tn(n.pixelToCoordinateTransform,t.slice()):null},n.prototype.getControls=function(){return this.controls},n.prototype.getOverlays=function(){return this.sr},n.prototype.getOverlayById=function(t){var n=this.ur[t.toString()];return void 0!==n?n:null},n.prototype.getInteractions=function(){return this.interactions},n.prototype.getLayerGroup=function(){return this.get(wu)},n.prototype.setLayers=function(t){var n=this.getLayerGroup();if(t instanceof ft)n.setLayers(t);else{var i=n.getLayers();i.clear(),i.extend(t)}},n.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},n.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),n=0,i=t.length;n<i;++n){var r=t[n];if(r.visible){var e=r.layer.getRenderer();if(e&&!e.ready)return!0;var o=r.layer.getSource();if(o&&o.loading)return!0}}return!1},n.prototype.getPixelFromCoordinate=function(t){var n=Ir(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(n)},n.prototype.getPixelFromCoordinateInternal=function(t){var n=this.Zi;return n?tn(n.coordinateToPixelTransform,t.slice(0,2)):null},n.prototype.getRenderer=function(){return this.hn},n.prototype.getSize=function(){return this.get(gu)},n.prototype.getView=function(){return this.get(xu)},n.prototype.getViewport=function(){return this.Qi},n.prototype.getOverlayContainer=function(){return this.tr},n.prototype.getOverlayContainerStopEvent=function(){return this.nr},n.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},n.prototype.getTilePriority=function(t,n,i,r){return ju(this.Zi,t,n,i,r)},n.prototype.handleBrowserEvent=function(t,n){var i=n||t.type,r=new ou(i,this,t);this.handleMapBrowserEvent(r)},n.prototype.handleMapBrowserEvent=function(t){if(this.Zi){var n=t.originalEvent,i=n.type;if(i===au||i===Z||i===B){var r=this.getOwnerDocument(),e=this.Qi.getRootNode?this.Qi.getRootNode():r,o=n.target;if(this.nr.contains(o)||!(e===r?r.documentElement:e).contains(o))return}if(t.frameState=this.Zi,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),u=s.length-1;u>=0;u--){var a=s[u];if(a.getMap()===this&&a.getActive()&&this.getTargetElement())if(!a.handleEvent(t)||t.propagationStopped)break}}},n.prototype.handlePostRender=function(){var t=this.Zi,n=this.hr;if(!n.isEmpty()){var i=this.Di,r=i;if(t){var e=t.viewHints;if(e[Eu]||e[Tu]){var o=Date.now()-t.time>8;i=o?0:8,r=o?0:2}}n.getTilesLoading()<i&&(n.reprioritize(),n.loadMoreTiles(i,r))}t&&this.hn&&!t.animate&&(!0===this.Ri?(this.hasListener(hs)&&this.hn.dispatchRenderEvent(hs,t),!1===this.Fi&&(this.Fi=!0,this.dispatchEvent(new ru(mu,this,t)))):!0===this.Fi&&(this.Fi=!1,this.dispatchEvent(new ru(yu,this,t))));for(var s=this.ar,u=0,a=s.length;u<a;++u)s[u](this,t);s.length=0},n.prototype.dr=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},n.prototype.pr=function(){if(this.ir){for(var t=0,n=this.er.length;t<n;++t)H(this.er[t]);this.er=null,this.Qi.removeEventListener(R,this.Gi),this.Qi.removeEventListener(Z,this.Gi),this.ir.dispose(),this.ir=null,To(this.Qi)}var i=this.getTargetElement();if(i){for(var r in i.appendChild(this.Qi),this.hn||(this.hn=this.createRenderer()),this.ir=new lu(this,this.In),su)this.ir.addEventListener(su[r],this.handleMapBrowserEvent.bind(this));this.Qi.addEventListener(R,this.Gi,!1),this.Qi.addEventListener(Z,this.Gi,!!Yt&&{passive:!1});var e=this.getOwnerDocument().defaultView,o=this.rr?this.rr:i;this.er=[$(o,B,this.handleBrowserEvent,this),$(o,X,this.handleBrowserEvent,this),$(e,W,this.updateSize,this)]}else this.hn&&(clearTimeout(this.qi),this.qi=void 0,this.ar.length=0,this.hn.dispose(),this.hn=null),this.Ui&&(cancelAnimationFrame(this.Ui),this.Ui=void 0);this.updateSize()},n.prototype.cr=function(){this.render()},n.prototype.wr=function(){this.render()},n.prototype.vr=function(){this.Ki&&(H(this.Ki),this.Ki=null),this.Hi&&(H(this.Hi),this.Hi=null);var t=this.getView();t&&(this.gr(),this.Ki=$(t,l,this.wr,this),this.Hi=$(t,L,this.wr,this),t.resolveConstraints(0)),this.render()},n.prototype.lr=function(){this.Ji&&(this.Ji.forEach(H),this.Ji=null);var t=this.getLayerGroup();t&&(this.mr(new Qs("addlayer",t)),this.Ji=[$(t,l,this.render,this),$(t,L,this.render,this),$(t,"addlayer",this.mr,this),$(t,"removelayer",this.br,this)]),this.render()},n.prototype.isRendered=function(){return!!this.Zi},n.prototype.renderSync=function(){this.Ui&&cancelAnimationFrame(this.Ui),this.Bi()},n.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),n=0,i=t.length;n<i;++n){var r=t[n].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}},n.prototype.render=function(){this.hn&&void 0===this.Ui&&(this.Ui=requestAnimationFrame(this.Bi))},n.prototype.removeControl=function(t){return this.getControls().remove(t)},n.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},n.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},n.prototype.br=function(t){na(t.layer)},n.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},n.prototype.Xi=function(t){var n=this,i=this.getSize(),r=this.getView(),e=this.Zi,s=null;if(void 0!==i&&Hu(i)&&r&&r.isDef()){var u=r.getHints(this.Zi?this.Zi.viewHints:void 0),a=r.getState();if(s={animate:!1,coordinateToPixelTransform:this.Vi,declutterTree:null,extent:Bn(a.center,a.resolution,a.rotation,i),index:this.Yi++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.kt,pixelToCoordinateTransform:this.Wi,postRenderFunctions:[],size:i,tileQueue:this.hr,time:t,usedTiles:{},viewState:a,viewHints:u,wantedTiles:{},mapId:o(this),renderTargets:{}},a.nextCenter&&a.nextResolution){var h=isNaN(a.nextRotation)?a.rotation:a.nextRotation;s.nextExtent=Bn(a.nextCenter,a.nextResolution,h,i)}}if(this.Zi=s,this.hn.renderFrame(s),s){if(s.animate&&this.render(),Array.prototype.push.apply(this.ar,s.postRenderFunctions),e)(!this.$i||!Hn(this.$i)&&!An(s.extent,this.$i))&&(this.dispatchEvent(new ru(du,this,e)),this.$i=jn(this.$i));this.$i&&!s.viewHints[Eu]&&!s.viewHints[Tu]&&!An(s.extent,this.$i)&&(this.dispatchEvent(new ru(pu,this,s)),wn(s.extent,this.$i))}this.dispatchEvent(new ru(vu,this,s)),this.Ri=this.hasListener(yu)||this.hasListener(mu)||this.hasListener(hs)?!this.hr.getTilesLoading()&&!this.hr.getCount()&&!this.getLoadingOrNotReady():void 0,this.qi||(this.qi=setTimeout((function(){n.qi=void 0,n.handlePostRender()}),0))},n.prototype.setLayerGroup=function(t){var n=this.getLayerGroup();n&&this.br(new Qs("removelayer",n)),this.set(wu,t)},n.prototype.setSize=function(t){this.set(gu,t)},n.prototype.setTarget=function(t){this.set(bu,t)},n.prototype.setView=function(t){if(!t||t instanceof $u)this.set(xu,t);else{this.set(xu,new $u);var n=this;t.then((function(t){n.setView(new $u(t))}))}},n.prototype.updateSize=function(){var t=this.getTargetElement(),n=void 0;if(t){var i=getComputedStyle(t),r=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),e=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(r)||isNaN(e)||!Hu(n=[r,e])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(n),this.gr()},n.prototype.gr=function(){var t=this.getView();if(t){var n=void 0,i=getComputedStyle(this.Qi);i.width&&i.height&&(n=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(n)}},n}(et),ea=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oa=function(t){function n(n){var i=t.call(this)||this,r=n.element;return!r||n.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),i.element=r||null,i.Mr=null,i.vn=null,i.listenerKeys=[],n.render&&(i.render=n.render),n.target&&i.setTarget(n.target),i}return ea(n,t),n.prototype.disposeInternal=function(){To(this.element),t.prototype.disposeInternal.call(this)},n.prototype.getMap=function(){return this.vn},n.prototype.setMap=function(t){this.vn&&To(this.element);for(var n=0,i=this.listenerKeys.length;n<i;++n)H(this.listenerKeys[n]);(this.listenerKeys.length=0,this.vn=t,t)&&((this.Mr?this.Mr:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==j&&this.listenerKeys.push($(t,vu,this.render,this)),t.render())},n.prototype.render=function(t){},n.prototype.setTarget=function(t){this.Mr="string"==typeof t?document.getElementById(t):t},n}(et),sa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ua=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this)._r=document.createElement("ul"),i.Sr=void 0===r.collapsed||r.collapsed,i.jr=i.Sr,i.Er=void 0!==r.collapsible,i.Tr=void 0===r.collapsible||r.collapsible,i.Tr||(i.Sr=!1);var e=void 0!==r.className?r.className:"ol-attribution",o=void 0!==r.tipLabel?r.tipLabel:"Attributions",s=void 0!==r.expandClassName?r.expandClassName:e+"-expand",u=void 0!==r.collapseLabel?r.collapseLabel:"",a=void 0!==r.collapseClassName?r.collapseClassName:e+"-collapse";"string"==typeof u?(i.Ar=document.createElement("span"),i.Ar.textContent=u,i.Ar.className=a):i.Ar=u;var h=void 0!==r.label?r.label:"i";"string"==typeof h?(i.Pr=document.createElement("span"),i.Pr.textContent=h,i.Pr.className=s):i.Pr=h;var f=i.Tr&&!i.Sr?i.Ar:i.Pr;i.Cr=document.createElement("button"),i.Cr.setAttribute("type","button"),i.Cr.setAttribute("aria-expanded",String(!i.Sr)),i.Cr.title=o,i.Cr.appendChild(f),i.Cr.addEventListener(F,i.kr.bind(i),!1);var c=e+" "+"ol-unselectable "+Ms+(i.Sr&&i.Tr?" ol-collapsed":"")+(i.Tr?"":" ol-uncollapsible"),l=i.element;return l.className=c,l.appendChild(i.Cr),l.appendChild(i._r),i.Ir=[],i.mn=!0,i}return sa(n,t),n.prototype.Nr=function(t){for(var n={},i=[],r=!0,e=t.layerStatesArray,o=0,s=e.length;o<s;++o){var u=e[o];if(cs(u,t.viewState)){var a=u.layer.getSource();if(a){var h=a.getAttributions();if(h){var f=h(t);if(f)if(r=r&&!1!==a.getAttributionsCollapsible(),Array.isArray(f))for(var c=0,l=f.length;c<l;++c)f[c]in n||(i.push(f[c]),n[f[c]]=!0);else f in n||(i.push(f),n[f]=!0)}}}}return this.Er||this.setCollapsible(r),i},n.prototype.Lr=function(t){if(t){var n=this.Nr(t),i=n.length>0;if(this.mn!=i&&(this.element.style.display=i?"":"none",this.mn=i),!x(n,this.Ir)){Ao(this._r);for(var r=0,e=n.length;r<e;++r){var o=document.createElement("li");o.innerHTML=n[r],this._r.appendChild(o)}this.Ir=n}}else this.mn&&(this.element.style.display="none",this.mn=!1)},n.prototype.kr=function(t){t.preventDefault(),this.zr(),this.jr=this.Sr},n.prototype.zr=function(){this.element.classList.toggle(_s),this.Sr?Eo(this.Ar,this.Pr):Eo(this.Pr,this.Ar),this.Sr=!this.Sr,this.Cr.setAttribute("aria-expanded",String(!this.Sr))},n.prototype.getCollapsible=function(){return this.Tr},n.prototype.setCollapsible=function(t){this.Tr!==t&&(this.Tr=t,this.element.classList.toggle("ol-uncollapsible"),this.jr&&this.zr())},n.prototype.setCollapsed=function(t){this.jr=t,this.Tr&&this.Sr!==t&&this.zr()},n.prototype.getCollapsed=function(){return this.Sr},n.prototype.render=function(t){this.Lr(t.frameState)},n}(oa),aa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ha=function(t){function n(n){var i=this,r=n||{};i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var e=void 0!==r.className?r.className:"ol-rotate",o=void 0!==r.label?r.label:"⇧",s=void 0!==r.compassClassName?r.compassClassName:"ol-compass";i.Pr=null,"string"==typeof o?(i.Pr=document.createElement("span"),i.Pr.className=s,i.Pr.textContent=o):(i.Pr=o,i.Pr.classList.add(s));var u=r.tipLabel?r.tipLabel:"Reset rotation",a=document.createElement("button");a.className=e+"-reset",a.setAttribute("type","button"),a.title=u,a.appendChild(i.Pr),a.addEventListener(F,i.kr.bind(i),!1);var h=e+" "+"ol-unselectable "+Ms,f=i.element;return f.className=h,f.appendChild(a),i.Rr=r.resetNorth?r.resetNorth:void 0,i.Fr=void 0!==r.duration?r.duration:250,i.Gr=void 0===r.autoHide||r.autoHide,i.Dr=void 0,i.Gr&&i.element.classList.add(ws),i}return aa(n,t),n.prototype.kr=function(t){t.preventDefault(),void 0!==this.Rr?this.Rr():this.qr()},n.prototype.qr=function(){var t=this.getMap().getView();if(t){var n=t.getRotation();void 0!==n&&(this.Fr>0&&n%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.Fr,easing:mt}):t.setRotation(0))}},n.prototype.render=function(t){var n=t.frameState;if(n){var i=n.viewState.rotation;if(i!=this.Dr){var r="rotate("+i+"rad)";if(this.Gr){var e=this.element.classList.contains(ws);e||0!==i?e&&0!==i&&this.element.classList.remove(ws):this.element.classList.add(ws)}this.Pr.style.transform=r}this.Dr=i}},n}(oa),fa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ca=function(t){function n(n){var i=this,r=n||{};i=t.call(this,{element:document.createElement("div"),target:r.target})||this;var e=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:e+"-in",u=void 0!==r.zoomOutClassName?r.zoomOutClassName:e+"-out",a=void 0!==r.zoomInLabel?r.zoomInLabel:"+",h=void 0!==r.zoomOutLabel?r.zoomOutLabel:"–",f=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",c=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=s,l.setAttribute("type","button"),l.title=f,l.appendChild("string"==typeof a?document.createTextNode(a):a),l.addEventListener(F,i.kr.bind(i,o),!1);var v=document.createElement("button");v.className=u,v.setAttribute("type","button"),v.title=c,v.appendChild("string"==typeof h?document.createTextNode(h):h),v.addEventListener(F,i.kr.bind(i,-o),!1);var d=e+" "+"ol-unselectable "+Ms,p=i.element;return p.className=d,p.appendChild(l),p.appendChild(v),i.Fr=void 0!==r.duration?r.duration:250,i}return fa(n,t),n.prototype.kr=function(t,n){n.preventDefault(),this.Ur(t)},n.prototype.Ur=function(t){var n=this.getMap().getView();if(n){var i=n.getZoom();if(void 0!==i){var r=n.getConstrainedZoom(i+t);this.Fr>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.Fr,easing:mt})):n.setZoom(r)}}},n}(oa);function la(t){var n=t||{},i=new ft;return(void 0===n.zoom||n.zoom)&&i.push(new ca(n.zoomOptions)),(void 0===n.rotate||n.rotate)&&i.push(new ha(n.rotateOptions)),(void 0===n.attribution||n.attribution)&&i.push(new ua(n.attributionOptions)),i}var va="active",da=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function pa(t,n,i){var r=t.getCenterInternal();if(r){var e=[r[0]+n[0],r[1]+n[1]];t.animateInternal({duration:void 0!==i?i:250,easing:gt,center:t.getConstrainedCenter(e)})}}function ya(t,n,i,r){var e=t.getZoom();if(void 0!==e){var o=t.getConstrainedZoom(e+n),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==r?r:250,easing:mt})}}var ma=function(t){function n(n){var i=t.call(this)||this;return i.on,i.once,i.un,n&&n.handleEvent&&(i.handleEvent=n.handleEvent),i.vn=null,i.setActive(!0),i}return da(n,t),n.prototype.getActive=function(){return this.get(va)},n.prototype.getMap=function(){return this.vn},n.prototype.handleEvent=function(t){return!0},n.prototype.setActive=function(t){this.set(va,t)},n.prototype.setMap=function(t){this.vn=t},n}(et),wa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ga=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Br=r.delta?r.delta:1,i.Fr=void 0!==r.duration?r.duration:250,i}return wa(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==su.DBLCLICK){var i=t.originalEvent,r=t.map,e=t.coordinate,o=i.shiftKey?-this.Br:this.Br;ya(r.getView(),o,e,this.Fr),i.preventDefault(),n=!0}return!n},n}(ma),ba=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function xa(t){for(var n=t.length,i=0,r=0,e=0;e<n;e++)i+=t[e].clientX,r+=t[e].clientY;return[i/n,r/n]}var Ma=function(t){function n(n){var i=this,r=n||{};return i=t.call(this,r)||this,r.handleDownEvent&&(i.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(i.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(i.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(i.handleUpEvent=r.handleUpEvent),r.stopDown&&(i.stopDown=r.stopDown),i.handlingDownUpSequence=!1,i.targetPointers=[],i}return ba(n,t),n.prototype.getPointerCount=function(){return this.targetPointers.length},n.prototype.handleDownEvent=function(t){return!1},n.prototype.handleDragEvent=function(t){},n.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var n=!1;if(this.Xr(t),this.handlingDownUpSequence){if(t.type==su.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==su.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==su.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,n=this.stopDown(r)}else t.type==su.POINTERMOVE&&this.handleMoveEvent(t);return!n},n.prototype.handleMoveEvent=function(t){},n.prototype.handleUpEvent=function(t){return!1},n.prototype.stopDown=function(t){return t},n.prototype.Xr=function(t){t.activePointers&&(this.targetPointers=t.activePointers)},n}(ma);function _a(t){var n=arguments;return function(t){for(var i=!0,r=0,e=n.length;r<e&&(i=i&&n[r](t));++r);return i}}var Sa=function(t){var n=t.originalEvent;return n.altKey&&!(n.metaKey||n.ctrlKey)&&!n.shiftKey},Oa=function(t){var n=t.originalEvent;return n.altKey&&!(n.metaKey||n.ctrlKey)&&n.shiftKey},ja=function(t){var n=t.map.getTargetElement(),i=t.map.getOwnerDocument().activeElement;return n.contains(i)},Ea=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||ja(t)},Ta=S,Aa=function(t){var n=t.originalEvent;return 0==n.button&&!(Ut&&Bt&&n.ctrlKey)},Pa=O,Ca=function(t){return t.type==su.SINGLECLICK},ka=function(t){var n=t.originalEvent;return!n.altKey&&!(n.metaKey||n.ctrlKey)&&!n.shiftKey},Ia=function(t){var n=t.originalEvent;return!n.altKey&&!(n.metaKey||n.ctrlKey)&&n.shiftKey},Na=function(t){var n=t.originalEvent,i=n.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i&&!n.target.isContentEditable},La=function(t){var n=t.originalEvent;return St(void 0!==n,56),"mouse"==n.pointerType},za=function(t){var n=t.originalEvent;return St(void 0!==n,56),n.isPrimary&&0===n.button},Ra=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fa=function(t){function n(n){var i=t.call(this,{stopDown:O})||this,r=n||{};i.Vr=r.kinetic,i.lastCentroid=null,i.Wr,i.Yr=!1;var e=r.condition?r.condition:_a(ka,za);return i.Zr=r.onFocusOnly?_a(Ea,e):e,i.$r=!1,i}return Ra(n,t),n.prototype.handleDragEvent=function(t){this.Yr||(this.Yr=!0,this.getMap().getView().beginInteraction());var n=this.targetPointers,i=xa(n);if(n.length==this.Wr){if(this.Vr&&this.Vr.update(i[0],i[1]),this.lastCentroid){var r=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],e=t.map.getView();Ji(r,e.getResolution()),Hi(r,e.getRotation()),e.adjustCenterInternal(r)}}else this.Vr&&this.Vr.begin();this.lastCentroid=i,this.Wr=n.length,t.originalEvent.preventDefault()},n.prototype.handleUpEvent=function(t){var n=t.map,i=n.getView();if(0===this.targetPointers.length){if(!this.$r&&this.Vr&&this.Vr.end()){var r=this.Vr.getDistance(),e=this.Vr.getAngle(),o=i.getCenterInternal(),s=n.getPixelFromCoordinateInternal(o),u=n.getCoordinateFromPixelInternal([s[0]-r*Math.cos(e),s[1]-r*Math.sin(e)]);i.animateInternal({center:i.getConstrainedCenter(u),duration:500,easing:mt})}return this.Yr&&(this.Yr=!1,i.endInteraction()),!1}return this.Vr&&this.Vr.begin(),this.lastCentroid=null,!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.Zr(t)){var n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.Vr&&this.Vr.begin(),this.$r=this.targetPointers.length>1,!0}return!1},n}(Ma),Ga=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Da=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,{stopDown:O})||this).Zr=r.condition?r.condition:Oa,i.Kr=void 0,i.Fr=void 0!==r.duration?r.duration:250,i}return Ga(n,t),n.prototype.handleDragEvent=function(t){if(La(t)){var n=t.map,i=n.getView();if(i.getConstraints().rotation!==Fu){var r=n.getSize(),e=t.pixel,o=Math.atan2(r[1]/2-e[1],e[0]-r[0]/2);if(void 0!==this.Kr){var s=o-this.Kr;i.adjustRotationInternal(-s)}this.Kr=o}}},n.prototype.handleUpEvent=function(t){return!La(t)||(t.map.getView().endInteraction(this.Fr),!1)},n.prototype.handleDownEvent=function(t){return!!La(t)&&(!(!Aa(t)||!this.Zr(t))&&(t.map.getView().beginInteraction(),this.Kr=void 0,!0))},n}(Ma),qa=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ua=function(t){function n(n){var i=t.call(this)||this;return i.Hr=null,i.pn=document.createElement("div"),i.pn.style.position="absolute",i.pn.style.pointerEvents="auto",i.pn.className="ol-box "+n,i.vn=null,i.Jr=null,i.Qr=null,i}return qa(n,t),n.prototype.disposeInternal=function(){this.setMap(null)},n.prototype.te=function(){var t=this.Jr,n=this.Qr,i="px",r=this.pn.style;r.left=Math.min(t[0],n[0])+i,r.top=Math.min(t[1],n[1])+i,r.width=Math.abs(n[0]-t[0])+i,r.height=Math.abs(n[1]-t[1])+i},n.prototype.setMap=function(t){if(this.vn){this.vn.getOverlayContainer().removeChild(this.pn);var n=this.pn.style;n.left="inherit",n.top="inherit",n.width="inherit",n.height="inherit"}this.vn=t,this.vn&&this.vn.getOverlayContainer().appendChild(this.pn)},n.prototype.setPixels=function(t,n){this.Jr=t,this.Qr=n,this.createOrUpdateGeometry(),this.te()},n.prototype.createOrUpdateGeometry=function(){var t=this.Jr,n=this.Qr,i=[t,[t[0],n[1]],n,[n[0],t[1]]].map(this.vn.getCoordinateFromPixelInternal,this.vn);i[4]=i[0].slice(),this.Hr?this.Hr.setCoordinates([i]):this.Hr=new We([i])},n.prototype.getGeometry=function(){return this.Hr},n}(v),Ba=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xa="boxstart",Va="boxdrag",Wa="boxend",Ya="boxcancel",Za=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.coordinate=i,e.mapBrowserEvent=r,e}return Ba(n,t),n}(c),$a=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r=n||{};return i.ne=new Ua(r.className||"ol-dragbox"),i.ie=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(i.onBoxEnd=r.onBoxEnd),i.Jr=null,i.Zr=r.condition?r.condition:Aa,i.re=r.boxEndCondition?r.boxEndCondition:i.defaultBoxEndCondition,i}return Ba(n,t),n.prototype.defaultBoxEndCondition=function(t,n,i){var r=i[0]-n[0],e=i[1]-n[1];return r*r+e*e>=this.ie},n.prototype.getGeometry=function(){return this.ne.getGeometry()},n.prototype.handleDragEvent=function(t){this.ne.setPixels(this.Jr,t.pixel),this.dispatchEvent(new Za(Va,t.coordinate,t))},n.prototype.handleUpEvent=function(t){this.ne.setMap(null);var n=this.re(t,this.Jr,t.pixel);return n&&this.onBoxEnd(t),this.dispatchEvent(new Za(n?Wa:Ya,t.coordinate,t)),!1},n.prototype.handleDownEvent=function(t){return!!this.Zr(t)&&(this.Jr=t.pixel,this.ne.setMap(t.map),this.ne.setPixels(this.Jr,this.Jr),this.dispatchEvent(new Za(Xa,t.coordinate,t)),!0)},n.prototype.onBoxEnd=function(t){},n}(Ma),Ka=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ha=function(t){function n(n){var i=this,r=n||{},e=r.condition?r.condition:Ia;return(i=t.call(this,{condition:e,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).Fr=void 0!==r.duration?r.duration:200,i.ee=void 0!==r.out&&r.out,i}return Ka(n,t),n.prototype.onBoxEnd=function(t){var n=this.getMap().getView(),i=this.getGeometry();if(this.ee){var r=n.rotatedExtentForGeometry(i),e=n.getResolutionForExtentInternal(r),o=n.getResolution()/e;(i=i.clone()).scale(o*o)}n.fitInternal(i,{duration:this.Fr,easing:mt})},n}($a),Ja=37,Qa=38,th=39,nh=40,ih=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rh=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.oe=function(t){return ka(t)&&Na(t)},i.Zr=void 0!==r.condition?r.condition:i.oe,i.Fr=void 0!==r.duration?r.duration:100,i.se=void 0!==r.pixelDelta?r.pixelDelta:128,i}return ih(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==B){var i=t.originalEvent,r=i.keyCode;if(this.Zr(t)&&(r==nh||r==Ja||r==th||r==Qa)){var e=t.map.getView(),o=e.getResolution()*this.se,s=0,u=0;r==nh?u=-o:r==Ja?s=-o:r==th?s=o:u=o;var a=[s,u];Hi(a,e.getRotation()),pa(e,a,this.Fr),i.preventDefault(),n=!0}}return!n},n}(ma),eh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oh=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Zr=r.condition?r.condition:Na,i.Br=r.delta?r.delta:1,i.Fr=void 0!==r.duration?r.duration:100,i}return eh(n,t),n.prototype.handleEvent=function(t){var n=!1;if(t.type==B||t.type==X){var i=t.originalEvent,r=i.charCode;if(this.Zr(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var e=t.map,o=r=="+".charCodeAt(0)?this.Br:-this.Br;ya(e.getView(),o,void 0,this.Fr),i.preventDefault(),n=!0}}return!n},n}(ma),sh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uh="trackpad",ah="wheel",hh=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,r)||this).ue=0,i.ae=0,i.wt=void 0!==r.maxDelta?r.maxDelta:1,i.Fr=void 0!==r.duration?r.duration:250,i.he=void 0!==r.timeout?r.timeout:80,i.fe=void 0===r.useAnchor||r.useAnchor,i.ce=void 0!==r.constrainResolution&&r.constrainResolution;var e=r.condition?r.condition:Ta;return i.Zr=r.onFocusOnly?_a(Ea,e):e,i.le=null,i.ve=void 0,i.de,i.pe=void 0,i.ye=400,i.me,i.we=300,i}return sh(n,t),n.prototype.ge=function(){this.me=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.ae?this.ae>0?1:-1:0,this.le)},n.prototype.handleEvent=function(t){if(!this.Zr(t))return!0;if(t.type!==Z)return!0;var n,i=t.map,r=t.originalEvent;if(r.preventDefault(),this.fe&&(this.le=t.coordinate),t.type==Z&&(n=r.deltaY,Gt&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=Xt),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=40)),0===n)return!1;this.ae=n;var e=Date.now();void 0===this.ve&&(this.ve=e),(!this.pe||e-this.ve>this.ye)&&(this.pe=Math.abs(n)<4?uh:ah);var o=i.getView();if(this.pe===uh&&!o.getConstrainResolution()&&!this.ce)return this.me?clearTimeout(this.me):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.me=setTimeout(this.ge.bind(this),this.he),o.adjustZoom(-n/this.we,this.le),this.ve=e,!1;this.ue+=n;var s=Math.max(this.he-(e-this.ve),0);return clearTimeout(this.de),this.de=setTimeout(this.be.bind(this,i),s),!1},n.prototype.be=function(t){var n=t.getView();n.getAnimating()&&n.cancelAnimations();var i=-oi(this.ue,-this.wt*this.we,this.wt*this.we)/this.we;(n.getConstrainResolution()||this.ce)&&(i=i?i>0?1:-1:0),ya(n,i,this.le,this.Fr),this.pe=void 0,this.ue=0,this.le=null,this.ve=void 0,this.de=void 0},n.prototype.setMouseAnchor=function(t){this.fe=t,t||(this.le=null)},n}(ma),fh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ch=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=O),(i=t.call(this,e)||this).xe=null,i.Kr=void 0,i.Me=!1,i._e=0,i.Se=void 0!==r.threshold?r.threshold:.3,i.Fr=void 0!==r.duration?r.duration:250,i}return fh(n,t),n.prototype.handleDragEvent=function(t){var n=0,i=this.targetPointers[0],r=this.targetPointers[1],e=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);if(void 0!==this.Kr){var o=e-this.Kr;this._e+=o,!this.Me&&Math.abs(this._e)>this.Se&&(this.Me=!0),n=o}this.Kr=e;var s=t.map,u=s.getView();if(u.getConstraints().rotation!==Fu){var a=s.getViewport().getBoundingClientRect(),h=xa(this.targetPointers);h[0]-=a.left,h[1]-=a.top,this.xe=s.getCoordinateFromPixelInternal(h),this.Me&&(s.render(),u.adjustRotationInternal(n,this.xe))}},n.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.Fr),!1)},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.xe=null,this.Kr=void 0,this.Me=!1,this._e=0,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Ma),lh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vh=function(t){function n(n){var i=this,r=n||{},e=r;return e.stopDown||(e.stopDown=O),(i=t.call(this,e)||this).xe=null,i.Fr=void 0!==r.duration?r.duration:400,i.Oe=void 0,i.je=1,i}return lh(n,t),n.prototype.handleDragEvent=function(t){var n=1,i=this.targetPointers[0],r=this.targetPointers[1],e=i.clientX-r.clientX,o=i.clientY-r.clientY,s=Math.sqrt(e*e+o*o);void 0!==this.Oe&&(n=this.Oe/s),this.Oe=s;var u=t.map,a=u.getView();1!=n&&(this.je=n);var h=u.getViewport().getBoundingClientRect(),f=xa(this.targetPointers);f[0]-=h.left,f[1]-=h.top,this.xe=u.getCoordinateFromPixelInternal(f),u.render(),a.adjustResolutionInternal(n,this.xe)},n.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var n=t.map.getView(),i=this.je>1?1:-1;return n.endInteraction(this.Fr,i),!1}return!0},n.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var n=t.map;return this.xe=null,this.Oe=void 0,this.je=1,this.handlingDownUpSequence||n.getView().beginInteraction(),!0}return!1},n}(Ma);function dh(t){var n=t||{},i=new ft,r=new Io(-.005,.05,100);return(void 0===n.altShiftDragRotate||n.altShiftDragRotate)&&i.push(new Da),(void 0===n.doubleClickZoom||n.doubleClickZoom)&&i.push(new ga({delta:n.zoomDelta,duration:n.zoomDuration})),(void 0===n.dragPan||n.dragPan)&&i.push(new Fa({onFocusOnly:n.onFocusOnly,kinetic:r})),(void 0===n.pinchRotate||n.pinchRotate)&&i.push(new ch),(void 0===n.pinchZoom||n.pinchZoom)&&i.push(new vh({duration:n.zoomDuration})),(void 0===n.keyboard||n.keyboard)&&(i.push(new rh),i.push(new oh({delta:n.zoomDelta,duration:n.zoomDuration}))),(void 0===n.mouseWheelZoom||n.mouseWheelZoom)&&i.push(new hh({onFocusOnly:n.onFocusOnly,duration:n.zoomDuration})),(void 0===n.shiftDragZoom||n.shiftDragZoom)&&i.push(new Ha({duration:n.zoomDuration})),i}var ph=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yh=function(t){function n(n){return(n=A({},n)).controls||(n.controls=la()),n.interactions||(n.interactions=dh({onFocusOnly:!0})),t.call(this,n)||this}return ph(n,t),n.prototype.createRenderer=function(){return new Hs(this)},n}(ra),mh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wh="element",gh="map",bh="offset",xh="position",Mh="positioning",_h=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un,i.options=n,i.id=n.id,i.insertFirst=void 0===n.insertFirst||n.insertFirst,i.stopEvent=void 0===n.stopEvent||n.stopEvent,i.element=document.createElement("div"),i.element.className=void 0!==n.className?n.className:"ol-overlay-container ol-selectable",i.element.style.position="absolute",i.element.style.pointerEvents="auto";var r=n.autoPan;return r&&"object"!=typeof r&&(r={animation:n.autoPanAnimation,margin:n.autoPanMargin}),i.autoPan=r||!1,i.rendered={jt:"",visible:!0},i.mapPostrenderListenerKey=null,i.addChangeListener(wh,i.handleElementChanged),i.addChangeListener(gh,i.handleMapChanged),i.addChangeListener(bh,i.handleOffsetChanged),i.addChangeListener(xh,i.handlePositionChanged),i.addChangeListener(Mh,i.handlePositioningChanged),void 0!==n.element&&i.setElement(n.element),i.setOffset(void 0!==n.offset?n.offset:[0,0]),i.setPositioning(n.positioning||"top-left"),void 0!==n.position&&i.setPosition(n.position),i}return mh(n,t),n.prototype.getElement=function(){return this.get(wh)},n.prototype.getId=function(){return this.id},n.prototype.getMap=function(){return this.get(gh)||null},n.prototype.getOffset=function(){return this.get(bh)},n.prototype.getPosition=function(){return this.get(xh)},n.prototype.getPositioning=function(){return this.get(Mh)},n.prototype.handleElementChanged=function(){Ao(this.element);var t=this.getElement();t&&this.element.appendChild(t)},n.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(To(this.element),H(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=$(t,vu,this.render,this),this.updatePixelPosition();var n=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?n.insertBefore(this.element,n.childNodes[0]||null):n.appendChild(this.element),this.performAutoPan()}},n.prototype.render=function(){this.updatePixelPosition()},n.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},n.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},n.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},n.prototype.setElement=function(t){this.set(wh,t)},n.prototype.setMap=function(t){this.set(gh,t)},n.prototype.setOffset=function(t){this.set(bh,t)},n.prototype.setPosition=function(t){this.set(xh,t)},n.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},n.prototype.panIntoView=function(t){var n=this.getMap();if(n&&n.getTargetElement()&&this.get(xh)){var i=this.getRect(n.getTargetElement(),n.getSize()),r=this.getElement(),e=this.getRect(r,[Oo(r),jo(r)]),o=t||{},s=void 0===o.margin?20:o.margin;if(!xn(i,e)){var u=e[0]-i[0],a=i[2]-e[2],h=e[1]-i[1],f=i[3]-e[3],c=[0,0];if(u<0?c[0]=u-s:a<0&&(c[0]=Math.abs(a)+s),h<0?c[1]=h-s:f<0&&(c[1]=Math.abs(f)+s),0!==c[0]||0!==c[1]){var l=n.getView().getCenterInternal(),v=n.getPixelFromCoordinateInternal(l);if(!v)return;var d=[v[0]+c[0],v[1]+c[1]],p=o.animation||{};n.getView().animateInternal({center:n.getCoordinateFromPixelInternal(d),duration:p.duration,easing:p.easing})}}}},n.prototype.getRect=function(t,n){var i=t.getBoundingClientRect(),r=i.left+window.pageXOffset,e=i.top+window.pageYOffset;return[r,e,r+n[0],e+n[1]]},n.prototype.setPositioning=function(t){this.set(Mh,t)},n.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},n.prototype.updatePixelPosition=function(){var t=this.getMap(),n=this.getPosition();if(t&&t.isRendered()&&n){var i=t.getPixelFromCoordinate(n),r=t.getSize();this.updateRenderedPosition(i,r)}else this.setVisible(!1)},n.prototype.updateRenderedPosition=function(t,n){var i=this.element.style,r=this.getOffset(),e=this.getPositioning();this.setVisible(!0);var o=Math.round(t[0]+r[0])+"px",s=Math.round(t[1]+r[1])+"px",u="0%",a="0%";"bottom-right"==e||"center-right"==e||"top-right"==e?u="-100%":"bottom-center"!=e&&"center-center"!=e&&"top-center"!=e||(u="-50%"),"bottom-left"==e||"bottom-center"==e||"bottom-right"==e?a="-100%":"center-left"!=e&&"center-center"!=e&&"center-right"!=e||(a="-50%");var h="translate(".concat(u,", ").concat(a,") translate(").concat(o,", ").concat(s,")");this.rendered.jt!=h&&(this.rendered.jt=h,i.transform=h,i.msTransform=h)},n.prototype.getOptions=function(){return this.options},n}(et),Sh=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.Ee=0,this.Te={},this.Ae=null,this.Pe=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},t.prototype.clear=function(){this.Ee=0,this.Te={},this.Ae=null,this.Pe=null},t.prototype.containsKey=function(t){return this.Te.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var n=this.Ae;n;)t(n.Ce,n.ke,this),n=n.newer},t.prototype.get=function(t,n){var i=this.Te[t];return St(void 0!==i,15),i===this.Pe||(i===this.Ae?(this.Ae=this.Ae.newer,this.Ae.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.Pe,this.Pe.newer=i,this.Pe=i),i.Ce},t.prototype.remove=function(t){var n=this.Te[t];return St(void 0!==n,15),n===this.Pe?(this.Pe=n.older,this.Pe&&(this.Pe.newer=null)):n===this.Ae?(this.Ae=n.newer,this.Ae&&(this.Ae.older=null)):(n.newer.older=n.older,n.older.newer=n.newer),delete this.Te[t],--this.Ee,n.Ce},t.prototype.getCount=function(){return this.Ee},t.prototype.getKeys=function(){var t,n=new Array(this.Ee),i=0;for(t=this.Pe;t;t=t.older)n[i++]=t.ke;return n},t.prototype.getValues=function(){var t,n=new Array(this.Ee),i=0;for(t=this.Pe;t;t=t.older)n[i++]=t.Ce;return n},t.prototype.peekLast=function(){return this.Ae.Ce},t.prototype.peekLastKey=function(){return this.Ae.ke},t.prototype.peekFirstKey=function(){return this.Pe.ke},t.prototype.peek=function(t){if(this.containsKey(t))return this.Te[t].Ce},t.prototype.pop=function(){var t=this.Ae;return delete this.Te[t.ke],t.newer&&(t.newer.older=null),this.Ae=t.newer,this.Ae||(this.Pe=null),--this.Ee,t.Ce},t.prototype.replace=function(t,n){this.get(t),this.Te[t].Ce=n},t.prototype.set=function(t,n){St(!(t in this.Te),16);var i={ke:t,newer:null,older:this.Pe,Ce:n};this.Pe?this.Pe.newer=i:this.Ae=i,this.Pe=i,this.Te[t]=i,++this.Ee},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function Oh(t,n,i,r){return void 0!==r?(r[0]=t,r[1]=n,r[2]=i,r):[t,n,i]}function jh(t,n,i){return t+"/"+n+"/"+i}function Eh(t){return jh(t[0],t[1],t[2])}function Th(t){var n=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return jh(n[0],n[1],n[2])}function Ah(t){return t.split("/").map(Number)}function Ph(t){return(t[1]<<t[0])+t[2]}function Ch(t,n){var i=t[0],r=t[1],e=t[2];if(n.getMinZoom()>i||i>n.getMaxZoom())return!1;var o=n.getFullTileRange(i);return!o||o.containsXY(r,e)}var kh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ih=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return kh(n,t),n.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},n.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Ah(this.peekFirstKey())[0];this.forEach(function(n){n.tileCoord[0]!==t&&(this.remove(Eh(n.tileCoord)),n.release())}.bind(this))}},n}(Sh),Nh=function(){function t(t,n,i,r){this.minX=t,this.maxX=n,this.minY=i,this.maxY=r}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,n){return this.minX<=t&&t<=this.maxX&&this.minY<=n&&n<=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 Lh(t,n,i,r,e){return void 0!==e?(e.minX=t,e.maxX=n,e.minY=i,e.maxY=r,e):new Nh(t,n,i,r)}var zh=Nh,Rh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fh=[],Gh=function(t){function n(n,i,r,e){var o=t.call(this,n,i,{transition:0})||this;return o.Ne={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.Le={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=e.bind(void 0,o),o.wrappedTileCoord=r,o}return Rh(n,t),n.prototype.getContext=function(t){var n=o(t);return n in this.Ne||(this.Ne[n]=_o(1,1,Fh)),this.Ne[n]},n.prototype.hasContext=function(t){return o(t)in this.Ne},n.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},n.prototype.getReplayState=function(t){var n=o(t);return n in this.Le||(this.Le[n]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.Le[n]},n.prototype.load=function(){this.getSourceTiles()},n.prototype.release=function(){for(var n in this.Ne){var i=this.Ne[n];So(i),Fh.push(i.canvas),delete this.Ne[n]}t.prototype.release.call(this)},n}(xt),Dh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qh=function(t){function n(n,i,r,e,o,s){var u=t.call(this,n,i,s)||this;return u.extent=null,u.ze=e,u.Re=null,u.U,u.projection=null,u.resolution,u.Xt=o,u.Fe=r,u.key=r,u}return Dh(n,t),n.prototype.getFormat=function(){return this.ze},n.prototype.getFeatures=function(){return this.Re},n.prototype.load=function(){this.state==ct&&(this.setState(lt),this.Xt(this,this.Fe),this.U&&this.U(this.extent,this.resolution,this.projection))},n.prototype.onLoad=function(t,n){this.setFeatures(t)},n.prototype.onError=function(){this.setState(dt)},n.prototype.setFeatures=function(t){this.Re=t,this.setState(vt)},n.prototype.setLoader=function(t){this.U=t},n}(xt);function Uh(t){return Array.isArray(t)?qo(t):t}var Bh=!1;function Xh(t,n,i,r,e,o,s){var u=new XMLHttpRequest;u.open("GET","function"==typeof t?t(i,r,e):t,!0),"arraybuffer"==n.getType()&&(u.responseType="arraybuffer"),u.withCredentials=Bh,u.onload=function(t){if(!u.status||u.status>=200&&u.status<300){var r=n.getType(),a=void 0;"json"==r||"text"==r?a=u.responseText:"xml"==r?(a=u.responseXML)||(a=(new DOMParser).parseFromString(u.responseText,"application/xml")):"arraybuffer"==r&&(a=u.response),a?o(n.readFeatures(a,{extent:i,featureProjection:e}),n.readProjection(a)):s()}else s()},u.onerror=s,u.send()}function Vh(t,n){return function(i,r,e,o,s){var u=this;Xh(t,n,i,r,e,(function(t,n){u.addFeatures(t),void 0!==o&&o(t)}),s||j)}}function Wh(t,n){return[[-1/0,-1/0,1/0,1/0]]}var Yh=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Zh(t,n,i,r){var e=document.createElement("script"),s="olc_"+o(n);function u(){delete window[s],e.parentNode.removeChild(e)}e.async=!0,e.src=t+(-1==t.indexOf("?")?"?":"&")+(r||"callback")+"="+s;var a=setTimeout((function(){u(),i&&i()}),1e4);window[s]=function(t){clearTimeout(a),u(),n(t)},document.head.appendChild(e)}var $h,Kh=function(t){function n(n){var i=this,r="Unexpected response status: "+n.status;return(i=t.call(this,r)||this).name="ResponseError",i.response=n,i}return Yh(n,t),n}(Error),Hh=function(t){function n(n){var i=t.call(this,"Failed to issue request")||this;return i.name="ClientError",i.client=n,i}return Yh(n,t),n}(Error);function Jh(t){return new Promise((function(n,i){var r=new XMLHttpRequest;r.addEventListener("load",(function(t){var r=t.target;if(!r.status||r.status>=200&&r.status<300){var e=void 0;try{e=JSON.parse(r.responseText)}catch(t){var o="Error parsing response text as JSON: "+t.message;return void i(new Error(o))}n(e)}else i(new Kh(r))})),r.addEventListener("error",(function(t){i(new Hh(t.target))})),r.open("GET",t),r.setRequestHeader("Accept","application/json"),r.send()}))}function Qh(t,n){return n.indexOf("://")>=0?n:new URL(n,t).href}var tf=function(){function t(){}return t.prototype.drawCustom=function(t,n,i,r){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,n){},t.prototype.drawFeature=function(t,n){},t.prototype.drawGeometryCollection=function(t,n){},t.prototype.drawLineString=function(t,n){},t.prototype.drawMultiLineString=function(t,n){},t.prototype.drawMultiPoint=function(t,n){},t.prototype.drawMultiPolygon=function(t,n){},t.prototype.drawPoint=function(t,n){},t.prototype.drawPolygon=function(t,n){},t.prototype.drawText=function(t,n){},t.prototype.setFillStrokeStyle=function(t,n){},t.prototype.setImageStyle=function(t,n){},t.prototype.setTextStyle=function(t,n){},t}(),nf=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rf=function(t){function n(n,i,r,e,o,s,u){var a=t.call(this)||this;return a.Ne=n,a.kt=i,a.st=r,a.jt=e,a.Ge=o,a.De=s,a.qe=u,a.Ue=null,a.Be=null,a.Xe=null,a.Ve=null,a.We=null,a.Lt=null,a.Ye=0,a.Ze=0,a.$e=0,a.Ke=0,a.He=0,a.Je=0,a.Qe=!1,a.no=0,a.io=[0,0],a.ro=0,a.eo="",a.oo=0,a.so=0,a.uo=!1,a.ao=0,a.ho=[0,0],a.fo=null,a.co=null,a.lo=null,a.vo=[],a.do=[1,0,0,1,0,0],a}return nf(n,t),n.prototype.po=function(t,n,i,r){if(this.Lt){var e=Dr(t,n,i,r,this.jt,this.vo),o=this.Ne,s=this.do,u=o.globalAlpha;1!=this.Ke&&(o.globalAlpha=u*this.Ke);var a=this.no;this.Qe&&(a+=this.Ge);for(var h=0,f=e.length;h<f;h+=2){var c=e[h]-this.Ye,l=e[h+1]-this.Ze;if(0!==a||1!=this.io[0]||1!=this.io[1]){var v=c+this.Ye,d=l+this.Ze;sn(s,v,d,1,1,a,-v,-d),o.setTransform.apply(o,s),o.translate(v,d),o.scale(this.io[0],this.io[1]),o.drawImage(this.Lt,this.He,this.Je,this.ro,this.$e,-this.Ye,-this.Ze,this.ro,this.$e),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.Lt,this.He,this.Je,this.ro,this.$e,c,l,this.ro,this.$e)}1!=this.Ke&&(o.globalAlpha=u)}},n.prototype.yo=function(t,n,i,r){if(this.lo&&""!==this.eo){this.fo&&this.mo(this.fo),this.co&&this.wo(this.co),this.bo(this.lo);var e=Dr(t,n,i,r,this.jt,this.vo),o=this.Ne,s=this.ao;for(this.uo&&(s+=this.Ge);n<i;n+=r){var u=e[n]+this.oo,a=e[n+1]+this.so;if(0!==s||1!=this.ho[0]||1!=this.ho[1]){var h=sn(this.do,u,a,1,1,s,-u,-a);o.setTransform.apply(o,h),o.translate(u,a),o.scale(this.ho[0],this.ho[1]),this.co&&o.strokeText(this.eo,0,0),this.fo&&o.fillText(this.eo,0,0),o.setTransform(1,0,0,1,0,0)}else this.co&&o.strokeText(this.eo,u,a),this.fo&&o.fillText(this.eo,u,a)}}},n.prototype.xo=function(t,n,i,r,e){var o=this.Ne,s=Dr(t,n,i,r,this.jt,this.vo);o.moveTo(s[0],s[1]);var u=s.length;e&&(u-=2);for(var a=2;a<u;a+=2)o.lineTo(s[a],s[a+1]);return e&&o.closePath(),i},n.prototype.Mo=function(t,n,i,r){for(var e=0,o=i.length;e<o;++e)n=this.xo(t,n,i[e],r,!0);return n},n.prototype.drawCircle=function(t){if(Kn(this.st,t.getExtent())){if(this.Ve||this.We){this.Ve&&this.mo(this.Ve),this.We&&this.wo(this.We);var n=$r(t,this.jt,this.vo),i=n[2]-n[0],r=n[3]-n[1],e=Math.sqrt(i*i+r*r),o=this.Ne;o.beginPath(),o.arc(n[0],n[1],e,0,2*Math.PI),this.Ve&&o.fill(),this.We&&o.stroke()}""!==this.eo&&this.yo(t.getCenter(),0,2,2)}},n.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},n.prototype.setTransform=function(t){this.jt=t},n.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},n.prototype.drawFeature=function(t,n){var i=n.getGeometryFunction()(t);i&&Kn(this.st,i.getExtent())&&(this.setStyle(n),this.drawGeometry(i))},n.prototype.drawGeometryCollection=function(t){for(var n=t.getGeometriesArray(),i=0,r=n.length;i<r;++i)this.drawGeometry(n[i])},n.prototype.drawPoint=function(t){this.De&&(t=t.simplifyTransformed(this.De,this.qe));var n=t.getFlatCoordinates(),i=t.getStride();this.Lt&&this.po(n,0,n.length,i),""!==this.eo&&this.yo(n,0,n.length,i)},n.prototype.drawMultiPoint=function(t){this.De&&(t=t.simplifyTransformed(this.De,this.qe));var n=t.getFlatCoordinates(),i=t.getStride();this.Lt&&this.po(n,0,n.length,i),""!==this.eo&&this.yo(n,0,n.length,i)},n.prototype.drawLineString=function(t){if(this.De&&(t=t.simplifyTransformed(this.De,this.qe)),Kn(this.st,t.getExtent())){if(this.We){this.wo(this.We);var n=this.Ne,i=t.getFlatCoordinates();n.beginPath(),this.xo(i,0,i.length,t.getStride(),!1),n.stroke()}if(""!==this.eo){var r=t.getFlatMidpoint();this.yo(r,0,2,2)}}},n.prototype.drawMultiLineString=function(t){this.De&&(t=t.simplifyTransformed(this.De,this.qe));var n=t.getExtent();if(Kn(this.st,n)){if(this.We){this.wo(this.We);var i=this.Ne,r=t.getFlatCoordinates(),e=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var u=0,a=o.length;u<a;++u)e=this.xo(r,e,o[u],s,!1);i.stroke()}if(""!==this.eo){var h=t.getFlatMidpoints();this.yo(h,0,h.length,2)}}},n.prototype.drawPolygon=function(t){if(this.De&&(t=t.simplifyTransformed(this.De,this.qe)),Kn(this.st,t.getExtent())){if(this.We||this.Ve){this.Ve&&this.mo(this.Ve),this.We&&this.wo(this.We);var n=this.Ne;n.beginPath(),this.Mo(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.Ve&&n.fill(),this.We&&n.stroke()}if(""!==this.eo){var i=t.getFlatInteriorPoint();this.yo(i,0,2,2)}}},n.prototype.drawMultiPolygon=function(t){if(this.De&&(t=t.simplifyTransformed(this.De,this.qe)),Kn(this.st,t.getExtent())){if(this.We||this.Ve){this.Ve&&this.mo(this.Ve),this.We&&this.wo(this.We);var n=this.Ne,i=t.getOrientedFlatCoordinates(),r=0,e=t.getEndss(),o=t.getStride();n.beginPath();for(var s=0,u=e.length;s<u;++s){var a=e[s];r=this.Mo(i,r,a,o)}this.Ve&&n.fill(),this.We&&n.stroke()}if(""!==this.eo){var h=t.getFlatInteriorPoints();this.yo(h,0,h.length,2)}}},n.prototype.mo=function(t){var n=this.Ne,i=this.Ue;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,n.fillStyle=t.fillStyle):(n.fillStyle=t.fillStyle,this.Ue={fillStyle:t.fillStyle})},n.prototype.wo=function(t){var n=this.Ne,i=this.Be;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,n.lineCap=t.lineCap),n.setLineDash&&(x(i.lineDash,t.lineDash)||n.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,n.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,n.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,n.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,n.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,n.strokeStyle=t.strokeStyle)):(n.lineCap=t.lineCap,n.setLineDash&&(n.setLineDash(t.lineDash),n.lineDashOffset=t.lineDashOffset),n.lineJoin=t.lineJoin,n.lineWidth=t.lineWidth,n.miterLimit=t.miterLimit,n.strokeStyle=t.strokeStyle,this.Be={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},n.prototype.bo=function(t){var n=this.Ne,i=this.Xe,r=t.textAlign?t.textAlign:Ns;i?(i.font!=t.font&&(i.font=t.font,n.font=t.font),i.textAlign!=r&&(i.textAlign=r,n.textAlign=r),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,n.textBaseline=t.textBaseline)):(n.font=t.font,n.textAlign=r,n.textBaseline=t.textBaseline,this.Xe={font:t.font,textAlign:r,textBaseline:t.textBaseline})},n.prototype.setFillStrokeStyle=function(t,n){var i=this;if(t){var r=t.getColor();this.Ve={fillStyle:Uh(r||Ts)}}else this.Ve=null;if(n){var e=n.getColor(),o=n.getLineCap(),s=n.getLineDash(),u=n.getLineDashOffset(),a=n.getLineJoin(),h=n.getWidth(),f=n.getMiterLimit(),c=s||Ps;this.We={lineCap:void 0!==o?o:As,lineDash:1===this.kt?c:c.map((function(t){return t*i.kt})),lineDashOffset:(u||0)*this.kt,lineJoin:void 0!==a?a:Cs,lineWidth:(void 0!==h?h:1)*this.kt,miterLimit:void 0!==f?f:ks,strokeStyle:Uh(e||Is)}}else this.We=null},n.prototype.setImageStyle=function(t){var n;if(t&&(n=t.getSize())){var i=t.getAnchor(),r=t.getOrigin();this.Lt=t.getImage(this.kt),this.Ye=i[0]*this.kt,this.Ze=i[1]*this.kt,this.$e=n[1]*this.kt,this.Ke=t.getOpacity(),this.He=r[0],this.Je=r[1],this.Qe=t.getRotateWithView(),this.no=t.getRotation(),this.io=t.getScaleArray(),this.ro=n[0]*this.kt}else this.Lt=null},n.prototype.setTextStyle=function(t){if(t){var n=t.getFill();if(n){var i=n.getColor();this.fo={fillStyle:Uh(i||Ts)}}else this.fo=null;var r=t.getStroke();if(r){var e=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),u=r.getLineDashOffset(),a=r.getLineJoin(),h=r.getWidth(),f=r.getMiterLimit();this.co={lineCap:void 0!==o?o:As,lineDash:s||Ps,lineDashOffset:u||0,lineJoin:void 0!==a?a:Cs,lineWidth:void 0!==h?h:1,miterLimit:void 0!==f?f:ks,strokeStyle:Uh(e||Is)}}else this.co=null;var c=t.getFont(),l=t.getOffsetX(),v=t.getOffsetY(),d=t.getRotateWithView(),p=t.getRotation(),y=t.getScaleArray(),m=t.getText(),w=t.getTextAlign(),g=t.getTextBaseline();this.lo={font:void 0!==c?c:Es,textAlign:void 0!==w?w:Ns,textBaseline:void 0!==g?g:Ls},this.eo=void 0!==m?Array.isArray(m)?m.reduce((function(t,n,i){return t+(i%2?" ":n)}),""):m:"",this.oo=void 0!==l?this.kt*l:0,this.so=void 0!==v?this.kt*v:0,this.uo=void 0!==d&&d,this.ao=void 0!==p?p:0,this.ho=[this.kt*y[0],this.kt*y[1]]}else this.eo=""},n}(tf),ef={Point:function(t,n,i,r,e){var o,s=i.getImage(),u=i.getText();if(s){if(s.getImageState()!=po)return;var a=t;if(e){var h=s.getDeclutterMode();if("none"!==h)if(a=e,"obstacle"===h){var f=t.getBuilder(i.getZIndex(),"Image");f.setImageStyle(s,o),f.drawPoint(n,r)}else u&&u.getText()&&(o={})}var c=a.getBuilder(i.getZIndex(),"Image");c.setImageStyle(s,o),c.drawPoint(n,r)}if(u&&u.getText()){var l=t;e&&(l=e);var v=l.getBuilder(i.getZIndex(),"Text");v.setTextStyle(u,o),v.drawText(n,r)}},LineString:function(t,n,i,r,e){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawLineString(n,r)}var u=i.getText();if(u&&u.getText()){var a=(e||t).getBuilder(i.getZIndex(),"Text");a.setTextStyle(u),a.drawText(n,r)}},Polygon:function(t,n,i,r,e){var o=i.getFill(),s=i.getStroke();if(o||s){var u=t.getBuilder(i.getZIndex(),"Polygon");u.setFillStrokeStyle(o,s),u.drawPolygon(n,r)}var a=i.getText();if(a&&a.getText()){var h=(e||t).getBuilder(i.getZIndex(),"Text");h.setTextStyle(a),h.drawText(n,r)}},MultiPoint:function(t,n,i,r,e){var o,s=i.getImage(),u=i.getText();if(s){if(s.getImageState()!=po)return;var a=t;if(e){var h=s.getDeclutterMode();if("none"!==h)if(a=e,"obstacle"===h){var f=t.getBuilder(i.getZIndex(),"Image");f.setImageStyle(s,o),f.drawMultiPoint(n,r)}else u&&u.getText()&&(o={})}var c=a.getBuilder(i.getZIndex(),"Image");c.setImageStyle(s,o),c.drawMultiPoint(n,r)}if(u&&u.getText()){var l=t;e&&(l=e);var v=l.getBuilder(i.getZIndex(),"Text");v.setTextStyle(u,o),v.drawText(n,r)}},MultiLineString:function(t,n,i,r,e){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),"LineString");s.setFillStrokeStyle(null,o),s.drawMultiLineString(n,r)}var u=i.getText();if(u&&u.getText()){var a=(e||t).getBuilder(i.getZIndex(),"Text");a.setTextStyle(u),a.drawText(n,r)}},MultiPolygon:function(t,n,i,r,e){var o=i.getFill(),s=i.getStroke();if(s||o){var u=t.getBuilder(i.getZIndex(),"Polygon");u.setFillStrokeStyle(o,s),u.drawMultiPolygon(n,r)}var a=i.getText();if(a&&a.getText()){var h=(e||t).getBuilder(i.getZIndex(),"Text");h.setTextStyle(a),h.drawText(n,r)}},GeometryCollection:function(t,n,i,r,e){var o,s,u=n.getGeometriesArray();for(o=0,s=u.length;o<s;++o){(0,ef[u[o].getType()])(t,u[o],i,r,e)}},Circle:function(t,n,i,r,e){var o=i.getFill(),s=i.getStroke();if(o||s){var u=t.getBuilder(i.getZIndex(),"Circle");u.setFillStrokeStyle(o,s),u.drawCircle(n,r)}var a=i.getText();if(a&&a.getText()){var h=(e||t).getBuilder(i.getZIndex(),"Text");h.setTextStyle(a),h.drawText(n,r)}}};function of(t,n){return parseInt(o(t),10)-parseInt(o(n),10)}function sf(t,n){var i=uf(t,n);return i*i}function uf(t,n){return.5*t/n}function af(t,n,i,r,e,o,s){var u=!1,a=i.getImage();if(a){var h=a.getImageState();h==po||h==yo?a.unlistenImageChange(e):(h==lo&&a.load(),a.listenImageChange(e),u=!0)}return function(t,n,i,r,e,o){var s=i.getGeometryFunction()(n);if(!s)return;var u=s.simplifyTransformed(r,e);if(i.getRenderer())hf(t,u,i,n);else{(0,ef[u.getType()])(t,u,i,n,o)}}(t,n,i,r,o,s),u}function hf(t,n,i,r){if("GeometryCollection"!=n.getType())t.getBuilder(i.getZIndex(),"Default").drawCustom(n,r,i.getRenderer(),i.getHitDetectionRenderer());else for(var e=n.getGeometries(),o=0,s=e.length;o<s;++o)hf(t,e[o],i,r)}function ff(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");var n,i=t.inversePixelTransform[0],r=t.frameState,e=Ht(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),o=sf(r.viewState.resolution,i),s=Cr();return s&&(n=Or(s,r.viewState.projection)),new rf(t.context,i,r.extent,e,r.viewState.rotation,o,n)}var cf,lf={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},vf={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},df=[];function pf(t,n,i,r,e){t.beginPath(),t.moveTo(0,0),t.lineTo(n,i),t.lineTo(r,e),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(n,r)+1,Math.max(i,e)),t.restore()}function yf(t,n){return Math.abs(t[4*n]-210)>2||Math.abs(t[4*n+3]-191.25)>2}function mf(t,n,i,r){var e=Er(i,n,t),o=mr(n,r,i),s=n.getMetersPerUnit();void 0!==s&&(o*=s);var u=t.getMetersPerUnit();void 0!==u&&(o/=u);var a=t.getExtent();if(!a||bn(a,e)){var h=mr(t,o,e)/o;isFinite(h)&&h>0&&(o/=h)}return o}function wf(t,n,i,r){var e=qn(i),o=mf(t,n,e,r);return(!isFinite(o)||o<=0)&&Rn(i,(function(i){return o=mf(t,n,i,r),isFinite(o)&&o>0})),o}function gf(t,n,i,r,e,o,s,u,a,h,f,c){var l=_o(Math.round(i*t),Math.round(i*n),df);if(c||A(l,lf),0===a.length)return l.canvas;function v(t){return Math.round(t*i)/i}l.scale(i,i),l.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];a.forEach((function(t,n,i){Cn(d,t.extent)}));var p=$n(d),y=Vn(d),m=_o(Math.round(i*p/r),Math.round(i*y/r));c||A(m,lf);var w=i/r;a.forEach((function(t,n,i){var r=t.extent[0]-d[0],e=-(t.extent[3]-d[3]),o=$n(t.extent),s=Vn(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,r*w,e*w,o*w,s*w)}));var g=Yn(s);return u.getTriangles().forEach((function(t,n,e){var s=t.source,u=t.target,a=s[0][0],h=s[0][1],f=s[1][0],p=s[1][1],y=s[2][0],w=s[2][1],b=v((u[0][0]-g[0])/o),x=v(-(u[0][1]-g[1])/o),M=v((u[1][0]-g[0])/o),_=v(-(u[1][1]-g[1])/o),S=v((u[2][0]-g[0])/o),O=v(-(u[2][1]-g[1])/o),j=a,E=h;a=0,h=0;var T=fi([[f-=j,p-=E,0,0,M-b],[y-=j,w-=E,0,0,S-b],[0,0,f,p,_-x],[0,0,y,w,O-x]]);if(T){if(l.save(),l.beginPath(),function(){if(void 0===cf){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",pf(t,4,5,4,0),pf(t,4,5,0,5);var n=t.getImageData(0,0,3,3).data;cf=yf(n,0)||yf(n,4)||yf(n,8)}return cf}()||!c){l.moveTo(M,_);for(var A=b-M,P=x-_,C=0;C<4;C++)l.lineTo(M+v((C+1)*A/4),_+v(C*P/3)),3!=C&&l.lineTo(M+v((C+1)*A/4),_+v((C+1)*P/3));l.lineTo(S,O)}else l.moveTo(M,_),l.lineTo(b,x),l.lineTo(S,O);l.clip(),l.transform(T[0],T[2],T[1],T[3],b,x),l.translate(d[0]-j,d[3]-E),l.scale(r/i,-r/i),l.drawImage(m.canvas,0,0),l.restore()}})),f&&(l.save(),l.globalCompositeOperation="source-over",l.strokeStyle="black",l.lineWidth=1,u.getTriangles().forEach((function(t,n,i){var r=t.target,e=(r[0][0]-g[0])/o,s=-(r[0][1]-g[1])/o,u=(r[1][0]-g[0])/o,a=-(r[1][1]-g[1])/o,h=(r[2][0]-g[0])/o,f=-(r[2][1]-g[1])/o;l.beginPath(),l.moveTo(u,a),l.lineTo(e,s),l.lineTo(h,f),l.closePath(),l.stroke()})),l.restore()),l.canvas}var bf=[0,0,0],xf=function(){function t(t){var n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.Ti=t.resolutions,St(_(this.Ti,(function(t,n){return n-t}),!0),17),!t.origins)for(var i=0,r=this.Ti.length-1;i<r;++i)if(n){if(this.Ti[i]/this.Ti[i+1]!==n){n=void 0;break}}else n=this.Ti[i]/this.Ti[i+1];this.Ei=n,this.maxZoom=this.Ti.length-1,this._o=void 0!==t.origin?t.origin:null,this.So=null,void 0!==t.origins&&(this.So=t.origins,St(this.So.length==this.Ti.length,20));var e=t.extent;void 0===e||this._o||this.So||(this._o=Yn(e)),St(!this._o&&this.So||this._o&&!this.So,18),this.Oo=null,void 0!==t.tileSizes&&(this.Oo=t.tileSizes,St(this.Oo.length==this.Ti.length,19)),this.jo=void 0!==t.tileSize?t.tileSize:this.Oo?null:Pu,St(!this.jo&&this.Oo||this.jo&&!this.Oo,22),this.st=void 0!==e?e:null,this.Eo=null,this.To=[0,0],this.Ao=[0,0,0,0],void 0!==t.sizes?this.Eo=t.sizes.map((function(t,n){var i=new zh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(e){var r=this.getTileRangeForExtentAndZ(e,n);i.minX=Math.max(r.minX,i.minX),i.maxX=Math.min(r.maxX,i.maxX),i.minY=Math.max(r.minY,i.minY),i.maxY=Math.min(r.maxY,i.maxY)}return i}),this):e&&this.Po(e)}return t.prototype.forEachTileCoord=function(t,n,i){for(var r=this.getTileRangeForExtentAndZ(t,n),e=r.minX,o=r.maxX;e<=o;++e)for(var s=r.minY,u=r.maxY;s<=u;++s)i([n,e,s])},t.prototype.forEachTileCoordParentTileRange=function(t,n,i,r){var e,o,s=null,u=t[0]-1;for(2===this.Ei?(e=t[1],o=t[2]):s=this.getTileCoordExtent(t,r);u>=this.minZoom;){if(n(u,2===this.Ei?Lh(e=Math.floor(e/2),e,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,u,i)))return!0;--u}return!1},t.prototype.getExtent=function(){return this.st},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this._o?this._o:this.So[t]},t.prototype.getResolution=function(t){return this.Ti[t]},t.prototype.getResolutions=function(){return this.Ti},t.prototype.getTileCoordChildTileRange=function(t,n,i){if(t[0]<this.maxZoom){if(2===this.Ei){var r=2*t[1],e=2*t[2];return Lh(r,r+1,e,e+1,n)}var o=this.getTileCoordExtent(t,i||this.Ao);return this.getTileRangeForExtentAndZ(o,t[0]+1,n)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,n,i){if(n>this.maxZoom||n<this.minZoom)return null;var r=t[0],e=t[1],o=t[2];if(n===r)return Lh(e,o,e,o,i);if(this.Ei){var s=Math.pow(this.Ei,n-r),u=Math.floor(e*s),a=Math.floor(o*s);return n<r?Lh(u,u,a,a,i):Lh(u,Math.floor(s*(e+1))-1,a,Math.floor(s*(o+1))-1,i)}var h=this.getTileCoordExtent(t,this.Ao);return this.getTileRangeForExtentAndZ(h,n,i)},t.prototype.getTileRangeExtent=function(t,n,i){var r=this.getOrigin(t),e=this.getResolution(t),o=Qu(this.getTileSize(t),this.To),s=r[0]+n.minX*o[0]*e,u=r[0]+(n.maxX+1)*o[0]*e;return On(s,r[1]+n.minY*o[1]*e,u,r[1]+(n.maxY+1)*o[1]*e,i)},t.prototype.getTileRangeForExtentAndZ=function(t,n,i){var r=bf;this.Co(t[0],t[3],n,!1,r);var e=r[1],o=r[2];return this.Co(t[2],t[1],n,!0,r),Lh(e,r[1],o,r[2],i)},t.prototype.getTileCoordCenter=function(t){var n=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=Qu(this.getTileSize(t[0]),this.To);return[n[0]+(t[1]+.5)*r[0]*i,n[1]-(t[2]+.5)*r[1]*i]},t.prototype.getTileCoordExtent=function(t,n){var i=this.getOrigin(t[0]),r=this.getResolution(t[0]),e=Qu(this.getTileSize(t[0]),this.To),o=i[0]+t[1]*e[0]*r,s=i[1]-(t[2]+1)*e[1]*r;return On(o,s,o+e[0]*r,s+e[1]*r,n)},t.prototype.getTileCoordForCoordAndResolution=function(t,n,i){return this.ko(t[0],t[1],n,!1,i)},t.prototype.ko=function(t,n,i,r,e){var o=this.getZForResolution(i),s=i/this.getResolution(o),u=this.getOrigin(o),a=Qu(this.getTileSize(o),this.To),h=s*(t-u[0])/i/a[0],f=s*(u[1]-n)/i/a[1];return r?(h=wi(h,5)-1,f=wi(f,5)-1):(h=mi(h,5),f=mi(f,5)),Oh(o,h,f,e)},t.prototype.Co=function(t,n,i,r,e){var o=this.getOrigin(i),s=this.getResolution(i),u=Qu(this.getTileSize(i),this.To),a=(t-o[0])/s/u[0],h=(o[1]-n)/s/u[1];return r?(a=wi(a,5)-1,h=wi(h,5)-1):(a=mi(a,5),h=mi(h,5)),Oh(i,a,h,e)},t.prototype.getTileCoordForCoordAndZ=function(t,n,i){return this.Co(t[0],t[1],n,!1,i)},t.prototype.getTileCoordResolution=function(t){return this.Ti[t[0]]},t.prototype.getTileSize=function(t){return this.jo?this.jo:this.Oo[t]},t.prototype.getFullTileRange=function(t){return this.Eo?this.Eo[t]:this.st?this.getTileRangeForExtentAndZ(this.st,t):null},t.prototype.getZForResolution=function(t,n){return oi(m(this.Ti,t,n||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,n){return Ne(n,0,n.length,2,this.getTileCoordExtent(t))},t.prototype.Po=function(t){for(var n=this.Ti.length,i=new Array(n),r=this.minZoom;r<n;++r)i[r]=this.getTileRangeForExtentAndZ(t,r);this.Eo=i},t}();function Mf(t){var n=t.getDefaultTileGrid();return n||(n=Ef(t),t.setDefaultTileGrid(n)),n}function _f(t,n,i){var r=n[0],e=t.getTileCoordCenter(n),o=Tf(i);if(bn(o,e))return n;var s=$n(o),u=Math.ceil((o[0]-e[0])/s);return e[0]+=s*u,t.getTileCoordForCoordAndZ(e,r)}function Sf(t,n,i,r){var e=void 0!==r?r:"top-left",o=jf(t,n,i);return new xf({extent:t,origin:Un(t,e),resolutions:o,tileSize:i})}function Of(t){var n=t||{},i=n.extent||yr("EPSG:3857").getExtent(),r={extent:i,minZoom:n.minZoom,tileSize:n.tileSize,resolutions:jf(i,n.maxZoom,n.tileSize,n.maxResolution)};return new xf(r)}function jf(t,n,i,r){for(var e=void 0!==n?n:42,o=Vn(t),s=$n(t),u=Qu(void 0!==i?i:Pu),a=r>0?r:Math.max(s/u[0],o/u[1]),h=e+1,f=new Array(h),c=0;c<h;++c)f[c]=a/Math.pow(2,c);return f}function Ef(t,n,i,r){return Sf(Tf(t),n,i,r)}function Tf(t){var n=(t=yr(t)).getExtent();if(!n){var i=180*Lt[Rt.DEGREES]/t.getMetersPerUnit();n=On(-i,-i,i,i)}return n}function Af(t,n){var i=/\{z\}/g,r=/\{x\}/g,e=/\{y\}/g,o=/\{-y\}/g;return function(s,u,a){return s?t.replace(i,s[0].toString()).replace(r,s[1].toString()).replace(e,s[2].toString()).replace(o,(function(){var t=s[0],i=n.getFullTileRange(t);return St(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function Pf(t,n){for(var i=t.length,r=new Array(i),e=0;e<i;++e)r[e]=Af(t[e],n);return Cf(r)}function Cf(t){return 1===t.length?t[0]:function(n,i,r){if(n){var e=vi(Ph(n),t.length);return t[e](n,i,r)}}}function kf(t,n,i){}function If(t){var n=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var r=i[1].charCodeAt(0),e=i[2].charCodeAt(0),o=void 0;for(o=r;o<=e;++o)n.push(t.replace(i[0],String.fromCharCode(o)));return n}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),u=parseInt(i[1],10);u<=s;u++)n.push(t.replace(i[0],u.toString()));return n}return n.push(t),n}function Nf(t,n){var i=[];Object.keys(n).forEach((function(t){null!==n[t]&&void 0!==n[t]&&i.push(t+"="+encodeURIComponent(n[t]))}));var r=i.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var Lf,zf=34962,Rf=34963,Ff=35044,Gf=35048,Df=5126,qf=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Uf(t,n){for(var i=A({preserveDrawingBuffer:!0,antialias:!qt},n),r=qf.length,e=0;e<r;++e)try{var o=t.getContext(qf[e],i);if(o)return o}catch(t){}return null}var Bf="http://www.w3.org/2001/XMLSchema-instance";function Xf(t,n){return dc().createElementNS(t,n)}function Vf(t,n){return Wf(t,n,[]).join("")}function Wf(t,n,i){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)n?i.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)Wf(r,n,i)}return i}function Yf(t){return"documentElement"in t}function Zf(t,n,i){return t.getAttributeNS(n,i)||""}function $f(t){return(new DOMParser).parseFromString(t,"application/xml")}function Kf(t,n){return function(i,r){var e=t.call(void 0!==n?n:this,i,r);void 0!==e&&g(r[r.length-1],e)}}function Hf(t,n){return function(i,r){var e=t.call(void 0!==n?n:this,i,r);void 0!==e&&r[r.length-1].push(e)}}function Jf(t,n){return function(i,r){var e=t.call(void 0!==n?n:this,i,r);void 0!==e&&(r[r.length-1]=e)}}function Qf(t,n,i){return function(r,e){var o=t.call(void 0!==i?i:this,r,e);if(void 0!==o){var s=e[e.length-1],u=void 0!==n?n:r.localName,a=void 0;u in s?a=s[u]:(a=[],s[u]=a),a.push(o)}}}function tc(t,n,i){return function(r,e){var o=t.call(void 0!==i?i:this,r,e);void 0!==o&&(e[e.length-1][void 0!==n?n:r.localName]=o)}}function nc(t,n){return function(i,r,e){t.call(void 0!==n?n:this,i,r,e),e[e.length-1].node.appendChild(i)}}function ic(t,n){var i,r;return function(n,e,o){if(void 0===i){i={};var s={};s[n.localName]=t,i[n.namespaceURI]=s,r=rc(n.localName)}hc(i,r,e,o)}}function rc(t,n){var i=t;return function(t,r,e){var o=r[r.length-1].node,s=i;return void 0===s&&(s=e),Xf(void 0!==n?n:o.namespaceURI,s)}}var ec=rc();function oc(t,n){for(var i=n.length,r=new Array(i),e=0;e<i;++e)r[e]=t[n[e]];return r}function sc(t,n,i){var r,e,o=void 0!==i?i:{};for(r=0,e=t.length;r<e;++r)o[t[r]]=n;return o}function uc(t,n,i,r){var e;for(e=n.firstElementChild;e;e=e.nextElementSibling){var o=t[e.namespaceURI];if(void 0!==o){var s=o[e.localName];void 0!==s&&s.call(r,e,i)}}}function ac(t,n,i,r,e){return r.push(t),uc(n,i,r,e),r.pop()}function hc(t,n,i,r,e,o){for(var s,u,a=(void 0!==e?e:i).length,h=0;h<a;++h)void 0!==(s=i[h])&&void 0!==(u=n.call(void 0!==o?o:this,s,r,void 0!==e?e[h]:void 0))&&t[u.namespaceURI][u.localName].call(o,u,s,r)}function fc(t,n,i,r,e,o,s){return e.push(t),hc(n,i,r,e,o,s),e.pop()}var cc=void 0;function lc(){return void 0===cc&&"undefined"!=typeof XMLSerializer&&(cc=new XMLSerializer),cc}var vc=void 0;function dc(){return void 0===vc&&"undefined"!=typeof document&&(vc=document.implementation.createDocument("","",null)),vc}var pc=Ff;function yc(t){switch(t){case zf:return Float32Array;case Rf:return Uint32Array;default:return Float32Array}}var mc=function(){function t(t,n){this.array=null,this.type=t,St(t===zf||t===Rf,62),this.usage=void 0!==n?n:pc}return t.prototype.ofSize=function(t){this.array=new(yc(this.type))(t)},t.prototype.fromArray=function(t){var n=yc(this.type);this.array=n.from?n.from(t):new n(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(yc(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}(),wc="webglcontextlost",gc="webglcontextrestored",bc=function(){function t(t){this.Io=t.webGlContext;var n=this.Io;this.No=t.scaleRatio||1,this.Lo=n.createTexture(),this.zo=null,this.Ro=n.createFramebuffer();var i=n.createShader(n.VERTEX_SHADER);n.shaderSource(i,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"),n.compileShader(i);var r=n.createShader(n.FRAGMENT_SHADER);n.shaderSource(r,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),n.compileShader(r),this.Fo=n.createProgram(),n.attachShader(this.Fo,i),n.attachShader(this.Fo,r),n.linkProgram(this.Fo),this.Go=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,this.Go),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),n.STATIC_DRAW),this.Do=n.getAttribLocation(this.Fo,"a_position"),this.qo=n.getUniformLocation(this.Fo,"u_screenSize"),this.Uo=n.getUniformLocation(this.Fo,"u_opacity"),this.Bo=n.getUniformLocation(this.Fo,"u_image"),this.Xo=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(i){this.Xo.push({value:t.uniforms[i],location:n.getUniformLocation(this.Fo,i)})}.bind(this))}return t.prototype.getGL=function(){return this.Io},t.prototype.init=function(t){var n=this.getGL(),i=[n.drawingBufferWidth*this.No,n.drawingBufferHeight*this.No];if(n.bindFramebuffer(n.FRAMEBUFFER,this.getFrameBuffer()),n.viewport(0,0,i[0],i[1]),!this.zo||this.zo[0]!==i[0]||this.zo[1]!==i[1]){this.zo=i;var r=n.RGBA,e=n.RGBA,o=n.UNSIGNED_BYTE;n.bindTexture(n.TEXTURE_2D,this.Lo),n.texImage2D(n.TEXTURE_2D,0,r,i[0],i[1],0,e,o,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),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.Lo,0)}},t.prototype.apply=function(t,n,i,r){var e=this.getGL(),s=t.size;if(e.bindFramebuffer(e.FRAMEBUFFER,n?n.getFrameBuffer():null),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.Lo),!n){var u=o(e.canvas);if(!t.renderTargets[u]){var a=e.getContextAttributes();a&&a.preserveDrawingBuffer&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),t.renderTargets[u]=!0}}e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),e.bindBuffer(e.ARRAY_BUFFER,this.Go),e.useProgram(this.Fo),e.enableVertexAttribArray(this.Do),e.vertexAttribPointer(this.Do,2,e.FLOAT,!1,0,0),e.uniform2f(this.qo,s[0],s[1]),e.uniform1i(this.Bo,0);var h=t.layerStatesArray[t.layerIndex].opacity;e.uniform1f(this.Uo,h),this.applyUniforms(t),i&&i(e,t),e.drawArrays(e.TRIANGLES,0,6),r&&r(e,t)},t.prototype.getFrameBuffer=function(){return this.Ro},t.prototype.applyUniforms=function(t){var n,i=this.getGL(),r=1;this.Xo.forEach((function(e){if((n="function"==typeof e.value?e.value(t):e.value)instanceof HTMLCanvasElement||n instanceof ImageData)e.texture||(e.texture=i.createTexture()),i.activeTexture(i["TEXTURE".concat(r)]),i.bindTexture(i.TEXTURE_2D,e.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),n instanceof ImageData?i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,n.width,n.height,0,i.UNSIGNED_BYTE,new Uint8Array(n.data)):i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),i.uniform1i(e.location,r++);else if(Array.isArray(n))switch(n.length){case 2:return void i.uniform2f(e.location,n[0],n[1]);case 3:return void i.uniform3f(e.location,n[0],n[1],n[2]);case 4:return void i.uniform4f(e.location,n[0],n[1],n[2],n[3]);default:return}else"number"==typeof n&&i.uniform1f(e.location,n)}))},t}();function xc(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Mc(t,n){return t[0]=n[0],t[1]=n[1],t[4]=n[2],t[5]=n[3],t[12]=n[4],t[13]=n[5],t}var _c=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Sc="u_projectionMatrix",Oc="u_offsetScaleMatrix",jc="u_offsetRotateMatrix",Ec="u_time",Tc="u_zoom",Ac="u_resolution",Pc={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:Df},Cc={};function kc(t){return"shared/"+t}var Ic=0;function Nc(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];n+=r.size*Lc(r.type)}return n}function Lc(t){switch(t){case Pc.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Pc.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Pc.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Pc.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var zc=function(t){function n(n){var i,r=t.call(this)||this,e=n||{};r.Vo=r.handleWebGLContextLost.bind(r),r.Wo=r.handleWebGLContextRestored.bind(r),r.Yo=e.canvasCacheKey?kc(e.canvasCacheKey):(i="unique/"+Ic,Ic+=1,i),r.qt=function(t){var n=Cc[t];if(!n){var i=document.createElement("canvas");i.style.position="absolute",i.style.left="0",n={users:0,canvas:i},Cc[t]=n}return n.users+=1,n.canvas}(r.Yo),r.Io=Uf(r.qt),r.Zo={},r.$o={},r.Ko=null,r.qt.addEventListener(wc,r.Vo),r.qt.addEventListener(gc,r.Wo),r.Ho=[1,0,0,1,0,0],r.Jo=[1,0,0,1,0,0],r.Qo=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.ts={},r.ns={},r.Xo=[],e.uniforms&&r.setUniforms(e.uniforms);var o=r.getGL();return r.rs=e.postProcesses?e.postProcesses.map((function(t){return new bc({webGlContext:o,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new bc({webGlContext:o})],r.es=null,r.ve=Date.now(),r}return _c(n,t),n.prototype.setUniforms=function(t){for(var n in this.Xo=[],t)this.Xo.push({name:n,value:t[n]});this.ts={}},n.prototype.canvasCacheKeyMatches=function(t){return this.Yo===kc(t)},n.prototype.getExtension=function(t){if(t in this.$o)return this.$o[t];var n=this.Io.getExtension(t);return this.$o[t]=n,n},n.prototype.bindBuffer=function(t){var n=this.getGL(),i=o(t),r=this.Zo[i];r||(r={buffer:t,webGlBuffer:n.createBuffer()},this.Zo[i]=r);n.bindBuffer(t.getType(),r.webGlBuffer)},n.prototype.flushBufferData=function(t){var n=this.getGL();this.bindBuffer(t),n.bufferData(t.getType(),t.getArray(),t.getUsage())},n.prototype.deleteBuffer=function(t){var n=this.getGL(),i=o(t),r=this.Zo[i];r&&!n.isContextLost()&&n.deleteBuffer(r.webGlBuffer),delete this.Zo[i]},n.prototype.disposeInternal=function(){this.qt.removeEventListener(wc,this.Vo),this.qt.removeEventListener(gc,this.Wo),function(t){var n=Cc[t];if(n&&(n.users-=1,!(n.users>0))){var i=Uf(n.canvas).getExtension("WEBGL_lose_context");i&&i.loseContext(),delete Cc[t]}}(this.Yo),delete this.Io,delete this.qt},n.prototype.prepareDraw=function(t,n){var i=this.getGL(),r=this.getCanvas(),e=t.size,o=t.pixelRatio;r.width=e[0]*o,r.height=e[1]*o,r.style.width=e[0]+"px",r.style.height=e[1]+"px",i.useProgram(this.Ko);for(var s=this.rs.length-1;s>=0;s--)this.rs[s].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,n?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.Ko),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.prepareDrawToRenderTarget=function(t,n,i){var r=this.getGL(),e=n.getSize();r.bindFramebuffer(r.FRAMEBUFFER,n.getFramebuffer()),r.viewport(0,0,e[0],e[1]),r.bindTexture(r.TEXTURE_2D,n.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.Ko),this.applyFrameState(t),this.applyUniforms(t)},n.prototype.drawElements=function(t,n){var i=this.getGL();this.getExtension("OES_element_index_uint");var r=i.UNSIGNED_INT,e=n-t,o=4*t;i.drawElements(i.TRIANGLES,e,r,o)},n.prototype.finalizeDraw=function(t,n,i){for(var r=0,e=this.rs.length;r<e;r++)r===e-1?this.rs[r].apply(t,null,n,i):this.rs[r].apply(t,this.rs[r+1])},n.prototype.getCanvas=function(){return this.qt},n.prototype.getGL=function(){return this.Io},n.prototype.applyFrameState=function(t){var n=t.size,i=t.viewState.rotation,r=Kt(this.Jo);rn(r,2/n[0],2/n[1]);var e=Kt(this.Ho);0!==i&&nn(e,-i),this.setUniformMatrixValue(Oc,Mc(this.Qo,r)),this.setUniformMatrixValue(jc,Mc(this.Qo,e)),this.setUniformFloatValue(Ec,.001*(Date.now()-this.ve)),this.setUniformFloatValue(Tc,t.viewState.zoom),this.setUniformFloatValue(Ac,t.viewState.resolution)},n.prototype.applyUniforms=function(t){var n,i=this.getGL(),r=0;this.Xo.forEach(function(e){if((n="function"==typeof e.value?e.value(t):e.value)instanceof HTMLCanvasElement||n instanceof HTMLImageElement||n instanceof ImageData)e.texture||(e.prevValue=void 0,e.texture=i.createTexture()),i.activeTexture(i["TEXTURE".concat(r)]),i.bindTexture(i.TEXTURE_2D,e.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),(!(n instanceof HTMLImageElement)||n.complete)&&e.prevValue!==n&&(e.prevValue=n,i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n)),i.uniform1i(this.getUniformLocation(e.name),r++);else if(Array.isArray(n)&&6===n.length)this.setUniformMatrixValue(e.name,Mc(this.Qo,n));else if(Array.isArray(n)&&n.length<=4)switch(n.length){case 2:return void i.uniform2f(this.getUniformLocation(e.name),n[0],n[1]);case 3:return void i.uniform3f(this.getUniformLocation(e.name),n[0],n[1],n[2]);case 4:return void i.uniform4f(this.getUniformLocation(e.name),n[0],n[1],n[2],n[3]);default:return}else"number"==typeof n&&i.uniform1f(this.getUniformLocation(e.name),n)}.bind(this))},n.prototype.useProgram=function(t){return t!=this.Ko&&(this.getGL().useProgram(t),this.Ko=t,this.ts={},this.ns={},!0)},n.prototype.compileShader=function(t,n){var i=this.getGL(),r=i.createShader(n);return i.shaderSource(r,t),i.compileShader(r),r},n.prototype.getProgram=function(t,n){var i=this.getGL(),r=this.compileShader(t,i.FRAGMENT_SHADER),e=this.compileShader(n,i.VERTEX_SHADER),o=i.createProgram();if(i.attachShader(o,r),i.attachShader(o,e),i.linkProgram(o),!i.getShaderParameter(r,i.COMPILE_STATUS)){var s="Fragment shader compliation failed: ".concat(i.getShaderInfoLog(r));throw new Error(s)}if(i.deleteShader(r),!i.getShaderParameter(e,i.COMPILE_STATUS)){s="Vertex shader compilation failed: ".concat(i.getShaderInfoLog(e));throw new Error(s)}if(i.deleteShader(e),!i.getProgramParameter(o,i.LINK_STATUS)){s="GL program linking failed: ".concat(i.getShaderInfoLog(e));throw new Error(s)}return o},n.prototype.getUniformLocation=function(t){return void 0===this.ts[t]&&(this.ts[t]=this.getGL().getUniformLocation(this.Ko,t)),this.ts[t]},n.prototype.getAttributeLocation=function(t){return void 0===this.ns[t]&&(this.ns[t]=this.getGL().getAttribLocation(this.Ko,t)),this.ns[t]},n.prototype.makeProjectionTransform=function(t,n){var i=t.size,r=t.viewState.rotation,e=t.viewState.resolution,o=t.viewState.center;return Kt(n),sn(n,0,0,2/(e*i[0]),2/(e*i[1]),-r,-o[0],-o[1]),n},n.prototype.setUniformFloatValue=function(t,n){this.getGL().uniform1f(this.getUniformLocation(t),n)},n.prototype.setUniformFloatVec4=function(t,n){this.getGL().uniform4fv(this.getUniformLocation(t),n)},n.prototype.setUniformMatrixValue=function(t,n){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,n)},n.prototype.os=function(t,n,i,r,e){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,n,i,!1,r,e))},n.prototype.enableAttributes=function(t){for(var n=Nc(t),i=0,r=0;r<t.length;r++){var e=t[r];this.os(e.name,e.size,e.type||Df,n,i),i+=e.size*Lc(e.type)}},n.prototype.handleWebGLContextLost=function(){P(this.Zo),this.Ko=null},n.prototype.handleWebGLContextRestored=function(){},n.prototype.createTexture=function(t,n,i){var r=this.getGL(),e=i||r.createTexture(),o=r.RGBA,s=r.RGBA,u=r.UNSIGNED_BYTE;return r.bindTexture(r.TEXTURE_2D,e),n?r.texImage2D(r.TEXTURE_2D,0,o,s,u,n):r.texImage2D(r.TEXTURE_2D,0,o,t[0],t[1],0,s,u,null),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},n}(v),Rc=function(){function t(t,n){this.name=t,this.data=n,this.ss=null}return t.prototype.getTexture=function(t){if(!this.ss){var n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.ss=n}return this.ss},t}(),Fc=new Uint8Array(4),Gc=function(){function t(t,n){this.us=t;var i=t.getGL();this.ss=i.createTexture(),this.hs=i.createFramebuffer(),this.W=n||[1,1],this.B=new Uint8Array(0),this.fs=!0,this.cs()}return t.prototype.setSize=function(t){x(t,this.W)||(this.W[0]=t[0],this.W[1]=t[1],this.cs())},t.prototype.getSize=function(){return this.W},t.prototype.clearCachedData=function(){this.fs=!0},t.prototype.readAll=function(){if(this.fs){var t=this.W,n=this.us.getGL();n.bindFramebuffer(n.FRAMEBUFFER,this.hs),n.readPixels(0,0,t[0],t[1],n.RGBA,n.UNSIGNED_BYTE,this.B),this.fs=!1}return this.B},t.prototype.readPixel=function(t,n){if(t<0||n<0||t>this.W[0]||n>=this.W[1])return Fc[0]=0,Fc[1]=0,Fc[2]=0,Fc[3]=0,Fc;this.readAll();var i=Math.floor(t)+(this.W[1]-Math.floor(n)-1)*this.W[0];return Fc[0]=this.B[4*i],Fc[1]=this.B[4*i+1],Fc[2]=this.B[4*i+2],Fc[3]=this.B[4*i+3],Fc},t.prototype.getTexture=function(){return this.ss},t.prototype.getFramebuffer=function(){return this.hs},t.prototype.cs=function(){var t=this.W,n=this.us.getGL();this.ss=this.us.createTexture(t,null,this.ss),n.bindFramebuffer(n.FRAMEBUFFER,this.hs),n.viewport(0,0,t[0],t[1]),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.ss,0),this.B=new Uint8Array(t[0]*t[1]*4)},t}(),Dc=!0,qc=function(){function t(t,n,i,r,e,o){this.ls=t,this.vs=n;var s={},u=jr(this.vs,this.ls);this.ds=function(t){var n=t[0]+"/"+t[1];return s[n]||(s[n]=u(t)),s[n]},this.ps=r,this.ys=e*e,this.ws=[],this.gs=!1,this.bs=this.ls.canWrapX()&&!!r&&!!this.ls.getExtent()&&$n(r)==$n(this.ls.getExtent()),this.xs=this.ls.getExtent()?$n(this.ls.getExtent()):null,this.Ms=this.vs.getExtent()?$n(this.vs.getExtent()):null;var a=Yn(i),h=Zn(i),f=Dn(i),c=Gn(i),l=this.ds(a),v=this.ds(h),d=this.ds(f),p=this.ds(c),y=10+(o?Math.max(0,Math.ceil(ui(Fn(i)/(o*o*256*256)))):0);if(this._s(a,h,f,c,l,v,d,p,y),this.gs){var m=1/0;this.ws.forEach((function(t,n,i){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.ws.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.xs/2){var n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-m>this.xs/2&&(n[0][0]-=this.xs),n[1][0]-m>this.xs/2&&(n[1][0]-=this.xs),n[2][0]-m>this.xs/2&&(n[2][0]-=this.xs);var i=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-i<this.xs/2&&(t.source=n)}}.bind(this))}s={}}return t.prototype.Ss=function(t,n,i,r,e,o){this.ws.push({source:[r,e,o],target:[t,n,i]})},t.prototype._s=function(t,n,i,r,e,o,s,u,a){var h=yn([e,o,s,u]),f=this.xs?$n(h)/this.xs:null,c=this.xs,l=this.ls.canWrapX()&&f>.5&&f<1,v=!1;if(a>0){if(this.vs.isGlobal()&&this.Ms)v=$n(yn([t,n,i,r]))/this.Ms>.25||v;!l&&this.ls.isGlobal()&&f&&(v=f>.25||v)}if(!(!v&&this.ps&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Kn(h,this.ps)){var d=0;if(!(v||isFinite(e[0])&&isFinite(e[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(u[0])&&isFinite(u[1])))if(a>0)v=!0;else if(1!=(d=(isFinite(e[0])&&isFinite(e[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(u[0])&&isFinite(u[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(a>0){if(!v){var p=[(t[0]+i[0])/2,(t[1]+i[1])/2],y=this.ds(p),m=void 0;if(l)m=(vi(e[0],c)+vi(s[0],c))/2-vi(y[0],c);else m=(e[0]+s[0])/2-y[0];var w=(e[1]+s[1])/2-y[1];v=m*m+w*w>this.ys}if(v){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var g=[(n[0]+i[0])/2,(n[1]+i[1])/2],b=this.ds(g),x=[(r[0]+t[0])/2,(r[1]+t[1])/2],M=this.ds(x);this._s(t,n,g,x,e,o,b,M,a-1),this._s(x,g,i,r,M,b,s,u,a-1)}else{var _=[(t[0]+n[0])/2,(t[1]+n[1])/2],S=this.ds(_),O=[(i[0]+r[0])/2,(i[1]+r[1])/2],j=this.ds(O);this._s(t,_,O,r,e,S,j,u,a-1),this._s(_,n,i,O,S,o,s,j,a-1)}return}}if(l){if(!this.bs)return;this.gs=!0}0==(11&d)&&this.Ss(t,i,r,e,s,u),0==(14&d)&&this.Ss(t,i,n,e,s,o),d&&(0==(13&d)&&this.Ss(n,r,t,o,u,e),0==(7&d)&&this.Ss(n,r,i,o,u,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.ws.forEach((function(n,i,r){var e=n.source;kn(t,e[0]),kn(t,e[1]),kn(t,e[2])})),t},t.prototype.getTriangles=function(){return this.ws},t}(),Uc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bc=function(t){function n(n,i,r,e,o,s,u,a,h,f,c,l){var v=t.call(this,o,ct,{interpolate:!!l})||this;v.Os=void 0!==c&&c,v.kt=u,v.js=a,v.qt=null,v.Es=i,v.Ts=e,v.As=s||o,v.Ps=[],v.Cs=null,v.ks=0;var d=e.getTileCoordExtent(v.As),p=v.Ts.getExtent(),y=v.Es.getExtent(),m=p?Wn(d,p):d;if(0===Fn(m))return v.state=pt,v;var w=n.getExtent();w&&(y=y?Wn(y,w):w);var g=e.getResolution(v.As[0]),b=wf(n,r,m,g);if(!isFinite(b)||b<=0)return v.state=pt,v;var x=void 0!==f?f:.5;if(v.Is=new qc(n,r,m,y,b*x,g),0===v.Is.getTriangles().length)return v.state=pt,v;v.ks=i.getZForResolution(b);var M=v.Is.calculateSourceExtent();if(y&&(n.canWrapX()?(M[1]=oi(M[1],y[1],y[3]),M[3]=oi(M[3],y[1],y[3])):M=Wn(M,y)),Fn(M)){for(var _=i.getTileRangeForExtentAndZ(M,v.ks),S=_.minX;S<=_.maxX;S++)for(var O=_.minY;O<=_.maxY;O++){var j=h(v.ks,S,O,u);j&&v.Ps.push(j)}0===v.Ps.length&&(v.state=pt)}else v.state=pt;return v}return Uc(n,t),n.prototype.getImage=function(){return this.qt},n.prototype.Ns=function(){var t=[];if(this.Ps.forEach(function(n,i,r){n&&n.getState()==vt&&t.push({extent:this.Es.getTileCoordExtent(n.tileCoord),image:n.getImage()})}.bind(this)),this.Ps.length=0,0===t.length)this.state=dt;else{var n=this.As[0],i=this.Ts.getTileSize(n),r="number"==typeof i?i:i[0],e="number"==typeof i?i:i[1],o=this.Ts.getResolution(n),s=this.Es.getResolution(this.ks),u=this.Ts.getTileCoordExtent(this.As);this.qt=gf(r,e,this.kt,s,this.Es.getExtent(),o,u,this.Is,t,this.js,this.Os,this.interpolate),this.state=vt}this.changed()},n.prototype.load=function(){if(this.state==ct){this.state=lt,this.changed();var t=0;this.Cs=[],this.Ps.forEach(function(n,i,r){var e=n.getState();if(e==ct||e==lt){t++;var o=$(n,L,(function(i){var r=n.getState();r!=vt&&r!=dt&&r!=pt||(H(o),0===--t&&(this.Ls(),this.Ns()))}),this);this.Cs.push(o)}}.bind(this)),0===t?setTimeout(this.Ns.bind(this),0):this.Ps.forEach((function(t,n,i){t.getState()==ct&&t.load()}))}},n.prototype.Ls=function(){this.Cs.forEach(H),this.Cs=null},n.prototype.release=function(){this.qt&&(So(this.qt.getContext("2d")),df.push(this.qt),this.qt=null),t.prototype.release.call(this)},n}(xt),Xc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Vc(t,n,i){var r=i?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r)}function Wc(t,n,i,r,e,o){var s,u,a=t.getGL();i instanceof Float32Array?(s=a.FLOAT,t.getExtension("OES_texture_float"),u=null!==t.getExtension("OES_texture_float_linear")):(s=a.UNSIGNED_BYTE,u=!0);Vc(a,n,o&&u);var h,f=i.byteLength/r[1],c=1;switch(f%8==0?c=8:f%4==0?c=4:f%2==0&&(c=2),e){case 1:h=a.LUMINANCE;break;case 2:h=a.LUMINANCE_ALPHA;break;case 3:h=a.RGB;break;case 4:h=a.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(e))}var l=a.getParameter(a.UNPACK_ALIGNMENT);a.pixelStorei(a.UNPACK_ALIGNMENT,c),a.texImage2D(a.TEXTURE_2D,0,h,r[0],r[1],0,h,s,i),a.pixelStorei(a.UNPACK_ALIGNMENT,l)}var Yc=null;var Zc=function(t){function n(n){var i=t.call(this)||this;i.tile,i.textures=[],i.cr=i.cr.bind(i),i.zs=Qu(n.grid.getTileSize(n.tile.tileCoord[0])),i.js=n.gutter||0,i.bandCount=NaN,i.us=n.helper;var r=new mc(zf,Ff);return r.fromArray([0,1,1,1,1,0,0,0]),i.us.flushBufferData(r),i.coords=r,i.setTile(n.tile),i}return Xc(n,t),n.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(L,this.cr),this.tile=t,this.textures.length=0,this.loaded=t.getState()===vt,this.loaded)this.Rs();else{if(t instanceof ko){var n=t.getImage();n instanceof Image&&!n.crossOrigin&&(n.crossOrigin="anonymous")}t.addEventListener(L,this.cr)}},n.prototype.Rs=function(){var t=this.us,n=t.getGL(),i=this.tile;if(i instanceof ko||i instanceof Bc){var r=n.createTexture();return this.textures.push(r),this.bandCount=4,void function(t,n,i,r){Vc(t,n,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)}(n,r,i.getImage(),i.interpolate)}var e=i.getSize(),o=[e[0]+2*this.js,e[1]+2*this.js],s=i.getData(),u=s instanceof Float32Array,a=o[0]*o[1],h=u?Float32Array:Uint8Array,f=h.BYTES_PER_ELEMENT,c=s.byteLength/o[1];this.bandCount=Math.floor(c/f/o[0]);var l=Math.ceil(this.bandCount/4);if(1===l){r=n.createTexture();return this.textures.push(r),void Wc(t,r,s,o,this.bandCount,i.interpolate)}for(var v=new Array(l),d=0;d<l;++d){r=n.createTexture();this.textures.push(r);var p=d<l-1?4:this.bandCount%4;v[d]=new h(a*p)}for(var y=0,m=0,w=o[0]*this.bandCount,g=0;g<o[1];++g){for(var b=0;b<w;++b){var x=s[m+b],M=Math.floor(y/this.bandCount),_=b%this.bandCount;(S=v[d=Math.floor(_/4)])[M*(p=S.length/a)+_%4]=x,++y}m+=c/f}for(d=0;d<l;++d){var S;Wc(t,r=this.textures[d],S=v[d],o,p=S.length/a,i.interpolate)}},n.prototype.cr=function(){this.tile.getState()===vt&&(this.loaded=!0,this.Rs(),this.dispatchEvent(L))},n.prototype.disposeInternal=function(){var t=this.us.getGL();this.us.deleteBuffer(this.coords);for(var n=0;n<this.textures.length;++n)t.deleteTexture(this.textures[n]);this.tile.removeEventListener(L,this.cr)},n.prototype.getPixelData=function(t,n){if(!this.loaded)return null;var i,r=this.zs[0],e=this.zs[1],o=this.js;if(this.tile instanceof _t){var s=this.tile.getSize(),u=s[0],a=s[1],h=u+2*o,f=a+2*o,c=o+Math.floor(u*(t/r)),l=o+Math.floor(a*(n/e)),v=this.tile.getData();if(v instanceof DataView){var d=v.byteLength/(h*f),p=d*(l*h+c),y=v.buffer.slice(p,p+d);return new DataView(y)}var m=this.bandCount*(l*h+c);return v.slice(m,m+this.bandCount)}Yc||((i=document.createElement("canvas")).width=1,i.height=1,Yc=i.getContext("2d")),Yc.clearRect(0,0,1,1);var w,g=this.tile.getImage(),b=g.width-2*o,x=g.height-2*o,M=o+Math.floor(b*(t/r)),_=o+Math.floor(x*(n/e));try{Yc.drawImage(g,M,_,1,1,0,0,1,1),w=Yc.getImageData(0,0,1,1).data}catch(t){return Yc=null,null}return w},n}(N),$c=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Kc=function(t){function n(n){var i=t.call(this)||this;return i.ready=!0,i.Fs=i.Gs.bind(i),i.Ds=n,i.declutterExecutorGroup=null,i}return $c(n,t),n.prototype.getFeatures=function(t){return r()},n.prototype.getData=function(t){return null},n.prototype.prepareFrame=function(t){return r()},n.prototype.renderFrame=function(t,n){return r()},n.prototype.loadedTileCallback=function(t,n,i){t[n]||(t[n]={}),t[n][i.tileCoord.toString()]=i},n.prototype.createLoadedTileFinder=function(t,n,i){return function(r,e){var o=this.loadedTileCallback.bind(this,i,r);return t.forEachLoadedTile(n,r,e,o)}.bind(this)},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){},n.prototype.getDataAtPixel=function(t,n,i){return null},n.prototype.getLayer=function(){return this.Ds},n.prototype.handleFontsChanged=function(){},n.prototype.Gs=function(t){t.target.getState()===po&&this.renderIfReadyAndVisible()},n.prototype.loadImage=function(t){var n=t.getState();return n!=po&&n!=yo&&t.addEventListener(L,this.Fs),n==lo&&(t.load(),n=t.getState()),n==po},n.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},n.prototype.disposeInternal=function(){delete this.Ds,t.prototype.disposeInternal.call(this)},n}(nt),Hc=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jc="GENERATE_BUFFERS",Qc=function(t){function n(n,i){var r=t.call(this,n)||this,e=i||{};return r.qs=[1,0,0,1,0,0],r.Us=null,r.Bs=e.postProcesses,r.Xo=e.uniforms,r.helper,n.addChangeListener(is,r.removeHelper.bind(r)),r.dispatchPreComposeEvent=r.dispatchPreComposeEvent.bind(r),r.dispatchPostComposeEvent=r.dispatchPostComposeEvent.bind(r),r}return Hc(n,t),n.prototype.dispatchPreComposeEvent=function(t,n){var i=this.getLayer();if(i.hasListener(us)){var r=new ms(us,void 0,n,t);i.dispatchEvent(r)}},n.prototype.dispatchPostComposeEvent=function(t,n){var i=this.getLayer();if(i.hasListener(as)){var r=new ms(as,void 0,n,t);i.dispatchEvent(r)}},n.prototype.reset=function(t){this.Xo=t.uniforms,this.helper&&this.helper.setUniforms(this.Xo)},n.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},n.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var i=!0,r=-1,e=void 0,o=0,s=t.layerStatesArray.length;o<s;o++){var u=t.layerStatesArray[o].layer,a=u.getRenderer();if(a instanceof n){var h=u.getClassName();if((i||h!==e)&&(r+=1,i=!1),e=h,a===this)break}else i=!0}var f="map/"+t.mapId+"/group/"+r;this.helper&&this.helper.canvasCacheKeyMatches(f)||(this.removeHelper(),this.helper=new zc({postProcesses:this.Bs,uniforms:this.Xo,canvasCacheKey:f}),e&&(this.helper.getCanvas().className=e),this.afterHelperCreated())}return this.prepareFrameInternal(t)},n.prototype.afterHelperCreated=function(){},n.prototype.prepareFrameInternal=function(t){return!0},n.prototype.disposeInternal=function(){this.removeHelper(),t.prototype.disposeInternal.call(this)},n.prototype.Xs=function(t,n,i){var r=this.getLayer();if(r.hasListener(t)){sn(this.qs,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);var e=new ms(t,this.qs,i,n);r.dispatchEvent(e)}},n.prototype.preRender=function(t,n){this.Xs(os,t,n)},n.prototype.postRender=function(t,n){this.Xs(ss,t,n)},n.prototype.getDataAtPixel=function(t,n,i){var r=tn([n.pixelRatio,0,0,n.pixelRatio,0,0],t.slice()),e=this.helper.getGL();if(!e)return null;var o=this.getLayer().getExtent();if(o&&!bn(o,tn(n.pixelToCoordinateTransform,t.slice())))return null;var s=e.getContextAttributes();if(!s||!s.preserveDrawingBuffer)return new Uint8Array;var u,a=Math.round(r[0]),h=Math.round(r[1]),f=this.Us;if(!f){var c=document.createElement("canvas");c.width=1,c.height=1,f=c.getContext("2d"),this.Us=f}f.clearRect(0,0,1,1);try{f.drawImage(e.canvas,a,h,1,1,0,0,1,1),u=f.getImageData(0,0,1,1).data}catch(t){return u}return 0===u[3]?null:u},n}(Kc),tl=[],nl={vertexPosition:0,indexPosition:0};function il(t,n,i,r,e){t[n+0]=i,t[n+1]=r,t[n+2]=e}function rl(t,n){var i=n||[],r=256,e=255;return i[0]=Math.floor(t/r/r/r)/e,i[1]=Math.floor(t/r/r)%r/e,i[2]=Math.floor(t/r)%r/e,i[3]=t%r/e,i}function el(t){var n=0,i=256,r=255;return n+=Math.round(t[0]*i*i*i*r),n+=Math.round(t[1]*i*i*r),n+=Math.round(t[2]*i*r),n+=Math.round(t[3]*r)}var ol=Qc,sl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ul={TILE_TEXTURE_ARRAY:"u_tileTextures",TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY",RENDER_EXTENT:"u_renderExtent",RESOLUTION:"u_resolution",ZOOM:"u_zoom"},al={TEXTURE_COORD:"a_textureCoord"},hl=[{name:al.TEXTURE_COORD,size:2,type:Pc.FLOAT}],fl={};function cl(t){return 2*(1-1/(t+1))-1}function ll(t,n,i){i in t||(t[i]=[]),t[i].push(n)}function vl(t,n){var i=t.layerStatesArray[t.layerIndex];i.extent&&(n=Wn(n,Lr(i.extent,t.viewState.projection)));var r=i.layer.getRenderSource();if(!r.getWrapX()){var e=r.getTileGridForProjection(t.viewState.projection).getExtent();e&&(n=Wn(n,e))}return n}function dl(t,n){return"".concat(t.getKey(),",").concat(Eh(n))}var pl=function(t){function n(n,i){var r=t.call(this,n,{uniforms:i.uniforms})||this;r.renderComplete=!1,r.Vs=[1,0,0,1,0,0],r.Ws=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.Ys=new zh(0,0,0,0),r.Zs=Oh(0,0,0),r.$s=[0,0],r.Ks,r.Hs=i.vertexShader,r.Js=i.fragmentShader,r.Qs=new mc(Rf,Ff),r.Qs.fromArray([0,1,3,1,2,3]);var e=void 0!==i.cacheSize?i.cacheSize:512;return r.tu=new Sh(e),r.nu=i.paletteTextures||[],r.Zi=null,r}return sl(n,t),n.prototype.reset=function(n){t.prototype.reset.call(this,{uniforms:n.uniforms}),this.Hs=n.vertexShader,this.Js=n.fragmentShader,this.nu=n.paletteTextures||[],this.helper&&(this.Ks=this.helper.getProgram(this.Js,this.Hs))},n.prototype.afterHelperCreated=function(){this.Ks=this.helper.getProgram(this.Js,this.Hs),this.helper.flushBufferData(this.Qs)},n.prototype.iu=function(t){var n=this.getLayer(),i=t.getState(),r=n.getUseInterimTilesOnError();return i==vt||i==pt||i==dt&&!r},n.prototype.prepareFrameInternal=function(t){var n=this.getLayer().getRenderSource();return!!n&&(!Hn(vl(t,t.extent))&&"ready"===n.getState())},n.prototype.enqueueTiles=function(t,n,i,r){var e=t.viewState,s=this.getLayer(),u=s.getRenderSource(),a=u.getTileGridForProjection(e.projection),h=u.getGutterForProjection(e.projection),f=o(u);f in t.wantedTiles||(t.wantedTiles[f]={});for(var c=t.wantedTiles[f],l=this.tu,v=Math.max(i-s.getPreload(),a.getMinZoom(),s.getMinZoom()),d=i;d>=v;--d)for(var p=a.getTileRangeForExtentAndZ(n,d,this.Ys),y=a.getResolution(d),m=p.minX;m<=p.maxX;++m)for(var w=p.minY;w<=p.maxY;++w){var g=Oh(d,m,w,this.Zs),b=dl(u,g),x=void 0,M=void 0;if(l.containsKey(b)&&(M=(x=l.get(b)).tile),!x||x.tile.key!==u.getKey())if(M=u.getTile(d,m,w,t.pixelRatio,e.projection),x)if(this.iu(M))x.setTile(M);else{var _=M.getInterimTile();x.setTile(_)}else x=new Zc({tile:M,grid:a,helper:this.helper,gutter:h}),l.set(b,x);ll(r,x,d);var S=M.getKey();c[S]=!0,M.getState()===ct&&(t.tileQueue.isKeyQueued(S)||t.tileQueue.enqueue([M,f,a.getTileCoordCenter(g),y]))}},n.prototype.renderFrame=function(t){this.Zi=t,this.renderComplete=!0;var n=this.helper.getGL();this.preRender(n,t);var i=t.viewState,r=this.getLayer().getRenderSource(),e=r.getTileGridForProjection(i.projection),s=r.getGutterForProjection(i.projection),u=vl(t,t.extent),a=e.getZForResolution(i.resolution,r.zDirection),h={};if(t.nextExtent){var f=e.getZForResolution(i.nextResolution,r.zDirection),c=vl(t,t.nextExtent);this.enqueueTiles(t,c,f,h)}this.enqueueTiles(t,u,a,h);for(var l={},v=o(this),d=t.time,y=!1,m=h[a],w=0,g=m.length;w<g;++w){var b=(D=(tt=m[w]).tile).tileCoord;if(tt.loaded){if(1===(q=D.getAlpha(v,d))){D.endTransition(v);continue}y=!0,l[U=Eh(b)]=q}if(this.renderComplete=!1,!this.ru(e,b,a+1,h))for(var x=e.getMinZoom(),M=a-1;M>=x;--M){if(this.ru(e,b,M,h))break}}this.helper.useProgram(this.Ks),this.helper.prepareDraw(t,!y);for(var _=Object.keys(h).map(Number).sort(p),S=i.center[0],O=i.center[1],j=0,E=_.length;j<E;++j){var T=_[j],A=e.getResolution(T),P=Qu(e.getTileSize(T),this.$s),C=e.getOrigin(T),k=P[0]+2*s,I=P[1]+2*s,N=k/I,L=(S-C[0])/(P[0]*A),z=(C[1]-O)/(P[1]*A),R=i.resolution/A,F=cl(T),G=h[T];for(w=0,g=G.length;w<g;++w){if((tt=G[w]).loaded){var D,q,U=Eh(b=(D=tt.tile).tileCoord),B=b[1],X=b[2];Kt(this.Vs),rn(this.Vs,2/(t.size[0]*R/k),-2/(t.size[1]*R/k)),nn(this.Vs,i.rotation),rn(this.Vs,1,1/N),on(this.Vs,(P[0]*(B-L)-s)/k,(P[1]*(X-z)-s)/I),this.helper.setUniformMatrixValue(ul.TILE_TRANSFORM,Mc(this.Ws,this.Vs)),this.helper.bindBuffer(tt.coords),this.helper.bindBuffer(this.Qs),this.helper.enableAttributes(hl);for(var V=0;V<tt.textures.length;){var W="TEXTURE"+V,Y="".concat(ul.TILE_TEXTURE_ARRAY,"[").concat(V,"]");n.activeTexture(n[W]),n.bindTexture(n.TEXTURE_2D,tt.textures[V]),n.uniform1i(this.helper.getUniformLocation(Y),V),++V}for(var Z=0;Z<this.nu.length;++Z){var $=this.nu[Z];n.activeTexture(n["TEXTURE"+V]);var K=$.getTexture(n);n.bindTexture(n.TEXTURE_2D,K),n.uniform1i(this.helper.getUniformLocation($.name),V),++V}(q=U in l?l[U]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(ul.TRANSITION_ALPHA,q),this.helper.setUniformFloatValue(ul.DEPTH,F),this.helper.setUniformFloatValue(ul.TEXTURE_PIXEL_WIDTH,k),this.helper.setUniformFloatValue(ul.TEXTURE_PIXEL_HEIGHT,I),this.helper.setUniformFloatValue(ul.TEXTURE_RESOLUTION,A),this.helper.setUniformFloatValue(ul.TEXTURE_ORIGIN_X,C[0]+B*P[0]*A-s*A),this.helper.setUniformFloatValue(ul.TEXTURE_ORIGIN_Y,C[1]-X*P[1]*A+s*A);var H=u;s>0&&Wn(H=e.getTileCoordExtent(b),u,H),this.helper.setUniformFloatVec4(ul.RENDER_EXTENT,H),this.helper.setUniformFloatValue(ul.RESOLUTION,i.resolution),this.helper.setUniformFloatValue(ul.ZOOM,i.zoom),this.helper.drawElements(0,this.Qs.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var J=this.helper.getCanvas(),Q=this.tu;Q.canExpireCache();){var tt;(tt=Q.pop()).dispose()}return t.postRenderFunctions.push((function(t,n){r.expireCache(n.viewState.projection,fl)})),this.postRender(n,t),J},n.prototype.getData=function(t){if(!this.helper.getGL())return null;var n=this.Zi;if(!n)return null;var i=this.getLayer(),r=tn(n.pixelToCoordinateTransform,t.slice()),e=n.viewState,o=i.getExtent();if(o&&!bn(Lr(o,e.projection),r))return null;var s,u,a,h=i.getSources(yn([r]),e.resolution);for(s=h.length-1;s>=0;--s)if("ready"===(u=h[s]).getState()){if(a=u.getTileGridForProjection(e.projection),u.getWrapX())break;var f=a.getExtent();if(!f||bn(f,r))break}if(s<0)return null;for(var c=this.tu,l=a.getZForResolution(e.resolution);l>=a.getMinZoom();--l){var v=a.getTileCoordForCoordAndZ(r,l),d=dl(u,v);if(c.containsKey(d)){var p=c.get(d);if(p.loaded){var y=a.getOrigin(l),m=Qu(a.getTileSize(l)),w=a.getResolution(l),g=(r[0]-y[0])/w-v[1]*m[0],b=(y[1]-r[1])/w-v[2]*m[1];return p.getPixelData(g,b)}}}return null},n.prototype.ru=function(t,n,i,r){var e=t.getTileRangeForTileCoordAndZ(n,i,this.Ys);if(!e)return!1;for(var o=!0,s=this.tu,u=this.getLayer().getRenderSource(),a=e.minX;a<=e.maxX;++a)for(var h=e.minY;h<=e.maxY;++h){var f=dl(u,[i,a,h]),c=!1;if(s.containsKey(f)){var l=s.get(f);l.loaded&&(ll(r,l,i),c=!0)}c||(o=!1)}return o},n.prototype.removeHelper=function(){if(this.helper){var n=this.tu;n.forEach((function(t){return t.dispose()})),n.clear()}t.prototype.removeHelper.call(this)},n.prototype.disposeInternal=function(){var n=this.helper;n&&(n.getGL().deleteProgram(this.Ks),delete this.Ks,n.deleteBuffer(this.Qs));t.prototype.disposeInternal.call(this),delete this.Qs,delete this.tu,delete this.Zi},n}(ol),yl=1,ml=2,wl=4,gl=8,bl=16,xl=31,Ml=0,_l={};function Sl(t){if("number"==typeof t)return yl;if("boolean"==typeof t)return gl;if("string"==typeof t)return Uo(t)?wl|ml:ml;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var n=t;if(n.every((function(t){return"number"==typeof t})))return 3===n.length||4===n.length?wl|bl:bl;if("string"!=typeof n[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(n)));var i=_l[n[0]];if(void 0===i)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return i.getReturnType(n.slice(1))}function Ol(t){return ui(t)%1==0}function jl(t){var n=t.toString();return-1===n.indexOf(".")?n+".0":n}function El(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(jl).join(", "),")")}function Tl(t){var n=Go(t).slice();return n.length<4&&n.push(1),El(n.map((function(t,n){return n<3?t/255:t})))}function Al(t,n){return void 0===t.stringLiteralsMap[n]&&(t.stringLiteralsMap[n]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[n]}function Pl(t,n){return jl(Al(t,n))}function Cl(t,n,i){if(Array.isArray(n)&&"string"==typeof n[0]){var r=_l[n[0]];if(void 0===r)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(n)));return r.toGlsl(t,n.slice(1),i)}var e=Sl(n);if((e&yl)>0)return jl(n);if((e&gl)>0)return n.toString();if((e&ml)>0&&(void 0===i||i==ml))return Pl(t,n.toString());if((e&wl)>0&&(void 0===i||i==wl))return Tl(n);if((e&bl)>0)return El(n);throw new Error("Unexpected expression ".concat(n," (expected type ").concat(i,")"))}function kl(t){if(!(Sl(t)&yl))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Il(t){for(var n=0;n<t.length;n++)kl(t[n])}function Nl(t){if(!(Sl(t)&ml))throw new Error("A string value was expected, got ".concat(JSON.stringify(t)," instead"))}function Ll(t){if(!(Sl(t)&gl))throw new Error("A boolean value was expected, got ".concat(JSON.stringify(t)," instead"))}function zl(t,n){if(t.length!==n)throw new Error("Exactly ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function Rl(t,n){if(t.length<n)throw new Error("At least ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function Fl(t,n){if(t.length>n)throw new Error("At most ".concat(n," arguments were expected, got ").concat(t.length," instead"))}function Gl(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function Dl(t,n){if(!Ol(n))throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function ql(t){return"u_var_"+t}_l.get={getReturnType:function(t){return xl},toGlsl:function(t,n){zl(n,1),Nl(n[0]);var i=n[0].toString();return-1===t.attributes.indexOf(i)&&t.attributes.push(i),(t.inFragmentShader?"v_":"a_")+i}},_l.var={getReturnType:function(t){return xl},toGlsl:function(t,n){zl(n,1),Nl(n[0]);var i=n[0].toString();return-1===t.variables.indexOf(i)&&t.variables.push(i),ql(i)}};var Ul="u_paletteTextures";_l.palette={getReturnType:function(t){return wl},toGlsl:function(t,n){zl(n,2),kl(n[0]);var i=Cl(t,n[0]),r=n[1];if(!Array.isArray(r))throw new Error("The second argument of palette must be an array");for(var e=r.length,o=new Uint8Array(4*e),s=0;s<e;s++){var u=r[s],a=void 0;if("string"==typeof u)a=Fo(u);else{if(!Array.isArray(u))throw new Error("The second argument of palette must be an array of strings or colors");var h=u.length;if(4===h)a=u;else{if(3!==h)throw new Error("Expected palette color to have 3 or 4 values, got ".concat(h));a=[u[0],u[1],u[2],1]}}var f=4*s;o[f]=a[0],o[f+1]=a[1],o[f+2]=a[2],o[f+3]=255*a[3]}t.paletteTextures||(t.paletteTextures=[]);var c="".concat(Ul,"[").concat(t.paletteTextures.length,"]"),l=new Rc(c,o);return t.paletteTextures.push(l),"texture2D(".concat(c,", vec2((").concat(i," + 0.5) / ").concat(e,".0, 0.5))")}};var Bl="getBandValue";function Xl(t){return{getReturnType:function(t){return gl},toGlsl:function(n,i){zl(i,2);for(var r=xl,e=0;e<i.length;e++)r&=Sl(i[e]);if(r===Ml)throw new Error("All arguments should be of compatible type, got ".concat(JSON.stringify(i)," instead"));return r&=~wl,"(".concat(Cl(n,i[0],r)," ").concat(t," ").concat(Cl(n,i[1],r),")")}}}function Vl(t){return{getReturnType:function(t){return gl},toGlsl:function(n,i){Rl(i,2);for(var r=0;r<i.length;r++)Ll(i[r]);var e="";return e=i.map((function(t){return Cl(n,t)})).join(" ".concat(t," ")),e="(".concat(e,")")}}}_l.band={getReturnType:function(t){return yl},toGlsl:function(t,n){Rl(n,1),Fl(n,3);var i=n[0];if(!(Bl in t.functions)){for(var r="",e=t.bandCount||1,o=0;o<e;o++){var s=Math.floor(o/4),u=o%4;u===e-1&&1===u&&(u=3);var a="".concat(ul.TILE_TEXTURE_ARRAY,"[").concat(s,"]");r+="\n if (band == ".concat(o+1,".0) {\n return texture2D(").concat(a,", v_textureCoord + vec2(dx, dy))[").concat(u,"];\n }\n ")}t.functions.getBandValue="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ".concat(ul.TEXTURE_PIXEL_WIDTH,";\n float dy = yOffset / ").concat(ul.TEXTURE_PIXEL_HEIGHT,";\n ").concat(r,"\n }\n ")}var h=Cl(t,i),f=Cl(t,n[1]||0),c=Cl(t,n[2]||0);return"".concat(Bl,"(").concat(h,", ").concat(f,", ").concat(c,")")}},_l.time={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,0),"u_time"}},_l.zoom={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,0),"u_zoom"}},_l.resolution={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,0),"u_resolution"}},_l["*"]={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," * ").concat(Cl(t,n[1]),")")}},_l["/"]={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," / ").concat(Cl(t,n[1]),")")}},_l["+"]={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," + ").concat(Cl(t,n[1]),")")}},_l["-"]={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," - ").concat(Cl(t,n[1]),")")}},_l.clamp={getReturnType:function(t){return yl},toGlsl:function(t,n){zl(n,3),Il(n);var i=Cl(t,n[1]),r=Cl(t,n[2]);return"clamp(".concat(Cl(t,n[0]),", ").concat(i,", ").concat(r,")")}},_l["%"]={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,2),Il(n),"mod(".concat(Cl(t,n[0]),", ").concat(Cl(t,n[1]),")")}},_l["^"]={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,2),Il(n),"pow(".concat(Cl(t,n[0]),", ").concat(Cl(t,n[1]),")")}},_l.abs={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,1),Il(n),"abs(".concat(Cl(t,n[0]),")")}},_l.floor={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,1),Il(n),"floor(".concat(Cl(t,n[0]),")")}},_l.round={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,1),Il(n),"floor(".concat(Cl(t,n[0])," + 0.5)")}},_l.ceil={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,1),Il(n),"ceil(".concat(Cl(t,n[0]),")")}},_l.sin={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,1),Il(n),"sin(".concat(Cl(t,n[0]),")")}},_l.cos={getReturnType:function(t){return yl},toGlsl:function(t,n){return zl(n,1),Il(n),"cos(".concat(Cl(t,n[0]),")")}},_l.atan={getReturnType:function(t){return yl},toGlsl:function(t,n){return Rl(n,1),Fl(n,2),Il(n),2===n.length?"atan(".concat(Cl(t,n[0]),", ").concat(Cl(t,n[1]),")"):"atan(".concat(Cl(t,n[0]),")")}},_l[">"]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," > ").concat(Cl(t,n[1]),")")}},_l[">="]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," >= ").concat(Cl(t,n[1]),")")}},_l["<"]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," < ").concat(Cl(t,n[1]),")")}},_l["<="]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,2),Il(n),"(".concat(Cl(t,n[0])," <= ").concat(Cl(t,n[1]),")")}},_l["=="]=Xl("=="),_l["!="]=Xl("!="),_l["!"]={getReturnType:function(t){return gl},toGlsl:function(t,n){return zl(n,1),Ll(n[0]),"(!".concat(Cl(t,n[0]),")")}},_l.all=Vl("&&"),_l.any=Vl("||"),_l.between={getReturnType:function(t){return gl},toGlsl:function(t,n){zl(n,3),Il(n);var i=Cl(t,n[1]),r=Cl(t,n[2]),e=Cl(t,n[0]);return"(".concat(e," >= ").concat(i," && ").concat(e," <= ").concat(r,")")}},_l.array={getReturnType:function(t){return bl},toGlsl:function(t,n){Rl(n,2),Fl(n,4),Il(n);var i=n.map((function(n){return Cl(t,n,yl)}));return"vec".concat(n.length,"(").concat(i.join(", "),")")}},_l.color={getReturnType:function(t){return wl},toGlsl:function(t,n){Rl(n,3),Fl(n,4),Il(n);var i=n;3===n.length&&i.push(1);var r=n.map((function(n,i){return Cl(t,n,yl)+(i<3?" / 255.0":"")}));return"vec".concat(n.length,"(").concat(r.join(", "),")")}},_l.interpolate={getReturnType:function(t){for(var n=wl|yl,i=3;i<t.length;i+=2)n&=Sl(t[i]);return n},toGlsl:function(t,n,i){Gl(n),Rl(n,6);var r,e=n[0];switch(e[0]){case"linear":r=1;break;case"exponential":r=e[1];break;default:r=null}if(!r)throw new Error('Invalid interpolation type for "interpolate" operator, received: '.concat(JSON.stringify(e)));var o=void 0!==i?i:xl,s=_l.interpolate.getReturnType(n)&o;Dl(n,s);for(var u=Cl(t,n[1]),a=jl(r),h="",f=2;f<n.length-2;f+=2){var c=Cl(t,n[f]),l=h||Cl(t,n[f+1],s),v=Cl(t,n[f+2]),d=Cl(t,n[f+3],s);h="mix(".concat(l,", ").concat(d,", pow(clamp((").concat(u," - ").concat(c,") / (").concat(v," - ").concat(c,"), 0.0, 1.0), ").concat(a,"))")}return h}},_l.match={getReturnType:function(t){for(var n=xl,i=2;i<t.length;i+=2)n&=Sl(t[i]);return n&=Sl(t[t.length-1])},toGlsl:function(t,n,i){Gl(n),Rl(n,4);var r=void 0!==i?i:xl,e=_l.match.getReturnType(n)&r;Dl(n,e);for(var o=Cl(t,n[0]),s=Cl(t,n[n.length-1],e),u=null,a=n.length-3;a>=1;a-=2){var h=Cl(t,n[a]),f=Cl(t,n[a+1],e);u="(".concat(o," == ").concat(h," ? ").concat(f," : ").concat(u||s,")")}return u}},_l.case={getReturnType:function(t){for(var n=xl,i=1;i<t.length;i+=2)n&=Sl(t[i]);return n&=Sl(t[t.length-1])},toGlsl:function(t,n,i){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got ".concat(t," instead"))}(n),Rl(n,3);var r=void 0!==i?i:xl,e=_l.case.getReturnType(n)&r;Dl(n,e);for(var o=0;o<n.length-1;o+=2)Ll(n[o]);var s=Cl(t,n[n.length-1],e),u=null;for(o=n.length-3;o>=0;o-=2){var a=Cl(t,n[o]),h=Cl(t,n[o+1],e);u="(".concat(a," ? ").concat(h," : ").concat(u||s,")")}return u}};var Wl=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,n,i){return this.varyings.push({name:t,type:n,expression:i}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var n=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",i=this.attributes,r=this.varyings;return t&&(i=i.concat("vec4 a_hitColor"),r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(i.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(n,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\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 vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(r.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var n=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",i=this.varyings;return t&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(n,"\n}")},t}();function Yl(t){var n=t.symbol,i=void 0!==n.size?n.size:1,r=n.color||"white",e=n.textureCoord||[0,0,1,1],o=n.offset||[0,0],s=void 0!==n.opacity?n.opacity:1,u=void 0!==n.rotation?n.rotation:0,a={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},h=Cl(a,i,bl|yl),f=Cl(a,o,bl),c=Cl(a,e,bl),l=Cl(a,u,yl),v={inFragmentShader:!0,variables:a.variables,attributes:[],stringLiteralsMap:a.stringLiteralsMap,functions:{}},d=Cl(v,r,wl),p=Cl(v,s,yl),y="1.0",m="vec2(".concat(Cl(v,i,bl|yl),").x");switch(n.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./".concat(m,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var w="(v_quadCoord*2.-1.)",g="(atan(".concat(w,".x,").concat(w,".y))");y="(1.0-smoothstep(.5-3./".concat(m,",.5,cos(floor(.5+").concat(g,"/2.094395102)*2.094395102-").concat(g,")*length(").concat(w,")))");break;default:throw new Error("Unexpected symbol type: "+n.symbolType)}var b=(new Wl).setSizeExpression("vec2(".concat(h,")")).setRotationExpression(l).setSymbolOffsetExpression(f).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!n.rotateWithView).setColorExpression("vec4(".concat(d,".rgb, ").concat(d,".a * ").concat(p," * ").concat(y,")"));if(t.filter){var x=Cl(v,t.filter,gl);b.setFragmentDiscardExpression("!".concat(x))}var M={};if(v.variables.forEach((function(n){var i=ql(n);b.addUniform("float ".concat(i)),M[i]=function(){if(!t.variables||void 0===t.variables[n])throw new Error("The following variable is missing from the style: ".concat(n));var i=t.variables[n];return"string"==typeof i&&(i=Al(a,i)),void 0!==i?i:-9999999}})),"image"===n.symbolType&&n.src){var _=new Image;_.crossOrigin=void 0===n.crossOrigin?"anonymous":n.crossOrigin,_.src=n.src,b.addUniform("sampler2D u_texture").setColorExpression(b.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),M.u_texture=_}return v.attributes.forEach((function(t){-1===a.attributes.indexOf(t)&&a.attributes.push(t),b.addVarying("v_".concat(t),"float","a_".concat(t))})),a.attributes.forEach((function(t){b.addAttribute("float a_".concat(t))})),{builder:b,attributes:a.attributes.map((function(t){return{name:t,callback:function(n,i){var r=i[t];return"string"==typeof r&&(r=Al(a,r)),void 0!==r?r:-9999999}}})),uniforms:M}}var Zl=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$l=function(t){function n(n){var i=t.call(this,{extent:n.extent,origin:n.origin,origins:n.origins,resolutions:n.resolutions,tileSize:n.tileSize,tileSizes:n.tileSizes,sizes:n.sizes})||this;return i.eu=n.matrixIds,i}return Zl(n,t),n.prototype.getMatrixId=function(t){return this.eu[t]},n.prototype.getMatrixIds=function(){return this.eu},n}(xf),Kl=$l;function Hl(t,n,i){var r=[],e=[],o=[],s=[],u=[],a=void 0!==i?i:[],h=yr(t.SupportedCRS),f=h.getMetersPerUnit(),c="ne"==h.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,n){return n.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(n){if(!(a.length>0)||b(a,(function(i){return n.Identifier==i.TileMatrix||-1===n.Identifier.indexOf(":")&&t.Identifier+":"+n.Identifier===i.TileMatrix}))){e.push(n.Identifier);var i=28e-5*n.ScaleDenominator/f,h=n.TileWidth,l=n.TileHeight;c?o.push([n.TopLeftCorner[1],n.TopLeftCorner[0]]):o.push(n.TopLeftCorner),r.push(i),s.push(h==l?h:[h,l]),u.push([n.MatrixWidth,n.MatrixHeight])}})),new $l({extent:n,origins:o,resolutions:r,matrixIds:e,tileSizes:s,sizes:u})}var Jl=function(){function t(t){this.ou=t.opacity,this.su=t.rotateWithView,this.Dr=t.rotation,this.uu=t.scale,this.au=Qu(t.scale),this.hu=t.displacement,this.fu=t.declutterMode}return t.prototype.clone=function(){var n=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(n)?n.slice():n,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getOpacity=function(){return this.ou},t.prototype.getRotateWithView=function(){return this.su},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.uu},t.prototype.getScaleArray=function(){return this.au},t.prototype.getDisplacement=function(){return this.hu},t.prototype.getDeclutterMode=function(){return this.fu},t.prototype.getAnchor=function(){return r()},t.prototype.getImage=function(t){return r()},t.prototype.getHitDetectionImage=function(){return r()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return r()},t.prototype.getImageSize=function(){return r()},t.prototype.getOrigin=function(){return r()},t.prototype.getSize=function(){return r()},t.prototype.setDisplacement=function(t){this.hu=t},t.prototype.setOpacity=function(t){this.ou=t},t.prototype.setRotateWithView=function(t){this.su=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.uu=t,this.au=Qu(t)},t.prototype.listenImageChange=function(t){r()},t.prototype.load=function(){r()},t.prototype.unlistenImageChange=function(t){r()},t}(),Ql=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tv=function(t){function n(n){var i=this,r=void 0!==n.rotateWithView&&n.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:r,rotation:void 0!==n.rotation?n.rotation:0,scale:void 0!==n.scale?n.scale:1,displacement:void 0!==n.displacement?n.displacement:[0,0],declutterMode:n.declutterMode})||this).qt=void 0,i.cu=null,i.lu=void 0!==n.fill?n.fill:null,i._o=[0,0],i.Zt=n.points,i.vu=void 0!==n.radius?n.radius:n.radius1,i.du=n.radius2,i.$t=void 0!==n.angle?n.angle:0,i.pu=void 0!==n.stroke?n.stroke:null,i.W=null,i.yu=null,i.render(),i}return Ql(n,t),n.prototype.clone=function(){var t=this.getScale(),i=new n({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(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i},n.prototype.getAnchor=function(){var t=this.W;if(!t)return null;var n=this.getDisplacement();return[t[0]/2-n[0],t[1]/2+n[1]]},n.prototype.getAngle=function(){return this.$t},n.prototype.getFill=function(){return this.lu},n.prototype.setFill=function(t){this.lu=t,this.render()},n.prototype.getHitDetectionImage=function(){return this.cu||this.mu(this.yu),this.cu},n.prototype.getImage=function(t){var n=this.qt[t];if(!n){var i=this.yu,r=_o(i.size*t,i.size*t);this.wu(i,r,t),n=r.canvas,this.qt[t]=n}return n},n.prototype.getPixelRatio=function(t){return t},n.prototype.getImageSize=function(){return this.W},n.prototype.getImageState=function(){return po},n.prototype.getOrigin=function(){return this._o},n.prototype.getPoints=function(){return this.Zt},n.prototype.getRadius=function(){return this.vu},n.prototype.getRadius2=function(){return this.du},n.prototype.getSize=function(){return this.W},n.prototype.getStroke=function(){return this.pu},n.prototype.setStroke=function(t){this.pu=t,this.render()},n.prototype.listenImageChange=function(t){},n.prototype.load=function(){},n.prototype.unlistenImageChange=function(t){},n.prototype.gu=function(t,n,i){if(0===n||this.Zt===1/0||"bevel"!==t&&"miter"!==t)return n;var r=this.vu,e=void 0===this.du?r:this.du;if(r<e){var o=r;r=e,e=o}var s=void 0===this.du?this.Zt:2*this.Zt,u=2*Math.PI/s,a=e*Math.sin(u),h=r-Math.sqrt(e*e-a*a),f=Math.sqrt(a*a+h*h),c=f/a;if("miter"===t&&c<=i)return c*n;var l=n/2/c,v=n/2*(h/f),d=Math.sqrt((r+l)*(r+l)+v*v)-r;if(void 0===this.du||"bevel"===t)return 2*d;var p=r*Math.sin(u),y=e-Math.sqrt(r*r-p*p),m=Math.sqrt(p*p+y*y)/p;if(m<=i){var w=m*n/2-e-r;return 2*Math.max(d,w)}return 2*d},n.prototype.createRenderOptions=function(){var t,n=Cs,i=0,r=null,e=0,o=0;this.pu&&(null===(t=this.pu.getColor())&&(t=Is),t=Uh(t),void 0===(o=this.pu.getWidth())&&(o=1),r=this.pu.getLineDash(),e=this.pu.getLineDashOffset(),void 0===(n=this.pu.getLineJoin())&&(n=Cs),void 0===(i=this.pu.getMiterLimit())&&(i=ks));var s=this.gu(n,o,i),u=Math.max(this.vu,this.du||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*u+s),lineDash:r,lineDashOffset:e,lineJoin:n,miterLimit:i}},n.prototype.render=function(){this.yu=this.createRenderOptions();var t=this.yu.size;this.qt={},this.W=[t,t]},n.prototype.wu=function(t,n,i){if(n.scale(i,i),n.translate(t.size/2,t.size/2),this.bu(n),this.lu){var r=this.lu.getColor();null===r&&(r=Ts),n.fillStyle=Uh(r),n.fill()}this.pu&&(n.strokeStyle=t.strokeStyle,n.lineWidth=t.strokeWidth,n.setLineDash&&t.lineDash&&(n.setLineDash(t.lineDash),n.lineDashOffset=t.lineDashOffset),n.lineJoin=t.lineJoin,n.miterLimit=t.miterLimit,n.stroke())},n.prototype.mu=function(t){if(this.lu){var n=this.lu.getColor(),i=0;if("string"==typeof n&&(n=Go(n)),null===n?i=1:Array.isArray(n)&&(i=4===n.length?n[3]:1),0===i){var r=_o(t.size,t.size);this.cu=r.canvas,this.xu(t,r)}}this.cu||(this.cu=this.getImage(1))},n.prototype.bu=function(t){var n=this.Zt,i=this.vu;if(n===1/0)t.arc(0,0,i,0,2*Math.PI);else{var r=void 0===this.du?i:this.du;void 0!==this.du&&(n*=2);for(var e=this.$t-Math.PI/2,o=2*Math.PI/n,s=0;s<n;s++){var u=e+s*o,a=s%2==0?i:r;t.lineTo(a*Math.cos(u),a*Math.sin(u))}t.closePath()}},n.prototype.xu=function(t,n){n.translate(t.size/2,t.size/2),this.bu(n),n.fillStyle=Ts,n.fill(),this.pu&&(n.strokeStyle=t.strokeStyle,n.lineWidth=t.strokeWidth,t.lineDash&&(n.setLineDash(t.lineDash),n.lineDashOffset=t.lineDashOffset),n.lineJoin=t.lineJoin,n.miterLimit=t.miterLimit,n.stroke())},n}(Jl),nv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),iv=function(t){function n(n){var i=n||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0],declutterMode:i.declutterMode})||this}return nv(n,t),n.prototype.clone=function(){var t=this.getScale(),i=new n({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return i.setOpacity(this.getOpacity()),i},n.prototype.setRadius=function(t){this.vu=t,this.render()},n}(tv),rv=function(){function t(t){var n=t||{};this.Mu=void 0!==n.color?n.color:null}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||void 0})},t.prototype.getColor=function(){return this.Mu},t.prototype.setColor=function(t){this.Mu=t},t}(),ev="fraction",ov="pixels",sv="bottom-left",uv="bottom-right",av="top-left",hv="top-right",fv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cv=null,lv=function(t){function n(n,i,r,e,o,s){var u=t.call(this)||this;return u._u=null,u.Lt=n||new Image,null!==e&&(u.Lt.crossOrigin=e),u.qt={},u.Mu=s,u.zt=null,u.Su=o,u.W=r,u.Nt=i,u.Ou,u}return fv(n,t),n.prototype.ju=function(){if(void 0===this.Ou&&this.Su===po){cv||(cv=_o(1,1)),cv.drawImage(this.Lt,0,0);try{cv.getImageData(0,0,1,1),this.Ou=!1}catch(t){cv=null,this.Ou=!0}}return!0===this.Ou},n.prototype.Eu=function(){this.dispatchEvent(L)},n.prototype.Ft=function(){this.Su=yo,this.Gt(),this.Eu()},n.prototype.Dt=function(){this.Su=po,this.W?(this.Lt.width=this.W[0],this.Lt.height=this.W[1]):this.W=[this.Lt.width,this.Lt.height],this.Gt(),this.Eu()},n.prototype.getImage=function(t){return this.Tu(t),this.qt[t]?this.qt[t]:this.Lt},n.prototype.getPixelRatio=function(t){return this.Tu(t),this.qt[t]?t:1},n.prototype.getImageState=function(){return this.Su},n.prototype.getHitDetectionImage=function(){if(!this._u)if(this.ju()){var t=this.W[0],n=this.W[1],i=_o(t,n);i.fillRect(0,0,t,n),this._u=i.canvas}else this._u=this.Lt;return this._u},n.prototype.getSize=function(){return this.W},n.prototype.getSrc=function(){return this.Nt},n.prototype.load=function(){if(this.Su==lo){this.Su=vo;try{this.Lt.src=this.Nt}catch(t){this.Ft()}this.zt=go(this.Lt,this.Dt.bind(this),this.Ft.bind(this))}},n.prototype.Tu=function(t){if(this.Mu&&!this.qt[t]&&this.Su===po){var n=document.createElement("canvas");this.qt[t]=n,n.width=Math.ceil(this.Lt.width*t),n.height=Math.ceil(this.Lt.height*t);var i=n.getContext("2d");if(i.scale(t,t),i.drawImage(this.Lt,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.ju())i.fillStyle=zo(this.Mu),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.Lt,0,0);else{for(var r=i.getImageData(0,0,n.width,n.height),e=r.data,o=this.Mu[0]/255,s=this.Mu[1]/255,u=this.Mu[2]/255,a=this.Mu[3],h=0,f=e.length;h<f;h+=4)e[h]*=o,e[h+1]*=s,e[h+2]*=u,e[h+3]*=a;i.putImageData(r,0,0)}}},n.prototype.Gt=function(){this.zt&&(this.zt(),this.zt=null)},n}(N);function vv(t,n,i,r,e,o){var s=Wo.get(n,r,o);return s||(s=new lv(t,n,i,r,e,o),Wo.set(n,r,o,s)),s}var dv=lv,pv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yv=function(t){function n(n){var i=this,r=n||{},e=void 0!==r.opacity?r.opacity:1,s=void 0!==r.rotation?r.rotation:0,u=void 0!==r.scale?r.scale:1,a=void 0!==r.rotateWithView&&r.rotateWithView;(i=t.call(this,{opacity:e,rotation:s,scale:u,displacement:void 0!==r.displacement?r.displacement:[0,0],rotateWithView:a,declutterMode:r.declutterMode})||this).xe=void 0!==r.anchor?r.anchor:[.5,.5],i.Au=null,i.Pu=void 0!==r.anchorOrigin?r.anchorOrigin:av,i.Cu=void 0!==r.anchorXUnits?r.anchorXUnits:ev,i.ku=void 0!==r.anchorYUnits?r.anchorYUnits:ev,i.Bt=void 0!==r.crossOrigin?r.crossOrigin:null;var h=void 0!==r.img?r.img:null;i.Iu=r.imgSize;var f=r.src;St(!(void 0!==f&&h),4),St(!h||h&&i.Iu,5),void 0!==f&&0!==f.length||!h||(f=h.src||o(h)),St(void 0!==f&&f.length>0,6);var c=void 0!==r.src?lo:po;return i.Mu=void 0!==r.color?Go(r.color):null,i.Nu=vv(h,f,void 0!==i.Iu?i.Iu:null,i.Bt,c,i.Mu),i.Lu=void 0!==r.offset?r.offset:[0,0],i.zu=void 0!==r.offsetOrigin?r.offsetOrigin:av,i._o=null,i.W=void 0!==r.size?r.size:null,i}return pv(n,t),n.prototype.clone=function(){var t=this.getScale();return new n({anchor:this.xe.slice(),anchorOrigin:this.Pu,anchorXUnits:this.Cu,anchorYUnits:this.ku,color:this.Mu&&this.Mu.slice?this.Mu.slice():this.Mu||void 0,crossOrigin:this.Bt,imgSize:this.Iu,offset:this.Lu.slice(),offsetOrigin:this.zu,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.W?this.W.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},n.prototype.getAnchor=function(){var t=this.Au;if(!t){t=this.xe;var n=this.getSize();if(this.Cu==ev||this.ku==ev){if(!n)return null;t=this.xe.slice(),this.Cu==ev&&(t[0]*=n[0]),this.ku==ev&&(t[1]*=n[1])}if(this.Pu!=av){if(!n)return null;t===this.xe&&(t=this.xe.slice()),this.Pu!=hv&&this.Pu!=uv||(t[0]=-t[0]+n[0]),this.Pu!=sv&&this.Pu!=uv||(t[1]=-t[1]+n[1])}this.Au=t}var i=this.getDisplacement();return[t[0]-i[0],t[1]+i[1]]},n.prototype.setAnchor=function(t){this.xe=t,this.Au=null},n.prototype.getColor=function(){return this.Mu},n.prototype.getImage=function(t){return this.Nu.getImage(t)},n.prototype.getPixelRatio=function(t){return this.Nu.getPixelRatio(t)},n.prototype.getImageSize=function(){return this.Nu.getSize()},n.prototype.getImageState=function(){return this.Nu.getImageState()},n.prototype.getHitDetectionImage=function(){return this.Nu.getHitDetectionImage()},n.prototype.getOrigin=function(){if(this._o)return this._o;var t=this.Lu;if(this.zu!=av){var n=this.getSize(),i=this.Nu.getSize();if(!n||!i)return null;t=t.slice(),this.zu!=hv&&this.zu!=uv||(t[0]=i[0]-n[0]-t[0]),this.zu!=sv&&this.zu!=uv||(t[1]=i[1]-n[1]-t[1])}return this._o=t,this._o},n.prototype.getSrc=function(){return this.Nu.getSrc()},n.prototype.getSize=function(){return this.W?this.W:this.Nu.getSize()},n.prototype.listenImageChange=function(t){this.Nu.addEventListener(L,t)},n.prototype.load=function(){this.Nu.load()},n.prototype.unlistenImageChange=function(t){this.Nu.removeEventListener(L,t)},n}(Jl),mv=function(){function t(t){var n=t||{};this.Mu=void 0!==n.color?n.color:null,this.Ru=n.lineCap,this.Fu=void 0!==n.lineDash?n.lineDash:null,this.Gu=n.lineDashOffset,this.Du=n.lineJoin,this.qu=n.miterLimit,this.Uu=n.width}return t.prototype.clone=function(){var n=this.getColor();return new t({color:Array.isArray(n)?n.slice():n||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.Mu},t.prototype.getLineCap=function(){return this.Ru},t.prototype.getLineDash=function(){return this.Fu},t.prototype.getLineDashOffset=function(){return this.Gu},t.prototype.getLineJoin=function(){return this.Du},t.prototype.getMiterLimit=function(){return this.qu},t.prototype.getWidth=function(){return this.Uu},t.prototype.setColor=function(t){this.Mu=t},t.prototype.setLineCap=function(t){this.Ru=t},t.prototype.setLineDash=function(t){this.Fu=t},t.prototype.setLineDashOffset=function(t){this.Gu=t},t.prototype.setLineJoin=function(t){this.Du=t},t.prototype.setMiterLimit=function(t){this.qu=t},t.prototype.setWidth=function(t){this.Uu=t},t}(),wv=function(){function t(t){var n=t||{};this.Hr=null,this.Bu=_v,void 0!==n.geometry&&this.setGeometry(n.geometry),this.lu=void 0!==n.fill?n.fill:null,this.Lt=void 0!==n.image?n.image:null,this.hn=void 0!==n.renderer?n.renderer:null,this.Xu=void 0!==n.hitDetectionRenderer?n.hitDetectionRenderer:null,this.pu=void 0!==n.stroke?n.stroke:null,this.eo=void 0!==n.text?n.text:null,this.Vu=n.zIndex}return t.prototype.clone=function(){var n=this.getGeometry();return n&&"object"==typeof n&&(n=n.clone()),new t({geometry:n,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),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.hn},t.prototype.setRenderer=function(t){this.hn=t},t.prototype.setHitDetectionRenderer=function(t){this.Xu=t},t.prototype.getHitDetectionRenderer=function(){return this.Xu},t.prototype.getGeometry=function(){return this.Hr},t.prototype.getGeometryFunction=function(){return this.Bu},t.prototype.getFill=function(){return this.lu},t.prototype.setFill=function(t){this.lu=t},t.prototype.getImage=function(){return this.Lt},t.prototype.setImage=function(t){this.Lt=t},t.prototype.getStroke=function(){return this.pu},t.prototype.setStroke=function(t){this.pu=t},t.prototype.getText=function(){return this.eo},t.prototype.setText=function(t){this.eo=t},t.prototype.getZIndex=function(){return this.Vu},t.prototype.setGeometry=function(t){"function"==typeof t?this.Bu=t:"string"==typeof t?this.Bu=function(n){return n.get(t)}:t?void 0!==t&&(this.Bu=function(){return t}):this.Bu=_v,this.Hr=t},t.prototype.setZIndex=function(t){this.Vu=t},t}();function gv(t){var n;if("function"==typeof t)n=t;else{var i;if(Array.isArray(t))i=t;else St("function"==typeof t.getZIndex,41),i=[t];n=function(){return i}}return n}var bv=null;function xv(t,n){if(!bv){var i=new rv({color:"rgba(255,255,255,0.4)"}),r=new mv({color:"#3399CC",width:1.25});bv=[new wv({image:new iv({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return bv}function Mv(){var t={},n=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new wv({fill:new rv({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new wv({stroke:new mv({color:n,width:5})}),new wv({stroke:new mv({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new wv({image:new iv({radius:6,fill:new rv({color:i}),stroke:new mv({color:n,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function _v(t){return t.getGeometry()}var Sv=wv,Ov="point",jv="line",Ev=function(){function t(t){var n=t||{};this.Wu=n.font,this.Dr=n.rotation,this.su=n.rotateWithView,this.uu=n.scale,this.au=Qu(void 0!==n.scale?n.scale:1),this.eo=n.text,this.Yu=n.textAlign,this.Zu=n.justify,this.$u=n.textBaseline,this.lu=void 0!==n.fill?n.fill:new rv({color:"#333"}),this.Ku=void 0!==n.maxAngle?n.maxAngle:Math.PI/4,this.Hu=void 0!==n.placement?n.placement:Ov,this.Ju=!!n.overflow,this.pu=void 0!==n.stroke?n.stroke:null,this.Qu=void 0!==n.offsetX?n.offsetX:0,this.ta=void 0!==n.offsetY?n.offsetY:0,this.na=n.backgroundFill?n.backgroundFill:null,this.ia=n.backgroundStroke?n.backgroundStroke:null,this.Ai=void 0===n.padding?null:n.padding}return t.prototype.clone=function(){var n=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(n)?n.slice():n,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),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()||void 0})},t.prototype.getOverflow=function(){return this.Ju},t.prototype.getFont=function(){return this.Wu},t.prototype.getMaxAngle=function(){return this.Ku},t.prototype.getPlacement=function(){return this.Hu},t.prototype.getOffsetX=function(){return this.Qu},t.prototype.getOffsetY=function(){return this.ta},t.prototype.getFill=function(){return this.lu},t.prototype.getRotateWithView=function(){return this.su},t.prototype.getRotation=function(){return this.Dr},t.prototype.getScale=function(){return this.uu},t.prototype.getScaleArray=function(){return this.au},t.prototype.getStroke=function(){return this.pu},t.prototype.getText=function(){return this.eo},t.prototype.getTextAlign=function(){return this.Yu},t.prototype.getJustify=function(){return this.Zu},t.prototype.getTextBaseline=function(){return this.$u},t.prototype.getBackgroundFill=function(){return this.na},t.prototype.getBackgroundStroke=function(){return this.ia},t.prototype.getPadding=function(){return this.Ai},t.prototype.setOverflow=function(t){this.Ju=t},t.prototype.setFont=function(t){this.Wu=t},t.prototype.setMaxAngle=function(t){this.Ku=t},t.prototype.setOffsetX=function(t){this.Qu=t},t.prototype.setOffsetY=function(t){this.ta=t},t.prototype.setPlacement=function(t){this.Hu=t},t.prototype.setRotateWithView=function(t){this.su=t},t.prototype.setFill=function(t){this.lu=t},t.prototype.setRotation=function(t){this.Dr=t},t.prototype.setScale=function(t){this.uu=t,this.au=Qu(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.pu=t},t.prototype.setText=function(t){this.eo=t},t.prototype.setTextAlign=function(t){this.Yu=t},t.prototype.setJustify=function(t){this.Zu=t},t.prototype.setTextBaseline=function(t){this.$u=t},t.prototype.setBackgroundFill=function(t){this.na=t},t.prototype.setBackgroundStroke=function(t){this.ia=t},t.prototype.setPadding=function(t){this.Ai=t},t}(),Tv=function(){function t(t){this.ra,this.ea,this.oa,this.sa=void 0===t||t,this.ua=0}return t.prototype.insertItem=function(t){var n={prev:void 0,next:void 0,data:t},i=this.oa;if(i){var r=i.next;n.prev=i,n.next=r,i.next=n,r&&(r.prev=n),i===this.ea&&(this.ea=n)}else this.ra=n,this.ea=n,this.sa&&(n.next=n,n.prev=n);this.oa=n,this.ua++},t.prototype.removeItem=function(){var t=this.oa;if(t){var n=t.next,i=t.prev;n&&(n.prev=i),i&&(i.next=n),this.oa=n||i,this.ra===this.ea?(this.oa=void 0,this.ra=void 0,this.ea=void 0):this.ra===t?this.ra=this.oa:this.ea===t&&(this.ea=i?this.oa.prev:this.oa),this.ua--}},t.prototype.firstItem=function(){if(this.oa=this.ra,this.oa)return this.oa.data},t.prototype.lastItem=function(){if(this.oa=this.ea,this.oa)return this.oa.data},t.prototype.nextItem=function(){if(this.oa&&this.oa.next)return this.oa=this.oa.next,this.oa.data},t.prototype.getNextItem=function(){if(this.oa&&this.oa.next)return this.oa.next.data},t.prototype.prevItem=function(){if(this.oa&&this.oa.prev)return this.oa=this.oa.prev,this.oa.data},t.prototype.getPrevItem=function(){if(this.oa&&this.oa.prev)return this.oa.prev.data},t.prototype.getCurrItem=function(){if(this.oa)return this.oa.data},t.prototype.setFirstItem=function(){this.sa&&this.oa&&(this.ra=this.oa,this.ea=this.oa.prev)},t.prototype.concat=function(t){if(t.oa){if(this.oa){var n=this.oa.next;this.oa.next=t.ra,t.ra.prev=this.oa,n.prev=t.ea,t.ea.next=n,this.ua+=t.ua}else this.oa=t.oa,this.ra=t.ra,this.ea=t.ea,this.ua=t.ua;t.oa=void 0,t.ra=void 0,t.ea=void 0,t.ua=0}},t.prototype.getLength=function(){return this.ua},t}(),Av=i(72),Pv=function(){function t(t){this.aa=new Av(t),this.ha={}}return t.prototype.insert=function(t,n){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:n};this.aa.insert(i),this.ha[o(n)]=i},t.prototype.load=function(t,n){for(var i=new Array(n.length),r=0,e=n.length;r<e;r++){var s=t[r],u=n[r],a={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:u};i[r]=a,this.ha[o(u)]=a}this.aa.load(i)},t.prototype.remove=function(t){var n=o(t),i=this.ha[n];return delete this.ha[n],null!==this.aa.remove(i)},t.prototype.update=function(t,n){var i=this.ha[o(n)];An([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(n),this.insert(t,n))},t.prototype.getAll=function(){return this.aa.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.aa.search(n).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.fa(this.getAll(),t)},t.prototype.forEachInExtent=function(t,n){return this.fa(this.getInExtent(t),n)},t.prototype.fa=function(t,n){for(var i,r=0,e=t.length;r<e;r++)if(i=n(t[r]))return i;return i},t.prototype.isEmpty=function(){return k(this.ha)},t.prototype.clear=function(){this.aa.clear(),this.ha={}},t.prototype.getExtent=function(t){var n=this.aa.toJSON();return On(n.minX,n.minY,n.maxX,n.maxY,t)},t.prototype.concat=function(t){for(var n in this.aa.load(t.aa.all()),t.ha)this.ha[n]=t.ha[n]},t}(),Cv="tileloadstart",kv="tileloadend",Iv="tileloaderror",Nv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Lv(t){return t?Array.isArray(t)?function(n){return t}:"function"==typeof t?t:function(n){return[t]}:null}var zv=function(t){function n(n){var i=t.call(this)||this;i.projection=yr(n.projection),i.ca=Lv(n.attributions),i.la=void 0===n.attributionsCollapsible||n.attributionsCollapsible,i.loading=!1,i.rn=void 0!==n.state?n.state:"ready",i.va=void 0!==n.wrapX&&n.wrapX,i.da=!!n.interpolate,i.viewResolver=null,i.viewRejector=null;var r=i;return i.pa=new Promise((function(t,n){r.viewResolver=t,r.viewRejector=n})),i}return Nv(n,t),n.prototype.getAttributions=function(){return this.ca},n.prototype.getAttributionsCollapsible=function(){return this.la},n.prototype.getProjection=function(){return this.projection},n.prototype.getResolutions=function(){return r()},n.prototype.getView=function(){return this.pa},n.prototype.getState=function(){return this.rn},n.prototype.getWrapX=function(){return this.va},n.prototype.getInterpolate=function(){return this.da},n.prototype.refresh=function(){this.changed()},n.prototype.setAttributions=function(t){this.ca=Lv(t),this.changed()},n.prototype.setState=function(t){this.rn=t,this.changed()},n}(et),Rv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Fv=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:n.projection,state:n.state,wrapX:n.wrapX,interpolate:n.interpolate})||this;i.on,i.once,i.un,i.ya=void 0!==n.opaque&&n.opaque,i.ma=void 0!==n.tilePixelRatio?n.tilePixelRatio:1,i.tileGrid=void 0!==n.tileGrid?n.tileGrid:null;return i.tileGrid&&Qu(i.tileGrid.getTileSize(i.tileGrid.getMinZoom()),[256,256]),i.tileCache=new Ih(n.cacheSize||0),i.tmpSize=[0,0],i.ke=n.key||"",i.tileOptions={transition:n.transition,interpolate:n.interpolate},i.zDirection=n.zDirection?n.zDirection:0,i}return Rv(n,t),n.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},n.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);i&&i.expireCache(n)},n.prototype.forEachLoadedTile=function(t,n,i,r){var e=this.getTileCacheForProjection(t);if(!e)return!1;for(var o,s,u,a=!0,h=i.minX;h<=i.maxX;++h)for(var f=i.minY;f<=i.maxY;++f)s=jh(n,h,f),u=!1,e.containsKey(s)&&(u=(o=e.get(s)).getState()===vt)&&(u=!1!==r(o)),u||(a=!1);return a},n.prototype.getGutterForProjection=function(t){return 0},n.prototype.getKey=function(){return this.ke},n.prototype.setKey=function(t){this.ke!==t&&(this.ke=t,this.changed())},n.prototype.getOpaque=function(t){return this.ya},n.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},n.prototype.getTile=function(t,n,i,e,o){return r()},n.prototype.getTileGrid=function(){return this.tileGrid},n.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Mf(t)},n.prototype.getTileCacheForProjection=function(t){var n=this.getProjection();return St(null===n||Sr(n,t),68),this.tileCache},n.prototype.getTilePixelRatio=function(t){return this.ma},n.prototype.getTilePixelSize=function(t,n,i){var r=this.getTileGridForProjection(i),e=this.getTilePixelRatio(n),o=Qu(r.getTileSize(t),this.tmpSize);return 1==e?o:Ju(o,e,this.tmpSize)},n.prototype.getTileCoordForTileUrlFunction=function(t,n){var i=void 0!==n?n:this.getProjection(),r=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=_f(r,t,i)),Ch(t,r)?t:null},n.prototype.clear=function(){this.tileCache.clear()},n.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},n.prototype.updateCacheSize=function(t,n){var i=this.getTileCacheForProjection(n);t>i.highWaterMark&&(i.highWaterMark=t)},n.prototype.useTile=function(t,n,i,r){},n}(zv),Gv=function(t){function n(n,i){var r=t.call(this,n)||this;return r.tile=i,r}return Rv(n,t),n}(c),Dv=Fv,qv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Uv=function(t){function n(i){var r=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,interpolate:i.interpolate,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return r.wa=r.tileUrlFunction===n.prototype.tileUrlFunction,r.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(r.tileUrlFunction=i.tileUrlFunction),r.urls=null,i.urls?r.setUrls(i.urls):i.url&&r.setUrl(i.url),r.ga={},r}return qv(n,t),n.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},n.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},n.prototype.getUrls=function(){return this.urls},n.prototype.handleTileChange=function(t){var n,i=t.target,r=o(i),e=i.getState();e==lt?(this.ga[r]=!0,n=Cv):r in this.ga&&(delete this.ga[r],n=e==dt?Iv:e==vt?kv:void 0),null!=n&&this.dispatchEvent(new Gv(n,i))},n.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},n.prototype.setTileUrlFunction=function(t,n){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==n?this.setKey(n):this.changed()},n.prototype.setUrl=function(t){var n=If(t);this.urls=n,this.setUrls(n)},n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.wa?this.setTileUrlFunction(Pf(t,this.tileGrid),n):this.setKey(n)},n.prototype.tileUrlFunction=function(t,n,i){},n.prototype.useTile=function(t,n,i){var r=jh(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(Dv),Bv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Xv(t,n){t.getImage().src=n}var Vv=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:Xv,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:n.wrapX,transition:n.transition,interpolate:r,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).crossOrigin=void 0!==n.crossOrigin?n.crossOrigin:null,i.tileClass=void 0!==n.tileClass?n.tileClass:ko,i.tileCacheForProjection={},i.tileGridForProjection={},i.ba=n.reprojectionErrorThreshold,i.xa=!1,i}return Bv(n,t),n.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},n.prototype.expireCache=function(t,n){var i=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==i?n:{}),this.tileCacheForProjection){var e=this.tileCacheForProjection[r];e.expireCache(e==i?n:{})}},n.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Sr(this.getProjection(),t)?0:this.getGutter()},n.prototype.getGutter=function(){return 0},n.prototype.getKey=function(){var n=t.prototype.getKey.call(this);return this.getInterpolate()||(n+=":disable-interpolation"),n},n.prototype.getOpaque=function(n){return!(this.getProjection()&&n&&!Sr(this.getProjection(),n))&&t.prototype.getOpaque.call(this,n)},n.prototype.getTileGridForProjection=function(t){var n=this.getProjection();if(!this.tileGrid||n&&!Sr(n,t)){var i=o(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Mf(t)),this.tileGridForProjection[i]}return this.tileGrid},n.prototype.getTileCacheForProjection=function(t){var n=this.getProjection();if(!n||Sr(n,t))return this.tileCache;var i=o(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Ih(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},n.prototype.Ma=function(t,n,i,r,e,o){var s=[t,n,i],u=this.getTileCoordForTileUrlFunction(s,e),a=u?this.tileUrlFunction(u,r,e):void 0,h=new this.tileClass(s,void 0!==a?ct:pt,void 0!==a?a:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(L,this.handleTileChange.bind(this)),h},n.prototype.getTile=function(t,n,i,r,e){var o=this.getProjection();if(o&&e&&!Sr(o,e)){var s=this.getTileCacheForProjection(e),u=[t,n,i],a=void 0,h=Eh(u);s.containsKey(h)&&(a=s.get(h));var f=this.getKey();if(a&&a.key==f)return a;var c=this.getTileGridForProjection(o),l=this.getTileGridForProjection(e),v=this.getTileCoordForTileUrlFunction(u,e),d=new Bc(o,c,e,l,u,v,this.getTilePixelRatio(r),this.getGutter(),function(t,n,i,r){return this.getTileInternal(t,n,i,r,o)}.bind(this),this.ba,this.xa,this.getInterpolate());return d.key=f,a?(d.interimTile=a,d.refreshInterimChain(),s.replace(h,d)):s.set(h,d),d}return this.getTileInternal(t,n,i,r,o||e)},n.prototype.getTileInternal=function(t,n,i,r,e){var o=null,s=jh(t,n,i),u=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=u){var a=o;o=this.Ma(t,n,i,r,e,u),a.getState()==ct?o.interimTile=a.interimTile:o.interimTile=a,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.Ma(t,n,i,r,e,u),this.tileCache.set(s,o);return o},n.prototype.setRenderReprojectionEdges=function(t){if(this.xa!=t){for(var n in this.xa=t,this.tileCacheForProjection)this.tileCacheForProjection[n].clear();this.changed()}},n.prototype.setTileGridForProjection=function(t,n){var i=yr(t);if(i){var r=o(i);r in this.tileGridForProjection||(this.tileGridForProjection[r]=n)}},n}(Uv),Wv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Yv(t){var n,i,r=t[0],e=new Array(r),o=1<<r-1;for(n=0;n<r;++n)i=48,t[1]&o&&(i+=1),t[2]&o&&(i+=2),e[n]=String.fromCharCode(i),o>>=1;return e.join("")}var Zv=function(t){function n(n){var i=this,r=void 0!==n.hidpi&&n.hidpi,e=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(e=n.interpolate),(i=t.call(this,{cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:e,opaque:!0,projection:yr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:"loading",tileLoadFunction:n.tileLoadFunction,tilePixelRatio:r?2:1,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this)._a=r,i.Sa=void 0!==n.culture?n.culture:"en-us",i.Oa=void 0!==n.maxZoom?n.maxZoom:-1,i.ja=n.key,i.Ea=n.imagerySet,Zh("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+i.Ea+"?uriScheme=https&include=ImageryProviders&key="+i.ja+"&c="+i.Sa,i.handleImageryMetadataResponse.bind(i),void 0,"jsonp"),i}return Wv(n,t),n.prototype.getApiKey=function(){return this.ja},n.prototype.getImagerySet=function(){return this.Ea},n.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 n=t.resourceSets[0].resources[0],i=-1==this.Oa?n.zoomMax:this.Oa,r=Tf(this.getProjection()),e=this._a?2:1,o=n.imageWidth==n.imageHeight?n.imageWidth/e:[n.imageWidth/e,n.imageHeight/e],s=Of({extent:r,minZoom:n.zoomMin,maxZoom:i,tileSize:o});this.tileGrid=s;var u=this.Sa,a=this._a;if(this.tileUrlFunction=Cf(n.imageUrlSubdomains.map((function(t){var i=[0,0,0],r=n.imageUrl.replace("{subdomain}",t).replace("{culture}",u);return function(t,n,e){if(t){Oh(t[0],t[1],t[2],i);var o=r;return a&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",Yv(i))}}}))),n.imageryProviders){var h=Or(yr("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var i=[],r=t.viewState,e=this.getTileGrid(),o=e.getZForResolution(r.resolution,this.zDirection),s=e.getTileCoordForCoordAndZ(r.center,o)[0];return n.imageryProviders.map((function(n){for(var r=!1,e=n.coverageAreas,o=0,u=e.length;o<u;++o){var a=e[o];if(s>=a.zoomMin&&s<=a.zoomMax){var f=a.bbox;if(Kn(ni([f[1],f[0],f[3],f[2]],h),t.extent)){r=!0;break}}}r&&i.push(n.attribution)})),i.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),i}.bind(this))}this.setState("ready")}else this.setState("error")},n}(Vv),$v=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Kv=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=void 0!==r.projection?r.projection:"EPSG:3857",s=void 0!==r.tileGrid?r.tileGrid:Of({extent:Tf(o),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,opaque:r.opaque,projection:o,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:s,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).js=void 0!==r.gutter?r.gutter:0,i}return $v(n,t),n.prototype.getGutter=function(){return this.js},n}(Vv),Hv=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Jv=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,maxZoom:void 0!==n.maxZoom?n.maxZoom:18,minZoom:n.minZoom,projection:n.projection,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection})||this;return i.Ta=n.account,i.Aa=n.map||"",i.Pa=n.config||{},i.Ca={},i.ka(),i}return Hv(n,t),n.prototype.getConfig=function(){return this.Pa},n.prototype.updateConfig=function(t){A(this.Pa,t),this.ka()},n.prototype.setConfig=function(t){this.Pa=t||{},this.ka()},n.prototype.ka=function(){var t=JSON.stringify(this.Pa);if(this.Ca[t])this.Ia(this.Ca[t]);else{var n="https://"+this.Ta+".carto.com/api/v1/map";this.Aa&&(n+="/named/"+this.Aa);var i=new XMLHttpRequest;i.addEventListener("load",this.Na.bind(this,t)),i.addEventListener("error",this.La.bind(this)),i.open("POST",n),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.Pa))}},n.prototype.Na=function(t,n){var i=n.target;if(!i.status||i.status>=200&&i.status<300){var r=void 0;try{r=JSON.parse(i.responseText)}catch(t){return void this.setState("error")}this.Ia(r),this.Ca[t]=r,this.setState("ready")}else this.setState("error")},n.prototype.La=function(t){this.setState("error")},n.prototype.Ia=function(t){var n="https://"+t.cdn_url.https+"/"+this.Ta+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(n)},n}(Kv),Qv="addfeature",td="changefeature",nd="clear",id="removefeature",rd="featuresloadstart",ed="featuresloadend",od="featuresloaderror",sd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ud=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.feature=i,e.features=r,e}return sd(n,t),n}(c),ad=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{attributions:r.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===r.wrapX||r.wrapX})||this).on,i.once,i.un,i.U=j,i.ze=r.format,i.za=void 0===r.overlaps||r.overlaps,i.Fe=r.url,void 0!==r.loader?i.U=r.loader:void 0!==i.Fe&&(St(i.ze,7),i.U=Vh(i.Fe,i.ze)),i.Ra=void 0!==r.strategy?r.strategy:Wh;var e,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return i.Fa=s?new Pv:null,i.Ga=new Pv,i.Da=0,i.qa={},i.Ua={},i.Ba={},i.Xa={},i.Va=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(e=r.features).getArray()),s||void 0!==e||(e=new ft(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==e&&i.Wa(e),i}return sd(n,t),n.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},n.prototype.addFeatureInternal=function(t){var n=o(t);if(this.Ya(n,t)){this.Za(n,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.Fa&&this.Fa.insert(r,t)}else this.qa[n]=t;this.dispatchEvent(new ud(Qv,t))}else this.Va&&this.Va.remove(t)},n.prototype.Za=function(t,n){this.Xa[t]=[$(n,L,this.$a,this),$(n,l,this.$a,this)]},n.prototype.Ya=function(t,n){var i=!0,r=n.getId();return void 0!==r&&(r.toString()in this.Ua?i=!1:this.Ua[r.toString()]=n),i&&(St(!(t in this.Ba),30),this.Ba[t]=n),i},n.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},n.prototype.addFeaturesInternal=function(t){for(var n=[],i=[],r=[],e=0,s=t.length;e<s;e++){var u=o(h=t[e]);this.Ya(u,h)&&i.push(h)}e=0;for(var a=i.length;e<a;e++){var h;u=o(h=i[e]);this.Za(u,h);var f=h.getGeometry();if(f){var c=f.getExtent();n.push(c),r.push(h)}else this.qa[u]=h}if(this.Fa&&this.Fa.load(n,r),this.hasListener(Qv)){e=0;for(var l=i.length;e<l;e++)this.dispatchEvent(new ud(Qv,i[e]))}},n.prototype.Wa=function(t){var n=!1;this.addEventListener(Qv,(function(i){n||(n=!0,t.push(i.feature),n=!1)})),this.addEventListener(id,(function(i){n||(n=!0,t.remove(i.feature),n=!1)})),t.addEventListener(ot,function(t){n||(n=!0,this.addFeature(t.element),n=!1)}.bind(this)),t.addEventListener(st,function(t){n||(n=!0,this.removeFeature(t.element),n=!1)}.bind(this)),this.Va=t},n.prototype.clear=function(t){if(t){for(var n in this.Xa){this.Xa[n].forEach(H)}this.Va||(this.Xa={},this.Ua={},this.Ba={})}else if(this.Fa){var i=function(t){this.removeFeatureInternal(t)}.bind(this);for(var r in this.Fa.forEach(i),this.qa)this.removeFeatureInternal(this.qa[r])}this.Va&&this.Va.clear(),this.Fa&&this.Fa.clear(),this.qa={};var e=new ud(nd);this.dispatchEvent(e),this.changed()},n.prototype.forEachFeature=function(t){if(this.Fa)return this.Fa.forEach(t);this.Va&&this.Va.forEach(t)},n.prototype.forEachFeatureAtCoordinateDirect=function(t,n){var i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?n(i):void 0}))},n.prototype.forEachFeatureInExtent=function(t,n){if(this.Fa)return this.Fa.forEachInExtent(t,n);this.Va&&this.Va.forEach(n)},n.prototype.forEachFeatureIntersectingExtent=function(t,n){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){var r=n(i);if(r)return r}}))},n.prototype.getFeaturesCollection=function(){return this.Va},n.prototype.getFeatures=function(){var t;return this.Va?t=this.Va.getArray().slice(0):this.Fa&&(t=this.Fa.getAll(),k(this.qa)||g(t,C(this.qa))),t},n.prototype.getFeaturesAtCoordinate=function(t){var n=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){n.push(t)})),n},n.prototype.getFeaturesInExtent=function(t,n){var i=this;if(this.Fa){if(!(n&&n.canWrapX()&&this.getWrapX()))return this.Fa.getInExtent(t);var r=ri(t,n);return[].concat.apply([],r.map((function(t){return i.Fa.getInExtent(t)})))}return this.Va?this.Va.getArray().slice(0):[]},n.prototype.getClosestFeatureToCoordinate=function(t,n){var i=t[0],r=t[1],e=null,o=[NaN,NaN],s=1/0,u=[-1/0,-1/0,1/0,1/0],a=n||S;return this.Fa.forEachInExtent(u,(function(t){if(a(t)){var n=t.getGeometry(),h=s;if((s=n.closestPointXY(i,r,o,s))<h){e=t;var f=Math.sqrt(s);u[0]=i-f,u[1]=r-f,u[2]=i+f,u[3]=r+f}}})),e},n.prototype.getExtent=function(t){return this.Fa.getExtent(t)},n.prototype.getFeatureById=function(t){var n=this.Ua[t.toString()];return void 0!==n?n:null},n.prototype.getFeatureByUid=function(t){var n=this.Ba[t];return void 0!==n?n:null},n.prototype.getFormat=function(){return this.ze},n.prototype.getOverlaps=function(){return this.za},n.prototype.getUrl=function(){return this.Fe},n.prototype.$a=function(t){var n=t.target,i=o(n),r=n.getGeometry();if(r){var e=r.getExtent();i in this.qa?(delete this.qa[i],this.Fa&&this.Fa.insert(e,n)):this.Fa&&this.Fa.update(e,n)}else i in this.qa||(this.Fa&&this.Fa.remove(n),this.qa[i]=n);var s=n.getId();if(void 0!==s){var u=s.toString();this.Ua[u]!==n&&(this.Ka(n),this.Ua[u]=n)}else this.Ka(n),this.Ba[i]=n;this.changed(),this.dispatchEvent(new ud(td,n))},n.prototype.hasFeature=function(t){var n=t.getId();return void 0!==n?n in this.Ua:o(t)in this.Ba},n.prototype.isEmpty=function(){return this.Fa?this.Fa.isEmpty()&&k(this.qa):!this.Va||0===this.Va.getLength()},n.prototype.loadFeatures=function(t,n,i){for(var r=this.Ga,e=this.Ra(t,n,i),o=function(t,o){var u=e[t];r.forEachInExtent(u,(function(t){return xn(t.extent,u)}))||(++s.Da,s.dispatchEvent(new ud(rd)),s.U.call(s,u,n,i,function(t){--this.Da,this.dispatchEvent(new ud(ed,void 0,t))}.bind(s),function(){--this.Da,this.dispatchEvent(new ud(od))}.bind(s)),r.insert(u,{extent:u.slice()}))},s=this,u=0,a=e.length;u<a;++u)o(u);this.loading=!(this.U.length<4)&&this.Da>0},n.prototype.refresh=function(){this.clear(!0),this.Ga.clear(),t.prototype.refresh.call(this)},n.prototype.removeLoadedExtent=function(t){var n,i=this.Ga;i.forEachInExtent(t,(function(i){if(An(i.extent,t))return n=i,!0})),n&&i.remove(n)},n.prototype.removeFeature=function(t){if(t){var n=o(t);n in this.qa?delete this.qa[n]:this.Fa&&this.Fa.remove(t),this.removeFeatureInternal(t)&&this.changed()}},n.prototype.removeFeatureInternal=function(t){var n=o(t),i=this.Xa[n];if(i){i.forEach(H),delete this.Xa[n];var r=t.getId();return void 0!==r&&delete this.Ua[r.toString()],delete this.Ba[n],this.dispatchEvent(new ud(id,t)),t}},n.prototype.Ka=function(t){var n=!1;for(var i in this.Ua)if(this.Ua[i]===t){delete this.Ua[i],n=!0;break}return n},n.prototype.setLoader=function(t){this.U=t},n.prototype.setUrl=function(t){St(this.ze,7),this.Fe=t,this.setLoader(Vh(t,this.ze))},n}(zv),hd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fd=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,wrapX:n.wrapX})||this;return i.resolution=void 0,i.distance=void 0!==n.distance?n.distance:20,i.minDistance=n.minDistance||0,i.interpolationRatio=0,i.features=[],i.geometryFunction=n.geometryFunction||function(t){var n=t.getGeometry();return St("Point"==n.getType(),10),n},i.Ha=n.createCluster,i.source=null,i.Ja=i.refresh.bind(i),i.updateDistance(i.distance,i.minDistance),i.setSource(n.source||null),i}return hd(n,t),n.prototype.clear=function(n){this.features.length=0,t.prototype.clear.call(this,n)},n.prototype.getDistance=function(){return this.distance},n.prototype.getSource=function(){return this.source},n.prototype.loadFeatures=function(t,n,i){this.source.loadFeatures(t,n,i),n!==this.resolution&&(this.resolution=n,this.refresh())},n.prototype.setDistance=function(t){this.updateDistance(t,this.minDistance)},n.prototype.setMinDistance=function(t){this.updateDistance(this.distance,t)},n.prototype.getMinDistance=function(){return this.minDistance},n.prototype.setSource=function(t){this.source&&this.source.removeEventListener(L,this.Ja),this.source=t,t&&t.addEventListener(L,this.Ja),this.refresh()},n.prototype.refresh=function(){this.clear(),this.cluster(),this.addFeatures(this.features)},n.prototype.updateDistance=function(t,n){var i=0===t?0:Math.min(n,t)/t,r=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=n,this.interpolationRatio=i,r&&this.refresh()},n.prototype.cluster=function(){if(void 0!==this.resolution&&this.source)for(var t=[1/0,1/0,-1/0,-1/0],n=this.distance*this.resolution,i=this.source.getFeatures(),r={},e=0,s=i.length;e<s;e++){var u=i[e];if(!(o(u)in r)){var a=this.geometryFunction(u);if(a){En(a.getCoordinates(),t),mn(t,n,t);var h=this.source.getFeaturesInExtent(t).filter((function(t){var n=o(t);return!(n in r)&&(r[n]=!0,!0)}));this.features.push(this.createCluster(h,t))}}}},n.prototype.createCluster=function(t,n){for(var i=[0,0],r=t.length-1;r>=0;--r){var e=this.geometryFunction(t[r]);e?Vi(i,e.getCoordinates()):t.splice(r,1)}Ji(i,1/t.length);var o=qn(n),s=this.interpolationRatio,u=new Se([i[0]*(1-s)+o[0]*s,i[1]*(1-s)+o[1]*s]);return this.Ha?this.Ha(u,t):new Et({geometry:u,features:t})},n}(ad),cd=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ld=function(t){function n(n){var i=this,r=void 0===n.projection?"EPSG:3857":n.projection,e=n.tileGrid;if(void 0===e&&r&&(e=Of({extent:Tf(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize})),(i=t.call(this,{cacheSize:.1,attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,projection:r,tileGrid:e,opaque:n.opaque,state:n.state,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,interpolate:n.interpolate})||this).js=void 0!==n.gutter?n.gutter:0,i.jo=n.tileSize?Qu(n.tileSize):null,!i.jo&&n.tilePixelRatio&&e){var o=Qu(e.getTileSize(0));i.jo=[o[0]*n.tilePixelRatio,o[1]*n.tilePixelRatio]}return i.Oo=null,i.ga={},i.U=n.loader,i.cr=i.cr.bind(i),i.bandCount=void 0===n.bandCount?4:n.bandCount,i}return cd(n,t),n.prototype.setTileSizes=function(t){this.Oo=t},n.prototype.getTileSize=function(t){if(this.Oo)return this.Oo[t];if(this.jo)return this.jo;var n=this.getTileGrid();return n?Qu(n.getTileSize(t)):[256,256]},n.prototype.getGutterForProjection=function(t){return this.js},n.prototype.setLoader=function(t){this.U=t},n.prototype.getTile=function(t,n,i,r,e){var o=this.getTileSize(t),s=jh(t,n,i);if(this.tileCache.containsKey(s))return this.tileCache.get(s);var u=this.U;var a=A({tileCoord:[t,n,i],loader:function(){return T((function(){return u(t,n,i)}))},size:o},this.tileOptions),h=new _t(a);return h.key=this.getKey(),h.addEventListener(L,this.cr),this.tileCache.set(s,h),h},n.prototype.cr=function(t){var n,i=t.target,r=o(i),e=i.getState();e==lt?(this.ga[r]=!0,n=Cv):r in this.ga&&(delete this.ga[r],n=e==dt?Iv:e==vt?kv:void 0),n&&this.dispatchEvent(new Gv(n,i))},n}(Dv);const vd=new ArrayBuffer(4),dd=new Float32Array(vd),pd=new Uint32Array(vd),yd=new Uint32Array(512),md=new Uint32Array(512);for(let t=0;t<256;++t){const n=t-127;n<-27?(yd[t]=0,yd[256|t]=32768,md[t]=24,md[256|t]=24):n<-14?(yd[t]=1024>>-n-14,yd[256|t]=1024>>-n-14|32768,md[t]=-n-1,md[256|t]=-n-1):n<=15?(yd[t]=n+15<<10,yd[256|t]=n+15<<10|32768,md[t]=13,md[256|t]=13):n<128?(yd[t]=31744,yd[256|t]=64512,md[t]=24,md[256|t]=24):(yd[t]=31744,yd[256|t]=64512,md[t]=13,md[256|t]=13)}const wd=new Uint32Array(2048),gd=new Uint32Array(64),bd=new Uint32Array(64);wd[0]=0;for(let t=1;t<1024;++t){let n=t<<13,i=0;for(;0==(8388608&n);)i-=8388608,n<<=1;n&=-8388609,i+=947912704,wd[t]=n|i}for(let t=1024;t<2048;++t)wd[t]=939524096+(t-1024<<13);gd[0]=0;for(let t=1;t<31;++t)gd[t]=t<<23;gd[31]=1199570944,gd[32]=2147483648;for(let t=33;t<63;++t)gd[t]=2147483648+(t-32<<23);gd[63]=3347054592,bd[0]=0;for(let t=1;t<64;++t)bd[t]=32===t?0:1024;function xd(t){const n=t>>10;return pd[0]=wd[bd[n]+(1023&t)]+gd[n],dd[0]}const Md=Reflect.getPrototypeOf(Uint8Array).prototype,_d=Reflect.getOwnPropertyDescriptor(Md,Symbol.toStringTag).get;function Sd(t){return void 0!==_d.call(t)}const Od=Object.prototype.toString;function jd(t){return!!ArrayBuffer.isView(t)&&(!Sd(t)&&"[object DataView]"===Od.call(t))}function Ed(t,n){if(!jd(t))throw new TypeError("First argument to getFloat16 function must be a DataView");for(var i=arguments.length,r=new Array(i>2?i-2:0),e=2;e<i;e++)r[e-2]=arguments[e];return xd(t.getUint16(n,...r))}var Td=i(802),Ad=i(51),Pd=i(150);const Cd=new Map;function kd(t,n){Array.isArray(t)||(t=[t]),t.forEach((t=>Cd.set(t,n)))}async function Id(t){const n=Cd.get(t.Compression);if(!n)throw new Error(`Unknown compression method identifier: ${t.Compression}`);return new(await n())(t)}function Nd(t,n,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(t).constructor)(n*i*r)}function Ld(t,n,i,r,e){const o=n/r,s=i/e;return t.map((t=>{const u=Nd(t,r,e);for(let a=0;a<e;++a){const e=Math.min(Math.round(s*a),i-1);for(let i=0;i<r;++i){const s=Math.min(Math.round(o*i),n-1),h=t[e*n+s];u[a*r+i]=h}}return u}))}function zd(t,n,i){return(1-i)*t+i*n}function Rd(t,n,i,r,e){const o=n/r,s=i/e;return t.map((t=>{const u=Nd(t,r,e);for(let a=0;a<e;++a){const e=s*a,h=Math.floor(e),f=Math.min(Math.ceil(e),i-1);for(let i=0;i<r;++i){const s=o*i,c=s%1,l=Math.floor(s),v=Math.min(Math.ceil(s),n-1),d=t[h*n+l],p=t[h*n+v],y=t[f*n+l],m=t[f*n+v],w=zd(zd(d,p,c),zd(y,m,c),e%1);u[a*r+i]=w}}return u}))}function Fd(t,n,i,r,e,o){const s=n/r,u=i/e,a=Nd(t,r,e,o);for(let h=0;h<e;++h){const e=Math.min(Math.round(u*h),i-1);for(let i=0;i<r;++i){const u=Math.min(Math.round(s*i),n-1);for(let s=0;s<o;++s){const f=t[e*n*o+u*o+s];a[h*r*o+i*o+s]=f}}}return a}function Gd(t,n,i,r,e,o){const s=n/r,u=i/e,a=Nd(t,r,e,o);for(let h=0;h<e;++h){const e=u*h,f=Math.floor(e),c=Math.min(Math.ceil(e),i-1);for(let i=0;i<r;++i){const u=s*i,l=u%1,v=Math.floor(u),d=Math.min(Math.ceil(u),n-1);for(let s=0;s<o;++s){const u=t[f*n*o+v*o+s],p=t[f*n*o+d*o+s],y=t[c*n*o+v*o+s],m=t[c*n*o+d*o+s],w=zd(zd(u,p,l),zd(y,m,l),e%1);a[h*r*o+i*o+s]=w}}}return a}function Dd(t,n,i){let r=0;for(let e=n;e<i;++e)r+=t[e];return r}function qd(t,n,i){switch(t){case 1:if(n<=8)return new Uint8Array(i);if(n<=16)return new Uint16Array(i);if(n<=32)return new Uint32Array(i);break;case 2:if(8===n)return new Int8Array(i);if(16===n)return new Int16Array(i);if(32===n)return new Int32Array(i);break;case 3:switch(n){case 16:case 32:return new Float32Array(i);case 64:return new Float64Array(i)}}throw Error("Unsupported data format/bitsPerSample")}kd([void 0,1],(()=>i.e(226).then(i.bind(i,966)).then((t=>t.default)))),kd(5,(()=>i.e(611).then(i.bind(i,611)).then((t=>t.default)))),kd(6,(()=>{throw new Error("old style JPEG compression is not supported.")})),kd(7,(()=>i.e(382).then(i.bind(i,382)).then((t=>t.default)))),kd([8,32946],(()=>Promise.all([i.e(247),i.e(356)]).then(i.bind(i,356)).then((t=>t.default)))),kd(32773,(()=>i.e(395).then(i.bind(i,395)).then((t=>t.default)))),kd(34887,(()=>Promise.all([i.e(247),i.e(54)]).then(i.bind(i,54)).then((t=>t.default)))),kd(50001,(()=>i.e(629).then(i.bind(i,629)).then((t=>t.default))));var Ud=class{constructor(t,n,i,r,e,o){this.fileDirectory=t,this.geoKeys=n,this.dataView=i,this.littleEndian=r,this.tiles=e?{}:null,this.isTiled=!t.StripOffsets;const s=t.PlanarConfiguration;if(this.planarConfiguration=void 0===s?1:s,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let n=0;n<this.fileDirectory.BitsPerSample.length;++n)t+=this.getSampleByteSize(n);return t}getSampleByteSize(t){if(t>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${t} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[t]/8)}getReaderForSample(t){const n=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1,i=this.fileDirectory.BitsPerSample[t];switch(n){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(t,n){return Ed(this,t,n)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[t]:1}getBitsPerSample(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.fileDirectory.BitsPerSample[t]}getArrayForSample(t,n){return qd(this.getSampleFormat(t),this.getBitsPerSample(t),n)}async getTileOrStrip(t,n,i,r,e){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let u;const{tiles:a}=this;let h,f;1===this.planarConfiguration?u=n*o+t:2===this.planarConfiguration&&(u=i*o*s+n*o+t),this.isTiled?(h=this.fileDirectory.TileOffsets[u],f=this.fileDirectory.TileByteCounts[u]):(h=this.fileDirectory.StripOffsets[u],f=this.fileDirectory.StripByteCounts[u]);const c=(await this.source.fetch([{offset:h,length:f}],e))[0];let l;return null!==a&&a[u]?l=a[u]:(l=(async()=>{let t=await r.decode(this.fileDirectory,c);const i=this.getSampleFormat(),e=this.getBitsPerSample();return function(t,n){return(1!==t&&2!==t||!(n<=32)||n%8!=0)&&(3!==t||16!==n&&32!==n&&64!==n)}(i,e)&&(t=function(t,n,i,r,e,o,s){const u=new DataView(t),a=2===i?1:r,h=qd(n,e,2===i?s*o:s*o*r),f=parseInt("1".repeat(e),2);if(1===n){let t;t=1===i?r*e:e;let n=o*t;0!=(7&n)&&(n=n+7&-8);for(let t=0;t<s;++t){const i=t*n;for(let n=0;n<o;++n){const r=i+n*a*e;for(let i=0;i<a;++i){const s=r+i*e,c=(t*o+n)*a+i,l=Math.floor(s/8),v=s%8;if(v+e<=8)h[c]=u.getUint8(l)>>8-e-v&f;else if(v+e<=16)h[c]=u.getUint16(l)>>16-e-v&f;else if(v+e<=24){const t=u.getUint16(l)<<8|u.getUint8(l+2);h[c]=t>>24-e-v&f}else h[c]=u.getUint32(l)>>32-e-v&f}}}}return h.buffer}(t,i,this.planarConfiguration,this.getSamplesPerPixel(),e,this.getTileWidth(),this.getBlockHeight(n))),t})(),null!==a&&(a[u]=l)),{x:t,y:n,sample:i,data:await l}}async _readRaster(t,n,i,r,e,o,s,u,a){const h=this.getTileWidth(),f=this.getTileHeight(),c=this.getWidth(),l=this.getHeight(),v=Math.max(Math.floor(t[0]/h),0),d=Math.min(Math.ceil(t[2]/h),Math.ceil(c/h)),p=Math.max(Math.floor(t[1]/f),0),y=Math.min(Math.ceil(t[3]/f),Math.ceil(l/f)),m=t[2]-t[0];let w=this.getBytesPerPixel();const g=[],b=[];for(let t=0;t<n.length;++t)1===this.planarConfiguration?g.push(Dd(this.fileDirectory.BitsPerSample,0,n[t])/8):g.push(0),b.push(this.getReaderForSample(n[t]));const x=[],{littleEndian:M}=this;for(let o=p;o<y;++o)for(let s=v;s<d;++s)for(let u=0;u<n.length;++u){const v=u,d=n[u];2===this.planarConfiguration&&(w=this.getSampleByteSize(u));const p=this.getTileOrStrip(s,o,d,e,a);x.push(p),p.then((e=>{const o=e.data,s=new DataView(o),u=this.getBlockHeight(e.y),a=e.y*f,d=e.x*h,p=a+u,y=(e.x+1)*h,x=b[v],_=Math.min(u,u-(p-t[3]),l-a),S=Math.min(h,h-(y-t[2]),c-d);for(let e=Math.max(0,t[1]-a);e<_;++e)for(let o=Math.max(0,t[0]-d);o<S;++o){const u=(e*h+o)*w,f=x.call(s,u+g[v],M);let c;r?(c=(e+a-t[1])*m*n.length+(o+d-t[0])*n.length+v,i[c]=f):(c=(e+a-t[1])*m+o+d-t[0],i[v][c]=f)}}))}if(await Promise.all(x),o&&t[2]-t[0]!==o||s&&t[3]-t[1]!==s){let e;return e=r?function(t,n,i,r,e,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(s.toLowerCase()){case"nearest":return Fd(t,n,i,r,e,o);case"bilinear":case"linear":return Gd(t,n,i,r,e,o);default:throw new Error(`Unsupported resampling method: '${s}'`)}}(i,t[2]-t[0],t[3]-t[1],o,s,n.length,u):function(t,n,i,r,e){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(o.toLowerCase()){case"nearest":return Ld(t,n,i,r,e);case"bilinear":case"linear":return Rd(t,n,i,r,e);default:throw new Error(`Unsupported resampling method: '${o}'`)}}(i,t[2]-t[0],t[3]-t[1],o,s,u),e.width=o,e.height=s,e}return i.width=o||t[2]-t[0],i.height=s||t[3]-t[1],i}async readRasters(){let{window:t,samples:n=[],interleave:i,pool:r=null,width:e,height:o,resampleMethod:s,fillValue:u,signal:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const h=t||[0,0,this.getWidth(),this.getHeight()];if(h[0]>h[2]||h[1]>h[3])throw new Error("Invalid subsets");const f=(h[2]-h[0])*(h[3]-h[1]),c=this.getSamplesPerPixel();if(n&&n.length){for(let t=0;t<n.length;++t)if(n[t]>=c)return Promise.reject(new RangeError(`Invalid sample index '${n[t]}'.`))}else for(let t=0;t<c;++t)n.push(t);let l;if(i){l=qd(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),f*n.length),u&&l.fill(u)}else{l=[];for(let t=0;t<n.length;++t){const i=this.getArrayForSample(n[t],f);Array.isArray(u)&&t<u.length?i.fill(u[t]):u&&!Array.isArray(u)&&i.fill(u),l.push(i)}}const v=r||await Id(this.fileDirectory);return await this._readRaster(h,n,l,i,v,e,o,s,a)}async readRGB(){let{window:t,interleave:n=!0,pool:i=null,width:r,height:e,resampleMethod:o,enableAlpha:s=!1,signal:u}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=t||[0,0,this.getWidth(),this.getHeight()];if(a[0]>a[2]||a[1]>a[3])throw new Error("Invalid subsets");const h=this.fileDirectory.PhotometricInterpretation;if(h===Pd.Ie.RGB){let a=[0,1,2];if(this.fileDirectory.ExtraSamples!==Pd.pd.Unspecified&&s){a=[];for(let t=0;t<this.fileDirectory.BitsPerSample.length;t+=1)a.push(t)}return this.readRasters({window:t,interleave:n,samples:a,pool:i,width:r,height:e,resampleMethod:o,signal:u})}let f;switch(h){case Pd.Ie.WhiteIsZero:case Pd.Ie.BlackIsZero:case Pd.Ie.Palette:f=[0];break;case Pd.Ie.CMYK:f=[0,1,2,3];break;case Pd.Ie.YCbCr:case Pd.Ie.CIELab:f=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const c={window:a,interleave:!0,samples:f,pool:i,width:r,height:e,resampleMethod:o,signal:u},{fileDirectory:l}=this,v=await this.readRasters(c),d=2**this.fileDirectory.BitsPerSample[0];let p;switch(h){case Pd.Ie.WhiteIsZero:p=function(t,n){const{width:i,height:r}=t,e=new Uint8Array(i*r*3);let o;for(let i=0,r=0;i<t.length;++i,r+=3)o=256-t[i]/n*256,e[r]=o,e[r+1]=o,e[r+2]=o;return e}(v,d);break;case Pd.Ie.BlackIsZero:p=function(t,n){const{width:i,height:r}=t,e=new Uint8Array(i*r*3);let o;for(let i=0,r=0;i<t.length;++i,r+=3)o=t[i]/n*256,e[r]=o,e[r+1]=o,e[r+2]=o;return e}(v,d);break;case Pd.Ie.Palette:p=function(t,n){const{width:i,height:r}=t,e=new Uint8Array(i*r*3),o=n.length/3,s=n.length/3*2;for(let i=0,r=0;i<t.length;++i,r+=3){const u=t[i];e[r]=n[u]/65536*256,e[r+1]=n[u+o]/65536*256,e[r+2]=n[u+s]/65536*256}return e}(v,l.ColorMap);break;case Pd.Ie.CMYK:p=function(t){const{width:n,height:i}=t,r=new Uint8Array(n*i*3);for(let n=0,i=0;n<t.length;n+=4,i+=3){const e=t[n],o=t[n+1],s=t[n+2],u=t[n+3];r[i]=(255-e)/256*255*((255-u)/256),r[i+1]=(255-o)/256*255*((255-u)/256),r[i+2]=(255-s)/256*255*((255-u)/256)}return r}(v);break;case Pd.Ie.YCbCr:p=function(t){const{width:n,height:i}=t,r=new Uint8ClampedArray(n*i*3);for(let n=0,i=0;n<t.length;n+=3,i+=3){const e=t[n],o=t[n+1],s=t[n+2];r[i]=e+1.402*(s-128),r[i+1]=e-.34414*(o-128)-.71414*(s-128),r[i+2]=e+1.772*(o-128)}return r}(v);break;case Pd.Ie.CIELab:p=function(t){const{width:n,height:i}=t,r=new Uint8Array(n*i*3);for(let n=0,i=0;n<t.length;n+=3,i+=3){let e,o,s,u=(t[n+0]+16)/116,a=(t[n+1]<<24>>24)/500+u,h=u-(t[n+2]<<24>>24)/200;a=.95047*(a*a*a>.008856?a*a*a:(a-16/116)/7.787),u=1*(u*u*u>.008856?u*u*u:(u-16/116)/7.787),h=1.08883*(h*h*h>.008856?h*h*h:(h-16/116)/7.787),e=3.2406*a+-1.5372*u+-.4986*h,o=-.9689*a+1.8758*u+.0415*h,s=.0557*a+-.204*u+1.057*h,e=e>.0031308?1.055*e**(1/2.4)-.055:12.92*e,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,r[i]=255*Math.max(0,Math.min(1,e)),r[i+1]=255*Math.max(0,Math.min(1,o)),r[i+2]=255*Math.max(0,Math.min(1,s))}return r}(v);break;default:throw new Error("Unsupported photometric interpretation.")}if(!n){const t=new Uint8Array(p.length/3),n=new Uint8Array(p.length/3),i=new Uint8Array(p.length/3);for(let r=0,e=0;r<p.length;r+=3,++e)t[e]=p[r],n[e]=p[r+1],i[e]=p[r+2];p=[t,n,i]}return p.width=v.width,p.height=v.height,p}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const t=[];for(let n=0;n<this.fileDirectory.ModelTiepoint.length;n+=6)t.push({i:this.fileDirectory.ModelTiepoint[n],j:this.fileDirectory.ModelTiepoint[n+1],k:this.fileDirectory.ModelTiepoint[n+2],x:this.fileDirectory.ModelTiepoint[n+3],y:this.fileDirectory.ModelTiepoint[n+4],z:this.fileDirectory.ModelTiepoint[n+5]});return t}getGDALMetadata(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const n={};if(!this.fileDirectory.GDAL_METADATA)return null;const i=this.fileDirectory.GDAL_METADATA;let r=Ad(i,"Item");r=null===t?r.filter((t=>void 0===Td(t,"sample"))):r.filter((n=>Number(Td(n,"sample"))===t));for(let t=0;t<r.length;++t){const i=r[t];n[Td(i,"name")]=i.inner}return n}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const t=this.fileDirectory.GDAL_NODATA;return Number(t.substring(0,t.length-1))}getOrigin(){const t=this.fileDirectory.ModelTiepoint,n=this.fileDirectory.ModelTransformation;if(t&&6===t.length)return[t[3],t[4],t[5]];if(n)return[n[3],n[7],n[11]];throw new Error("The image does not have an affine transformation.")}getResolution(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const n=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(n)return[n[0],-n[1],n[2]];if(i)return[i[0],i[5],i[10]];if(t){const[n,i,r]=t.getResolution();return[n*t.getWidth()/this.getWidth(),i*t.getHeight()/this.getHeight(),r*t.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(){const t=this.getOrigin(),n=this.getResolution(),i=t[0],r=t[1],e=i+n[0]*this.getWidth(),o=r+n[1]*this.getHeight();return[Math.min(i,e),Math.min(r,o),Math.max(i,e),Math.max(r,o)]}};class Bd{constructor(t){this._dataView=new DataView(t)}get buffer(){return this._dataView.buffer}getUint64(t,n){const i=this.getUint32(t,n),r=this.getUint32(t+4,n);let e;if(n){if(e=i+2**32*r,!Number.isSafeInteger(e))throw new Error(`${e} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return e}if(e=2**32*i+r,!Number.isSafeInteger(e))throw new Error(`${e} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return e}getInt64(t,n){let i=0;const r=(128&this._dataView.getUint8(t+(n?7:0)))>0;let e=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(t+(n?o:7-o));r&&(e?0!==s&&(s=255&~(s-1),e=!1):s=255&~s),i+=s*256**o}return r&&(i=-i),i}getUint8(t,n){return this._dataView.getUint8(t,n)}getInt8(t,n){return this._dataView.getInt8(t,n)}getUint16(t,n){return this._dataView.getUint16(t,n)}getInt16(t,n){return this._dataView.getInt16(t,n)}getUint32(t,n){return this._dataView.getUint32(t,n)}getInt32(t,n){return this._dataView.getInt32(t,n)}getFloat16(t,n){return Ed(this._dataView,t,n)}getFloat32(t,n){return this._dataView.getFloat32(t,n)}getFloat64(t,n){return this._dataView.getFloat64(t,n)}}class Xd{constructor(t,n,i,r){this._dataView=new DataView(t),this._sliceOffset=n,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(t,n){return this.sliceOffset<=t&&this.sliceTop>=t+n}readUint8(t){return this._dataView.getUint8(t-this._sliceOffset,this._littleEndian)}readInt8(t){return this._dataView.getInt8(t-this._sliceOffset,this._littleEndian)}readUint16(t){return this._dataView.getUint16(t-this._sliceOffset,this._littleEndian)}readInt16(t){return this._dataView.getInt16(t-this._sliceOffset,this._littleEndian)}readUint32(t){return this._dataView.getUint32(t-this._sliceOffset,this._littleEndian)}readInt32(t){return this._dataView.getInt32(t-this._sliceOffset,this._littleEndian)}readFloat32(t){return this._dataView.getFloat32(t-this._sliceOffset,this._littleEndian)}readFloat64(t){return this._dataView.getFloat64(t-this._sliceOffset,this._littleEndian)}readUint64(t){const n=this.readUint32(t),i=this.readUint32(t+4);let r;if(this._littleEndian){if(r=n+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*n+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(t){let n=0;const i=(128&this._dataView.getUint8(t+(this._littleEndian?7:0)))>0;let r=!0;for(let e=0;e<8;e++){let o=this._dataView.getUint8(t+(this._littleEndian?e:7-e));i&&(r?0!==o&&(o=255&~(o-1),r=!1):o=255&~o),n+=o*256**e}return i&&(n=-n),n}readOffset(t){return this._bigTiff?this.readUint64(t):this.readUint32(t)}}const Vd="\r\n\r\n";function Wd(t){if(void 0!==Object.fromEntries)return Object.fromEntries(t);const n={};for(const[i,r]of t)n[i.toLowerCase()]=r;return n}function Yd(t){return Wd(t.split("\r\n").map((t=>{const n=t.split(":").map((t=>t.trim()));return n[0]=n[0].toLowerCase(),n})))}function Zd(t){let n,i,r;return t&&([,n,i,r]=t.match(/bytes (\d+)-(\d+)\/(\d+)/),n=parseInt(n,10),i=parseInt(i,10),r=parseInt(r,10)),{start:n,end:i,total:r}}class $d{async fetch(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return Promise.all(t.map((t=>this.fetchSlice(t,n))))}async fetchSlice(t){throw new Error(`fetching of slice ${t} not possible, not implemented`)}get fileSize(){return null}async close(){}}var Kd=i(875);function Hd(t,n){const i=Array.isArray(t)?t:Array.from(t),r=Array.isArray(n)?n:Array.from(n);return i.map(((t,n)=>[t,r[n]]))}class Jd extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,Jd),this.name="AbortError"}}class Qd extends Error{constructor(t,n){super(n),this.errors=t,this.message=n,this.name="AggregateError"}}const tp=Qd;class np{constructor(t,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.offset=t,this.length=n,this.data=i}get top(){return this.offset+this.length}}class ip{constructor(t,n,i){this.offset=t,this.length=n,this.blockIds=i}}class rp extends $d{constructor(t){let{blockSize:n=65536,cacheSize:i=100}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.source=t,this.blockSize=n,this.blockCache=new Kd({max:i}),this.blockRequests=new Map,this.blockIdsToFetch=new Set}get fileSize(){return this.source.fileSize}async fetch(t,n){const i=new Map,r=new Map,e=new Set;for(const{offset:n,length:o}of t){let t=n+o;const{fileSize:s}=this;null!==s&&(t=Math.min(t,s));for(let o=Math.floor(n/this.blockSize)*this.blockSize;o<t;o+=this.blockSize){const t=Math.floor(o/this.blockSize);this.blockCache.has(t)?i.set(t,this.blockCache.get(t)):this.blockRequests.has(t)?r.set(t,this.blockRequests.get(t)):(this.blockIdsToFetch.has(t)||this.blockIdsToFetch.add(t),e.add(t))}}await async function(t){return new Promise((n=>setTimeout(n,t)))}(),this.fetchBlocks(n);for(const t of e){const n=this.blockRequests.get(t),e=this.blockCache.get(t);if(n)r.set(t,n);else{if(!e)throw new Error(`Block ${t} is not in the block requests`);i.set(t,e)}}let o=await Promise.allSettled(Array.from(r.values()));if(o.some((t=>"rejected"===t.status))){const t=new Set;for(const[i,e]of Hd(r.keys(),o)){const{rejected:r,reason:o}=e;r&&"AbortError"===o.name&&o.signal!==n&&(this.blockIdsToFetch.add(i),t.add(i))}if(this.blockIdsToFetch.length>0){this.fetchBlocks(n);for(const n of t){const t=this.blockRequests.get(n);if(!t)throw new Error(`Block ${n} is not in the block requests`);r.set(n,t)}o=await Promise.allSettled(Array.from(r.values()))}}if(o.some((t=>"rejected"===t.status))){if(n&&n.aborted)throw new Jd("Request was aborted");throw new tp(o.filter((t=>"rejected"===t.status)).map((t=>t.reason)),"Request failed")}const s=o.map((t=>t.value)),u=new Map(Hd(Array.from(r.keys()),s));for(const[t,n]of i)u.set(t,n);return this.readSliceData(t,u)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const n=this.groupBlocks(this.blockIdsToFetch),i=this.source.fetch(n,t);for(let r=0;r<n.length;++r){const e=n[r];for(const n of e.blockIds){const e=(async()=>{try{const t=(await i)[r],e=n*this.blockSize,o=e-t.offset,s=Math.min(o+this.blockSize,t.data.byteLength),u=t.data.slice(o,s),a=new np(e,u.byteLength,u);return this.blockCache.set(n,a),a}catch(n){throw"AbortError"===n.name&&(n.signal=t),n}finally{this.blockRequests.delete(n)}})();this.blockRequests.set(n,e)}}this.blockIdsToFetch.clear()}}groupBlocks(t){const n=Array.from(t).sort(((t,n)=>t-n));if(0===n.length)return[];let i=[],r=null;const e=[];for(const t of n)null===r||r+1===t?(i.push(t),r=t):(e.push(new ip(i[0]*this.blockSize,i.length*this.blockSize,i)),i=[t],r=t);return e.push(new ip(i[0]*this.blockSize,i.length*this.blockSize,i)),e}readSliceData(t,n){return t.map((t=>{const i=t.offset+t.length,r=Math.floor(t.offset/this.blockSize),e=Math.floor((t.offset+t.length)/this.blockSize),o=new ArrayBuffer(t.length),s=new Uint8Array(o);for(let o=r;o<=e;++o){const r=n.get(o),e=r.offset-t.offset,u=r.top-i;let a,h=0,f=0;e<0?h=-e:e>0&&(f=e),a=u<0?r.length-h:i-r.offset-h;const c=new Uint8Array(r.data,h,a);s.set(c,f)}return o}))}}class ep{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(t){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class op{constructor(t){this.url=t}async request(){let{headers:t,credentials:n,signal:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};throw new Error("request is not implemented")}}class sp extends ep{constructor(t){super(),this.response=t}get status(){return this.response.status}getHeader(t){return this.response.headers.get(t)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class up extends op{constructor(t,n){super(t),this.credentials=n}async request(){let{headers:t,credentials:n,signal:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=await fetch(this.url,{headers:t,credentials:n,signal:i});return new sp(r)}}class ap extends ep{constructor(t,n){super(),this.xhr=t,this.data=n}get status(){return this.xhr.status}getHeader(t){return this.xhr.getResponseHeader(t)}async getData(){return this.data}}class hp extends op{constructRequest(t,n){return new Promise(((i,r)=>{const e=new XMLHttpRequest;e.open("GET",this.url),e.responseType="arraybuffer";for(const[n,i]of Object.entries(t))e.setRequestHeader(n,i);e.onload=()=>{const t=e.response;i(new ap(e,t))},e.onerror=r,e.onabort=()=>r(new Jd("Request aborted")),e.send(),n&&(n.aborted&&e.abort(),n.addEventListener("abort",(()=>e.abort())))}))}async request(){let{headers:t,signal:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await this.constructRequest(t,n)}}var fp=i(752),cp=i(640),lp=i(630);class vp extends ep{constructor(t,n){super(),this.response=t,this.dataPromise=n}get status(){return this.response.statusCode}getHeader(t){return this.response.headers[t]}async getData(){return await this.dataPromise}}class dp extends op{constructor(t){super(t),this.parsedUrl=lp.parse(this.url),this.httpApi="http:"===this.parsedUrl.protocol?fp:cp}constructRequest(t,n){return new Promise(((i,r)=>{const e=this.httpApi.get({...this.parsedUrl,headers:t},(t=>{const n=new Promise((n=>{const i=[];t.on("data",(t=>{i.push(t)})),t.on("end",(()=>{const t=Buffer.concat(i).buffer;n(t)})),t.on("error",r)}));i(new vp(t,n))}));e.on("error",r),n&&(n.aborted&&e.destroy(new Jd("Request aborted")),n.addEventListener("abort",(()=>e.destroy(new Jd("Request aborted")))))}))}async request(){let{headers:t,signal:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return await this.constructRequest(t,n)}}class pp extends $d{constructor(t,n,i,r){super(),this.client=t,this.headers=n,this.maxRanges=i,this.allowFullFile=r,this._fileSize=null}async fetch(t,n){return this.maxRanges>=t.length?this.fetchSlices(t,n):(this.maxRanges>0&&t.length,Promise.all(t.map((t=>this.fetchSlice(t,n)))))}async fetchSlices(t,n){const i=await this.client.request({headers:{...this.headers,Range:`bytes=${t.map((t=>{let{offset:n,length:i}=t;return`${n}-${n+i}`})).join(",")}`},signal:n});if(i.ok){if(206===i.status){const{type:r,params:e}=function(t){const[n,...i]=t.split(";").map((t=>t.trim()));return{type:n,params:Wd(i.map((t=>t.split("="))))}}(i.getHeader("content-type"));if("multipart/byteranges"===r){const t=function(t,n){let i=null;const r=new TextDecoder("ascii"),e=[],o=`--${n}`,s=`${o}--`;for(let n=0;n<10;++n)r.decode(new Uint8Array(t,n,o.length))===o&&(i=n);if(null===i)throw new Error("Could not find initial boundary");for(;i<t.byteLength;){const n=r.decode(new Uint8Array(t,i,Math.min(o.length+1024,t.byteLength-i)));if(0===n.length||n.startsWith(s))break;if(!n.startsWith(o))throw new Error("Part does not start with boundary");const u=n.substr(o.length+2);if(0===u.length)break;const a=u.indexOf(Vd),h=Yd(u.substr(0,a)),{start:f,end:c,total:l}=Zd(h["content-range"]),v=i+o.length+a+Vd.length,d=parseInt(c,10)+1-parseInt(f,10);e.push({headers:h,data:t.slice(v,v+d),offset:f,length:d,fileSize:l}),i=v+d+4}return e}(await i.getData(),e.boundary);return this._fileSize=t[0].fileSize||null,t}const o=await i.getData(),{start:s,end:u,total:a}=Zd(i.getHeader("content-range"));this._fileSize=a||null;const h=[{data:o,offset:s,length:u-s}];if(t.length>1){const i=await Promise.all(t.slice(1).map((t=>this.fetchSlice(t,n))));return h.concat(i)}return h}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await i.getData();return this._fileSize=t.byteLength,[{data:t,offset:0,length:t.byteLength}]}}throw new Error("Error fetching data.")}async fetchSlice(t,n){const{offset:i,length:r}=t,e=await this.client.request({headers:{...this.headers,Range:`bytes=${i}-${i+r}`},signal:n});if(e.ok){if(206===e.status){const t=await e.getData(),{total:n}=Zd(e.getHeader("content-range"));return this._fileSize=n||null,{data:t,offset:i,length:r}}{if(!this.allowFullFile)throw new Error("Server responded with full file");const t=await e.getData();return this._fileSize=t.byteLength,{data:t,offset:0,length:t.byteLength}}}throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function yp(t,n){let{blockSize:i,cacheSize:r}=n;return null===i?t:new rp(t,i,r)}function mp(t){let{headers:n={},credentials:i,maxRanges:r=0,allowFullFile:e=!1,...o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=new up(t,i),u=new pp(s,n,r,e);return yp(u,o)}function wp(t){let{headers:n={},maxRanges:i=0,allowFullFile:r=!1,...e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=new hp(t),s=new pp(o,n,i,r);return yp(s,e)}function gp(t){let{headers:n={},maxRanges:i=0,allowFullFile:r=!1,...e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=new dp(t),s=new pp(o,n,i,r);return yp(s,e)}function bp(t){let{forceXHR:n=!1,...i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"function"!=typeof fetch||n?"undefined"!=typeof XMLHttpRequest?wp(t,i):gp(t,i):mp(t,i)}class xp extends $d{constructor(t){super(),this.file=t}async fetchSlice(t,n){return new Promise(((i,r)=>{const e=this.file.slice(t.offset,t.offset+t.length),o=new FileReader;o.onload=t=>i(t.target.result),o.onerror=r,o.onabort=r,o.readAsArrayBuffer(e),n&&n.addEventListener("abort",(()=>o.abort()))}))}}function Mp(t){switch(t){case Pd.sf.BYTE:case Pd.sf.ASCII:case Pd.sf.SBYTE:case Pd.sf.UNDEFINED:return 1;case Pd.sf.SHORT:case Pd.sf.SSHORT:return 2;case Pd.sf.LONG:case Pd.sf.SLONG:case Pd.sf.FLOAT:case Pd.sf.IFD:return 4;case Pd.sf.RATIONAL:case Pd.sf.SRATIONAL:case Pd.sf.DOUBLE:case Pd.sf.LONG8:case Pd.sf.SLONG8:case Pd.sf.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${t}`)}}function _p(t,n,i,r){let e=null,o=null;const s=Mp(n);switch(n){case Pd.sf.BYTE:case Pd.sf.ASCII:case Pd.sf.UNDEFINED:e=new Uint8Array(i),o=t.readUint8;break;case Pd.sf.SBYTE:e=new Int8Array(i),o=t.readInt8;break;case Pd.sf.SHORT:e=new Uint16Array(i),o=t.readUint16;break;case Pd.sf.SSHORT:e=new Int16Array(i),o=t.readInt16;break;case Pd.sf.LONG:case Pd.sf.IFD:e=new Uint32Array(i),o=t.readUint32;break;case Pd.sf.SLONG:e=new Int32Array(i),o=t.readInt32;break;case Pd.sf.LONG8:case Pd.sf.IFD8:e=new Array(i),o=t.readUint64;break;case Pd.sf.SLONG8:e=new Array(i),o=t.readInt64;break;case Pd.sf.RATIONAL:e=new Uint32Array(2*i),o=t.readUint32;break;case Pd.sf.SRATIONAL:e=new Int32Array(2*i),o=t.readInt32;break;case Pd.sf.FLOAT:e=new Float32Array(i),o=t.readFloat32;break;case Pd.sf.DOUBLE:e=new Float64Array(i),o=t.readFloat64;break;default:throw new RangeError(`Invalid field type: ${n}`)}if(n!==Pd.sf.RATIONAL&&n!==Pd.sf.SRATIONAL)for(let n=0;n<i;++n)e[n]=o.call(t,r+n*s);else for(let n=0;n<i;n+=2)e[n]=o.call(t,r+n*s),e[n+1]=o.call(t,r+(n*s+4));return n===Pd.sf.ASCII?new TextDecoder("utf-8").decode(e):e}class Sp{constructor(t,n,i){this.fileDirectory=t,this.geoKeyDirectory=n,this.nextIFDByteOffset=i}}class Op extends Error{constructor(t){super(`No image at index ${t}`),this.index=t}}class jp{async readRasters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{window:n,width:i,height:r}=t;let{resX:e,resY:o,bbox:s}=t;const u=await this.getImage();let a=u;const h=await this.getImageCount(),f=u.getBoundingBox();if(n&&s)throw new Error('Both "bbox" and "window" passed.');if(i||r){if(n){const[t,i]=u.getOrigin(),[r,e]=u.getResolution();s=[t+n[0]*r,i+n[1]*e,t+n[2]*r,i+n[3]*e]}const t=s||f;if(i){if(e)throw new Error("Both width and resX passed");e=(t[2]-t[0])/i}if(r){if(o)throw new Error("Both width and resY passed");o=(t[3]-t[1])/r}}if(e||o){const t=[];for(let n=0;n<h;++n){const i=await this.getImage(n),{SubfileType:r,NewSubfileType:e}=i.fileDirectory;(0===n||2===r||1&e)&&t.push(i)}t.sort(((t,n)=>t.getWidth()-n.getWidth()));for(let n=0;n<t.length;++n){const i=t[n],r=(f[2]-f[0])/i.getWidth(),s=(f[3]-f[1])/i.getHeight();if(a=i,e&&e>r||o&&o>s)break}}let c=n;if(s){const[t,n]=u.getOrigin(),[i,r]=a.getResolution(u);c=[Math.round((s[0]-t)/i),Math.round((s[1]-n)/r),Math.round((s[2]-t)/i),Math.round((s[3]-n)/r)],c=[Math.min(c[0],c[2]),Math.min(c[1],c[3]),Math.max(c[0],c[2]),Math.max(c[1],c[3])]}return a.readRasters({...t,window:c})}}class Ep extends jp{constructor(t,n,i,r){let e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(),this.source=t,this.littleEndian=n,this.bigTiff=i,this.firstIFDOffset=r,this.cache=e.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(t,n){const i=this.bigTiff?4048:1024;return new Xd((await this.source.fetch([{offset:t,length:void 0!==n?n:i}]))[0],t,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(t){const n=this.bigTiff?20:12,i=this.bigTiff?8:2;let r=await this.getSlice(t);const e=this.bigTiff?r.readUint64(t):r.readUint16(t),o=e*n+(this.bigTiff?16:6);r.covers(t,o)||(r=await this.getSlice(t,o));const s={};let u=t+(this.bigTiff?8:2);for(let t=0;t<e;u+=n,++t){const t=r.readUint16(u),n=r.readUint16(u+2),i=this.bigTiff?r.readUint64(u+4):r.readUint32(u+4);let e,o;const a=Mp(n),h=u+(this.bigTiff?12:8);if(a*i<=(this.bigTiff?8:4))e=_p(r,n,i,h);else{const t=r.readOffset(h),o=Mp(n)*i;if(r.covers(t,o))e=_p(r,n,i,t);else{e=_p(await this.getSlice(t,o),n,i,t)}}o=1===i&&-1===Pd.It.indexOf(t)&&n!==Pd.sf.RATIONAL&&n!==Pd.sf.SRATIONAL?e[0]:e,s[Pd.L[t]]=o}const a=function(t){const n=t.GeoKeyDirectory;if(!n)return null;const i={};for(let r=4;r<=4*n[3];r+=4){const e=Pd.P1[n[r]],o=n[r+1]?Pd.L[n[r+1]]:null,s=n[r+2],u=n[r+3];let a=null;if(o){if(a=t[o],null==a)throw new Error(`Could not get value of geoKey '${e}'.`);"string"==typeof a?a=a.substring(u,u+s-1):a.subarray&&(a=a.subarray(u,u+s),1===s&&(a=a[0]))}else a=u;i[e]=a}return i}(s),h=r.readOffset(t+i+n*e);return new Sp(s,a,h)}async requestIFD(t){if(this.ifdRequests[t])return this.ifdRequests[t];if(0===t)return this.ifdRequests[t]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[t];if(!this.ifdRequests[t-1])try{this.ifdRequests[t-1]=this.requestIFD(t-1)}catch(n){if(n instanceof Op)throw new Op(t);throw n}return this.ifdRequests[t]=(async()=>{const n=await this.ifdRequests[t-1];if(0===n.nextIFDByteOffset)throw new Op(t);return this.parseFileDirectoryAt(n.nextIFDByteOffset)})(),this.ifdRequests[t]}async getImage(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const n=await this.requestIFD(t);return new Ud(n.fileDirectory,n.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let t=0,n=!0;for(;n;)try{await this.requestIFD(t),++t}catch(t){if(!(t instanceof Op))throw t;n=!1}return t}async getGhostValues(){const t=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const n="GDAL_STRUCTURAL_METADATA_SIZE=",i=n.length+100;let r=await this.getSlice(t,i);if(n===_p(r,Pd.sf.ASCII,n.length,t)){const n=_p(r,Pd.sf.ASCII,i,t).split("\n")[0],e=Number(n.split("=")[1].split(" ")[0])+n.length;e>i&&(r=await this.getSlice(t,e));const o=_p(r,Pd.sf.ASCII,e,t);this.ghostValues={},o.split("\n").filter((t=>t.length>0)).map((t=>t.split("="))).forEach((t=>{let[n,i]=t;this.ghostValues[n]=i}))}return this.ghostValues}static async fromSource(t,n,i){const r=(await t.fetch([{offset:0,length:1024}],i))[0],e=new Bd(r),o=e.getUint16(0,0);let s;if(18761===o)s=!0;else{if(19789!==o)throw new TypeError("Invalid byte order value.");s=!1}const u=e.getUint16(2,s);let a;if(42===u)a=!1;else{if(43!==u)throw new TypeError("Invalid magic number.");a=!0;if(8!==e.getUint16(4,s))throw new Error("Unsupported offset byte-size.")}const h=a?e.getUint64(8,s):e.getUint32(4,s);return new Ep(t,s,a,h,n)}close(){return"function"==typeof this.source.close&&this.source.close()}}class Tp extends jp{constructor(t,n){super(),this.mainFile=t,this.overviewFiles=n,this.imageFiles=[t].concat(n),this.fileDirectoriesPerFile=null,this.fileDirectoriesPerFileParsing=null,this.imageCount=null}async parseFileDirectoriesPerFile(){const t=[this.mainFile.parseFileDirectoryAt(this.mainFile.firstIFDOffset)].concat(this.overviewFiles.map((t=>t.parseFileDirectoryAt(t.firstIFDOffset))));return this.fileDirectoriesPerFile=await Promise.all(t),this.fileDirectoriesPerFile}async getImage(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;await this.getImageCount(),await this.parseFileDirectoriesPerFile();let n=0,i=0;for(let r=0;r<this.imageFiles.length;r++){const e=this.imageFiles[r];for(let o=0;o<this.imageCounts[r];o++){if(t===n){const t=await e.requestIFD(i);return new Ud(t.fileDirectory,t.geoKeyDirectory,e.dataView,e.littleEndian,e.cache,e.source)}n++,i++}i=0}throw new RangeError("Invalid image index")}async getImageCount(){if(null!==this.imageCount)return this.imageCount;const t=[this.mainFile.getImageCount()].concat(this.overviewFiles.map((t=>t.getImageCount())));return this.imageCounts=await Promise.all(t),this.imageCount=this.imageCounts.reduce(((t,n)=>t+n),0),this.imageCount}}async function Ap(t,n){return Ep.fromSource(new xp(t),n)}const Pp="undefined"!=typeof navigator&&navigator.hardwareConcurrency||2;var Cp,kp=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pp,n=arguments.length>1?arguments[1]:void 0;this.workers=null,this._awaitingDecoder=null,this.size=t,this.messageId=0,t&&(this._awaitingDecoder=n?Promise.resolve(n):new Promise((t=>{i.e(231).then(i.bind(i,231)).then((n=>{t(n.create)}))})),this._awaitingDecoder.then((n=>{this._awaitingDecoder=null,this.workers=[];for(let i=0;i<t;i++)this.workers.push({worker:n(),idle:!0})})))}async decode(t,n){return this._awaitingDecoder&&await this._awaitingDecoder,0===this.size?Id(t).then((i=>i.decode(t,n))):new Promise((i=>{const r=this.workers.find((t=>t.idle))||this.workers[Math.floor(Math.random()*this.size)];r.idle=!1;const e=this.messageId++,o=t=>{t.data.id===e&&(r.idle=!0,i(t.data.decoded),r.worker.removeEventListener("message",o))};r.worker.addEventListener("message",o),r.worker.postMessage({fileDirectory:t,buffer:n,id:e},[n])}))}destroy(){this.workers&&(this.workers.forEach((t=>{t.worker.terminate()})),this.workers=null)}},Ip=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Np="STATISTICS_MAXIMUM",Lp="STATISTICS_MINIMUM";function zp(t){try{return t.getBoundingBox()}catch(i){var n=t.fileDirectory;return[0,0,n.ImageWidth,n.ImageLength]}}function Rp(t){try{return t.getOrigin().slice(0,2)}catch(n){return[0,t.fileDirectory.ImageLength]}}function Fp(t,n){try{return t.getResolution(n)}catch(i){return[n.fileDirectory.ImageWidth/t.fileDirectory.ImageWidth,n.fileDirectory.ImageHeight/t.fileDirectory.ImageHeight]}}function Gp(t){var n=t.geoKeys;if(!n)return null;if(n.ProjectedCSTypeGeoKey){if(!(r=yr(i="EPSG:"+n.ProjectedCSTypeGeoKey)))(e=Nt(n.ProjLinearUnitsGeoKey))&&(r=new ei({code:i,units:e}));return r}if(n.GeographicTypeGeoKey){var i,r,e;if(!(r=yr(i="EPSG:"+n.GeographicTypeGeoKey)))(e=Nt(n.GeogAngularUnitsGeoKey))&&(r=new ei({code:i,units:e}));return r}return null}function Dp(t){return t.getImageCount().then((function(n){for(var i=new Array(n),r=0;r<n;++r)i[r]=t.getImage(r);return Promise.all(i)}))}function qp(t,n){return(t.blob?Ap(t.blob):t.overviews?async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;const e=await Ep.fromSource(bp(t,i),r),o=await Promise.all(n.map((t=>Ep.fromSource(bp(t,i)))));return new Tp(e,o)}(t.url,t.overviews,n):async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return Ep.fromSource(bp(t,n),i)}(t.url,n)).then(Dp)}function Up(t,n,i,r,e){if(Array.isArray(t)){var o=t.length;if(!Array.isArray(n)||o!=n.length){var s=new Error(r);throw e(s),s}for(var u=0;u<o;++u)Up(t[u],n[u],i,r,e)}else if(n=n,Math.abs(t-n)>i*t)throw new Error(r)}function Bp(t){return t instanceof Int8Array?-128:t instanceof Int16Array?-32768:t instanceof Int32Array?-2147483648:t instanceof Float32Array?12e-39:0}function Xp(t){return t instanceof Int8Array?127:t instanceof Uint8Array||t instanceof Uint8ClampedArray?255:t instanceof Int16Array?32767:t instanceof Uint16Array?65535:t instanceof Int32Array?2147483647:t instanceof Uint32Array?4294967295:t instanceof Float32Array?34e37:255}var Vp=function(t){function n(n){var i=t.call(this,{state:"loading",tileGrid:null,projection:null,opaque:n.opaque,transition:n.transition,interpolate:!1!==n.interpolate,wrapX:n.wrapX})||this;i.Qa=n.sources;var r=i.Qa.length;i.th=n.sourceOptions,i.nh=new Array(r),i.ih=new Array(r),i.rh,i.eh,i.oh,i.sh=!1!==n.normalize,i.uh=!1,i.V=null,i.ah=n.convertToRGB?"readRGB":"readRasters",i.setKey(i.Qa.map((function(t){return t.url})).join(","));for(var e=i,o=new Array(r),s=0;s<r;++s)o[s]=qp(i.Qa[s],i.th);return Promise.all(o).then((function(t){e.hh(t)})).catch((function(t){console.error(t),e.V=t,e.setState("error")})),i}return Ip(n,t),n.prototype.getError=function(){return this.V},n.prototype.hh=function(t){for(var n,i,r,e,o,s=new Array(t.length),u=new Array(t.length),a=new Array(t.length),h=0,f=t.length,c=function(f){var c=t[f],v=c.length,d=void 0,p=void 0,y=new Array(v),m=new Array(v),w=new Array(v);u[f]=new Array(v),a[f]=new Array(v);for(var g=0;g<v;++g){var b=c[g],x=b.getGDALNoData();a[f][g]=b.getGDALMetadata(0),u[f][g]=x;var M=l.Qa[f].bands;s[f]=M?M.length:b.getSamplesPerPixel();var _=v-(g+1);d||(d=zp(b)),p||(p=Rp(b));var S=Fp(b,c[0]);w[_]=S[0];var O=[b.getTileWidth(),b.getTileHeight()];y[_]=O;var j=S[0]/Math.abs(S[1]);m[_]=[O[0],O[1]/j]}if(n?Wn(n,d,n):n=d,i){var E="Origin mismatch for source ".concat(f,", got [").concat(p,"] but expected [").concat(i,"]");Up(i,p,0,E,l.viewRejector)}else i=p;if(o){o.length-h>w.length&&(h=o.length-w.length);var T=o[o.length-1]/w[w.length-1];l.ih[f]=T;var A=w.map((function(t){return t*T}));E="Resolution mismatch for source ".concat(f,", got [").concat(A,"] but expected [").concat(o,"]");Up(o.slice(h,o.length),A,.02,E,l.viewRejector)}else o=w,l.ih[f]=1;r?Up(r.slice(h,r.length),m,.01,"Tile size mismatch for source ".concat(f),l.viewRejector):r=m,e?Up(e.slice(h,e.length),y,0,"Tile size mismatch for source ".concat(f),l.viewRejector):e=y,l.nh[f]=c.reverse()},l=this,v=0;v<f;++v)c(v);for(var d=0,p=this.nh.length;d<p;++d)for(var y=this.nh[d];y.length<o.length;)y.unshift(void 0);if(!this.getProjection()){var m=t[0];for(d=m.length-1;d>=0;--d){var w=Gp(m[d]);if(w){this.projection=w;break}}}this.rh=s,this.eh=u,this.oh=a;t:for(v=0;v<f;++v){if(void 0!==this.Qa[v].nodata){this.uh=!0;break}var g=u[v],b=this.Qa[v].bands;if(b){for(d=0;d<b.length;++d)if(null!==g[b[d]-1]){this.uh=!0;break t}}else for(var x=0;x<g.length;++x)if(null!==g[x]){this.uh=!0;break t}}var M=this.uh?1:0;this.bandCount=s.reduce((function(t,n){return t+=n}),0)+M;var _=new xf({extent:n,minZoom:h,origin:i,resolutions:o,tileSizes:r});this.tileGrid=_,this.setTileSizes(e),this.setLoader(this.fh.bind(this)),this.setState("ready"),this.viewResolver({projection:this.projection,resolutions:o,center:kr(qn(n),this.projection),extent:Nr(n,this.projection),zoom:0})},n.prototype.fh=function(t,n,i){for(var r=this.getTileSize(t),e=this.nh.length,o=new Array(e),s=this.uh,u=this.bandCount,a=this.rh,h=this.eh,f=this.Qa,c=function(e){var s=f[e],u=l.ih[e],a=[Math.round(n*(r[0]*u)),Math.round(i*(r[1]*u)),Math.round((n+1)*(r[0]*u)),Math.round((i+1)*(r[1]*u))],c=l.nh[e][t],v=void 0;s.bands&&(v=s.bands.map((function(t){return t-1})));var d=void 0;d="nodata"in s&&null!==s.nodata?s.nodata:v?v.map((function(t){return h[e][t]})):h[e],o[e]=c[l.ah]({window:a,width:r[0],height:r[1],samples:v,fillValue:d,pool:(Cp||(Cp=new kp),Cp),interleave:!1})},l=this,v=0;v<e;++v)c(v);var d=r[0]*r[1],p=d*u,y=this.sh,m=this.oh;return Promise.all(o).then((function(t){var n;n=y?new Uint8Array(p):new Float32Array(p);for(var i=0,r=0;r<d;++r){for(var o=s,u=0;u<e;++u){var c=f[u],l=c.min,v=c.max,w=void 0,g=void 0;if(y){var b=m[u][0];void 0===l&&(l=b&&Lp in b?parseFloat(b.STATISTICS_MINIMUM):Bp(t[u][0])),void 0===v&&(v=b&&Np in b?parseFloat(b.STATISTICS_MAXIMUM):Xp(t[u][0])),g=-l*(w=255/(v-l))}for(var x=0;x<a[u];++x){var M=t[u][x][r],_=void 0;if(_=y?oi(w*M+g,0,255):M,s){var S=c.nodata;if(void 0===S){var O=void 0;O=c.bands?c.bands[x]-1:x,S=h[u][O]}var j=isNaN(S);(!j&&M!==S||j&&!isNaN(M))&&(o=!1,n[i]=_)}else n[i]=_;i++}}s&&(o||(n[i]=255),i++)}return n})).catch((function(t){throw console.error(t),t}))},n}(ld);Vp.prototype.getView;var Wp=Vp,Yp=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zp="default",$p="truncated",Kp=function(t){function n(n,i,r,e,o,s,u){var a=t.call(this,i,r,e,o,s,u)||this;return a.lh=null,a.jo=n,a}return Yp(n,t),n.prototype.getImage=function(){if(this.lh)return this.lh;var n=t.prototype.getImage.call(this);if(this.state==vt){var i=this.jo;if(n.width==i[0]&&n.height==i[1])return this.lh=n,n;var r=_o(i[0],i[1]);return r.drawImage(n,0,0),this.lh=r.canvas,r.canvas}return n},n}(ko),Hp=function(t){function n(n){var i=this,r=n,e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.size,s=void 0!==r.tierSizeCalculation?r.tierSizeCalculation:Zp,u=r.tilePixelRatio||1,a=o[0],h=o[1],f=[],c=r.tileSize||Pu,l=c*u;switch(s){case Zp:for(;a>l||h>l;)f.push([Math.ceil(a/l),Math.ceil(h/l)]),l+=l;break;case $p:for(var v=a,d=h;v>l||d>l;)f.push([Math.ceil(v/l),Math.ceil(d/l)]),v>>=1,d>>=1;break;default:St(!1,53)}f.push([1,1]),f.reverse();for(var p=[u],y=[0],m=1,w=f.length;m<w;m++)p.push(u<<m),y.push(f[m-1][0]*f[m-1][1]+y[m-1]);p.reverse();var g=new xf({tileSize:c,extent:r.extent||[0,-h,a,0],resolutions:p}),b=r.url;b&&-1==b.indexOf("{TileGroup}")&&-1==b.indexOf("{tileIndex}")&&(b+="{TileGroup}/{z}-{x}-{y}.jpg");var x=If(b),M=c*u;var _=Cf(x.map((function(t){return function(n,i,r){if(n){var e=n[0],o=n[1],s=n[2],u=o+s*f[e][0],a={z:e,x:o,y:s,tileIndex:u,TileGroup:"TileGroup"+((u+y[e])/M|0)};return t.replace(/\{(\w+?)\}/g,(function(t,n){return a[n]}))}}}))),S=Kp.bind(null,Qu(c*u));(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,tilePixelRatio:u,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:S,tileGrid:g,tileUrlFunction:_,transition:r.transition})||this).zDirection=r.zDirection;var O=_(g.getTileCoordForCoordAndResolution(qn(g.getExtent()),p[p.length-1]),1,null),j=new Image;return j.addEventListener("error",function(){M=c,this.changed()}.bind(i)),j.src=O,i}return Yp(n,t),n}(Vv),Jp=function(t,n,i){if(i||2===arguments.length)for(var r,e=0,o=n.length;e<o;e++)!r&&e in n||(r||(r=Array.prototype.slice.call(n,0,e)),r[e]=n[e]);return t.concat(r||Array.prototype.slice.call(n))},Qp="version1",ty="version2",ny="version3",iy={};iy[Qp]={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"]}},iy[ty]={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"]}},iy[ny]={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"]}},iy.none={none:{supports:[],formats:[],qualities:[]}};var ry=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,ey=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,oy=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;var sy={};sy[Qp]=function(t){var n=t.getComplianceLevelSupportedFeatures();return void 0===n&&(n=iy[Qp].level0),{url:void 0===t.imageInfo["@id"]?void 0:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),supports:n.supports,formats:Jp(Jp([],n.formats,!0),[void 0===t.imageInfo.formats?[]:t.imageInfo.formats],!1),qualities:Jp(Jp([],n.qualities,!0),[void 0===t.imageInfo.qualities?[]:t.imageInfo.qualities],!1),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}},sy[ty]=function(t){var n=t.getComplianceLevelSupportedFeatures(),i=Array.isArray(t.imageInfo.profile)&&t.imageInfo.profile.length>1,r=i&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],e=i&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],o=i&&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:Jp(Jp([],n.supports,!0),r,!0),formats:Jp(Jp([],n.formats,!0),e,!0),qualities:Jp(Jp([],n.qualities,!0),o,!0)}},sy[ny]=function(t){var n=t.getComplianceLevelSupportedFeatures(),i=void 0===t.imageInfo.extraFormats?n.formats:Jp(Jp([],n.formats,!0),t.imageInfo.extraFormats,!0),r=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return y(["jpg","png","gif"],t)})).reduce((function(t,n){return void 0===t&&y(i,n)?n: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?n.supports:Jp(Jp([],n.supports,!0),t.imageInfo.extraFeatures,!0),formats:i,qualities:void 0===t.imageInfo.extraQualities?n.qualities:Jp(Jp([],n.qualities,!0),t.imageInfo.extraQualities,!0),preferredFormat:r}};var uy=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 n=0;n<t.length;n++)switch(t[n]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return Qp;case"http://iiif.io/api/image/2/context.json":return ty;case"http://iiif.io/api/image/3/context.json":return ny;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(Qp)&&this.imageInfo.identifier)return Qp}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 Qp:if(ry.test(this.imageInfo.profile))return this.imageInfo.profile;break;case ny:if(oy.test(this.imageInfo.profile))return this.imageInfo.profile;break;case ty:if("string"==typeof this.imageInfo.profile&&ey.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]&&ey.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}},t.prototype.getComplianceLevelFromProfile=function(t){var n=this.getComplianceLevelEntryFromProfile(t);if(void 0!==n){var i=n.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}},t.prototype.getComplianceLevelSupportedFeatures=function(){if(void 0!==this.imageInfo){var t=this.getImageApiVersion(),n=this.getComplianceLevelFromProfile(t);return void 0===n?iy.none.none:iy[t][n]}},t.prototype.getTileSourceOptions=function(t){var n=t||{},i=this.getImageApiVersion();if(void 0!==i){var r=void 0===i?void 0:sy[i](this);if(void 0!==r)return{url:r.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:r.sizes,format:void 0!==n.format&&y(r.formats,n.format)?n.format:void 0!==r.preferredFormat?r.preferredFormat:"jpg",supports:r.supports,quality:n.quality&&y(r.qualities,n.quality)?n.quality:y(r.qualities,"native")?"native":"default",resolutions:Array.isArray(r.resolutions)?r.resolutions.sort((function(t,n){return n-t})):void 0,tileSize:r.tileSize}}},t}(),ay=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function hy(t){return t.toLocaleString("en",{maximumFractionDigits:10})}var fy=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.url||"";o+=o.lastIndexOf("/")===o.length-1||""===o?"":"/";var s=r.version||ty,u=r.sizes||[],a=r.size;St(null!=a&&Array.isArray(a)&&2==a.length&&!isNaN(a[0])&&a[0]>0&&!isNaN(a[1])&&a[1]>0,60);var h,f,c,l=a[0],v=a[1],d=r.tileSize,p=r.tilePixelRatio||1,m=r.format||"jpg",w=r.quality||(r.version==Qp?"native":"default"),g=r.resolutions||[],b=r.supports||[],x=r.extent||[0,-v,l,0],M=null!=u&&Array.isArray(u)&&u.length>0,_=void 0!==d&&("number"==typeof d&&Number.isInteger(d)&&d>0||Array.isArray(d)&&d.length>0),S=null!=b&&Array.isArray(b)&&(y(b,"regionByPx")||y(b,"regionByPct"))&&(y(b,"sizeByWh")||y(b,"sizeByH")||y(b,"sizeByW")||y(b,"sizeByPct"));if(g.sort((function(t,n){return n-t})),_||S)if(null!=d&&("number"==typeof d&&Number.isInteger(d)&&d>0?(h=d,f=d):Array.isArray(d)&&d.length>0&&((1==d.length||null==d[1]&&Number.isInteger(d[0]))&&(h=d[0],f=d[0]),2==d.length&&(Number.isInteger(d[0])&&Number.isInteger(d[1])?(h=d[0],f=d[1]):null==d[0]&&Number.isInteger(d[1])&&(h=d[1],f=d[1])))),void 0!==h&&void 0!==f||(h=Pu,f=Pu),0==g.length)for(var O=c=Math.max(Math.ceil(Math.log(l/h)/Math.LN2),Math.ceil(Math.log(v/f)/Math.LN2));O>=0;O--)g.push(Math.pow(2,O));else{var j=Math.max.apply(Math,g);c=Math.round(Math.log(j)/Math.LN2)}else if(h=l,f=v,g=[],M){u.sort((function(t,n){return t[0]-n[0]})),c=-1;var E=[];for(O=0;O<u.length;O++){var T=l/u[O][0];g.length>0&&g[g.length-1]==T?E.push(O):(g.push(T),c++)}if(E.length>0)for(O=0;O<E.length;O++)u.splice(E[O]-O,1)}else g.push(1),u.push([l,v]),c=0;var A=new xf({tileSize:[h,f],extent:x,origin:Yn(x),resolutions:g}),P=Kp.bind(null,Qu(d||256).map((function(t){return t*p})));return(i=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,state:r.state,tileClass:P,tileGrid:A,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:function(t,n,i){var r,e,a=t[0];if(!(a>c)){var d=t[1],p=t[2],x=g[a];if(!(void 0===d||void 0===p||void 0===x||d<0||Math.ceil(l/x/h)<=d||p<0||Math.ceil(v/x/f)<=p)){if(S||_){var O=d*h*x,j=p*f*x,E=h*x,T=f*x,A=h,P=f;if(O+E>l&&(E=l-O),j+T>v&&(T=v-j),O+h*x>l&&(A=Math.floor((l-O+x-1)/x)),j+f*x>v&&(P=Math.floor((v-j+x-1)/x)),0==O&&E==l&&0==j&&T==v)r="full";else if(!S||y(b,"regionByPx"))r=O+","+j+","+E+","+T;else if(y(b,"regionByPct")){r="pct:"+hy(O/l*100)+","+hy(j/v*100)+","+hy(E/l*100)+","+hy(T/v*100)}s!=ny||S&&!y(b,"sizeByWh")?!S||y(b,"sizeByW")?e=A+",":y(b,"sizeByH")?e=","+P:y(b,"sizeByWh")?e=A+","+P:y(b,"sizeByPct")&&(e="pct:"+hy(100/x)):e=A+","+P}else if(r="full",M){var C=u[a][0],k=u[a][1];e=s==ny?C==l&&k==v?"max":C+","+k:C==l?"full":C+","}else e=s==ny?"max":"full";return o+r+"/"+e+"/0/"+w+"."+m}}},transition:r.transition})||this).zDirection=r.zDirection,i}return ay(n,t),n}(Vv),cy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ly=function(t){function n(n,i,r,e,o,s,u){var a=this,h=n.getExtent(),f=i.getExtent(),c=f?Wn(r,f):r,l=mf(n,i,qn(c),e),v=new qc(n,i,c,h,.5*l,e),d=s(v.calculateSourceExtent(),l,o),p=d?lo:mo,y=d?d.getPixelRatio():1;return(a=t.call(this,r,e,y,p)||this).vs=i,a.ps=h,a.Is=v,a.wi=e,a.dh=r,a.ph=d,a.yh=y,a.da=u,a.qt=null,a.mh=null,a}return cy(n,t),n.prototype.disposeInternal=function(){this.state==vo&&this.wh(),t.prototype.disposeInternal.call(this)},n.prototype.getImage=function(){return this.qt},n.prototype.getProjection=function(){return this.vs},n.prototype.Ns=function(){var t=this.ph.getState();if(t==po){var n=$n(this.dh)/this.wi,i=Vn(this.dh)/this.wi;this.qt=gf(n,i,this.yh,this.ph.getResolution(),this.ps,this.wi,this.dh,this.Is,[{extent:this.ph.getExtent(),image:this.ph.getImage()}],0,void 0,this.da)}this.state=t,this.changed()},n.prototype.load=function(){if(this.state==lo){this.state=vo,this.changed();var t=this.ph.getState();t==po||t==yo?this.Ns():(this.mh=$(this.ph,L,(function(t){var n=this.ph.getState();n!=po&&n!=yo||(this.wh(),this.Ns())}),this),this.ph.load())}},n.prototype.wh=function(){H(this.mh),this.mh=null},n}(co),vy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dy="imageloadstart",py="imageloadend",yy="imageloaderror",my=function(t){function n(n,i){var r=t.call(this,n)||this;return r.image=i,r}return vy(n,t),n}(c);function wy(t,n){t.getImage().src=n}var gy=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,projection:n.projection,state:n.state,interpolate:r})||this).on,i.once,i.un,i.Ti=void 0!==n.resolutions?n.resolutions:null,i.gh=null,i.bh=0,i}return vy(n,t),n.prototype.getResolutions=function(){return this.Ti},n.prototype.findNearestResolution=function(t){if(this.Ti){var n=m(this.Ti,t,0);t=this.Ti[n]}return t},n.prototype.getImage=function(t,n,i,r){var e=this.getProjection();if(e&&r&&!Sr(e,r)){if(this.gh){if(this.bh==this.getRevision()&&Sr(this.gh.getProjection(),r)&&this.gh.getResolution()==n&&An(this.gh.getExtent(),t))return this.gh;this.gh.dispose(),this.gh=null}return this.gh=new ly(e,r,t,n,i,function(t,n,i){return this.getImageInternal(t,n,i,e)}.bind(this),this.getInterpolate()),this.bh=this.getRevision(),this.gh}return e&&(r=e),this.getImageInternal(t,n,i,r)},n.prototype.getImageInternal=function(t,n,i,e){return r()},n.prototype.handleImageChange=function(t){var n,i=t.target;switch(i.getState()){case vo:this.loading=!0,n=dy;break;case po:this.loading=!1,n=py;break;case yo:this.loading=!1,n=yy;break;default:return}this.hasListener(n)&&this.dispatchEvent(new my(n,i))},n}(zv),by=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xy=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i._a=void 0===r.hidpi||r.hidpi,i.Fe=r.url,i.Rt=void 0!==r.imageLoadFunction?r.imageLoadFunction:wy,i.xh=r.params||{},i.Lt=null,i.Mh=[0,0],i._h=0,i.Sh=void 0!==r.ratio?r.ratio:1.5,i}return by(n,t),n.prototype.getParams=function(){return this.xh},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Fe)return null;n=this.findNearestResolution(n),i=this._a?i:1;var e=this.Lt;if(e&&this._h==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&xn(e.getExtent(),t))return e;var o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};A(o,this.xh);var s=((t=t.slice())[0]+t[2])/2,u=(t[1]+t[3])/2;if(1!=this.Sh){var a=this.Sh*$n(t)/2,h=this.Sh*Vn(t)/2;t[0]=s-a,t[1]=u-h,t[2]=s+a,t[3]=u+h}var f=n/i,c=Math.ceil($n(t)/f),l=Math.ceil(Vn(t)/f);t[0]=s-f*c/2,t[2]=s+f*c/2,t[1]=u-f*l/2,t[3]=u+f*l/2,this.Mh[0]=c,this.Mh[1]=l;var v=this.Oh(t,this.Mh,i,r,o);return this.Lt=new bo(t,n,i,v,this.Bt,this.Rt),this._h=this.getRevision(),this.Lt.addEventListener(L,this.handleImageChange.bind(this)),this.Lt},n.prototype.getImageLoadFunction=function(){return this.Rt},n.prototype.Oh=function(t,n,i,r,e){var o=r.getCode().split(/:(?=\d+$)/).pop();e.SIZE=n[0]+","+n[1],e.BBOX=t.join(","),e.BBOXSR=o,e.IMAGESR=o,e.DPI=Math.round(90*i);var s=this.Fe,u=s.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return u==s&&St(!1,50),Nf(u,e)},n.prototype.getUrl=function(){return this.Fe},n.prototype.setImageLoadFunction=function(t){this.Lt=null,this.Rt=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Fe&&(this.Fe=t,this.Lt=null,this.changed())},n.prototype.updateParams=function(t){A(this.xh,t),this.Lt=null,this.changed()},n}(gy),My=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_y=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions,state:r.state})||this).jh=r.canvasFunction,i.qt=null,i._h=0,i.Sh=void 0!==r.ratio?r.ratio:1.5,i}return My(n,t),n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n);var e=this.qt;if(e&&this._h==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&xn(e.getExtent(),t))return e;Qn(t=t.slice(),this.Sh);var o=[$n(t)/n*i,Vn(t)/n*i],s=this.jh.call(this,t,n,i,o,r);return s&&(e=new Mo(t,n,i,s)),this.qt=e,this._h=this.getRevision(),e},n}(gy),Sy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var Oy=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{interpolate:r,projection:n.projection,resolutions:n.resolutions})||this).Bt=void 0!==n.crossOrigin?n.crossOrigin:null,i.Eh=void 0!==n.displayDpi?n.displayDpi:96,i.xh=n.params||{},i.Fe=n.url,i.Rt=void 0!==n.imageLoadFunction?n.imageLoadFunction:wy,i._a=void 0===n.hidpi||n.hidpi,i.dt=void 0!==n.metersPerUnit?n.metersPerUnit:1,i.Sh=void 0!==n.ratio?n.ratio:1,i.Th=void 0!==n.useOverlay&&n.useOverlay,i.Lt=null,i._h=0,i}return Sy(n,t),n.prototype.getParams=function(){return this.xh},n.prototype.getImageInternal=function(t,n,i,r){n=this.findNearestResolution(n),i=this._a?i:1;var e=this.Lt;if(e&&this._h==this.getRevision()&&e.getResolution()==n&&e.getPixelRatio()==i&&xn(e.getExtent(),t))return e;1!=this.Sh&&Qn(t=t.slice(),this.Sh);var o=[$n(t)/n*i,Vn(t)/n*i];if(void 0!==this.Fe){var s=this.getUrl(this.Fe,this.xh,t,o,r);(e=new bo(t,n,i,s,this.Bt,this.Rt)).addEventListener(L,this.handleImageChange.bind(this))}else e=null;return this.Lt=e,this._h=this.getRevision(),e},n.prototype.getImageLoadFunction=function(){return this.Rt},n.prototype.updateParams=function(t){A(this.xh,t),this.changed()},n.prototype.getUrl=function(t,n,i,r,e){var o=function(t,n,i,r){var e=$n(t),o=Vn(t),s=n[0],u=n[1],a=.0254/r;return u*e>s*o?e*i/(s*a):o*i/(u*a)}(i,r,this.dt,this.Eh),s=qn(i),u={OPERATION:this.Th?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.Eh,SETDISPLAYWIDTH:Math.round(r[0]),SETDISPLAYHEIGHT:Math.round(r[1]),SETVIEWSCALE:o,SETVIEWCENTERX:s[0],SETVIEWCENTERY:s[1]};return A(u,n),Nf(t,u)},n.prototype.setImageLoadFunction=function(t){this.Lt=null,this.Rt=t,this.changed()},n}(gy),jy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ey=function(t){function n(n){var i=this,r=void 0!==n.crossOrigin?n.crossOrigin:null,e=void 0!==n.imageLoadFunction?n.imageLoadFunction:wy,o=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(o=n.interpolate),(i=t.call(this,{attributions:n.attributions,interpolate:o,projection:yr(n.projection)})||this).Fe=n.url,i.Ah=n.imageExtent,i.Lt=new bo(i.Ah,void 0,1,i.Fe,r,e),i.Mh=n.imageSize?n.imageSize:null,i.Lt.addEventListener(L,i.handleImageChange.bind(i)),i}return jy(n,t),n.prototype.getImageExtent=function(){return this.Ah},n.prototype.getImageInternal=function(t,n,i,r){return Kn(t,this.Lt.getExtent())?this.Lt:null},n.prototype.getUrl=function(){return this.Fe},n.prototype.handleImageChange=function(n){if(this.Lt.getState()==po){var i=this.Lt.getExtent(),r=this.Lt.getImage(),e=void 0,o=void 0;this.Mh?(e=this.Mh[0],o=this.Mh[1]):(e=r.width,o=r.height);var s=$n(i),u=Vn(i),a=s/e,h=u/o,f=e,c=o;if(a>h?f=Math.round(s/h):c=Math.round(u/a),f!==e||c!==o){var l=_o(f,c);this.getInterpolate()||A(l,lf);var v=l.canvas;l.drawImage(r,0,0,e,o,0,0,v.width,v.height),this.Lt.setImage(v)}}t.prototype.handleImageChange.call(this,n)},n}(gy),Ty="1.3.0",Ay=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Py=[101,101],Cy=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,interpolate:e,projection:r.projection,resolutions:r.resolutions})||this).Bt=void 0!==r.crossOrigin?r.crossOrigin:null,i.Fe=r.url,i.Rt=void 0!==r.imageLoadFunction?r.imageLoadFunction:wy,i.xh=r.params||{},i.Ph=!0,i.Ch(),i.kh=r.serverType,i._a=void 0===r.hidpi||r.hidpi,i.Lt=null,i.Mh=[0,0],i._h=0,i.Sh=void 0!==r.ratio?r.ratio:1.5,i}return Ay(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){if(void 0!==this.Fe){var e=yr(i),o=this.getProjection();o&&o!==e&&(n=mf(o,e,t,n),t=Er(t,e,o));var s=Bn(t,n,0,Py),u={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xh.LAYERS};A(u,this.xh,r);var a=mi((t[0]-s[0])/n,4),h=mi((s[3]-t[1])/n,4);return u[this.Ph?"I":"X"]=a,u[this.Ph?"J":"Y"]=h,this.Oh(s,Py,1,o||e,u)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.Fe){var i={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xh.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return A(i,n),Nf(this.Fe,i)}},n.prototype.getParams=function(){return this.xh},n.prototype.getImageInternal=function(t,n,i,r){if(void 0===this.Fe)return null;n=this.findNearestResolution(n),1==i||this._a&&void 0!==this.kh||(i=1);var e=n/i,o=qn(t),s=Bn(o,e,0,[wi($n(t)/e,4),wi(Vn(t)/e,4)]),u=Bn(o,e,0,[wi(this.Sh*$n(t)/e,4),wi(this.Sh*Vn(t)/e,4)]),a=this.Lt;if(a&&this._h==this.getRevision()&&a.getResolution()==n&&a.getPixelRatio()==i&&xn(a.getExtent(),s))return a;var h={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};A(h,this.xh),this.Mh[0]=yi($n(u)/e,4),this.Mh[1]=yi(Vn(u)/e,4);var f=this.Oh(u,this.Mh,i,r,h);return this.Lt=new bo(u,n,i,f,this.Bt,this.Rt),this._h=this.getRevision(),this.Lt.addEventListener(L,this.handleImageChange.bind(this)),this.Lt},n.prototype.getImageLoadFunction=function(){return this.Rt},n.prototype.Oh=function(t,n,i,r,e){if(St(void 0!==this.Fe,9),e[this.Ph?"CRS":"SRS"]=r.getCode(),"STYLES"in this.xh||(e.STYLES=""),1!=i)switch(this.kh){case"geoserver":var o=90*i+.5|0;"FORMAT_OPTIONS"in e?e.FORMAT_OPTIONS+=";dpi:"+o:e.FORMAT_OPTIONS="dpi:"+o;break;case"mapserver":e.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":e.DPI=90*i;break;default:St(!1,8)}e.WIDTH=n[0],e.HEIGHT=n[1];var s,u=r.getAxisOrientation();return s=this.Ph&&"ne"==u.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,e.BBOX=s.join(","),Nf(this.Fe,e)},n.prototype.getUrl=function(){return this.Fe},n.prototype.setImageLoadFunction=function(t){this.Lt=null,this.Rt=t,this.changed()},n.prototype.setUrl=function(t){t!=this.Fe&&(this.Fe=t,this.Lt=null,this.changed())},n.prototype.updateParams=function(t){A(this.xh,t),this.Ch(),this.Lt=null,this.changed()},n.prototype.Ch=function(){var t=this.xh.VERSION||Ty;this.Ph=Xi(t,"1.3")>=0},n}(gy),ky={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},Iy={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function Ny(t,n){for(var i,r,e=0;e<t.length;++e){var o=t[e];if("item"===o.rel){if(o.type===n){i=o.href;break}ky[o.type]?r=o.href:r||0!==o.type.indexOf("image/")||(r=o.href)}}if(!i){if(!r)throw new Error('Could not find "item" link');i=r}return i}function Ly(t,n,i){for(var r,e,o={},s=0;s<t.length;++s){var u=t[s];if(o[u.type]=u.href,"item"===u.rel){if(u.type===n){r=u.href;break}Iy[u.type]&&(e=u.href)}}if(!r&&i)for(s=0;s<i.length;++s){var a=i[s];if(o[a]){r=o[a];break}}if(!r){if(!e)throw new Error('Could not find "item" link');r=e}return r}function zy(t,n,i,r){var e=t.projection;if(!e&&!(e=yr(n.crs)))throw new Error("Unsupported CRS: ".concat(n.crs));for(var o="en"!==e.getAxisOrientation().substr(0,2),s=n.tileMatrices,u={},a=0;a<s.length;++a){var h=s[a];u[h.id]=h}var f={},c=[];if(r)for(a=0;a<r.length;++a){var l=(g=r[a]).tileMatrix;c.push(l),f[l]=g}else for(a=0;a<s.length;++a){l=s[a].id;c.push(l)}var v=c.length,d=new Array(v),p=new Array(v),y=new Array(v),m=new Array(v),w=[-1/0,-1/0,1/0,1/0];for(a=0;a<v;++a){l=c[a];var g,b=(h=u[l]).pointOfOrigin;if(d[a]=o?[b[1],b[0]]:b,p[a]=h.cellSize,y[a]=[h.matrixWidth,h.matrixHeight],m[a]=[h.tileWidth,h.tileHeight],g=f[l]){var x=h.cellSize*h.tileWidth,M=d[a][0]+g.minTileCol*x,_=d[a][0]+(g.maxTileCol+1)*x,S=h.cellSize*h.tileHeight,O=void 0,j=void 0;"bottomLeft"===h.cornerOfOrigin?(O=d[a][1]+g.minTileRow*S,j=d[a][1]+(g.maxTileRow+1)*S):(O=d[a][1]-(g.maxTileRow+1)*S,j=d[a][1]-g.minTileRow*S),Wn(w,[M,O,_,j],w)}}var E=new xf({origins:d,resolutions:p,sizes:y,tileSizes:m,extent:r?w:void 0}),T=t.context,P=t.url;return{grid:E,urlTemplate:i,urlFunction:function(t,n,e){if(t){var o=c[t[0]],s=u[o],a="bottomLeft"===s.cornerOfOrigin,h={tileMatrix:o,tileCol:t[1],tileRow:a?-t[2]-1:t[2]};if(r){var l=f[s.id];if(h.tileCol<l.minTileCol||h.tileCol>l.maxTileCol||h.tileRow<l.minTileRow||h.tileRow>l.maxTileRow)return}A(h,T);var v=i.replace(/\{(\w+?)\}/g,(function(t,n){return h[n]}));return Qh(P,v)}}}}function Ry(t){return Jh(t.url).then((function(n){return function(t,n){var i,r=n.tileMatrixSetLimits;if("map"===n.dataType)i=Ny(n.links,t.mediaType);else{if("vector"!==n.dataType)throw new Error('Expected tileset data type to be "map" or "vector"');i=Ly(n.links,t.mediaType,t.supportedMediaTypes)}if(n.tileMatrixSet)return zy(t,n.tileMatrixSet,i,r);var e=n.links.find((function(t){return"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===t.rel}));if(!e)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");var o=e.href;return Jh(Qh(t.url,o)).then((function(n){return zy(t,n,i,r)}))}(t,n)}))}var Fy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gy=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(r=n.interpolate),i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:"loading",tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition})||this,Ry({url:n.url,projection:i.getProjection(),mediaType:n.mediaType,context:n.context||null}).then(i.Ih.bind(i)).catch(i.Nh.bind(i)),i}return Fy(n,t),n.prototype.Ih=function(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")},n.prototype.Nh=function(t){console.error(t),this.setState("error")},n}(Vv),Dy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qy=function(t){function n(n){var i=this,r=n.projection||"EPSG:3857",e=n.extent||Tf(r),o=n.tileGrid||Of({extent:e,maxResolution:n.maxResolution,maxZoom:void 0!==n.maxZoom?n.maxZoom:22,minZoom:n.minZoom,tileSize:n.tileSize||512});return(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,interpolate:!0,opaque:!1,projection:r,state:n.state,tileGrid:o,tileLoadFunction:n.tileLoadFunction?n.tileLoadFunction:Uy,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:void 0===n.zDirection?1:n.zDirection})||this).ze=n.format?n.format:null,i.sourceTileCache=new Ih(i.tileCache.highWaterMark),i.za=null==n.overlaps||n.overlaps,i.tileClass=n.tileClass?n.tileClass:qh,i.Lh={},i}return Dy(n,t),n.prototype.getFeaturesInExtent=function(t){var n=[],i=this.tileCache;if(0===i.getCount())return n;var r=Ah(i.peekFirstKey())[0],e=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===r&&i.getState()===vt)for(var o=i.getSourceTiles(),s=0,u=o.length;s<u;++s){var a=o[s],h=a.tileCoord;if(Kn(t,e.getTileCoordExtent(h))){var f=a.getFeatures();if(f)for(var c=0,l=f.length;c<l;++c){var v=f[c],d=v.getGeometry();Kn(t,d.getExtent())&&n.push(v)}}}})),n},n.prototype.getOverlaps=function(){return this.za},n.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},n.prototype.expireCache=function(n,i){var r=this.getTileCacheForProjection(n),e=Object.keys(i).reduce((function(t,n){var i=Th(n),e=r.peek(i);if(e)for(var o=e.sourceTiles,s=0,u=o.length;s<u;++s)t[o[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,n,i),this.sourceTileCache.expireCache(e)},n.prototype.getSourceTiles=function(t,n,i){var r=this;if(i.getState()===ct){i.setState(lt);var e=i.wrappedTileCoord,o=this.getTileGridForProjection(n),s=o.getTileCoordExtent(e),u=e[0],a=o.getResolution(u);mn(s,-a,s);var h=this.tileGrid,f=h.getExtent();f&&Wn(s,f,s);var c=h.getZForResolution(a,this.zDirection);h.forEachTileCoord(s,c,(function(e){var o=r.tileUrlFunction(e,t,n),s=r.sourceTileCache.containsKey(o)?r.sourceTileCache.get(o):new r.tileClass(e,o?ct:pt,o,r.ze,r.tileLoadFunction);i.sourceTiles.push(s);var u=s.getState();if(u<vt){var a=function(t){r.handleTileChange(t);var n=s.getState();if(n===vt||n===dt){var e=s.getKey();e in i.errorTileKeys?s.getState()===vt&&delete i.errorTileKeys[e]:i.loadingSourceTiles--,n===dt?i.errorTileKeys[e]=!0:s.removeEventListener(L,a),0===i.loadingSourceTiles&&i.setState(k(i.errorTileKeys)?vt:dt)}};s.addEventListener(L,a),i.loadingSourceTiles++}u===ct&&(s.extent=h.getTileCoordExtent(e),s.projection=n,s.resolution=h.getResolution(e[0]),r.sourceTileCache.set(o,s),s.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===dt}))?dt:vt)}return i.sourceTiles},n.prototype.getTile=function(t,n,i,r,e){var o,s=jh(t,n,i),u=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===u)return o;var a=[t,n,i],h=this.getTileCoordForTileUrlFunction(a,e),f=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(e);if(h&&f){var l=c.getTileCoordExtent(h);mn(l,-c.getResolution(t),l),Kn(f,l)||(h=null)}var v=!0;if(null!==h){var d=this.tileGrid,p=c.getResolution(t),y=d.getZForResolution(p,1),m=c.getTileCoordExtent(h);mn(m,-p,m),d.forEachTileCoord(m,y,function(t){v=v&&!this.tileUrlFunction(t,r,e)}.bind(this))}var w=new Gh(a,v?pt:ct,h,this.getSourceTiles.bind(this,r,e));return w.key=u,o?(w.interimTile=o,w.refreshInterimChain(),this.tileCache.replace(s,w)):this.tileCache.set(s,w),w},n.prototype.getTileGridForProjection=function(t){var n=t.getCode(),i=this.Lh[n];if(!i){for(var r=this.tileGrid,e=r.getResolutions().slice(),o=e.map((function(t,n){return r.getOrigin(n)})),s=e.map((function(t,n){return r.getTileSize(n)})),u=e.length;u<43;++u)e.push(e[u-1]/2),o.push(o[u-1]),s.push(s[u-1]);i=new xf({extent:r.getExtent(),origins:o,resolutions:e,tileSizes:s}),this.Lh[n]=i}return i},n.prototype.getTilePixelRatio=function(t){return t},n.prototype.getTilePixelSize=function(t,n,i){var r=Qu(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(r[0]*n),Math.round(r[1]*n)]},n.prototype.updateCacheSize=function(n,i){t.prototype.updateCacheSize.call(this,2*n,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},n}(Uv);function Uy(t,n){t.setLoader((function(i,r,e){Xh(n,t.getFormat(),i,r,e,t.onLoad.bind(t),t.onError.bind(t))}))}var By=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xy=function(t){function n(n){var i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,format:n.format,overlaps:n.overlaps,projection:n.projection,tileClass:n.tileClass,transition:n.transition,wrapX:n.wrapX,zDirection:n.zDirection,state:"loading"})||this;return Ry({url:n.url,projection:i.getProjection(),mediaType:n.mediaType,supportedMediaTypes:n.format.supportedMediaTypes,context:n.context||null}).then(i.Ih.bind(i)).catch(i.Nh.bind(i)),i}return By(n,t),n.prototype.Ih=function(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")},n.prototype.Nh=function(t){console.error(t),this.setState("error")},n}(qy),Vy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wy='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Yy=function(t){function n(n){var i,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate),i=void 0!==r.attributions?r.attributions:[Wy];var o=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",s=void 0!==r.url?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:o,interpolate:e,maxZoom:void 0!==r.maxZoom?r.maxZoom:19,opaque:void 0===r.opaque||r.opaque,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:s,wrapX:r.wrapX,zDirection:r.zDirection})||this}return Vy(n,t),n}(Kv),Zy=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$y=function(t){function n(n){var i=n||{};return t.call(this,i)||this}return Zy(n,t),n}(ls),Ky=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hy=[],Jy=null;var Qy,tm=function(t){function n(n){var i=t.call(this,n)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i.Us=null,i.frameState=null,i}return Ky(n,t),n.prototype.getImageData=function(t,n,i){var r,e;Jy||((r=document.createElement("canvas")).width=1,r.height=1,Jy=r.getContext("2d")),Jy.clearRect(0,0,1,1);try{Jy.drawImage(t,n,i,1,1,0,0,1,1),e=Jy.getImageData(0,0,1,1).data}catch(t){return Jy=null,null}return e},n.prototype.getBackground=function(t){var n=this.getLayer().getBackground();return"function"==typeof n&&(n=n(t.viewState.resolution)),n||void 0},n.prototype.useContainer=function(t,n,i){var r,e,o=this.getLayer().getClassName();t&&t.className===o&&(!i||t&&t.style.backgroundColor&&x(Go(t.style.backgroundColor),Go(i)))&&((u=t.firstElementChild)instanceof HTMLCanvasElement&&(e=u.getContext("2d")));if(e&&e.canvas.style.transform===n?(this.container=t,this.context=e,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(r=document.createElement("div")).className=o;var s=r.style;s.position="absolute",s.width="100%",s.height="100%";var u=(e=_o()).canvas;r.appendChild(u),(s=u.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=r,this.context=e}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)},n.prototype.clipUnrotated=function(t,n,i){var r=Yn(i),e=Zn(i),o=Dn(i),s=Gn(i);tn(n.coordinateToPixelTransform,r),tn(n.coordinateToPixelTransform,e),tn(n.coordinateToPixelTransform,o),tn(n.coordinateToPixelTransform,s);var u=this.inversePixelTransform;tn(u,r),tn(u,e),tn(u,o),tn(u,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(e[0]),Math.round(e[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},n.prototype.Xs=function(t,n,i){var r=this.getLayer();if(r.hasListener(t)){var e=new ms(t,this.inversePixelTransform,i,n);r.dispatchEvent(e)}},n.prototype.preRender=function(t,n){this.frameState=n,this.Xs(os,t,n)},n.prototype.postRender=function(t,n){this.Xs(ss,t,n)},n.prototype.getRenderTransform=function(t,n,i,r,e,o,s){var u=e/2,a=o/2,h=r/n,f=-h,c=-t[0]+s,l=-t[1];return sn(this.tempTransform,u,a,h,f,-i,c,l)},n.prototype.getDataAtPixel=function(t,n,i){var r=tn(this.inversePixelTransform,t.slice()),e=this.context,o=this.getLayer().getExtent();if(o&&!bn(o,tn(n.pixelToCoordinateTransform,t.slice())))return null;var s,u=Math.round(r[0]),a=Math.round(r[1]),h=this.Us;if(!h){var f=document.createElement("canvas");f.width=1,f.height=1,h=f.getContext("2d"),this.Us=h}h.clearRect(0,0,1,1);try{h.drawImage(e.canvas,u,a,1,1,0,0,1,1),s=h.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.Us=null,new Uint8Array):s}return 0===s[3]?null:s},n.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},n}(Kc),nm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),im=function(t){function n(n){var i=t.call(this,n)||this;return i.Lt=null,i}return nm(n,t),n.prototype.getImage=function(){return this.Lt?this.Lt.getImage():null},n.prototype.prepareFrame=function(t){var n=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,r=t.viewState,e=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,u=t.extent;if(void 0!==n.extent&&(u=Wn(u,Lr(n.extent,r.projection))),!s[Eu]&&!s[Tu]&&!Hn(u))if(o){var a=r.projection,h=o.getImage(u,e,i,a);h&&(this.loadImage(h)?this.Lt=h:h.getState()===mo&&(this.Lt=null))}else this.Lt=null;return!!this.Lt},n.prototype.getData=function(t){var n=this.frameState;if(!n)return null;var i=this.getLayer(),r=tn(n.pixelToCoordinateTransform,t.slice()),e=i.getExtent();if(e&&!bn(e,r))return null;var o=this.Lt.getExtent(),s=this.Lt.getImage(),u=$n(o),a=Math.floor(s.width*((r[0]-o[0])/u));if(a<0||a>=s.width)return null;var h=Vn(o),f=Math.floor(s.height*((o[3]-r[1])/h));return f<0||f>=s.height?null:this.getImageData(s,a,f)},n.prototype.renderFrame=function(t,n){var i=this.Lt,r=i.getExtent(),e=i.getResolution(),o=i.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],u=t.pixelRatio,a=t.viewState,h=a.center,f=u*e/(a.resolution*o),c=t.extent,l=a.resolution,v=a.rotation,d=Math.round($n(c)/l*u),p=Math.round(Vn(c)/l*u);sn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,v,-d/2,-p/2),un(this.inversePixelTransform,this.pixelTransform);var y=hn(this.pixelTransform);this.useContainer(n,y,this.getBackground(t));var m=this.context,w=m.canvas;w.width!=d||w.height!=p?(w.width=d,w.height=p):this.containerReused||m.clearRect(0,0,d,p);var g=!1,b=!0;if(s.extent){var x=Lr(s.extent,a.projection);(g=(b=Kn(x,t.extent))&&!xn(x,t.extent))&&this.clipUnrotated(m,t,x)}var M=i.getImage(),_=sn(this.tempTransform,d/2,p/2,f,f,0,o*(r[0]-h[0])/e,o*(h[1]-r[3])/e);this.renderedResolution=e*u/o;var S=M.width*_[0],O=M.height*_[3];if(this.getLayer().getSource().getInterpolate()||A(m,lf),this.preRender(m,t),b&&S>=.5&&O>=.5){var j=_[4],E=_[5],T=s.opacity,P=void 0;1!==T&&(P=m.globalAlpha,m.globalAlpha=T),m.drawImage(M,0,0,+M.width,+M.height,j,E,S,O),1!==T&&(m.globalAlpha=P)}return this.postRender(m,t),g&&m.restore(),A(m,vf),y!==w.style.transform&&(w.style.transform=y),this.container},n}(tm),rm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),em=function(t){function n(n){return t.call(this,n)||this}return rm(n,t),n.prototype.createRenderer=function(){return new im(this)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}($y),om="preload",sm="useInterimTilesOnError",um=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),am=function(t){function n(n){var i=this,r=n||{},e=A({},r);return delete e.preload,delete e.useInterimTilesOnError,(i=t.call(this,e)||this).on,i.once,i.un,i.setPreload(void 0!==r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i}return um(n,t),n.prototype.getPreload=function(){return this.get(om)},n.prototype.setPreload=function(t){this.set(om,t)},n.prototype.getUseInterimTilesOnError=function(){return this.get(sm)},n.prototype.setUseInterimTilesOnError=function(t){this.set(sm,t)},n.prototype.getData=function(n){return t.prototype.getData.call(this,n)},n}(ls),hm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fm=function(t){function n(n){var i=t.call(this,n)||this;return i.extentChanged=!0,i.zh=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.Rh=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.Fh=new zh(0,0,0,0),i}return hm(n,t),n.prototype.isDrawableTile=function(t){var n=this.getLayer(),i=t.getState(),r=n.getUseInterimTilesOnError();return i==vt||i==pt||i==dt&&!r},n.prototype.getTile=function(t,n,i,r){var e=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),u=s.getSource().getTile(t,n,i,e,o);return u.getState()==dt&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.Rh=!0):u.setState(vt)),this.isDrawableTile(u)||(u=u.getInterimTile()),u},n.prototype.getData=function(t){var n=this.frameState;if(!n)return null;var i=this.getLayer(),r=tn(n.pixelToCoordinateTransform,t.slice()),e=i.getExtent();if(e&&!bn(e,r))return null;for(var o=n.pixelRatio,s=n.viewState.projection,u=n.viewState,a=i.getRenderSource(),h=a.getTileGridForProjection(u.projection),f=a.getTilePixelRatio(n.pixelRatio),c=h.getZForResolution(u.resolution);c>=h.getMinZoom();--c){var l=h.getTileCoordForCoordAndZ(r,c),v=a.getTile(c,l[1],l[2],o,s);if(!(v instanceof ko||v instanceof Bc))return null;if(v.getState()===vt){var d=h.getOrigin(c),p=Qu(h.getTileSize(c)),y=h.getResolution(c),m=Math.floor(f*((r[0]-d[0])/y-l[1]*p[0])),w=Math.floor(f*((d[1]-r[1])/y-l[2]*p[1])),g=Math.round(f*a.getGutterForProjection(u.projection));return this.getImageData(v.getImage(),m+g,w+g)}}return null},n.prototype.loadedTileCallback=function(n,i,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,n,i,r)},n.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},n.prototype.renderFrame=function(t,n){var i=t.layerStatesArray[t.layerIndex],r=t.viewState,e=r.projection,s=r.resolution,u=r.center,a=r.rotation,h=t.pixelRatio,f=this.getLayer(),c=f.getSource(),l=c.getRevision(),v=c.getTileGridForProjection(e),d=v.getZForResolution(s,c.zDirection),y=v.getResolution(d),m=t.extent,w=t.viewState.resolution,g=c.getTilePixelRatio(h),b=Math.round($n(m)/w*h),x=Math.round(Vn(m)/w*h),M=i.extent&&Lr(i.extent,e);M&&(m=Wn(m,Lr(i.extent,e)));var _=y*b/2/g,S=y*x/2/g,O=[u[0]-_,u[1]-S,u[0]+_,u[1]+S],j=v.getTileRangeForExtentAndZ(m,d),E={};E[d]={};var T=this.createLoadedTileFinder(c,e,E),P=this.tmpExtent,C=this.Fh;this.Rh=!1;for(var k=a?Xn(r.center,w,a,t.size):void 0,I=j.minX;I<=j.maxX;++I)for(var N=j.minY;N<=j.maxY;++N)if(!a||v.tileCoordIntersectsViewport([d,I,N],k)){var L=this.getTile(d,I,N,t);if(this.isDrawableTile(L)){var z=o(this);if(L.getState()==vt)E[d][L.tileCoord.toString()]=L,(ot=L.inTransition(z))&&1!==i.opacity&&(L.endTransition(z),ot=!1),this.Rh||!ot&&-1!==this.renderedTiles.indexOf(L)||(this.Rh=!0);if(1===L.getAlpha(z,t.time))continue}var R=v.getTileCoordChildTileRange(L.tileCoord,C,P),F=!1;R&&(F=T(d+1,R)),F||v.forEachTileCoordParentTileRange(L.tileCoord,T,C,P)}var G=y/s*h/g;sn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,a,-b/2,-x/2);var D=hn(this.pixelTransform);this.useContainer(n,D,this.getBackground(t));var q=this.context,U=q.canvas;un(this.inversePixelTransform,this.pixelTransform),sn(this.tempTransform,b/2,x/2,G,G,0,-b/2,-x/2),U.width!=b||U.height!=x?(U.width=b,U.height=x):this.containerReused||q.clearRect(0,0,b,x),M&&this.clipUnrotated(q,t,M),c.getInterpolate()||A(q,lf),this.preRender(q,t),this.renderedTiles.length=0;var B,X,V,W=Object.keys(E).map(Number);W.sort(p),1!==i.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(B=[],X=[]):W=W.reverse();for(var Y=W.length-1;Y>=0;--Y){var Z=W[Y],$=c.getTilePixelSize(Z,h,e),K=v.getResolution(Z)/y,H=$[0]*K*G,J=$[1]*K*G,Q=v.getTileCoordForCoordAndZ(Yn(O),Z),tt=v.getTileCoordExtent(Q),nt=tn(this.tempTransform,[g*(tt[0]-O[0])/y,g*(O[3]-tt[3])/y]),it=g*c.getGutterForProjection(e),rt=E[Z];for(var et in rt){var ot,st=(L=rt[et]).tileCoord,ut=Q[1]-st[1],at=Math.round(nt[0]-(ut-1)*H),ht=Q[2]-st[2],ft=Math.round(nt[1]-(ht-1)*J),ct=at-(I=Math.round(nt[0]-ut*H)),lt=ft-(N=Math.round(nt[1]-ht*J)),dt=d===Z,pt=!1;if(!(ot=dt&&1!==L.getAlpha(o(this),t.time)))if(B){V=[I,N,I+ct,N,I+ct,N+lt,I,N+lt];for(var yt=0,mt=B.length;yt<mt;++yt)if(d!==Z&&Z<X[yt]){var wt=B[yt];Kn([I,N,I+ct,N+lt],[wt[0],wt[3],wt[4],wt[7]])&&(pt||(q.save(),pt=!0),q.beginPath(),q.moveTo(V[0],V[1]),q.lineTo(V[2],V[3]),q.lineTo(V[4],V[5]),q.lineTo(V[6],V[7]),q.moveTo(wt[6],wt[7]),q.lineTo(wt[4],wt[5]),q.lineTo(wt[2],wt[3]),q.lineTo(wt[0],wt[1]),q.clip())}B.push(V),X.push(Z)}else q.clearRect(I,N,ct,lt);this.drawTileImage(L,t,I,N,ct,lt,it,dt),B&&!ot?(pt&&q.restore(),this.renderedTiles.unshift(L)):this.renderedTiles.push(L),this.updateUsedTiles(t.usedTiles,c,L)}}return this.renderedRevision=l,this.renderedResolution=y,this.extentChanged=!this.zh||!An(this.zh,O),this.zh=O,this.renderedPixelRatio=h,this.renderedProjection=e,this.manageTilePyramid(t,c,v,h,e,m,d,f.getPreload()),this.scheduleExpireCache(t,c),this.postRender(q,t),i.extent&&q.restore(),A(q,vf),D!==U.style.transform&&(U.style.transform=D),this.container},n.prototype.drawTileImage=function(t,n,i,r,e,s,u,a){var h=this.getTileImage(t);if(h){var f=o(this),c=n.layerStatesArray[n.layerIndex],l=c.opacity*(a?t.getAlpha(f,n.time):1),v=l!==this.context.globalAlpha;v&&(this.context.save(),this.context.globalAlpha=l),this.context.drawImage(h,u,u,h.width-2*u,h.height-2*u,i,r,e,s),v&&this.context.restore(),l!==c.opacity?n.animate=!0:a&&t.endTransition(f)}},n.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},n.prototype.getTileImage=function(t){return t.getImage()},n.prototype.scheduleExpireCache=function(t,n){if(n.canExpireCache()){var i=function(t,n,i){var r=o(t);r in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[r])}.bind(null,n);t.postRenderFunctions.push(i)}},n.prototype.updateUsedTiles=function(t,n,i){var r=o(n);r in t||(t[r]={}),t[r][i.getKey()]=!0},n.prototype.manageTilePyramid=function(t,n,i,r,e,s,u,a,h){var f=o(n);f in t.wantedTiles||(t.wantedTiles[f]={});var c,l,v,d,p,y,m=t.wantedTiles[f],w=t.tileQueue,g=i.getMinZoom(),b=t.viewState.rotation,x=b?Xn(t.viewState.center,t.viewState.resolution,b,t.size):void 0,M=0;for(y=g;y<=u;++y)for(l=i.getTileRangeForExtentAndZ(s,y,l),v=i.getResolution(y),d=l.minX;d<=l.maxX;++d)for(p=l.minY;p<=l.maxY;++p)b&&!i.tileCoordIntersectsViewport([y,d,p],x)||(u-y<=a?(++M,(c=n.getTile(y,d,p,r,e)).getState()==ct&&(m[c.getKey()]=!0,w.isKeyQueued(c.getKey())||w.enqueue([c,f,i.getTileCoordCenter(c.tileCoord),v])),void 0!==h&&h(c)):n.useTile(y,d,p,e));n.updateCacheSize(M,e)},n}(tm),cm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lm=function(t){function n(n){return t.call(this,n)||this}return cm(n,t),n.prototype.createRenderer=function(){return new fm(this)},n}(am),vm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dm=!0;try{new ImageData(10,10)}catch(t){dm=!1}function pm(t,n,i){if(dm)return new ImageData(t,n,i);Qy||(Qy=document.createElement("canvas").getContext("2d"));var r=Qy.createImageData(n,i);return r.data.set(t),r}function ym(t){var n=!0;try{new ImageData(10,10)}catch(t){n=!1}function i(t,i,r){return n?new ImageData(t,i,r):{data:t,width:i,height:r}}return function(n){var r=n.buffers,e=n.meta,o=n.imageOps,s=n.width,u=n.height,a=r.length,h=r[0].byteLength;if(o){for(var f=new Array(a),c=0;c<a;++c)f[c]=i(new Uint8ClampedArray(r[c]),s,u);return t(f,e).data.buffer}var l=new Uint8ClampedArray(h),v=new Array(a),d=new Array(a);for(c=0;c<a;++c)v[c]=new Uint8ClampedArray(r[c]),d[c]=[0,0,0,0];for(var p=0;p<h;p+=4){for(var y=0;y<a;++y){var m=v[y];d[y][0]=m[p],d[y][1]=m[p+1],d[y][2]=m[p+2],d[y][3]=m[p+3]}var w=t(d,e);l[p]=w[0],l[p+1]=w[1],l[p+2]=w[2],l[p+3]=w[3]}return l.buffer}}function mm(t,n){var i=Object.keys(t.lib||{}).map((function(n){return"var "+n+" = "+t.lib[n].toString()+";"})).concat(["var __minion__ = ("+ym.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker("undefined"==typeof Blob?"data:text/javascript;base64,"+Buffer.from(i.join("\n"),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",n),r}var wm=function(t){function n(n){var i,r=t.call(this)||this;r._imageOps=!!n.imageOps,i=0===n.threads?0:r._imageOps?1:n.threads||1;var e=new Array(i);if(i)for(var o=0;o<i;++o)e[o]=mm(n,r._onWorkerMessage.bind(r,o));else e[0]=function(t,n){var i=ym(t.operation),r=!1;return{postMessage:function(t){setTimeout((function(){r||n({data:{buffer:i(t),meta:t.meta}})}),0)},terminate:function(){r=!0}}}(n,r._onWorkerMessage.bind(r,0));return r._workers=e,r._queue=[],r._maxQueueLength=n.queue||1/0,r._running=0,r._dataLookup={},r._job=null,r}return vm(n,t),n.prototype.process=function(t,n,i){this._enqueue({inputs:t,meta:n,callback:i}),this._dispatch()},n.prototype._enqueue=function(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)},n.prototype._dispatch=function(){if(!this._running&&0!==this._queue.length){var t=this._queue.shift();this._job=t;var n=t.inputs[0].width,i=t.inputs[0].height,r=t.inputs.map((function(t){return t.data.buffer})),e=this._workers.length;if(this._running=e,1!==e)for(var o=t.inputs[0].data.length,s=4*Math.ceil(o/4/e),u=0;u<e;++u){for(var a=u*s,h=[],f=0,c=r.length;f<c;++f)h.push(r[f].slice(a,a+s));this._workers[u].postMessage({buffers:h,meta:t.meta,imageOps:this._imageOps,width:n,height:i},h)}else this._workers[0].postMessage({buffers:r,meta:t.meta,imageOps:this._imageOps,width:n,height:i},r)}},n.prototype._onWorkerMessage=function(t,n){this.disposed||(this._dataLookup[t]=n.data,--this._running,0===this._running&&this._resolveJob())},n.prototype._resolveJob=function(){var t,n,i=this._job,r=this._workers.length;if(1===r)t=new Uint8ClampedArray(this._dataLookup[0].buffer),n=this._dataLookup[0].meta;else{var e=i.inputs[0].data.length;t=new Uint8ClampedArray(e),n=new Array(r);for(var o=4*Math.ceil(e/4/r),s=0;s<r;++s){var u=this._dataLookup[s].buffer,a=s*o;t.set(new Uint8ClampedArray(u),a),n[s]=this._dataLookup[s].meta}}this._job=null,this._dataLookup={},i.callback(null,pm(t,i.inputs[0].width,i.inputs[0].height),n),this._dispatch()},n.prototype.disposeInternal=function(){for(var t=0;t<this._workers.length;++t)this._workers[t].terminate();this._workers.length=0},n}(v),gm="beforeoperations",bm="afteroperations",xm="pixel",Mm="image",_m=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.extent=i.extent,e.resolution=i.viewState.resolution/i.pixelRatio,e.data=r,e}return vm(n,t),n}(c),Sm=function(t){function n(n){var i=t.call(this,{projection:null})||this;i.on,i.once,i.un,i.Gh=null,i.Dh=void 0!==n.operationType?n.operationType:xm,i.qh=void 0!==n.threads?n.threads:1,i.Uh=function(t){for(var n=t.length,i=new Array(n),r=0;r<n;++r)i[r]=Em(t[r]);return i}(n.sources);for(var r,e=i.changed.bind(i),s=0,u=i.Uh.length;s<u;++s)i.Uh[s].addEventListener(L,e);return i.hr=new Ou((function(){return 1}),i.changed.bind(i)),i.Bh,i.Xh=null,i._h,i.Zi={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],declutterTree:null,extent:null,index:0,layerIndex:0,layerStatesArray:(r=i.Uh,r.map((function(t){return t.getLayerState()}))),pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],tileQueue:i.hr,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:o(i),renderTargets:{}},i.setAttributions((function(t){for(var i=[],r=0,e=n.sources.length;r<e;++r){var o=n.sources[r],s=(o instanceof zv?o:o.getSource()).getAttributions();if("function"==typeof s){var u=s(t);i.push.apply(i,u)}}return 0!==i.length?i:null})),void 0!==n.operation&&i.setOperation(n.operation,n.lib),i}return vm(n,t),n.prototype.setOperation=function(t,n){this.Gh&&this.Gh.dispose(),this.Gh=new wm({operation:t,imageOps:this.Dh===Mm,queue:1,lib:n,threads:this.qh}),this.changed()},n.prototype.Vh=function(t,n,i){var r=A({},this.Zi);r.viewState=A({},r.viewState);var e=qn(t);r.extent=t.slice(),r.size[0]=Math.round($n(t)/n),r.size[1]=Math.round(Vn(t)/n),r.time=Date.now();var o=r.viewState;return o.center=e,o.projection=i,o.resolution=n,r},n.prototype.Wh=function(){for(var t=!0,n=0,i=this.Uh.length;n<i;++n)if("ready"!==this.Uh[n].getSource().getState()){t=!1;break}return t},n.prototype.getImage=function(t,n,i,r){if(!this.Wh())return null;var e=this.Vh(t,n,r);if(this.Bh=e,this.Xh){var o=this.Xh.getResolution(),s=this.Xh.getExtent();n===o&&An(t,s)||(this.Xh=null)}return this.Xh&&this.getRevision()===this._h||this.Yh(),e.tileQueue.loadMoreTiles(16,16),e.animate&&requestAnimationFrame(this.changed.bind(this)),this.Xh},n.prototype.Yh=function(){for(var t=this.Bh,n=this.Uh.length,i=new Array(n),r=0;r<n;++r){t.layerIndex=r;var e=jm(this.Uh[r],t);if(!e)return;i[r]=e}var o={};this.dispatchEvent(new _m(gm,t,o)),this.Gh.process(i,o,this.Zh.bind(this,t))},n.prototype.Zh=function(t,n,i,r){if(!n&&i){var e=t.extent,o=t.viewState.resolution;if(o===this.Bh.viewState.resolution&&An(e,this.Bh.extent)){var s;if(this.Xh)s=this.Xh.getImage().getContext("2d");else s=_o(Math.round($n(e)/o),Math.round(Vn(e)/o)),this.Xh=new Mo(e,o,1,s.canvas);s.putImageData(i,0,0),this.changed(),this._h=this.getRevision(),this.dispatchEvent(new _m(bm,t,r)),t.animate&&requestAnimationFrame(this.changed.bind(this))}}},n.prototype.disposeInternal=function(){this.Gh&&this.Gh.dispose(),t.prototype.disposeInternal.call(this)},n}(gy);Sm.prototype.dispose;var Om=null;function jm(t,n){var i=t.getRenderer();if(!i)throw new Error("Unsupported layer type: "+t);if(!i.prepareFrame(n))return null;var r=n.size[0],e=n.size[1];if(0===r||0===e)return null;var o,s=i.renderFrame(n,null);if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===r&&o.height===e)return o.getContext("2d").getImageData(0,0,r,e)}if(Om){var u=Om.canvas;u.width!==r||u.height!==e?Om=_o(r,e):Om.clearRect(0,0,r,e)}else Om=_o(r,e);return Om.drawImage(o,0,0,r,e),Om.getImageData(0,0,r,e)}function Em(t){var n;return t instanceof zv?t instanceof Dv?n=new lm({source:t}):t instanceof gy&&(n=new em({source:t})):n=t,n}var Tm=Sm,Am=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pm=['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>.',Wy],Cm={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}},km={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},Im=function(t){function n(n){var i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var r=n.layer.indexOf("-"),e=-1==r?n.layer:n.layer.slice(0,r),o=km[e],s=Cm[n.layer],u=void 0!==n.url?n.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+n.layer+"/{z}/{x}/{y}."+s.extension;return t.call(this,{attributions:Pm,cacheSize:n.cacheSize,crossOrigin:"anonymous",interpolate:i,maxZoom:null!=n.maxZoom?n.maxZoom:o.maxZoom,minZoom:null!=n.minZoom?n.minZoom:o.minZoom,opaque:s.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:u,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Am(n,t),n}(Kv),Nm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Lm=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;return void 0!==r.interpolate&&(e=r.interpolate),(i=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).xh=r.params||{},i._a=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.setKey(i.$h()),i}return Nm(n,t),n.prototype.$h=function(){var t=0,n=[];for(var i in this.xh)n[t++]=i+"-"+this.xh[i];return n.join("/")},n.prototype.getParams=function(){return this.xh},n.prototype.Oh=function(t,n,i,r,e,o){var s=this.urls;if(s){var u,a=e.getCode().split(/:(?=\d+$)/).pop();if(o.SIZE=n[0]+","+n[1],o.BBOX=i.join(","),o.BBOXSR=a,o.IMAGESR=a,o.DPI=Math.round(o.DPI?o.DPI*r:90*r),1==s.length)u=s[0];else u=s[vi(Ph(t),s.length)];return Nf(u.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},n.prototype.getTilePixelRatio=function(t){return this._a?t:1},n.prototype.updateParams=function(t){A(this.xh,t),this.setKey(this.$h())},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this._a||(n=1);var e=r.getTileCoordExtent(t,this.Ao),o=Qu(r.getTileSize(t[0]),this.tmpSize);1!=n&&(o=Ju(o,n,this.tmpSize));var s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return A(s,this.xh),this.Oh(t,o,e,n,i,s)}},n}(Vv),zm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rm=function(t){function n(n){var i=this,r=n||{};return i=t.call(this,{opaque:!1,projection:r.projection,tileGrid:r.tileGrid,wrapX:void 0===r.wrapX||r.wrapX,zDirection:r.zDirection,url:r.template||"z:{z} x:{x} y:{y}",tileLoadFunction:function(t,n){var r=t.getTileCoord()[0],e=Qu(i.tileGrid.getTileSize(r)),o=_o(e[0],e[1]);o.strokeStyle="grey",o.strokeRect(.5,.5,e[0]+.5,e[1]+.5),o.fillStyle="grey",o.strokeStyle="white",o.textAlign="center",o.textBaseline="middle",o.font="24px sans-serif",o.lineWidth=4,o.strokeText(n,e[0]/2,e[1]/2,e[0]),o.fillText(n,e[0]/2,e[1]/2,e[0]),t.setImage(o.canvas)}})||this}return zm(n,t),n}(Kv),Fm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gm=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;if(void 0!==n.interpolate&&(r=n.interpolate),(i=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:yr("EPSG:3857"),reprojectionErrorThreshold:n.reprojectionErrorThreshold,state:"loading",tileLoadFunction:n.tileLoadFunction,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).Kh=null,i.jo=n.tileSize,n.url)if(n.jsonp)Zh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var e=new XMLHttpRequest;e.addEventListener("load",i.Hh.bind(i)),e.addEventListener("error",i.Jh.bind(i)),e.open("GET",n.url),e.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):St(!1,51);return i}return Fm(n,t),n.prototype.Hh=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.Jh=function(t){this.handleTileJSONError()},n.prototype.getTileJSON=function(){return this.Kh},n.prototype.handleTileJSONResponse=function(t){var n,i=yr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Or(i,r);n=ni(t.bounds,e)}var o=Tf(r),s=t.minzoom||0,u=Of({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.jo});if(this.tileGrid=u,this.tileUrlFunction=Pf(t.tiles,u),void 0!==t.attribution&&!this.getAttributions()){var a=void 0!==n?n:o;this.setAttributions((function(n){return Kn(a,n.extent)?[t.attribution]:null}))}this.Kh=t,this.setState("ready")},n.prototype.handleTileJSONError=function(){this.setState("error")},n}(Vv),Dm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qm=function(t){function n(n){var i=this,r=n||{},e=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(e=r.interpolate);var o=r.params||{},s=!("TRANSPARENT"in o)||o.TRANSPARENT;return(i=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:e,opaque:!s,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).js=void 0!==r.gutter?r.gutter:0,i.xh=o,i.Ph=!0,i.kh=r.serverType,i._a=void 0===r.hidpi||r.hidpi,i.Ao=[1/0,1/0,-1/0,-1/0],i.Ch(),i.setKey(i.$h()),i}return Dm(n,t),n.prototype.getFeatureInfoUrl=function(t,n,i,r){var e=yr(i),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(e));var u=s.getZForResolution(n,this.zDirection),a=s.getTileCoordForCoordAndZ(t,u);if(!(s.getResolutions().length<=a[0])){var h=s.getResolution(a[0]),f=s.getTileCoordExtent(a,this.Ao),c=Qu(s.getTileSize(a[0]),this.tmpSize),l=this.js;0!==l&&(c=Ku(c,l,this.tmpSize),f=mn(f,h*l,f)),o&&o!==e&&(h=mf(o,e,t,h),f=Tr(f,e,o),t=Er(t,e,o));var v={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.xh.LAYERS};A(v,this.xh,r);var d=Math.floor((t[0]-f[0])/h),p=Math.floor((f[3]-t[1])/h);return v[this.Ph?"I":"X"]=d,v[this.Ph?"J":"Y"]=p,this.Oh(a,c,f,1,o||e,v)}},n.prototype.getLegendUrl=function(t,n){if(void 0!==this.urls[0]){var i={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===n||void 0===n.LAYER){var r=this.xh.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;i.LAYER=r}if(void 0!==t){var e=this.getProjection()?this.getProjection().getMetersPerUnit():1;i.SCALE=t*e/28e-5}return A(i,n),Nf(this.urls[0],i)}},n.prototype.getGutter=function(){return this.js},n.prototype.getParams=function(){return this.xh},n.prototype.Oh=function(t,n,i,r,e,o){var s=this.urls;if(s){if(o.WIDTH=n[0],o.HEIGHT=n[1],o[this.Ph?"CRS":"SRS"]=e.getCode(),"STYLES"in this.xh||(o.STYLES=""),1!=r)switch(this.kh){case"geoserver":var u=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+u:o.FORMAT_OPTIONS="dpi:"+u;break;case"mapserver":o.MAP_RESOLUTION=90*r;break;case"carmentaserver":case"qgis":o.DPI=90*r;break;default:St(!1,52)}var a,h=e.getAxisOrientation(),f=i;if(this.Ph&&"ne"==h.substr(0,2)){var c=void 0;c=i[0],f[0]=i[1],f[1]=c,c=i[2],f[2]=i[3],f[3]=c}if(o.BBOX=f.join(","),1==s.length)a=s[0];else a=s[vi(Ph(t),s.length)];return Nf(a,o)}},n.prototype.getTilePixelRatio=function(t){return this._a&&void 0!==this.kh?t:1},n.prototype.$h=function(){var t=0,n=[];for(var i in this.xh)n[t++]=i+"-"+this.xh[i];return n.join("/")},n.prototype.updateParams=function(t){A(this.xh,t),this.Ch(),this.setKey(this.$h())},n.prototype.Ch=function(){var t=this.xh.VERSION||Ty;this.Ph=Xi(t,"1.3")>=0},n.prototype.tileUrlFunction=function(t,n,i){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(i)),!(r.getResolutions().length<=t[0])){1==n||this._a&&void 0!==this.kh||(n=1);var e=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.Ao),s=Qu(r.getTileSize(t[0]),this.tmpSize),u=this.js;0!==u&&(s=Ku(s,u,this.tmpSize),o=mn(o,e*u,o)),1!=n&&(s=Ju(s,n,this.tmpSize));var a={SERVICE:"WMS",VERSION:Ty,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return A(a,this.xh),this.Oh(t,s,o,n,i,a)}},n}(Vv),Um=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Bm=function(t){function n(n,i,r,e,o,s){var u=t.call(this,n,i)||this;return u.Nt=r,u.st=e,u.Qh=o,u.tf=null,u.nf=null,u.B=null,u.if=s,u}return Um(n,t),n.prototype.getImage=function(){return null},n.prototype.getData=function(t){if(!this.tf||!this.nf)return null;var n=(t[0]-this.st[0])/(this.st[2]-this.st[0]),i=(t[1]-this.st[1])/(this.st[3]-this.st[1]),r=this.tf[Math.floor((1-i)*this.tf.length)];if("string"!=typeof r)return null;var e=r.charCodeAt(Math.floor(n*r.length));e>=93&&e--,e>=35&&e--;var o=null;if((e-=32)in this.nf){var s=this.nf[e];o=this.B&&s in this.B?this.B[s]:s}return o},n.prototype.forDataAtCoordinate=function(t,n,i){this.state==pt&&!0===i?(this.state=ct,K(this,L,(function(i){n(this.getData(t))}),this),this.rf()):!0===i?setTimeout(function(){n(this.getData(t))}.bind(this),0):n(this.getData(t))},n.prototype.getKey=function(){return this.Nt},n.prototype.Nh=function(){this.state=dt,this.changed()},n.prototype.Ut=function(t){this.tf=t.grid,this.nf=t.keys,this.B=t.data,this.state=vt,this.changed()},n.prototype.rf=function(){if(this.state==ct)if(this.state=lt,this.if)Zh(this.Nt,this.Ut.bind(this),this.Nh.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.Hh.bind(this)),t.addEventListener("error",this.Jh.bind(this)),t.open("GET",this.Nt),t.send()}},n.prototype.Hh=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.Nh()}this.Ut(i)}else this.Nh()},n.prototype.Jh=function(t){this.Nh()},n.prototype.load=function(){this.Qh?this.rf():this.setState(pt)},n}(xt),Xm=function(t){function n(n){var i=t.call(this,{projection:yr("EPSG:3857"),state:"loading",zDirection:n.zDirection})||this;if(i.Qh=void 0===n.preemptive||n.preemptive,i.ef=kf,i.uf=void 0,i.if=n.jsonp||!1,n.url)if(i.if)Zh(n.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var r=new XMLHttpRequest;r.addEventListener("load",i.Hh.bind(i)),r.addEventListener("error",i.Jh.bind(i)),r.open("GET",n.url),r.send()}else n.tileJSON?i.handleTileJSONResponse(n.tileJSON):St(!1,51);return i}return Um(n,t),n.prototype.Hh=function(t){var n=t.target;if(!n.status||n.status>=200&&n.status<300){var i=void 0;try{i=JSON.parse(n.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},n.prototype.Jh=function(t){this.handleTileJSONError()},n.prototype.getTemplate=function(){return this.uf},n.prototype.forDataAtCoordinateAndResolution=function(t,n,i,r){if(this.tileGrid){var e=this.tileGrid.getZForResolution(n,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,e);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,i,r)}else!0===r?setTimeout((function(){i(null)}),0):i(null)},n.prototype.handleTileJSONError=function(){this.setState("error")},n.prototype.handleTileJSONResponse=function(t){var n,i=yr("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var e=Or(i,r);n=ni(t.bounds,e)}var o=Tf(r),s=t.minzoom||0,u=Of({extent:o,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=u,this.uf=t.template;var a=t.grids;if(a){if(this.ef=Pf(a,u),void 0!==t.attribution){var h=void 0!==n?n:o;this.setAttributions((function(n){return Kn(h,n.extent)?[t.attribution]:null}))}this.setState("ready")}else this.setState("error")},n.prototype.getTile=function(t,n,i,r,e){var o=jh(t,n,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,n,i],u=this.getTileCoordForTileUrlFunction(s,e),a=this.ef(u,r,e),h=new Bm(s,void 0!==a?ct:pt,void 0!==a?a:"",this.tileGrid.getTileCoordExtent(s),this.Qh,this.if);return this.tileCache.set(o,h),h},n.prototype.useTile=function(t,n,i){var r=jh(t,n,i);this.tileCache.containsKey(r)&&this.tileCache.get(r)},n}(Dv),Vm=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Wm=function(t){function n(n){var i=this,r=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(r=n.interpolate);var e=void 0!==n.requestEncoding?n.requestEncoding:"KVP",o=n.tileGrid,s=n.urls;return void 0===s&&void 0!==n.url&&(s=If(n.url)),(i=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:r,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:o,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,urls:s,wrapX:void 0!==n.wrapX&&n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).af=void 0!==n.version?n.version:"1.0.0",i.ze=void 0!==n.format?n.format:"image/jpeg",i.hf=void 0!==n.dimensions?n.dimensions:{},i.Ds=n.layer,i.ff=n.matrixSet,i.H=n.style,i.cf=e,i.setKey(i.lf()),s&&s.length>0&&(i.tileUrlFunction=Cf(s.map(i.createFromWMTSTemplate.bind(i)))),i}return Vm(n,t),n.prototype.setUrls=function(t){this.urls=t;var n=t.join("\n");this.setTileUrlFunction(Cf(t.map(this.createFromWMTSTemplate.bind(this))),n)},n.prototype.getDimensions=function(){return this.hf},n.prototype.getFormat=function(){return this.ze},n.prototype.getLayer=function(){return this.Ds},n.prototype.getMatrixSet=function(){return this.ff},n.prototype.getRequestEncoding=function(){return this.cf},n.prototype.getStyle=function(){return this.H},n.prototype.getVersion=function(){return this.af},n.prototype.lf=function(){var t=0,n=[];for(var i in this.hf)n[t++]=i+"-"+this.hf[i];return n.join("/")},n.prototype.updateDimensions=function(t){A(this.hf,t),this.setKey(this.lf())},n.prototype.createFromWMTSTemplate=function(t){var n=this.cf,i={layer:this.Ds,style:this.H,tilematrixset:this.ff};"KVP"==n&&A(i,{Service:"WMTS",Request:"GetTile",Version:this.af,Format:this.ze}),t="KVP"==n?Nf(t,i):t.replace(/\{(\w+?)\}/g,(function(t,n){return n.toLowerCase()in i?i[n.toLowerCase()]:t}));var r=this.tileGrid,e=this.hf;return function(i,o,s){if(i){var u={TileMatrix:r.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};A(u,e);var a=t;return a="KVP"==n?Nf(a,u):a.replace(/\{(\w+?)\}/g,(function(t,n){return u[n]}))}}},n}(Vv);var Ym=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Zm="renderOrder",$m=function(t){function n(n){var i=this,r=n||{},e=A({},r);return delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,(i=t.call(this,e)||this).vf=void 0!==r.declutter&&r.declutter,i.df=void 0!==r.renderBuffer?r.renderBuffer:100,i.H=null,i.tt=void 0,i.setStyle(r.style),i.pf=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,i.yf=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,i}return Ym(n,t),n.prototype.getDeclutter=function(){return this.vf},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderBuffer=function(){return this.df},n.prototype.getRenderOrder=function(){return this.get(Zm)},n.prototype.getStyle=function(){return this.H},n.prototype.getStyleFunction=function(){return this.tt},n.prototype.getUpdateWhileAnimating=function(){return this.pf},n.prototype.getUpdateWhileInteracting=function(){return this.yf},n.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Av(9)),this.getRenderer().renderDeclutter(t)},n.prototype.setRenderOrder=function(t){this.set(Zm,t)},n.prototype.setStyle=function(t){this.H=void 0!==t?t:xv,this.tt=null===t?void 0:gv(this.H),this.changed()},n}(ls);var Km=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Hm=function(t){function n(n,i){var r=this,e=i.uniforms||{},s=[1,0,0,1,0,0];e[Sc]=s,(r=t.call(this,n,{uniforms:e,postProcesses:i.postProcesses})||this).ready=!1,r.mf=-1,r.wf=new mc(zf,Gf),r.gf=new mc(zf,Gf),r.bf=new mc(Rf,Gf),r.Hs=i.vertexShader,r.Js=i.fragmentShader,r.Ks,r.xf=!(!i.hitFragmentShader||!i.hitVertexShader),r.Mf=i.hitVertexShader,r._f=i.hitFragmentShader,r.Sf;var u=i.attributes?i.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Pc.FLOAT}})):[];r.attributes=[{name:"a_position",size:2,type:Pc.FLOAT},{name:"a_index",size:1,type:Pc.FLOAT}].concat(u),r.hitDetectionAttributes=[{name:"a_position",size:2,type:Pc.FLOAT},{name:"a_index",size:1,type:Pc.FLOAT},{name:"a_hitColor",size:4,type:Pc.FLOAT},{name:"a_featureUid",size:1,type:Pc.FLOAT}].concat(u),r.customAttributes=i.attributes?i.attributes:[],r.$i=[1/0,1/0,-1/0,-1/0],r.Of=s,r.jf=[1,0,0,1,0,0],r.Ef=[1,0,0,1,0,0],r.Tf=new Float32Array(0),r.Af=new Float32Array(0),r.Pf,r.Cf=0,r.kf=function(){var t='const e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1,n=arguments.length;e<n;++e){const n=arguments[e];if(null!=n)for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e])}return t},n="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";n.indexOf("firefox");-1!==n.indexOf("safari")&&-1==n.indexOf("chrom")&&(n.indexOf("version/15.4")>=0||n.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==n.indexOf("webkit")&&n.indexOf("edge"),n.indexOf("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(e){}}(),new Array(6);const t="GENERATE_BUFFERS",o=[],r={vertexPosition:0,indexPosition:0};function i(e,n,t,o,r){e[n+0]=t,e[n+1]=o,e[n+2]=r}function s(e,n,t,s,f,c){const l=3+f,a=e[n+0],u=e[n+1],d=o;d.length=f;for(let t=0;t<d.length;t++)d[t]=e[n+2+t];let g=c?c.vertexPosition:0,x=c?c.indexPosition:0;const h=g/l;return i(t,g,a,u,0),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,1),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,2),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,3),d.length&&t.set(d,g+3),g+=l,s[x++]=h,s[x++]=h+1,s[x++]=h+3,s[x++]=h+1,s[x++]=h+2,s[x++]=h+3,r.vertexPosition=g,r.indexPosition=x,r}const f=self;f.onmessage=n=>{const o=n.data;if(o.type===t){const n=3,t=2,r=o.customAttributesCount,i=t+r,c=new Float32Array(o.renderInstructions),l=c.length/i,a=4*l*(r+n),u=new Uint32Array(6*l),d=new Float32Array(a);let g;for(let e=0;e<c.length;e+=i)g=s(c,e,d,u,r,g);const x=e({vertexBuffer:d.buffer,indexBuffer:u.buffer,renderInstructions:c.buffer},o);f.postMessage(x,[d.buffer,u.buffer,c.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}(),r.kf.addEventListener("message",function(t){var n=t.data;if(n.type===Jc){var i=n.projectionTransform;n.hitDetection?(this.gf.fromArrayBuffer(n.vertexBuffer),this.helper.flushBufferData(this.gf)):(this.wf.fromArrayBuffer(n.vertexBuffer),this.helper.flushBufferData(this.wf)),this.bf.fromArrayBuffer(n.indexBuffer),this.helper.flushBufferData(this.bf),this.jf=i,un(this.Ef,this.jf),n.hitDetection?this.Af=new Float32Array(t.data.renderInstructions):(this.Tf=new Float32Array(t.data.renderInstructions),n.generateBuffersRun===this.Cf&&(this.ready=!0)),this.getLayer().changed()}}.bind(r)),r.If={},r.Nf=0;var a=r.getLayer().getSource();return r.Lf=[$(a,Qv,r.zf,r),$(a,td,r.Rf,r),$(a,id,r.Ff,r),$(a,nd,r.Gf,r)],a.forEachFeature(function(t){this.If[o(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.Nf++}.bind(r)),r}return Km(n,t),n.prototype.afterHelperCreated=function(){this.Ks=this.helper.getProgram(this.Js,this.Hs),this.xf&&(this.Sf=this.helper.getProgram(this._f,this.Mf),this.Pf=new Gc(this.helper))},n.prototype.zf=function(t){var n=t.feature;this.If[o(n)]={feature:n,properties:n.getProperties(),geometry:n.getGeometry()},this.Nf++},n.prototype.Rf=function(t){var n=t.feature;this.If[o(n)]={feature:n,properties:n.getProperties(),geometry:n.getGeometry()}},n.prototype.Ff=function(t){var n=t.feature;delete this.If[o(n)],this.Nf--},n.prototype.Gf=function(){this.If={},this.Nf=0},n.prototype.renderFrame=function(t){var n=this.helper.getGL();this.preRender(n,t);var i=t.viewState.projection,r=this.getLayer().getSource().getWrapX()&&i.canWrapX(),e=i.getExtent(),o=t.extent,s=r?$n(e):null,u=r?Math.ceil((o[2]-e[2])/s)+1:1,a=r?Math.floor((o[0]-e[0])/s):0,h=a,f=this.bf.getSize();do{this.helper.makeProjectionTransform(t,this.Of),on(this.Of,h*s,0),Ht(this.Of,this.Ef),this.helper.applyUniforms(t),this.helper.drawElements(0,f)}while(++h<u);this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var c=this.helper.getCanvas();return this.xf&&(this.renderHitDetection(t,a,u,s),this.Pf.clearCachedData()),this.postRender(n,t),c},n.prototype.prepareFrameInternal=function(t){var n=this.getLayer(),i=n.getSource(),r=t.viewState,e=!t.viewHints[Eu]&&!t.viewHints[Tu],o=!An(this.$i,t.extent),s=this.mf<i.getRevision();if(s&&(this.mf=i.getRevision()),e&&(o||s)){var u=r.projection,a=r.resolution,h=n instanceof $m?n.getRenderBuffer():0,f=mn(t.extent,h*a);i.loadFeatures(f,a,u),this.Df(t),this.$i=t.extent.slice()}return this.helper.useProgram(this.Ks),this.helper.prepareDraw(t),this.helper.bindBuffer(this.wf),this.helper.bindBuffer(this.bf),this.helper.enableAttributes(this.attributes),!0},n.prototype.Df=function(t){var n=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,n);var i,r,e=(2+this.customAttributes.length)*this.Nf;if(this.Tf&&this.Tf.length===e||(this.Tf=new Float32Array(e)),this.xf){var o=(7+this.customAttributes.length)*this.Nf;this.Af&&this.Af.length===o||(this.Af=new Float32Array(o))}var s,u=[],a=[],h=0,f=0;for(var c in this.If)if((r=(i=this.If[c]).geometry)&&"Point"===r.getType()){u[0]=r.getFlatCoordinates()[0],u[1]=r.getFlatCoordinates()[1],tn(n,u),s=rl(f+6,a),this.Tf[h++]=u[0],this.Tf[h++]=u[1],this.xf&&(this.Af[f++]=u[0],this.Af[f++]=u[1],this.Af[f++]=s[0],this.Af[f++]=s[1],this.Af[f++]=s[2],this.Af[f++]=s[3],this.Af[f++]=Number(c));for(var l=void 0,v=0;v<this.customAttributes.length;v++)l=this.customAttributes[v].callback(i.feature,i.properties),this.Tf[h++]=l,this.xf&&(this.Af[f++]=l)}var d={type:Jc,renderInstructions:this.Tf.buffer,customAttributesCount:this.customAttributes.length};if(d.projectionTransform=n,d.generateBuffersRun=++this.Cf,this.ready=!1,this.kf.postMessage(d,[this.Tf.buffer]),this.Tf=null,this.xf){var p={type:Jc,renderInstructions:this.Af.buffer,customAttributesCount:5+this.customAttributes.length};p.projectionTransform=n,p.hitDetection=!0,this.kf.postMessage(p,[this.Af.buffer]),this.Af=null}},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){if(St(this.xf,66),this.Af){var o=tn(n.coordinateToPixelTransform,t.slice()),s=this.Pf.readPixel(o[0]/2,o[1]/2),u=el([s[0]/255,s[1]/255,s[2]/255,s[3]/255]),a=this.Af[u],h=Math.floor(a).toString(),f=this.getLayer().getSource().getFeatureByUid(h);return f?r(f,this.getLayer(),null):void 0}},n.prototype.renderHitDetection=function(t,n,i,r){if(this.gf.getSize()){var e=n;this.Pf.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.Sf),this.helper.prepareDrawToRenderTarget(t,this.Pf,!0),this.helper.bindBuffer(this.gf),this.helper.bindBuffer(this.bf),this.helper.enableAttributes(this.hitDetectionAttributes);do{this.helper.makeProjectionTransform(t,this.Of),on(this.Of,e*r,0),Ht(this.Of,this.Ef),this.helper.applyUniforms(t);var o=this.bf.getSize();this.helper.drawElements(0,o)}while(++e<i)}},n.prototype.disposeInternal=function(){this.kf.terminate(),this.Ds=null,this.Lf.forEach((function(t){H(t)})),this.Lf=null,t.prototype.disposeInternal.call(this)},n}(ol),Jm={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},Qm=[Jm.FILL],tw=[Jm.STROKE],nw=[Jm.BEGIN_PATH],iw=[Jm.CLOSE_PATH],rw=Jm,ew=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ow=function(t){function n(n,i,r,e){var o=t.call(this)||this;return o.tolerance=n,o.maxExtent=i,o.pixelRatio=e,o.maxLineWidth=0,o.resolution=r,o.qf=null,o.Uf=null,o.Bf=null,o.instructions=[],o.coordinates=[],o.Xf=[],o.hitDetectionInstructions=[],o.state={},o}return ew(n,t),n.prototype.applyPixelRatio=function(t){var n=this.pixelRatio;return 1==n?t:t.map((function(t){return t*n}))},n.prototype.appendFlatPointCoordinates=function(t,n){for(var i=this.getBufferedMaxExtent(),r=this.Xf,e=this.coordinates,o=e.length,s=0,u=t.length;s<u;s+=n)r[0]=t[s],r[1]=t[s+1],bn(i,r)&&(e[o++]=r[0],e[o++]=r[1]);return o},n.prototype.appendFlatLineCoordinates=function(t,n,i,r,e,o){var s=this.coordinates,u=s.length,a=this.getBufferedMaxExtent();o&&(n+=r);var h,f,c,l=t[n],v=t[n+1],d=this.Xf,p=!0;for(h=n+r;h<i;h+=r)d[0]=t[h],d[1]=t[h+1],(c=_n(a,d))!==f?(p&&(s[u++]=l,s[u++]=v,p=!1),s[u++]=d[0],s[u++]=d[1]):c===cn?(s[u++]=d[0],s[u++]=d[1],p=!1):p=!0,l=d[0],v=d[1],f=c;return(e&&p||h===n+r)&&(s[u++]=l,s[u++]=v),u},n.prototype.Vf=function(t,n,i,r,e){for(var o=0,s=i.length;o<s;++o){var u=i[o],a=this.appendFlatLineCoordinates(t,n,u,r,!1,!1);e.push(a),n=u}return n},n.prototype.drawCustom=function(t,n,i,r){this.beginGeometry(t,n);var e,o,s,u,a,h=t.getType(),f=t.getStride(),c=this.coordinates.length;switch(h){case"MultiPolygon":e=t.getOrientedFlatCoordinates(),u=[];var l=t.getEndss();a=0;for(var v=0,d=l.length;v<d;++v){var p=[];a=this.Vf(e,a,l[v],f,p),u.push(p)}this.instructions.push([rw.CUSTOM,c,u,t,i,me]),this.hitDetectionInstructions.push([rw.CUSTOM,c,u,t,r||i,me]);break;case"Polygon":case"MultiLineString":s=[],e="Polygon"==h?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.Vf(e,0,t.getEnds(),f,s),this.instructions.push([rw.CUSTOM,c,s,t,i,ye]),this.hitDetectionInstructions.push([rw.CUSTOM,c,s,t,r||i,ye]);break;case"LineString":case"Circle":e=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(e,0,e.length,f,!1,!1),this.instructions.push([rw.CUSTOM,c,o,t,i,pe]),this.hitDetectionInstructions.push([rw.CUSTOM,c,o,t,r||i,pe]);break;case"MultiPoint":e=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(e,f))>c&&(this.instructions.push([rw.CUSTOM,c,o,t,i,pe]),this.hitDetectionInstructions.push([rw.CUSTOM,c,o,t,r||i,pe]));break;case"Point":e=t.getFlatCoordinates(),this.coordinates.push(e[0],e[1]),o=this.coordinates.length,this.instructions.push([rw.CUSTOM,c,o,t,i]),this.hitDetectionInstructions.push([rw.CUSTOM,c,o,t,r||i])}this.endGeometry(n)},n.prototype.beginGeometry=function(t,n){this.qf=[rw.BEGIN_GEOMETRY,n,0,t],this.instructions.push(this.qf),this.Uf=[rw.BEGIN_GEOMETRY,n,0,t],this.hitDetectionInstructions.push(this.Uf)},n.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},n.prototype.reverseHitDetectionInstructions=function(){var t,n=this.hitDetectionInstructions;n.reverse();var i,r,e=n.length,o=-1;for(t=0;t<e;++t)(r=(i=n[t])[0])==rw.END_GEOMETRY?o=t:r==rw.BEGIN_GEOMETRY&&(i[2]=t,w(this.hitDetectionInstructions,o,t),o=-1)},n.prototype.setFillStrokeStyle=function(t,n){var i=this.state;if(t){var r=t.getColor();i.fillStyle=Uh(r||Ts)}else i.fillStyle=void 0;if(n){var e=n.getColor();i.strokeStyle=Uh(e||Is);var o=n.getLineCap();i.lineCap=void 0!==o?o:As;var s=n.getLineDash();i.lineDash=s?s.slice():Ps;var u=n.getLineDashOffset();i.lineDashOffset=u||0;var a=n.getLineJoin();i.lineJoin=void 0!==a?a:Cs;var h=n.getWidth();i.lineWidth=void 0!==h?h:1;var f=n.getMiterLimit();i.miterLimit=void 0!==f?f:ks,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.Bf=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},n.prototype.createFill=function(t){var n=t.fillStyle,i=[rw.SET_FILL_STYLE,n];return"string"!=typeof n&&i.push(!0),i},n.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},n.prototype.createStroke=function(t){return[rw.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},n.prototype.updateFillStyle=function(t,n){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(n.call(this,t)),t.currentFillStyle=i)},n.prototype.updateStrokeStyle=function(t,n){var i=t.strokeStyle,r=t.lineCap,e=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,u=t.lineWidth,a=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||e!=t.currentLineDash&&!x(t.currentLineDash,e)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=u||t.currentMiterLimit!=a)&&(void 0!==i&&n.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=e,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=u,t.currentMiterLimit=a)},n.prototype.endGeometry=function(t){this.qf[2]=this.instructions.length,this.qf=null,this.Uf[2]=this.hitDetectionInstructions.length,this.Uf=null;var n=[rw.END_GEOMETRY,t];this.instructions.push(n),this.hitDetectionInstructions.push(n)},n.prototype.getBufferedMaxExtent=function(){if(!this.Bf&&(this.Bf=wn(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;mn(this.Bf,t,this.Bf)}return this.Bf},n}(tf),sw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uw=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o._u=null,o.Lt=null,o.Wf=void 0,o.Yf=void 0,o.Zf=void 0,o.$f=void 0,o.ou=void 0,o.Kf=void 0,o.Hf=void 0,o.su=void 0,o.Dr=void 0,o.uu=void 0,o.Uu=void 0,o.fu=void 0,o.Jf=void 0,o}return sw(n,t),n.prototype.drawPoint=function(t,n){if(this.Lt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([rw.DRAW_IMAGE,e,o,this.Lt,this.Yf*this.Wf,this.Zf*this.Wf,Math.ceil(this.$f*this.Wf),this.ou,this.Kf*this.Wf,this.Hf*this.Wf,this.su,this.Dr,[this.uu[0]*this.pixelRatio/this.Wf,this.uu[1]*this.pixelRatio/this.Wf],Math.ceil(this.Uu*this.Wf),this.fu,this.Jf]),this.hitDetectionInstructions.push([rw.DRAW_IMAGE,e,o,this._u,this.Yf,this.Zf,this.$f,this.ou,this.Kf,this.Hf,this.su,this.Dr,this.uu,this.Uu,this.fu,this.Jf]),this.endGeometry(n)}},n.prototype.drawMultiPoint=function(t,n){if(this.Lt){this.beginGeometry(t,n);var i=t.getFlatCoordinates(),r=t.getStride(),e=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([rw.DRAW_IMAGE,e,o,this.Lt,this.Yf*this.Wf,this.Zf*this.Wf,Math.ceil(this.$f*this.Wf),this.ou,this.Kf*this.Wf,this.Hf*this.Wf,this.su,this.Dr,[this.uu[0]*this.pixelRatio/this.Wf,this.uu[1]*this.pixelRatio/this.Wf],Math.ceil(this.Uu*this.Wf),this.fu,this.Jf]),this.hitDetectionInstructions.push([rw.DRAW_IMAGE,e,o,this._u,this.Yf,this.Zf,this.$f,this.ou,this.Kf,this.Hf,this.su,this.Dr,this.uu,this.Uu,this.fu,this.Jf]),this.endGeometry(n)}},n.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.Yf=void 0,this.Zf=void 0,this._u=null,this.Lt=null,this.Wf=void 0,this.$f=void 0,this.uu=void 0,this.ou=void 0,this.Kf=void 0,this.Hf=void 0,this.su=void 0,this.Dr=void 0,this.Uu=void 0,t.prototype.finish.call(this)},n.prototype.setImageStyle=function(t,n){var i=t.getAnchor(),r=t.getSize(),e=t.getOrigin();this.Wf=t.getPixelRatio(this.pixelRatio),this.Yf=i[0],this.Zf=i[1],this._u=t.getHitDetectionImage(),this.Lt=t.getImage(this.pixelRatio),this.$f=r[1],this.ou=t.getOpacity(),this.Kf=e[0],this.Hf=e[1],this.su=t.getRotateWithView(),this.Dr=t.getRotation(),this.uu=t.getScaleArray(),this.Uu=r[0],this.fu=t.getDeclutterMode(),this.Jf=n},n}(ow),aw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hw=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e)||this}return aw(n,t),n.prototype.Qf=function(t,n,i,r){var e=this.coordinates.length,o=this.appendFlatLineCoordinates(t,n,i,r,!1,!1),s=[rw.MOVE_TO_LINE_TO,e,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},n.prototype.drawLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([rw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Ps,0],nw);var o=t.getFlatCoordinates(),s=t.getStride();this.Qf(o,0,o.length,s),this.hitDetectionInstructions.push(tw),this.endGeometry(n)}},n.prototype.drawMultiLineString=function(t,n){var i=this.state,r=i.strokeStyle,e=i.lineWidth;if(void 0!==r&&void 0!==e){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,n),this.hitDetectionInstructions.push([rw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],nw);for(var o=t.getEnds(),s=t.getFlatCoordinates(),u=t.getStride(),a=0,h=0,f=o.length;h<f;++h)a=this.Qf(s,a,o[h],u);this.hitDetectionInstructions.push(tw),this.endGeometry(n)}},n.prototype.finish=function(){var n=this.state;return null!=n.lastStroke&&n.lastStroke!=this.coordinates.length&&this.instructions.push(tw),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},n.prototype.applyStroke=function(n){null!=n.lastStroke&&n.lastStroke!=this.coordinates.length&&(this.instructions.push(tw),n.lastStroke=this.coordinates.length),n.lastStroke=0,t.prototype.applyStroke.call(this,n),this.instructions.push(nw)},n}(ow),fw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cw=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e)||this}return fw(n,t),n.prototype.tc=function(t,n,i,r){var e=this.state,o=void 0!==e.fillStyle,s=void 0!==e.strokeStyle,u=i.length;this.instructions.push(nw),this.hitDetectionInstructions.push(nw);for(var a=0;a<u;++a){var h=i[a],f=this.coordinates.length,c=this.appendFlatLineCoordinates(t,n,h,r,!0,!s),l=[rw.MOVE_TO_LINE_TO,f,c];this.instructions.push(l),this.hitDetectionInstructions.push(l),s&&(this.instructions.push(iw),this.hitDetectionInstructions.push(iw)),n=h}return o&&(this.instructions.push(Qm),this.hitDetectionInstructions.push(Qm)),s&&(this.instructions.push(tw),this.hitDetectionInstructions.push(tw)),n},n.prototype.drawCircle=function(t,n){var i=this.state,r=i.fillStyle,e=i.strokeStyle;if(void 0!==r||void 0!==e){this.ic(),this.beginGeometry(t,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([rw.SET_FILL_STYLE,Ts]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([rw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),u=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var a=[rw.CIRCLE,u];this.instructions.push(nw,a),this.hitDetectionInstructions.push(nw,a),void 0!==i.fillStyle&&(this.instructions.push(Qm),this.hitDetectionInstructions.push(Qm)),void 0!==i.strokeStyle&&(this.instructions.push(tw),this.hitDetectionInstructions.push(tw)),this.endGeometry(n)}},n.prototype.drawPolygon=function(t,n){var i=this.state,r=i.fillStyle,e=i.strokeStyle;if(void 0!==r||void 0!==e){this.ic(),this.beginGeometry(t,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([rw.SET_FILL_STYLE,Ts]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([rw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),u=t.getStride();this.tc(s,0,o,u),this.endGeometry(n)}},n.prototype.drawMultiPolygon=function(t,n){var i=this.state,r=i.fillStyle,e=i.strokeStyle;if(void 0!==r||void 0!==e){this.ic(),this.beginGeometry(t,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([rw.SET_FILL_STYLE,Ts]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([rw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),u=t.getStride(),a=0,h=0,f=o.length;h<f;++h)a=this.tc(s,a,o[h],u);this.endGeometry(n)}},n.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var n=this.tolerance;if(0!==n)for(var i=this.coordinates,r=0,e=i.length;r<e;++r)i[r]=ce(i[r],n);return t.prototype.finish.call(this)},n.prototype.ic=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},n}(ow);function lw(t,n,i,r,e){var o,s,u,a,h,f,c,l,v,d=i,p=i,y=0,m=0,w=i;for(o=i;o<r;o+=e){var g=n[o],b=n[o+1];void 0!==a&&(l=g-a,v=b-h,u=Math.sqrt(l*l+v*v),void 0!==f&&(m+=s,Math.acos((f*l+c*v)/(s*u))>t&&(m>y&&(y=m,d=w,p=o),m=0,w=o-e)),s=u,f=l,c=v),a=g,h=b}return(m+=u)>y?[w,o]:[d,p]}var vw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),dw={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},pw=function(t){function n(n,i,r,e){var o=t.call(this,n,i,r,e)||this;return o.rc=null,o.eo="",o.oo=0,o.so=0,o.uo=void 0,o.ao=0,o.fo=null,o.fillStates={},o.co=null,o.strokeStates={},o.lo={},o.textStates={},o.ec="",o.oc="",o.sc="",o.Jf=void 0,o}return vw(n,t),n.prototype.finish=function(){var n=t.prototype.finish.call(this);return n.textStates=this.textStates,n.fillStates=this.fillStates,n.strokeStates=this.strokeStates,n},n.prototype.drawText=function(t,n){var i=this.fo,r=this.co,e=this.lo;if(""!==this.eo&&e&&(i||r)){var o=this.coordinates,s=o.length,u=t.getType(),a=null,h=t.getStride();if(e.placement!==jv||"LineString"!=u&&"MultiLineString"!=u&&"Polygon"!=u&&"MultiPolygon"!=u){var f=e.overflow?null:[];switch(u){case"Point":case"MultiPoint":a=t.getFlatCoordinates();break;case"LineString":a=t.getFlatMidpoint();break;case"Circle":a=t.getCenter();break;case"MultiLineString":a=t.getFlatMidpoints(),h=2;break;case"Polygon":a=t.getFlatInteriorPoint(),e.overflow||f.push(a[2]/this.resolution),h=3;break;case"MultiPolygon":var c=t.getFlatInteriorPoints();a=[];for(M=0,_=c.length;M<_;M+=3)e.overflow||f.push(c[M+2]/this.resolution),a.push(c[M],c[M+1]);if(0===a.length)return;h=2}if((P=this.appendFlatPointCoordinates(a,h))===s)return;if(f&&(P-s)/2!=a.length/h){var l=s/2;f=f.filter((function(t,n){var i=o[2*(l+n)]===a[n*h]&&o[2*(l+n)+1]===a[n*h+1];return i||--l,i}))}this.uc(),(e.backgroundFill||e.backgroundStroke)&&(this.setFillStrokeStyle(e.backgroundFill,e.backgroundStroke),e.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),e.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,n);var v=e.padding;if(v!=zs&&(e.scale[0]<0||e.scale[1]<0)){var d=e.padding[0],p=e.padding[1],y=e.padding[2],m=e.padding[3];e.scale[0]<0&&(p=-p,m=-m),e.scale[1]<0&&(d=-d,y=-y),v=[d,p,y,m]}var w=this.pixelRatio;this.instructions.push([rw.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.uo,this.ao,[1,1],NaN,void 0,this.Jf,v==zs?zs:v.map((function(t){return t*w})),!!e.backgroundFill,!!e.backgroundStroke,this.eo,this.ec,this.sc,this.oc,this.oo,this.so,f]);var g=1/w;this.hitDetectionInstructions.push([rw.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.uo,this.ao,[g,g],NaN,void 0,this.Jf,v,!!e.backgroundFill,!!e.backgroundStroke,this.eo,this.ec,this.sc,this.oc,this.oo,this.so,f]),this.endGeometry(n)}else{if(!Kn(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(a=t.getFlatCoordinates(),"LineString"==u)b=[a.length];else if("MultiLineString"==u)b=t.getEnds();else if("Polygon"==u)b=t.getEnds().slice(0,1);else if("MultiPolygon"==u){var x=t.getEndss();b=[];for(var M=0,_=x.length;M<_;++M)b.push(x[M][0])}this.beginGeometry(t,n);for(var S=e.textAlign,O=0,j=void 0,E=0,T=b.length;E<T;++E){if(null==S){var A=lw(e.maxAngle,a,O,b[E],h);O=A[0],j=A[1]}else j=b[E];for(var M=O;M<j;M+=h)o.push(a[M],a[M+1]);var P=o.length;O=b[E],this.ac(s,P),s=P}this.endGeometry(n)}}},n.prototype.uc=function(){var t=this.co,n=this.lo,i=this.fo,r=this.sc;t&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var e=this.ec;e in this.textStates||(this.textStates[e]={font:n.font,textAlign:n.textAlign||Ns,justify:n.justify,textBaseline:n.textBaseline||Ls,scale:n.scale});var o=this.oc;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},n.prototype.ac=function(t,n){var i=this.co,r=this.lo,e=this.sc,o=this.ec,s=this.oc;this.uc();var u=this.pixelRatio,a=dw[r.textBaseline],h=this.so*u,f=this.eo,c=i?i.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([rw.DRAW_CHARS,t,n,a,r.overflow,s,r.maxAngle,u,h,e,c*u,f,o,1]),this.hitDetectionInstructions.push([rw.DRAW_CHARS,t,n,a,r.overflow,s,r.maxAngle,1,h,e,c,f,o,1/u])},n.prototype.setTextStyle=function(t,n){var i,r,e;if(t){var s=t.getFill();s?((r=this.fo)||(r={},this.fo=r),r.fillStyle=Uh(s.getColor()||Ts)):(r=null,this.fo=r);var u=t.getStroke();if(u){(e=this.co)||(e={},this.co=e);var a=u.getLineDash(),h=u.getLineDashOffset(),f=u.getWidth(),c=u.getMiterLimit();e.lineCap=u.getLineCap()||As,e.lineDash=a?a.slice():Ps,e.lineDashOffset=void 0===h?0:h,e.lineJoin=u.getLineJoin()||Cs,e.lineWidth=void 0===f?1:f,e.miterLimit=void 0===c?ks:c,e.strokeStyle=Uh(u.getColor()||Is)}else e=null,this.co=e;i=this.lo;var l=t.getFont()||Es;Bs(l);var v=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||Ls,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||zs,i.scale=void 0===v?[1,1]:v;var d=t.getOffsetX(),p=t.getOffsetY(),y=t.getRotateWithView(),m=t.getRotation();this.eo=t.getText()||"",this.oo=void 0===d?0:d,this.so=void 0===p?0:p,this.uo=void 0!==y&&y,this.ao=void 0===m?0:m,this.sc=e?("string"==typeof e.strokeStyle?e.strokeStyle:o(e.strokeStyle))+e.lineCap+e.lineDashOffset+"|"+e.lineWidth+e.lineJoin+e.miterLimit+"["+e.lineDash.join()+"]":"",this.ec=i.font+i.scale+(i.textAlign||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.oc=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+o(r.fillStyle):""}else this.eo="";this.Jf=n},n}(ow),yw={Circle:cw,Default:ow,Image:uw,LineString:hw,Polygon:cw,Text:pw},mw=function(){function t(t,n,i,r){this.hc=t,this.fc=n,this.kt=r,this.cc=i,this.lc={}}return t.prototype.finish=function(){var t={};for(var n in this.lc){t[n]=t[n]||{};var i=this.lc[n];for(var r in i){var e=i[r].finish();t[n][r]=e}}return t},t.prototype.getBuilder=function(t,n){var i=void 0!==t?t.toString():"0",r=this.lc[i];void 0===r&&(r={},this.lc[i]=r);var e=r[n];void 0===e&&(e=new(0,yw[n])(this.hc,this.fc,this.cc,this.kt),r[n]=e);return e},t}();function ww(t,n,i,r,e,o,s,u,a,h,f,c){var l=t[n],v=t[n+1],d=0,p=0,y=0,m=0;function w(){d=l,p=v,l=t[n+=r],v=t[n+1],m+=y,y=Math.sqrt((l-d)*(l-d)+(v-p)*(v-p))}do{w()}while(n<i-r&&m+y<o);for(var g=0===y?0:(o-m)/y,b=di(d,l,g),x=di(p,v,g),M=n-r,_=m,S=o+u*a(h,e,f);n<i-r&&m+y<S;)w();var O,j=di(d,l,g=0===y?0:(S-m)/y),E=di(p,v,g);if(c){var T=[b,x,j,E];qr(T,0,4,2,c,T,T),O=T[0]>T[2]}else O=b>j;var A,P=Math.PI,C=[],k=M+r===n;if(y=0,m=_,l=t[n=M],v=t[n+1],k){w(),A=Math.atan2(v-p,l-d),O&&(A+=A>0?-P:P);var I=(j+b)/2,N=(E+x)/2;return C[0]=[I,N,(S-o)/2,A,e],C}for(var L=0,z=(e=e.replace(/\n/g," ")).length;L<z;){w();var R=Math.atan2(v-p,l-d);if(O&&(R+=R>0?-P:P),void 0!==A){var F=R-A;if(F+=F>P?-2*P:F<-P?2*P:0,Math.abs(F)>s)return null}A=R;for(var G=L,D=0;L<z;++L){var q=u*a(h,e[O?z-L-1:L],f);if(n+r<i&&m+y<o+D+q/2)break;D+=q}if(L!==G){var U=O?e.substring(z-G,z-L):e.substring(G,L);I=di(d,l,g=0===y?0:(o+D/2-m)/y),N=di(p,v,g);C.push([I,N,D/2,R,U]),o+=D}}return C}function gw(t,n,i,r){for(var e=t[n],o=t[n+1],s=0,u=n+r;u<i;u+=r){var a=t[u],h=t[u+1];s+=Math.sqrt((a-e)*(a-e)+(h-o)*(h-o)),e=a,o=h}return s}var bw=[1/0,1/0,-1/0,-1/0],xw=[],Mw=[],_w=[],Sw=[];function Ow(t){return t[3].declutterBox}var jw=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Ew(t,n){return"start"!==n&&"end"!==n||jw.test(t)||(n="start"===n?"left":"right"),dw[n]}function Tw(t,n,i){return i>0&&t.push("\n",""),t.push(n,""),t}var Aw=function(){function t(t,n,i,r){this.overlaps=i,this.pixelRatio=n,this.resolution=t,this.vc,this.instructions=r.instructions,this.coordinates=r.coordinates,this.dc={},this.yc=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.vo=null,this.Ge=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.mc={},this.rc={}}return t.prototype.createLabel=function(t,n,i,r){var e=t+n+i+r;if(this.rc[e])return this.rc[e];var o=r?this.strokeStates[r]:null,s=i?this.fillStates[i]:null,u=this.textStates[n],a=this.pixelRatio,h=[u.scale[0]*a,u.scale[1]*a],f=Array.isArray(t),c=u.justify?dw[u.justify]:Ew(Array.isArray(t)?t[0]:t,u.textAlign||Ns),l=r&&o.lineWidth?o.lineWidth:0,v=f?t:t.split("\n").reduce(Tw,[]),d=Zs(u,v),p=d.width,y=d.height,m=d.widths,w=d.heights,g=d.lineWidths,b=p+l,x=[],M=(b+2)*h[0],_=(y+l)*h[1],S={width:M<0?Math.floor(M):Math.ceil(M),height:_<0?Math.floor(_):Math.ceil(_),contextInstructions:x};(1==h[0]&&1==h[1]||x.push("scale",h),r)&&(x.push("strokeStyle",o.strokeStyle),x.push("lineWidth",l),x.push("lineCap",o.lineCap),x.push("lineJoin",o.lineJoin),x.push("miterLimit",o.miterLimit),(Vt?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(x.push("setLineDash",[o.lineDash]),x.push("lineDashOffset",o.lineDashOffset)));i&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var O,j=.5-c,E=c*b+j*l,T=[],A=[],P=0,C=0,k=0,I=0,N=0,L=v.length;N<L;N+=2){var z=v[N];if("\n"!==z){var R=v[N+1]||u.font;R!==O&&(r&&T.push("font",R),i&&A.push("font",R),O=R),P=Math.max(P,w[k]);var F=[z,E+j*m[k]+c*(m[k]-g[I]),.5*(l+P)+C];E+=m[k],r&&T.push("strokeText",F),i&&A.push("fillText",F),++k}else C+=P,P=0,E=c*b+j*l,++I}return Array.prototype.push.apply(x,T),Array.prototype.push.apply(x,A),this.rc[e]=S,S},t.prototype.wc=function(t,n,i,r,e,o,s){t.beginPath(),t.moveTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,e),t.lineTo.apply(t,n),o&&(this.vc=o[2],this.lu(t)),s&&(this.gc(t,s),t.stroke())},t.prototype.bc=function(t,n,i,r,e,o,s,u,a,h,f,c,l,v,d,p){var y,m=i-(s*=c[0]),w=r-(u*=c[1]),g=e+a>t?t-a:e,b=o+h>n?n-h:o,x=v[3]+g*c[0]+v[1],M=v[0]+b*c[1]+v[2],_=m-v[3],S=w-v[0];return(d||0!==f)&&(xw[0]=_,Sw[0]=_,xw[1]=S,Mw[1]=S,Mw[0]=_+x,_w[0]=Mw[0],_w[1]=S+M,Sw[1]=_w[1]),0!==f?(tn(y=sn([1,0,0,1,0,0],i,r,1,1,f,-i,-r),xw),tn(y,Mw),tn(y,_w),tn(y,Sw),On(Math.min(xw[0],Mw[0],_w[0],Sw[0]),Math.min(xw[1],Mw[1],_w[1],Sw[1]),Math.max(xw[0],Mw[0],_w[0],Sw[0]),Math.max(xw[1],Mw[1],_w[1],Sw[1]),bw)):On(Math.min(_,_+x),Math.min(S,S+M),Math.max(_,_+x),Math.max(S,S+M),bw),l&&(m=Math.round(m),w=Math.round(w)),{drawImageX:m,drawImageY:w,drawImageW:g,drawImageH:b,originX:a,originY:h,declutterBox:{minX:bw[0],minY:bw[1],maxX:bw[2],maxY:bw[3],value:p},canvasTransform:y,scale:c}},t.prototype.xc=function(t,n,i,r,e,o,s){var u=!(!o&&!s),a=r.declutterBox,h=t.canvas,f=s?s[2]*r.scale[0]/2:0;return a.minX-f<=h.width/n&&a.maxX+f>=0&&a.minY-f<=h.height/n&&a.maxY+f>=0&&(u&&this.wc(t,xw,Mw,_w,Sw,o,s),$s(t,r.canvasTransform,e,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.lu=function(t){if(this.vc){var n=tn(this.yc,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),t.rotate(this.Ge)}t.fill(),this.vc&&t.restore()},t.prototype.gc=function(t,n){t.strokeStyle=n[1],t.lineWidth=n[2],t.lineCap=n[3],t.lineJoin=n[4],t.miterLimit=n[5],t.setLineDash&&(t.lineDashOffset=n[7],t.setLineDash(n[6]))},t.prototype.Mc=function(t,n,i,r){var e=this.textStates[n],o=this.createLabel(t,n,r,i),s=this.strokeStates[i],u=this.pixelRatio,a=Ew(Array.isArray(t)?t[0]:t,e.textAlign||Ns),h=dw[e.textBaseline||Ls],f=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:a*(o.width/u-2*e.scale[0])+2*(.5-a)*f,anchorY:h*o.height/u+2*(.5-h)*f}},t.prototype._c=function(t,n,i,r,e,o,s,u){var a;this.vo&&x(i,this.yc)?a=this.vo:(this.vo||(this.vo=[]),a=Dr(this.coordinates,0,this.coordinates.length,2,i,this.vo),Qt(this.yc,i));for(var h,f,c,l,v,d,p,y,m,w,g,b,M,_,S,O,j=0,E=r.length,T=0,A=0,P=0,C=null,k=null,I=this.dc,N=this.Ge,L=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,z={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:N},R=this.instructions!=r||this.overlaps?0:200;j<E;){var F=r[j];switch(F[0]){case rw.BEGIN_GEOMETRY:M=F[1],O=F[3],M.getGeometry()?void 0===s||Kn(s,O.getExtent())?++j:j=F[2]+1:j=F[2];break;case rw.BEGIN_PATH:A>R&&(this.lu(t),A=0),P>R&&(t.stroke(),P=0),A||P||(t.beginPath(),l=NaN,v=NaN),++j;break;case rw.CIRCLE:var G=a[T=F[1]],D=a[T+1],q=a[T+2]-G,U=a[T+3]-D,B=Math.sqrt(q*q+U*U);t.moveTo(G+B,D),t.arc(G,D,B,0,2*Math.PI,!0),++j;break;case rw.CLOSE_PATH:t.closePath(),++j;break;case rw.CUSTOM:T=F[1],h=F[2];var X=F[3],V=F[4],W=6==F.length?F[5]:void 0;z.geometry=X,z.feature=M,j in I||(I[j]=[]);var Y=I[j];W?W(a,T,h,2,Y):(Y[0]=a[T],Y[1]=a[T+1],Y.length=2),V(Y,z),++j;break;case rw.DRAW_IMAGE:T=F[1],h=F[2],y=F[3],f=F[4],c=F[5];var Z=F[6],$=F[7],K=F[8],H=F[9],J=F[10],Q=F[11],tt=F[12],nt=F[13],it=F[14],rt=F[15];if(!y&&F.length>=20){m=F[19],w=F[20],g=F[21],b=F[22];var et=this.Mc(m,w,g,b);y=et.label,F[3]=y;var ot=F[23];f=(et.anchorX-ot)*this.pixelRatio,F[4]=f;var st=F[24];c=(et.anchorY-st)*this.pixelRatio,F[5]=c,Z=y.height,F[6]=Z,nt=y.width,F[13]=nt}var ut=void 0;F.length>25&&(ut=F[25]);var at=void 0,ht=void 0,ft=void 0;F.length>17?(at=F[16],ht=F[17],ft=F[18]):(at=zs,ht=!1,ft=!1),J&&L?Q+=N:J||L||(Q-=N);for(var ct=0;T<h;T+=2)if(!(ut&&ut[ct++]<nt/this.pixelRatio)){var lt=[t,n,y,Gt=this.bc(y.width,y.height,a[T],a[T+1],nt,Z,f,c,K,H,Q,tt,e,at,ht||ft,M),$,ht?C:null,ft?k:null];if(u){if("none"===it)continue;if("obstacle"===it){u.insert(Gt.declutterBox);continue}var vt=void 0,dt=void 0;if(rt){var pt=h-T;if(!rt[pt]){rt[pt]=lt;continue}if(vt=rt[pt],delete rt[pt],dt=Ow(vt),u.collides(dt))continue}if(u.collides(Gt.declutterBox))continue;vt&&(u.insert(dt),this.xc.apply(this,vt)),u.insert(Gt.declutterBox)}this.xc.apply(this,lt)}++j;break;case rw.DRAW_CHARS:var yt=F[1],mt=F[2],wt=F[3],gt=F[4];b=F[5];var bt=F[6],xt=F[7],Mt=F[8];g=F[9];var _t=F[10];m=F[11],w=F[12];var St=[F[13],F[13]],Ot=this.textStates[w],jt=Ot.font,Et=[Ot.scale[0]*xt,Ot.scale[1]*xt],Tt=void 0;jt in this.mc?Tt=this.mc[jt]:(Tt={},this.mc[jt]=Tt);var At=gw(a,yt,mt,2),Pt=Math.abs(Et[0])*Ys(jt,m,Tt);if(gt||Pt<=At){var Ct=this.textStates[w].textAlign,kt=ww(a,yt,mt,2,m,(At-Pt)*dw[Ct],bt,Math.abs(Et[0]),Ys,jt,Tt,L?0:this.Ge);t:if(kt){var It=[],Nt=void 0,Lt=void 0,zt=void 0,Rt=void 0,Ft=void 0;if(g)for(Nt=0,Lt=kt.length;Nt<Lt;++Nt){zt=(Ft=kt[Nt])[4],Rt=this.createLabel(zt,w,"",g),f=Ft[2]+(Et[0]<0?-_t:_t),c=wt*Rt.height+2*(.5-wt)*_t*Et[1]/Et[0]-Mt;var Gt=this.bc(Rt.width,Rt.height,Ft[0],Ft[1],Rt.width,Rt.height,f,c,0,0,Ft[3],St,!1,zs,!1,M);if(u&&u.collides(Gt.declutterBox))break t;It.push([t,n,Rt,Gt,1,null,null])}if(b)for(Nt=0,Lt=kt.length;Nt<Lt;++Nt){zt=(Ft=kt[Nt])[4],Rt=this.createLabel(zt,w,b,""),f=Ft[2],c=wt*Rt.height-Mt;Gt=this.bc(Rt.width,Rt.height,Ft[0],Ft[1],Rt.width,Rt.height,f,c,0,0,Ft[3],St,!1,zs,!1,M);if(u&&u.collides(Gt.declutterBox))break t;It.push([t,n,Rt,Gt,1,null,null])}u&&u.load(It.map(Ow));for(var Dt=0,qt=It.length;Dt<qt;++Dt)this.xc.apply(this,It[Dt])}}++j;break;case rw.END_GEOMETRY:if(void 0!==o){var Ut=o(M=F[1],O);if(Ut)return Ut}++j;break;case rw.FILL:R?A++:this.lu(t),++j;break;case rw.MOVE_TO_LINE_TO:for(T=F[1],h=F[2],_=a[T],p=(S=a[T+1])+.5|0,(d=_+.5|0)===l&&p===v||(t.moveTo(_,S),l=d,v=p),T+=2;T<h;T+=2)d=(_=a[T])+.5|0,p=(S=a[T+1])+.5|0,T!=h-2&&d===l&&p===v||(t.lineTo(_,S),l=d,v=p);++j;break;case rw.SET_FILL_STYLE:C=F,this.vc=F[2],A&&(this.lu(t),A=0,P&&(t.stroke(),P=0)),t.fillStyle=F[1],++j;break;case rw.SET_STROKE_STYLE:k=F,P&&(t.stroke(),P=0),this.gc(t,F),++j;break;case rw.STROKE:R?P++:t.stroke(),++j;break;default:++j}}A&&this.lu(t),P&&t.stroke()},t.prototype.execute=function(t,n,i,r,e,o){this.Ge=r,this._c(t,n,i,this.instructions,e,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,n,i,r,e){return this.Ge=i,this._c(t,1,n,this.hitDetectionInstructions,!0,r,e)},t}(),Pw=["Polygon","Circle","LineString","Image","Text","Default"],Cw=function(){function t(t,n,i,r,e,o){this.fc=t,this.za=r,this.kt=i,this.cc=n,this.df=o,this.Sc={},this.Oc=null,this.jc=[1,0,0,1,0,0],this.Ec(e)}return t.prototype.clip=function(t,n){var i=this.getClipCoords(n);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.Ec=function(t){for(var n in t){var i=this.Sc[n];void 0===i&&(i={},this.Sc[n]=i);var r=t[n];for(var e in r){var o=r[e];i[e]=new Aw(this.cc,this.kt,this.za,o)}}},t.prototype.hasExecutors=function(t){for(var n in this.Sc)for(var i=this.Sc[n],r=0,e=t.length;r<e;++r)if(t[r]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e,o){var s=2*(r=Math.round(r))+1,u=sn(this.jc,r+.5,r+.5,1/n,-1/n,-i,-t[0],-t[1]),a=!this.Oc;a&&(this.Oc=_o(s,s));var h,f=this.Oc;f.canvas.width!==s||f.canvas.height!==s?(f.canvas.width=s,f.canvas.height=s):a||f.clearRect(0,0,s,s),void 0!==this.df&&(kn(h=[1/0,1/0,-1/0,-1/0],t),mn(h,n*(this.df+r),h));var c,l=Iw(r);function v(t,n){for(var i=f.getImageData(0,0,s,s).data,u=0,a=l.length;u<a;u++)if(i[l[u]]>0){if(!o||"Image"!==c&&"Text"!==c||-1!==o.indexOf(t)){var h=(l[u]-3)/4,v=r-h%s,d=r-(h/s|0),p=e(t,n,v*v+d*d);if(p)return p}f.clearRect(0,0,s,s);break}}var d,y,m,w,g,b=Object.keys(this.Sc).map(Number);for(b.sort(p),d=b.length-1;d>=0;--d){var x=b[d].toString();for(m=this.Sc[x],y=Pw.length-1;y>=0;--y)if(void 0!==(w=m[c=Pw[y]])&&(g=w.executeHitDetection(f,u,i,v,h)))return g}},t.prototype.getClipCoords=function(t){var n=this.fc;if(!n)return null;var i=n[0],r=n[1],e=n[2],o=n[3],s=[i,r,i,o,e,o,e,r];return Dr(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return k(this.Sc)},t.prototype.execute=function(t,n,i,r,e,o,s){var u=Object.keys(this.Sc).map(Number);u.sort(p),this.fc&&(t.save(),this.clip(t,i));var a,h,f,c,l,v,d=o||Pw;for(s&&u.reverse(),a=0,h=u.length;a<h;++a){var y=u[a].toString();for(l=this.Sc[y],f=0,c=d.length;f<c;++f){void 0!==(v=l[d[f]])&&v.execute(t,n,i,r,e,s)}}this.fc&&t.restore()},t}(),kw={};function Iw(t){if(void 0!==kw[t])return kw[t];for(var n=2*t+1,i=t*t,r=new Array(i+1),e=0;e<=t;++e)for(var o=0;o<=t;++o){var s=e*e+o*o;if(s>i)break;var u=r[s];u||(u=[],r[s]=u),u.push(4*((t+e)*n+(t+o))+3),e>0&&u.push(4*((t-e)*n+(t+o))+3),o>0&&(u.push(4*((t+e)*n+(t-o))+3),e>0&&u.push(4*((t-e)*n+(t-o))+3))}for(var a=[],h=(e=0,r.length);e<h;++e)r[e]&&a.push.apply(a,r[e]);return kw[t]=a,a}var Nw=Cw,Lw=.5;function zw(t,n,i,r,e,o,s){var u=_o(t[0]*Lw,t[1]*Lw);u.imageSmoothingEnabled=!1;for(var a=u.canvas,h=new rf(u,Lw,e,null,s),f=i.length,c=Math.floor(16777215/f),l={},v=1;v<=f;++v){var d=i[v-1],y=d.getStyleFunction()||r;if(r){var m=y(d,o);if(m){Array.isArray(m)||(m=[m]);for(var w="#"+("000000"+(v*c).toString(16)).slice(-6),g=0,b=m.length;g<b;++g){var x=m[g],M=x.getGeometryFunction()(d);if(M&&Kn(e,M.getExtent())){var _=x.clone(),S=_.getFill();S&&S.setColor(w);var O=_.getStroke();O&&(O.setColor(w),O.setLineDash(null)),_.setText(void 0);var j=x.getImage();if(j&&0!==j.getOpacity()){var E=j.getImageSize();if(!E)continue;var T=_o(E[0],E[1],void 0,{alpha:!1}),A=T.canvas;T.fillStyle=w,T.fillRect(0,0,A.width,A.height),_.setImage(new yv({img:A,imgSize:E,anchor:j.getAnchor(),anchorXUnits:ov,anchorYUnits:ov,offset:j.getOrigin(),opacity:1,size:j.getSize(),scale:j.getScale(),rotation:j.getRotation(),rotateWithView:j.getRotateWithView()}))}var P=_.getZIndex()||0;(I=l[P])||(I={},l[P]=I,I.Polygon=[],I.Circle=[],I.LineString=[],I.Point=[]),I[M.getType().replace("Multi","")].push(M,_)}}}}}for(var C=Object.keys(l).map(Number).sort(p),k=(v=0,C.length);v<k;++v){var I=l[C[v]];for(var N in I){var L=I[N];for(g=0,b=L.length;g<b;g+=2){h.setStyle(L[g+1]);for(var z=0,R=n.length;z<R;++z)h.setTransform(n[z]),h.drawGeometry(L[g])}}}return u.getImageData(0,0,a.width,a.height)}function Rw(t,n,i){var r=[];if(i){var e=Math.floor(Math.round(t[0])*Lw),o=Math.floor(Math.round(t[1])*Lw),s=4*(oi(e,0,i.width-1)+oi(o,0,i.height-1)*i.width),u=i.data[s],a=i.data[s+1],h=i.data[s+2]+256*(a+256*u),f=Math.floor(16777215/n.length);h&&h%f==0&&r.push(n[h/f-1])}return r}var Fw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Gw=function(t){function n(n){var i=t.call(this,n)||this;return i.Tc=i.Ac.bind(i),i.Pc,i.Cc=null,i.kc=null,i._h=-1,i.Ic=NaN,i.zh=[1/0,1/0,-1/0,-1/0],i.Nc=[1/0,1/0,-1/0,-1/0],i.Lc,i.zc=null,i.Rc=null,i.Fc=null,i.Gc=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i.Dc=null,i.ou=1,i}return Fw(n,t),n.prototype.renderWorlds=function(t,n,i){var r=n.extent,e=n.viewState,o=e.center,s=e.resolution,u=e.projection,a=e.rotation,h=u.getExtent(),f=this.getLayer().getSource(),c=n.pixelRatio,l=n.viewHints,v=!(l[Eu]||l[Tu]),d=this.Dc,p=Math.round(n.size[0]*c),y=Math.round(n.size[1]*c),m=f.getWrapX()&&u.canWrapX(),w=m?$n(h):null,g=m?Math.ceil((r[2]-h[2])/w)+1:1,b=m?Math.floor((r[0]-h[0])/w):0;do{var x=this.getRenderTransform(o,s,a,c,p,y,b*w);t.execute(d,1,x,a,v,void 0,i)}while(++b<g)},n.prototype.qc=function(){if(1!==this.ou){var t=_o(this.context.canvas.width,this.context.canvas.height,Hy);this.Dc=t}else this.Dc=this.context},n.prototype.Uc=function(){if(1!==this.ou){var t=this.context.globalAlpha;this.context.globalAlpha=this.ou,this.context.drawImage(this.Dc.canvas,0,0),this.context.globalAlpha=t,So(this.Dc),Hy.push(this.Dc.canvas),this.Dc=null}},n.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.qc(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.Uc())},n.prototype.renderFrame=function(t,n){var i=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];en(this.pixelTransform,1/i,1/i),un(this.inversePixelTransform,this.pixelTransform);var e=hn(this.pixelTransform);this.useContainer(n,e,this.getBackground(t));var o=this.context,s=o.canvas,u=this.Gc,a=this.declutterExecutorGroup;if((!u||u.isEmpty())&&(!a||a.isEmpty()))return null;var h=Math.round(t.size[0]*i),f=Math.round(t.size[1]*i);s.width!=h||s.height!=f?(s.width=h,s.height=f,s.style.transform!==e&&(s.style.transform=e)):this.containerReused||o.clearRect(0,0,h,f),this.preRender(o,t);var c=t.viewState,l=c.projection;this.ou=r.opacity,this.qc();var v=!1,d=!0;if(r.extent&&this.clipping){var p=Lr(r.extent,l);(v=(d=Kn(p,t.extent))&&!xn(p,t.extent))&&this.clipUnrotated(this.Dc,t,p)}return d&&this.renderWorlds(u,t),v&&this.Dc.restore(),this.Uc(),this.postRender(o,t),this.Lc!==c.rotation&&(this.Lc=c.rotation,this.Cc=null),this.container},n.prototype.getFeatures=function(t){return new Promise(function(n){if(!this.Cc&&!this.Pc){var i=[this.context.canvas.width,this.context.canvas.height];tn(this.pixelTransform,i);var r=this.zc,e=this.Ic,o=this.Lc,s=this.Rc,u=this.Nc,a=this.getLayer(),h=[],f=i[0]*Lw,c=i[1]*Lw;h.push(this.getRenderTransform(r,e,o,Lw,f,c,0).slice());var l=a.getSource(),v=s.getExtent();if(l.getWrapX()&&s.canWrapX()&&!xn(v,u)){for(var d=u[0],p=$n(v),y=0,m=void 0;d<v[0];)m=p*--y,h.push(this.getRenderTransform(r,e,o,Lw,f,c,m).slice()),d+=p;for(y=0,d=u[2];d>v[2];)m=p*++y,h.push(this.getRenderTransform(r,e,o,Lw,f,c,m).slice()),d-=p}this.Cc=zw(i,h,this.kc,a.getStyleFunction(),u,e,o)}n(Rw(t,this.kc,this.Cc))}.bind(this))},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){var s=this;if(this.Gc){var u,a=n.viewState.resolution,h=n.viewState.rotation,f=this.getLayer(),c={},l=function(t,n,i){var s=o(t),u=c[s];if(u){if(!0!==u&&i<u.distanceSq){if(0===i)return c[s]=!0,e.splice(e.lastIndexOf(u),1),r(t,f,n);u.geometry=n,u.distanceSq=i}}else{if(0===i)return c[s]=!0,r(t,f,n);e.push(c[s]={feature:t,layer:f,geometry:n,distanceSq:i,callback:r})}},v=[this.Gc];return this.declutterExecutorGroup&&v.push(this.declutterExecutorGroup),v.some((function(r){return u=r.forEachFeatureAtCoordinate(t,a,h,i,l,r===s.declutterExecutorGroup&&n.declutterTree?n.declutterTree.all().map((function(t){return t.value})):null)})),u}},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.Gc&&t.changed()},n.prototype.Ac=function(t){this.renderIfReadyAndVisible()},n.prototype.prepareFrame=function(t){var n=this.getLayer(),i=n.getSource();if(!i)return!1;var r=t.viewHints[Eu],e=t.viewHints[Tu],o=n.getUpdateWhileAnimating(),s=n.getUpdateWhileInteracting();if(this.ready&&!o&&r||!s&&e)return this.Pc=!0,!0;this.Pc=!1;var u=t.extent,a=t.viewState,h=a.projection,f=a.resolution,c=t.pixelRatio,l=n.getRevision(),v=n.getRenderBuffer(),d=n.getRenderOrder();void 0===d&&(d=of);var p=a.center.slice(),y=mn(u,v*f),m=y.slice(),w=[y.slice()],g=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!xn(g,t.extent)){var b=$n(g),M=Math.max($n(y)/2,b);y[0]=g[0]-M,y[2]=g[2]+M,rr(p,h);var _=ii(w[0],h);_[0]<g[0]&&_[2]<g[2]?w.push([_[0]+b,_[1],_[2]+b,_[3]]):_[0]>g[0]&&_[2]>g[2]&&w.push([_[0]-b,_[1],_[2]-b,_[3]])}if(this.ready&&this.Ic==f&&this._h==l&&this.Fc==d&&xn(this.Nc,y))return x(this.zh,m)||(this.Cc=null,this.zh=m),this.zc=p,this.replayGroupChanged=!1,!0;this.Gc=null;var S,O=new mw(uf(f,c),y,f,c);this.getLayer().getDeclutter()&&(S=new mw(uf(f,c),y,f,c));var j,E=Cr();if(E){for(var T=0,A=w.length;T<A;++T){var P=Nr(w[T],h);i.loadFeatures(P,zr(f,h),E)}j=Or(E,h)}else for(T=0,A=w.length;T<A;++T)i.loadFeatures(w[T],f,h);var C=sf(f,c),k=!0,I=function(t){var i,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(i=r(t,f)),i){var e=this.renderFeature(t,C,i,O,j,S);k=k&&!e}}.bind(this),N=Nr(y,h),L=i.getFeaturesInExtent(N);d&&L.sort(d);for(T=0,A=L.length;T<A;++T)I(L[T]);this.kc=L,this.ready=k;var z=O.finish(),R=new Nw(y,f,c,i.getOverlaps(),z,n.getRenderBuffer());return S&&(this.declutterExecutorGroup=new Nw(y,f,c,i.getOverlaps(),S.finish(),n.getRenderBuffer())),this.Ic=f,this._h=l,this.Fc=d,this.zh=m,this.Nc=y,this.zc=p,this.Rc=h,this.Gc=R,this.Cc=null,this.replayGroupChanged=!0,!0},n.prototype.renderFeature=function(t,n,i,r,e,o){if(!i)return!1;var s=!1;if(Array.isArray(i))for(var u=0,a=i.length;u<a;++u)s=af(r,t,i[u],n,this.Tc,e,o)||s;else s=af(r,t,i,n,this.Tc,e,o);return s},n}(tm),Dw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qw=function(t){function n(n){var i=t.call(this,n)||this;return i.Bc=new Gw(n),i.Xc=n.getImageRatio(),i.Vc=[1,0,0,1,0,0],i.Wc=null,i}return Dw(n,t),n.prototype.disposeInternal=function(){this.Bc.dispose(),t.prototype.disposeInternal.call(this)},n.prototype.getFeatures=function(t){if(!this.Bc)return new Promise((function(t){return t([])}));var n=tn(this.Vc,tn(this.Wc,t.slice()));return this.Bc.getFeatures(n)},n.prototype.handleFontsChanged=function(){this.Bc.handleFontsChanged()},n.prototype.prepareFrame=function(t){var n=t.pixelRatio,i=t.viewState,r=i.resolution,e=t.viewHints,o=this.Bc,s=t.extent;1!==this.Xc&&Qn(s=s.slice(0),this.Xc);var u=$n(s)/r,a=Vn(s)/r;if(!e[Eu]&&!e[Tu]&&!Hn(s)){o.useContainer(null,null);var h=o.context,f=t.layerStatesArray[t.layerIndex];h.globalAlpha=f.opacity;var c=A({},f,{opacity:1}),l=A({},t,{declutterTree:new Av(9),extent:s,size:[u,a],viewState:A({},t.viewState,{rotation:0}),layerStatesArray:[c],layerIndex:0}),v=!0,d=new Mo(s,r,n,h.canvas,(function(t){o.prepareFrame(l)&&o.replayGroupChanged&&(o.clipping=!1,o.renderFrame(l,null)&&(o.renderDeclutter(l),v=!1),t())}));d.addEventListener(L,function(){if(d.getState()===po){this.Lt=v?null:d;var t=d.getResolution(),r=d.getPixelRatio(),e=t*n/r;this.renderedResolution=e,this.Vc=sn(this.Vc,u/2,a/2,1/e,-1/e,0,-i.center[0],-i.center[1])}}.bind(this)),d.load()}return this.Lt&&(this.Wc=t.pixelToCoordinateTransform.slice()),!!this.Lt},n.prototype.preRender=function(){},n.prototype.postRender=function(){},n.prototype.renderDeclutter=function(){},n.prototype.forEachFeatureAtCoordinate=function(n,i,r,e,o){return this.Bc?this.Bc.forEachFeatureAtCoordinate(n,i,r,e,o):t.prototype.forEachFeatureAtCoordinate.call(this,n,i,r,e,o)},n}(im),Uw="image",Bw="hybrid",Xw="vector",Vw=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ww={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},Yw={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]},Zw=function(t){function n(n){var i=t.call(this,n)||this;return i.Tc=i.Ac.bind(i),i.Yc,i.Wc=null,i.Lc,i.Zc=[1,0,0,1,0,0],i}return Vw(n,t),n.prototype.prepareTile=function(t,n,i){var r,e=t.getState();return e!==vt&&e!==dt||(this.$c(t,n,i),this.Kc(t)&&(r=!0)),r},n.prototype.getTile=function(n,i,r,e){var o=e.pixelRatio,s=e.viewState,u=s.resolution,a=s.projection,h=this.getLayer(),f=h.getSource().getTile(n,i,r,o,a),c=e.viewHints,l=!(c[Eu]||c[Tu]);return!l&&f.wantedResolution||(f.wantedResolution=u),this.prepareTile(f,o,a)&&(l||Date.now()-e.time<8)&&h.getRenderMode()!==Xw&&this.Hc(f,e),t.prototype.getTile.call(this,n,i,r,e)},n.prototype.isDrawableTile=function(n){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,n)&&(i.getRenderMode()===Xw?o(i)in n.executorGroups:n.hasContext(i))},n.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},n.prototype.prepareFrame=function(n){var i=this.getLayer().getRevision();return this.Yc!==i&&(this.Yc=i,this.renderedTiles.length=0),t.prototype.prepareFrame.call(this,n)},n.prototype.$c=function(t,n,i){var r=this.getLayer(),e=r.getRevision(),s=r.getRenderOrder()||null,u=t.wantedResolution,a=t.getReplayState(r);if(a.dirty||a.renderedResolution!==u||a.renderedRevision!=e||a.renderedRenderOrder!=s){var h=r.getSource(),f=r.getDeclutter(),c=h.getTileGrid(),l=h.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),v=h.getSourceTiles(n,i,t),d=o(r);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],f&&(t.declutterExecutorGroups[d]=[]),a.dirty=!1;for(var p=function(i,e){var o=v[i];if(o.getState()!=vt)return"continue";var p=o.tileCoord,m=c.getTileCoordExtent(p),w=Wn(l,m),g=mn(w,r.getRenderBuffer()*u,y.tmpExtent),b=An(m,w)?null:g,x=new mw(0,g,u,n),M=f?new mw(0,w,u,n):void 0,_=sf(u,n),S=function(t){var n,i=t.getStyleFunction()||r.getStyleFunction();if(i&&(n=i(t,u)),n){var e=this.renderFeature(t,_,n,x,M);a.dirty=a.dirty||e}},O=o.getFeatures();s&&s!==a.renderedRenderOrder&&O.sort(s);for(var j=0,E=O.length;j<E;++j){var T=O[j];b&&!Kn(b,T.getGeometry().getExtent())||S.call(y,T)}var A=x.finish(),P=r.getRenderMode()!==Xw&&f&&1===v.length?null:w,C=new Nw(P,u,n,h.getOverlaps(),A,r.getRenderBuffer());if(t.executorGroups[d].push(C),M){var k=new Nw(null,u,n,h.getOverlaps(),M.finish(),r.getRenderBuffer());t.declutterExecutorGroups[d].push(k)}},y=this,m=0,w=v.length;m<w;++m)p(m);a.renderedRevision=e,a.renderedRenderOrder=s,a.renderedResolution=u}},n.prototype.forEachFeatureAtCoordinate=function(t,n,i,r,e){var s=n.viewState.resolution,u=n.viewState.rotation;i=null==i?0:i;var a=this.getLayer(),h=a.getSource().getTileGridForProjection(n.viewState.projection),f=yn([t]);mn(f,s*i,f);for(var c,l={},v=function(t,n,i){var s=t.getId();void 0===s&&(s=o(t));var u=l[s];if(u){if(!0!==u&&i<u.distanceSq){if(0===i)return l[s]=!0,e.splice(e.lastIndexOf(u),1),r(t,a,n);u.geometry=n,u.distanceSq=i}}else{if(0===i)return l[s]=!0,r(t,a,n);e.push(l[s]={feature:t,layer:a,geometry:n,distanceSq:i,callback:r})}},d=this.renderedTiles,p=function(r,e){var l=d[r];if(!Kn(h.getTileCoordExtent(l.wrappedTileCoord),f))return"continue";var p=o(a),y=[l.executorGroups[p]],m=l.declutterExecutorGroups[p];m&&y.push(m),y.some((function(r){for(var e=r===m?n.declutterTree.all().map((function(t){return t.value})):null,o=0,a=r.length;o<a;++o){var h=r[o];if(c=h.forEachFeatureAtCoordinate(t,s,u,i,v,e))return!0}}))},y=0,m=d.length;!c&&y<m;++y)p(y);return c},n.prototype.getFeatures=function(t){return new Promise(function(n,i){for(var r,e=this.getLayer(),s=o(e),u=e.getSource(),a=this.renderedProjection,h=a.getExtent(),f=this.renderedResolution,c=u.getTileGridForProjection(a),l=tn(this.Wc,t.slice()),v=c.getTileCoordForCoordAndResolution(l,f),d=0,p=this.renderedTiles.length;d<p;++d)if(v.toString()===this.renderedTiles[d].tileCoord.toString()){if((r=this.renderedTiles[d]).getState()===vt){var y=c.getTileCoordExtent(r.tileCoord);u.getWrapX()&&a.canWrapX()&&!xn(h,y)&&rr(l,a);break}r=void 0}if(!r||r.loadingSourceTiles>0)n([]);else{var m=Yn(c.getTileCoordExtent(r.wrappedTileCoord)),w=[(l[0]-m[0])/f,(m[1]-l[1])/f],g=r.getSourceTiles().reduce((function(t,n){return t.concat(n.getFeatures())}),[]),b=r.hitDetectionImageData[s];if(!b&&!this.Pc){var x=Qu(c.getTileSize(c.getZForResolution(f,u.zDirection))),M=this.Lc;b=zw(x,[this.getRenderTransform(c.getTileCoordCenter(r.wrappedTileCoord),f,0,Lw,x[0]*Lw,x[1]*Lw,0)],g,e.getStyleFunction(),c.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(e).renderedResolution,M),r.hitDetectionImageData[s]=b}n(Rw(w,g,b))}}.bind(this))},n.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.Yc&&t.changed()},n.prototype.Ac=function(t){this.renderIfReadyAndVisible()},n.prototype.renderDeclutter=function(t){var n=this.context,i=n.globalAlpha;n.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,e=!(r[Eu]||r[Tu]),s=this.renderedTiles,u=0,a=s.length;u<a;++u){var h=s[u],f=h.declutterExecutorGroups[o(this.getLayer())];if(f)for(var c=f.length-1;c>=0;--c)f[c].execute(this.context,1,this.getTileRenderTransform(h,t),t.viewState.rotation,e,void 0,t.declutterTree)}n.globalAlpha=i},n.prototype.getTileRenderTransform=function(t,n){var i=n.pixelRatio,r=n.viewState,e=r.center,o=r.resolution,s=r.rotation,u=n.size,a=Math.round(u[0]*i),h=Math.round(u[1]*i),f=this.getLayer().getSource().getTileGridForProjection(n.viewState.projection),c=t.tileCoord,l=f.getTileCoordExtent(t.wrappedTileCoord),v=f.getTileCoordExtent(c,this.tmpExtent)[0]-l[0];return Ht(rn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(e,o,s,i,a,h,v))},n.prototype.renderFrame=function(n,i){var r=n.viewHints,e=!(r[Eu]||r[Tu]);t.prototype.renderFrame.call(this,n,i),this.Wc=n.pixelToCoordinateTransform.slice(),this.Lc=n.viewState.rotation;var s=this.getLayer(),u=s.getRenderMode(),a=this.context,h=a.globalAlpha;a.globalAlpha=s.getOpacity();for(var f=Yw[u],c=n.viewState,l=c.rotation,v=s.getSource(),d=v.getTileGridForProjection(c.projection).getZForResolution(c.resolution,v.zDirection),p=this.renderedTiles,y=[],m=[],w=!0,g=p.length-1;g>=0;--g){var b=p[g];w=w&&!b.getReplayState(s).dirty;var x=b.executorGroups[o(s)].filter((function(t){return t.hasExecutors(f)}));if(0!==x.length){var M=this.getTileRenderTransform(b,n),_=b.tileCoord[0],S=!1,O=x[0].getClipCoords(M);if(O){for(var j=0,E=y.length;j<E;++j)if(d!==_&&_<m[j]){var T=y[j];Kn([O[0],O[3],O[4],O[7]],[T[0],T[3],T[4],T[7]])&&(S||(a.save(),S=!0),a.beginPath(),a.moveTo(O[0],O[1]),a.lineTo(O[2],O[3]),a.lineTo(O[4],O[5]),a.lineTo(O[6],O[7]),a.moveTo(T[6],T[7]),a.lineTo(T[4],T[5]),a.lineTo(T[2],T[3]),a.lineTo(T[0],T[1]),a.clip())}y.push(O),m.push(_)}for(var A=0,P=x.length;A<P;++A){x[A].execute(a,1,M,l,e,f)}S&&a.restore()}}return a.globalAlpha=h,this.ready=w,this.container},n.prototype.renderFeature=function(t,n,i,r,e){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var s=0,u=i.length;s<u;++s)o=af(r,t,i[s],n,this.Tc,void 0,e)||o;else o=af(r,t,i,n,this.Tc,void 0,e);return o},n.prototype.Kc=function(t){var n=this.getLayer();if(n.getRenderMode()===Xw)return!1;var i=t.getReplayState(n),r=n.getRevision(),e=t.wantedResolution;return i.renderedTileResolution!==e||i.renderedTileRevision!==r},n.prototype.Hc=function(t,n){var i=this.getLayer(),r=t.getReplayState(i),e=i.getRevision(),s=t.executorGroups[o(i)];r.renderedTileRevision=e;var u=t.wrappedTileCoord,a=u[0],h=i.getSource(),f=n.pixelRatio,c=n.viewState.projection,l=h.getTileGridForProjection(c),v=l.getResolution(t.tileCoord[0]),d=n.pixelRatio/t.wantedResolution*v,p=l.getResolution(a),y=t.getContext(i);f=Math.round(Math.max(f,d/f));var m=h.getTilePixelSize(a,f,c);y.canvas.width=m[0],y.canvas.height=m[1];var w=f/d;if(1!==w){var g=Kt(this.Zc);rn(g,w,w),y.setTransform.apply(y,g)}var b=l.getTileCoordExtent(u,this.tmpExtent),x=d/p,M=Kt(this.Zc);rn(M,x,-x),on(M,-b[0],-b[3]);for(var _=0,S=s.length;_<S;++_){s[_].execute(y,w,M,0,!0,Ww[i.getRenderMode()])}r.renderedTileResolution=t.wantedResolution},n}(fm),$w=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Kw=function(t){function n(n,i){var r=t.call(this)||this;return i&&!Array.isArray(n[0])?r.setFlatCoordinates(i,n):r.setCoordinates(n,i),r}return $w(n,t),n.prototype.appendPoint=function(t){this.flatCoordinates?g(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){if(r<gn(this.getExtent(),t,n))return r;for(var e=this.flatCoordinates,o=this.stride,s=0,u=e.length;s<u;s+=o){var a=hi(t,n,e[s],e[s+1]);if(a<r){r=a;for(var h=0;h<o;++h)i[h]=e[s+h];i.length=o}}return r},n.prototype.getCoordinates=function(){return pe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getPoint=function(t){var n=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||n<=t?null:new Se(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},n.prototype.getPoints=function(){for(var t=this.flatCoordinates,n=this.layout,i=this.stride,r=[],e=0,o=t.length;e<o;e+=i){var s=new Se(t.slice(e,e+i),n);r.push(s)}return r},n.prototype.getType=function(){return"MultiPoint"},n.prototype.intersectsExtent=function(t){for(var n=this.flatCoordinates,i=this.stride,r=0,e=n.length;r<e;r+=i){if(Mn(t,n[r],n[r+1]))return!0}return!1},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=oe(this.flatCoordinates,0,t,this.stride),this.changed()},n}(Kr);function Hw(t,n,i,r,e,o,s){var u,a,h=(i-n)/r;if(1===h)u=n;else if(2===h)u=n,a=e;else if(0!==h){for(var f=t[n],c=t[n+1],l=0,v=[0],p=n+r;p<i;p+=r){var y=t[p],m=t[p+1];l+=Math.sqrt((y-f)*(y-f)+(m-c)*(m-c)),v.push(l),f=y,c=m}var w=e*l,g=d(v,w);g<0?(a=(w-v[-g-2])/(v[-g-1]-v[-g-2]),u=n+(-g-2)*r):u=n+g*r}var b=s>1?s:2,x=o||new Array(b);for(p=0;p<b;++p)x[p]=void 0===u?NaN:void 0===a?t[u+p]:di(t[u+p],t[u+r+p],a);return x}function Jw(t,n,i,r,e,o){if(i==n)return null;var s;if(e<t[n+r-1])return o?((s=t.slice(n,n+r))[r-1]=e,s):null;if(t[i-1]<e)return o?((s=t.slice(i-r,i))[r-1]=e,s):null;if(e==t[n+r-1])return t.slice(n,n+r);for(var u=n/r,a=i/r;u<a;){var h=u+a>>1;e<t[(h+1)*r-1]?a=h:u=h+1}var f=t[u*r-1];if(e==f)return t.slice((u-1)*r,(u-1)*r+r);var c=(e-f)/(t[(u+1)*r-1]-f);s=[];for(var l=0;l<r-1;++l)s.push(di(t[(u-1)*r+l],t[u*r+l],c));return s.push(e),s}function Qw(t,n,i,r,e,o,s){if(s)return Jw(t,n,i[i.length-1],r,e,o);var u;if(e<t[r-1])return o?((u=t.slice(0,r))[r-1]=e,u):null;if(t[t.length-1]<e)return o?((u=t.slice(t.length-r))[r-1]=e,u):null;for(var a=0,h=i.length;a<h;++a){var f=i[a];if(n!=f){if(e<t[n+r-1])return null;if(e<=t[f-1])return Jw(t,n,f,r,e,!1);n=f}}return null}var tg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ng=function(t){function n(n,i){var r=t.call(this)||this;return r.Jc=null,r.Qc=-1,r.wt=-1,r.gt=-1,void 0===i||Array.isArray(n[0])?r.setCoordinates(n,i):r.setFlatCoordinates(i,n),r}return tg(n,t),n.prototype.appendCoordinate=function(t){this.flatCoordinates?g(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){return r<gn(this.getExtent(),t,n)?r:(this.gt!=this.getRevision()&&(this.wt=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.gt=this.getRevision()),ne(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.wt,!1,t,n,i,r))},n.prototype.forEachSegment=function(t){return Ce(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinateAtM=function(t,n){if(this.layout!=Pt&&this.layout!=Ct)return null;var i=void 0!==n&&n;return Jw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},n.prototype.getCoordinates=function(){return pe(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getCoordinateAt=function(t,n){return Hw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,this.stride)},n.prototype.getLength=function(){return gw(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},n.prototype.getFlatMidpoint=function(){return this.Qc!=this.getRevision()&&(this.Jc=this.getCoordinateAt(.5,this.Jc),this.Qc=this.getRevision()),this.Jc},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ae(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new n(i,Tt)},n.prototype.getType=function(){return"LineString"},n.prototype.intersectsExtent=function(t){return ke(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=oe(this.flatCoordinates,0,t,this.stride),this.changed()},n}(Kr),ig=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rg=function(t){function n(n,i,r){var e=t.call(this)||this;if(e.bt=[],e.wt=-1,e.gt=-1,Array.isArray(n[0]))e.setCoordinates(n,i);else if(void 0!==i&&r)e.setFlatCoordinates(i,n),e.bt=r;else{for(var o=e.getLayout(),s=n,u=[],a=[],h=0,f=s.length;h<f;++h){var c=s[h];0===h&&(o=c.getLayout()),g(u,c.getFlatCoordinates()),a.push(u.length)}e.setFlatCoordinates(o,u),e.bt=a}return e}return ig(n,t),n.prototype.appendLineString=function(t){this.flatCoordinates?g(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.bt.push(this.flatCoordinates.length),this.changed()},n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),this.layout,this.bt.slice());return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){return r<gn(this.getExtent(),t,n)?r:(this.gt!=this.getRevision()&&(this.wt=Math.sqrt(Qr(this.flatCoordinates,0,this.bt,this.stride,0)),this.gt=this.getRevision()),ie(this.flatCoordinates,0,this.bt,this.stride,this.wt,!1,t,n,i,r))},n.prototype.getCoordinateAtM=function(t,n,i){if(this.layout!=Pt&&this.layout!=Ct||0===this.flatCoordinates.length)return null;var r=void 0!==n&&n,e=void 0!==i&&i;return Qw(this.flatCoordinates,0,this.bt,this.stride,t,r,e)},n.prototype.getCoordinates=function(){return ye(this.flatCoordinates,0,this.bt,this.stride)},n.prototype.getEnds=function(){return this.bt},n.prototype.getLineString=function(t){return t<0||this.bt.length<=t?null:new ng(this.flatCoordinates.slice(0===t?0:this.bt[t-1],this.bt[t]),this.layout)},n.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,n=this.bt,i=this.layout,r=[],e=0,o=0,s=n.length;o<s;++o){var u=n[o],a=new ng(t.slice(e,u),i);r.push(a),e=u}return r},n.prototype.getFlatMidpoints=function(){for(var t=[],n=this.flatCoordinates,i=0,r=this.bt,e=this.stride,o=0,s=r.length;o<s;++o){var u=r[o];g(t,Hw(n,i,u,e,.5)),i=u}return t},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=he(this.flatCoordinates,0,this.bt,this.stride,t,i,0,r),new n(i,Tt,r)},n.prototype.getType=function(){return"MultiLineString"},n.prototype.intersectsExtent=function(t){return Ie(this.flatCoordinates,0,this.bt,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=se(this.flatCoordinates,0,t,this.stride,this.bt);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},n}(Kr);function eg(t,n,i,r){for(var e=[],o=[1/0,1/0,-1/0,-1/0],s=0,u=i.length;s<u;++s){var a=i[s];o=Tn(t,n,a[0],r),e.push((o[0]+o[2])/2,(o[1]+o[3])/2),n=a[a.length-1]}return e}var og=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sg=function(t){function n(n,i,r){var e=t.call(this)||this;if(e.tl=[],e.nl=-1,e.il=null,e.wt=-1,e.gt=-1,e._t=-1,e.St=null,!r&&!Array.isArray(n[0])){for(var o=e.getLayout(),s=n,u=[],a=[],h=0,f=s.length;h<f;++h){var c=s[h];0===h&&(o=c.getLayout());for(var l=u.length,v=c.getEnds(),d=0,p=v.length;d<p;++d)v[d]+=l;g(u,c.getFlatCoordinates()),a.push(v)}i=o,n=u,r=a}return void 0!==i&&r?(e.setFlatCoordinates(i,n),e.tl=r):e.setCoordinates(n,i),e}return og(n,t),n.prototype.appendPolygon=function(t){var n;if(this.flatCoordinates){var i=this.flatCoordinates.length;g(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,e=(n=t.getEnds().slice()).length;r<e;++r)n[r]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),n=t.getEnds().slice(),this.tl.push();this.tl.push(n),this.changed()},n.prototype.clone=function(){for(var t=this.tl.length,i=new Array(t),r=0;r<t;++r)i[r]=this.tl[r].slice();var e=new n(this.flatCoordinates.slice(),this.layout,i);return e.applyProperties(this),e},n.prototype.closestPointXY=function(t,n,i,r){return r<gn(this.getExtent(),t,n)?r:(this.gt!=this.getRevision()&&(this.wt=Math.sqrt(te(this.flatCoordinates,0,this.tl,this.stride,0)),this.gt=this.getRevision()),re(this.getOrientedFlatCoordinates(),0,this.tl,this.stride,this.wt,!0,t,n,i,r))},n.prototype.containsXY=function(t,n){return Te(this.getOrientedFlatCoordinates(),0,this.tl,this.stride,t,n)},n.prototype.getArea=function(){return be(this.getOrientedFlatCoordinates(),0,this.tl,this.stride)},n.prototype.getCoordinates=function(t){var n;return void 0!==t?Ue(n=this.getOrientedFlatCoordinates().slice(),0,this.tl,this.stride,t):n=this.flatCoordinates,me(n,0,this.tl,this.stride)},n.prototype.getEndss=function(){return this.tl},n.prototype.getFlatInteriorPoints=function(){if(this.nl!=this.getRevision()){var t=eg(this.flatCoordinates,0,this.tl,this.stride);this.il=Pe(this.getOrientedFlatCoordinates(),0,this.tl,this.stride,t),this.nl=this.getRevision()}return this.il},n.prototype.getInteriorPoints=function(){return new Kw(this.getFlatInteriorPoints().slice(),Pt)},n.prototype.getOrientedFlatCoordinates=function(){if(this._t!=this.getRevision()){var t=this.flatCoordinates;De(t,0,this.tl,this.stride)?this.St=t:(this.St=t.slice(),this.St.length=Ue(this.St,0,this.tl,this.stride)),this._t=this.getRevision()}return this.St},n.prototype.getSimplifiedGeometryInternal=function(t){var i=[],r=[];return i.length=de(this.flatCoordinates,0,this.tl,this.stride,Math.sqrt(t),i,0,r),new n(i,Tt,r)},n.prototype.getPolygon=function(t){if(t<0||this.tl.length<=t)return null;var n;if(0===t)n=0;else{var i=this.tl[t-1];n=i[i.length-1]}var r=this.tl[t].slice(),e=r[r.length-1];if(0!==n)for(var o=0,s=r.length;o<s;++o)r[o]-=n;return new We(this.flatCoordinates.slice(n,e),this.layout,r)},n.prototype.getPolygons=function(){for(var t=this.layout,n=this.flatCoordinates,i=this.tl,r=[],e=0,o=0,s=i.length;o<s;++o){var u=i[o].slice(),a=u[u.length-1];if(0!==e)for(var h=0,f=u.length;h<f;++h)u[h]-=e;var c=new We(n.slice(e,a),t,u);r.push(c),e=a}return r},n.prototype.getType=function(){return"MultiPolygon"},n.prototype.intersectsExtent=function(t){return ze(this.getOrientedFlatCoordinates(),0,this.tl,this.stride,t)},n.prototype.setCoordinates=function(t,n){this.setLayout(n,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=ue(this.flatCoordinates,0,t,this.stride,this.tl);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},n}(Kr),ug=[1,0,0,1,0,0],ag=function(){function t(t,n,i,r,e){this.styleFunction,this.st,this.$=e,this.rl=t,this.el=n,this.il=null,this.sl=null,this.bt=i,this.ul=r}return t.prototype.get=function(t){return this.ul[t]},t.prototype.getExtent=function(){return this.st||(this.st="Point"===this.rl?En(this.el):Tn(this.el,0,this.el.length,2)),this.st},t.prototype.getFlatInteriorPoint=function(){if(!this.il){var t=qn(this.getExtent());this.il=Ae(this.el,0,this.bt,2,t,0)}return this.il},t.prototype.getFlatInteriorPoints=function(){if(!this.il){var t=eg(this.el,0,this.bt,2);this.il=Pe(this.el,0,this.bt,2,t)}return this.il},t.prototype.getFlatMidpoint=function(){return this.sl||(this.sl=Hw(this.el,0,this.el.length,2,.5)),this.sl},t.prototype.getFlatMidpoints=function(){if(!this.sl){this.sl=[];for(var t=this.el,n=0,i=this.bt,r=0,e=i.length;r<e;++r){var o=i[r],s=Hw(t,n,o,2,.5);g(this.sl,s),n=o}}return this.sl},t.prototype.getId=function(){return this.$},t.prototype.getOrientedFlatCoordinates=function(){return this.el},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,n){return this},t.prototype.getProperties=function(){return this.ul},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.rl},t.prototype.transform=function(t){var n=(t=yr(t)).getExtent(),i=t.getWorldExtent();if(n&&i){var r=Vn(i)/Vn(n);sn(ug,i[0],i[3],r,-r,0,0,0),Dr(this.el,0,this.el.length,2,ug,this.el)}},t.prototype.getEnds=function(){return this.bt},t}();function hg(t){var n=t.getType();switch(n){case"Point":return new Se(t.getFlatCoordinates());case"MultiPoint":return new Kw(t.getFlatCoordinates(),Tt);case"LineString":return new ng(t.getFlatCoordinates(),Tt);case"MultiLineString":return new rg(t.getFlatCoordinates(),Tt,t.getEnds());case"Polygon":var i=t.getFlatCoordinates(),r=t.getEnds(),e=Be(i,r);return e.length>1?new sg(i,Tt,e):new We(i,Tt,r);default:throw new Error("Invalid geometry type:"+n)}}ag.prototype.getEndss=ag.prototype.getEnds,ag.prototype.getFlatCoordinates=ag.prototype.getOrientedFlatCoordinates;var fg=ag;var cg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lg=function(t){function n(n){return t.call(this,n)||this}return cg(n,t),n.prototype.createRenderer=function(){return new Gw(this)},n}($m);function vg(t,n,i){for(var r,e,o,s,u,a,h=[],f=t(0),c=t(1),l=n(f),v=n(c),d=[c,f],p=[v,l],y=[1,0],m={},w=1e5;--w>0&&y.length>0;)o=y.pop(),f=d.pop(),l=p.pop(),(a=o.toString())in m||(h.push(l[0],l[1]),m[a]=!0),s=y.pop(),c=d.pop(),v=p.pop(),ai((e=n(r=t(u=(o+s)/2)))[0],e[1],l[0],l[1],v[0],v[1])<i?(h.push(v[0],v[1]),m[a=s.toString()]=!0):(y.push(s,u,u,o),p.push(v,e,e,l),d.push(c,r,r,f));return h}function dg(t,n,i,r,e){return vg((function(r){return[t,n+(i-n)*r]}),jr(yr("EPSG:4326"),r),e)}function pg(t,n,i,r,e){return vg((function(r){return[n+(i-n)*r,t]}),jr(yr("EPSG:4326"),r),e)}var yg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mg=new mv({color:"rgba(0,0,0,0.2)"}),wg=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],gg=function(t){function n(n){var i=this,r=n||{},e=A({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},r);return delete e.maxLines,delete e.strokeStyle,delete e.targetSize,delete e.showLabels,delete e.lonLabelFormatter,delete e.latLabelFormatter,delete e.lonLabelPosition,delete e.latLabelPosition,delete e.lonLabelStyle,delete e.latLabelStyle,delete e.intervals,(i=t.call(this,e)||this).di=null,i.al=1/0,i.hl=1/0,i.fl=-1/0,i.cl=-1/0,i.ll=1/0,i.vl=1/0,i.dl=-1/0,i.pl=-1/0,i.yl=void 0!==r.targetSize?r.targetSize:100,i.ml=void 0!==r.maxLines?r.maxLines:100,i.wl=[],i.gl=[],i.bl=void 0!==r.strokeStyle?r.strokeStyle:mg,i.xl=void 0,i.Ml=void 0,i._l=null,i.Sl=null,i.Ol=null,i.jl=null,i.El=null,i.Tl=null,i.Al=null,r.showLabels&&(i.Pl=null==r.lonLabelFormatter?Zi.bind(i,"EW"):r.lonLabelFormatter,i.Cl=null==r.latLabelFormatter?Zi.bind(i,"NS"):r.latLabelFormatter,i.kl=null==r.lonLabelPosition?0:r.lonLabelPosition,i.Il=null==r.latLabelPosition?1:r.latLabelPosition,i.Nl=new Sv({text:void 0!==r.lonLabelStyle?r.lonLabelStyle.clone():new Ev({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new rv({color:"rgba(0,0,0,1)"}),stroke:new mv({color:"rgba(255,255,255,1)",width:3})})}),i.Ll=function(t){var n=t.get("graticule_label");return this.Nl.getText().setText(n),this.Nl}.bind(i),i.zl=new Sv({text:void 0!==r.latLabelStyle?r.latLabelStyle.clone():new Ev({font:"12px Calibri,sans-serif",textAlign:"right",fill:new rv({color:"rgba(0,0,0,1)"}),stroke:new mv({color:"rgba(255,255,255,1)",width:3})})}),i.Rl=function(t){var n=t.get("graticule_label");return this.zl.getText().setText(n),this.zl}.bind(i),i.Tl=[],i.Al=[],i.addEventListener(ss,i.Fl.bind(i))),i.Gl=void 0!==r.intervals?r.intervals:wg,i.setSource(new ad({loader:i.loaderFunction.bind(i),strategy:i.strategyFunction.bind(i),features:new ft,overlaps:!1,useSpatialIndex:!1,wrapX:r.wrapX})),i.Dl=[],i.ql=new Sv({stroke:i.bl}),i.Ul=null,i.zh=null,i.Ic=null,i.setRenderOrder(null),i}return yg(n,t),n.prototype.strategyFunction=function(t,n){var i=t.slice();return this.di&&this.getSource().getWrapX()&&ii(i,this.di),this.Ul&&(Pn(this.Ul,i,n)?i=this.Ul.slice():this.getSource().removeLoadedExtent(this.Ul)),[i]},n.prototype.loaderFunction=function(t,n,i){this.Ul=t;var r=this.getSource(),e=Wn(this.getExtent()||[-1/0,-1/0,1/0,1/0],t);if(!(this.zh&&An(this.zh,e)&&this.Ic===n||(this.zh=e,this.Ic=n,Hn(e)))){var o=qn(e),s=n*n/4;(!this.di||!Sr(this.di,i))&&this.Bl(i),this.Xl(e,o,n,s);var u,a=this.wl.length+this.gl.length;for(this.Tl&&(a+=this.wl.length),this.Al&&(a+=this.gl.length);a>this.Dl.length;)u=new Et,this.Dl.push(u);var h=r.getFeaturesCollection();h.clear();var f,c,l=0;for(f=0,c=this.wl.length;f<c;++f)(u=this.Dl[l++]).setGeometry(this.wl[f]),u.setStyle(this.ql),h.push(u);for(f=0,c=this.gl.length;f<c;++f)(u=this.Dl[l++]).setGeometry(this.gl[f]),u.setStyle(this.ql),h.push(u)}},n.prototype.Vl=function(t,n,i,r,e,o){var s=this.Wl(t,n,i,r,o);if(Kn(s.getExtent(),e)){if(this.Tl){var u=this.Pl(t);o in this.Tl?this.Tl[o].text=u:this.Tl[o]={geom:new Se([]),text:u}}this.wl[o++]=s}return o},n.prototype.Yl=function(t,n,i,r,e,o){var s=this.Zl(t,n,i,r,o);if(Kn(s.getExtent(),e)){if(this.Al){var u=this.Cl(t);o in this.Al?this.Al[o].text=u:this.Al[o]={geom:new Se([]),text:u}}this.gl[o++]=s}return o},n.prototype.Fl=function(t){var n=t.frameState.viewState.rotation,i=t.frameState.viewState.resolution,r=t.frameState.size,e=t.frameState.extent,o=qn(e),s=e;if(n){var u=r[0]*i,a=r[1]*i;s=[o[0]-u/2,o[1]-a/2,o[0]+u/2,o[1]+a/2]}var h=0,f=0,c=this.Il<.5,l=this.di.getExtent(),v=$n(l);this.getSource().getWrapX()&&this.di.canWrapX()&&!xn(l,e)&&(h=Math.floor((e[0]-l[0])/v),f=Math.ceil((e[2]-l[2])/v),c=c!==Math.abs(n)>Math.PI/2);for(var d=ff(t),p=h;p<=f;++p){var y=this.wl.length+this.gl.length,m=void 0,w=void 0,g=void 0,b=void 0;if(this.Tl)for(w=0,g=this.Tl.length;w<g;++w){var x=this.wl[w];if(n||0!==p)(M=x.clone()).translate(p*v,0),M.rotate(-n,o),(b=this.$l(M,s,w)).rotate(n,o);else b=this.$l(x,e,w);(m=this.Dl[y++]).setGeometry(b),m.set("graticule_label",this.Tl[w].text),d.drawFeature(m,this.Ll(m))}if(this.Al&&(p===h&&c||p===f&&!c))for(w=0,g=this.gl.length;w<g;++w){var M;x=this.gl[w];if(n||0!==p)(M=x.clone()).translate(p*v,0),M.rotate(-n,o),(b=this.Kl(M,s,w)).rotate(n,o);else b=this.Kl(x,e,w);(m=this.Dl[y++]).setGeometry(b),m.set("graticule_label",this.Al[w].text),d.drawFeature(m,this.Rl(m))}}},n.prototype.Xl=function(t,n,i,r){var e=this.Hl(i);if(-1==e)return this.wl.length=0,this.gl.length=0,this.Tl&&(this.Tl.length=0),void(this.Al&&(this.Al.length=0));var o=!1,s=this.di.getExtent(),u=$n(s);this.getSource().getWrapX()&&this.di.canWrapX()&&!xn(s,t)&&($n(t)>=u?(t[0]=s[0],t[2]=s[2]):o=!0);var a=[oi(n[0],this.dl,this.ll),oi(n[1],this.pl,this.vl)],h=this.Ml(a);isNaN(h[1])&&(h[1]=Math.abs(this.al)>=Math.abs(this.fl)?this.al:this.fl);var f,c,l,v,d=oi(h[0],this.cl,this.hl),p=oi(h[1],this.fl,this.al),y=this.ml,m=t;o||(m=[oi(t[0],this.dl,this.ll),oi(t[1],this.pl,this.vl),oi(t[2],this.dl,this.ll),oi(t[3],this.pl,this.vl)]);var w=ni(m,this.Ml,void 0,8),g=w[3],b=w[2],x=w[1],M=w[0];if(o||(bn(m,this.Sl)&&(M=this.cl,x=this.fl),bn(m,this.Ol)&&(b=this.hl,x=this.fl),bn(m,this.jl)&&(M=this.cl,g=this.al),bn(m,this.El)&&(b=this.hl,g=this.al),g=oi(g,p,this.al),b=oi(b,d,this.hl),x=oi(x,this.fl,p),M=oi(M,this.cl,d)),v=oi(d=Math.floor(d/e)*e,this.cl,this.hl),c=this.Vl(v,x,g,r,t,0),f=0,o)for(;(v-=e)>=M&&f++<y;)c=this.Vl(v,x,g,r,t,c);else for(;v!=this.cl&&f++<y;)v=Math.max(v-e,this.cl),c=this.Vl(v,x,g,r,t,c);if(v=oi(d,this.cl,this.hl),f=0,o)for(;(v+=e)<=b&&f++<y;)c=this.Vl(v,x,g,r,t,c);else for(;v!=this.hl&&f++<y;)v=Math.min(v+e,this.hl),c=this.Vl(v,x,g,r,t,c);for(this.wl.length=c,this.Tl&&(this.Tl.length=c),l=oi(p=Math.floor(p/e)*e,this.fl,this.al),c=this.Yl(l,M,b,r,t,0),f=0;l!=this.fl&&f++<y;)l=Math.max(l-e,this.fl),c=this.Yl(l,M,b,r,t,c);for(l=oi(p,this.fl,this.al),f=0;l!=this.al&&f++<y;)l=Math.min(l+e,this.al),c=this.Yl(l,M,b,r,t,c);this.gl.length=c,this.Al&&(this.Al.length=c)},n.prototype.Hl=function(t){for(var n=this._l[0],i=this._l[1],r=-1,e=Math.pow(this.yl*t,2),o=[],s=[],u=0,a=this.Gl.length;u<a;++u){var h=oi(this.Gl[u]/2,0,90),f=oi(i,-90+h,90-h);if(o[0]=n-h,o[1]=f-h,s[0]=n+h,s[1]=f+h,this.xl(o,o),this.xl(s,s),Math.pow(s[0]-o[0],2)+Math.pow(s[1]-o[1],2)<=e)break;r=this.Gl[u]}return r},n.prototype.Wl=function(t,n,i,r,e){var o=dg(t,n,i,this.di,r),s=this.wl[e];return s?(s.setFlatCoordinates(Tt,o),s.changed()):(s=new ng(o,Tt),this.wl[e]=s),s},n.prototype.$l=function(t,n,i){var r=t.getFlatCoordinates(),e=1,o=r.length-1;r[e]>r[o]&&(e=o,o=1);var s=Math.max(n[1],r[e]),u=Math.min(n[3],r[o]),a=oi(n[1]+Math.abs(n[1]-n[3])*this.kl,s,u),h=[r[e-1]+(r[o-1]-r[e-1])*(a-r[e])/(r[o]-r[e]),a],f=this.Tl[i].geom;return f.setCoordinates(h),f},n.prototype.getMeridians=function(){return this.wl},n.prototype.Zl=function(t,n,i,r,e){var o=pg(t,n,i,this.di,r),s=this.gl[e];return s?(s.setFlatCoordinates(Tt,o),s.changed()):s=new ng(o,Tt),s},n.prototype.Kl=function(t,n,i){var r=t.getFlatCoordinates(),e=0,o=r.length-2;r[e]>r[o]&&(e=o,o=0);var s=Math.max(n[0],r[e]),u=Math.min(n[2],r[o]),a=oi(n[0]+Math.abs(n[0]-n[2])*this.Il,s,u),h=[a,r[e+1]+(r[o+1]-r[e+1])*(a-r[e])/(r[o]-r[e])],f=this.Al[i].geom;return f.setCoordinates(h),f},n.prototype.getParallels=function(){return this.gl},n.prototype.Bl=function(t){var n=yr("EPSG:4326"),i=t.getWorldExtent();this.al=i[3],this.hl=i[2],this.fl=i[1],this.cl=i[0];var r=jr(t,n);if(this.cl<this.hl)this.Ml=r;else{var e=this.cl+this.hl/2;this.hl+=360,this.Ml=function(t,n,i){for(var o=i||2,s=r(t,n,o),u=0,a=s.length;u<a;u+=o)s[u]<e&&(s[u]+=360);return s}}this.xl=jr(n,t);var o=ni([this.cl,this.fl,this.hl,this.al],this.xl,void 0,8);this.dl=o[0],this.ll=o[2],this.pl=o[1],this.vl=o[3],this.Sl=this.xl([this.cl,this.fl]),this.Ol=this.xl([this.hl,this.fl]),this.jl=this.xl([this.cl,this.al]),this.El=this.xl([this.hl,this.al]),this._l=this.Ml(qn(t.getExtent())),isNaN(this._l[1])&&(this._l[1]=Math.abs(this.al)>=Math.abs(this.fl)?this.al:this.fl),this.di=t},n}(lg),bg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xg="blur",Mg="gradient",_g="radius",Sg=["#00f","#0ff","#0f0","#ff0","#f00"];var Og=function(t){function n(n){var i=this,r=n||{},e=A({},r);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,(i=t.call(this,e)||this).Jl=null,i.addChangeListener(Mg,i.Ql),i.setGradient(r.gradient?r.gradient:Sg),i.setBlur(void 0!==r.blur?r.blur:15),i.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return i.tv="string"==typeof o?function(t){return t.get(o)}:o,i.setRenderOrder(null),i}return bg(n,t),n.prototype.getBlur=function(){return this.get(xg)},n.prototype.getGradient=function(){return this.get(Mg)},n.prototype.getRadius=function(){return this.get(_g)},n.prototype.Ql=function(){this.Jl=function(t){for(var n=1,i=256,r=_o(n,i),e=r.createLinearGradient(0,0,n,i),o=1/(t.length-1),s=0,u=t.length;s<u;++s)e.addColorStop(s*o,t[s]);return r.fillStyle=e,r.fillRect(0,0,n,i),r.canvas}(this.getGradient())},n.prototype.setBlur=function(t){this.set(xg,t)},n.prototype.setGradient=function(t){this.set(Mg,t)},n.prototype.setRadius=function(t){this.set(_g,t)},n.prototype.createRenderer=function(){return new Hm(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var n=this.tv(t);return void 0!==n?oi(n,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(_g)+this.get(xg))}.bind(this),u_blurSlope:function(){return this.get(_g)/Math.max(1,this.get(xg))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\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.Jl}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},n.prototype.renderDeclutter=function(){},n}($m),jg=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,n){var i;if(n){var r=n.dataProjection?yr(n.dataProjection):this.readProjection(t);n.extent&&r&&r.getUnits()===Rt.TILE_PIXELS&&(r=yr(r)).setWorldExtent(n.extent),i={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return A({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return r()},t.prototype.readFeature=function(t,n){return r()},t.prototype.readFeatures=function(t,n){return r()},t.prototype.readGeometry=function(t,n){return r()},t.prototype.readProjection=function(t){return r()},t.prototype.writeFeature=function(t,n){return r()},t.prototype.writeFeatures=function(t,n){return r()},t.prototype.writeGeometry=function(t,n){return r()},t}();function Eg(t,n,i){var r,e=i?yr(i.featureProjection):null,o=i?yr(i.dataProjection):null;if(r=e&&o&&!Sr(e,o)?(n?t.clone():t).transform(n?e:o,n?o:e):t,n&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);r===t&&(r=t.clone()),r.applyTransform((function(t){for(var n=0,i=t.length;n<i;++n)t[n]=Math.round(t[n]*s)/s;return t}))}return r}function Tg(t,n){var i=n?yr(n.featureProjection):null,r=n?yr(n.dataProjection):null;return i&&r&&!Sr(i,r)?Tr(t,r,i):t}var Ag=i(98),Pg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Cg(t,n,i){if(3===t){var r={keys:[],values:[],features:[]},e=i.readVarint()+i.pos;i.readFields(kg,r,e),r.length=r.features.length,r.length&&(n[r.name]=r)}}function kg(t,n,i){if(15===t)n.version=i.readVarint();else if(1===t)n.name=i.readString();else if(5===t)n.extent=i.readVarint();else if(2===t)n.features.push(i.pos);else if(3===t)n.keys.push(i.readString());else if(4===t){for(var r=null,e=i.readVarint()+i.pos;i.pos<e;)r=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;n.values.push(r)}}function Ig(t,n,i){if(1==t)n.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.pos<r;){var e=n.layer.keys[i.readVarint()],o=n.layer.values[i.readVarint()];n.properties[e]=o}else 3==t?n.type=i.readVarint():4==t&&(n.geometry=i.pos)}function Ng(t,n,i){t.pos=n.features[i];var r=t.readVarint()+t.pos,e={layer:n,type:0,properties:{}};return t.readFields(Ig,e,r),e}var Lg=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=new ei({code:"",units:Rt.TILE_PIXELS}),i.nv=r.featureClass?r.featureClass:fg,i.K=r.geometryName,i.iv=r.layerName?r.layerName:"layer",i.Uh=r.layers?r.layers:null,i.rv=r.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Pg(n,t),n.prototype.ev=function(t,n,i,r){t.pos=n.geometry;for(var e=t.readVarint()+t.pos,o=1,s=0,u=0,a=0,h=0,f=0;t.pos<e;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(u+=t.readSVarint(),a+=t.readSVarint(),1===o&&h>f&&(r.push(h),f=h),i.push(u,a),h+=2):7===o?h>f&&(i.push(i[f],i[f+1]),h+=2):St(!1,59)}h>f&&(r.push(h),f=h)},n.prototype.ov=function(t,n,i){var r,e=n.type;if(0===e)return null;var o,s=n.properties;this.rv?(o=s[this.rv],delete s[this.rv]):o=n.id,s[this.iv]=n.layer.name;var u=[],a=[];this.ev(t,n,u,a);var h=function(t,n){var i;1===t?i=1===n?"Point":"MultiPoint":2===t?i=1===n?"LineString":"MultiLineString":3===t&&(i="Polygon");return i}(e,a.length);if(this.nv===fg)(r=new this.nv(h,u,a,s,o)).transform(i.dataProjection);else{var f=void 0;if("Polygon"==h){var c=Be(u,a);f=c.length>1?new sg(u,Tt,c):new We(u,Tt,a)}else f="Point"===h?new Se(u,Tt):"LineString"===h?new ng(u,Tt):"MultiPoint"===h?new Kw(u,Tt):"MultiLineString"===h?new rg(u,Tt,a):null;r=new(0,this.nv),this.K&&r.setGeometryName(this.K);var l=Eg(f,!1,i);r.setGeometry(l),void 0!==o&&r.setId(o),r.setProperties(s,!0)}return r},n.prototype.getType=function(){return"arraybuffer"},n.prototype.readFeatures=function(t,n){var i=this.Uh,r=this.adaptOptions(n),e=yr(r.dataProjection);e.setWorldExtent(r.extent),r.dataProjection=e;var o=new Ag(t),s=o.readFields(Cg,{}),u=[];for(var a in s)if(!i||-1!=i.indexOf(a)){var h=s[a],f=h?[0,0,h.extent,h.extent]:null;e.setExtent(f);for(var c=0,l=h.length;c<l;++c){var v=Ng(o,h,c),d=this.ov(o,v,r);null!==d&&u.push(d)}}return u},n.prototype.readProjection=function(t){return this.dataProjection},n.prototype.setLayers=function(t){this.Uh=t},n}(jg),zg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rg=function(t){function n(n){var i=this,r=n||{},e=A({},r);delete e.preload,delete e.useInterimTilesOnError,(i=t.call(this,e)||this).on,i.once,i.un,r.renderMode===Uw&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),r.renderMode=void 0);var o=r.renderMode||Bw;return St(o==Bw||o==Xw,28),i.sv=o,i.setPreload(r.preload?r.preload:0),i.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),i.getBackground,i.setBackground,i}return zg(n,t),n.prototype.createRenderer=function(){return new Zw(this)},n.prototype.getFeatures=function(n){return t.prototype.getFeatures.call(this,n)},n.prototype.getRenderMode=function(){return this.sv},n.prototype.getPreload=function(){return this.get(om)},n.prototype.getUseInterimTilesOnError=function(){return this.get(sm)},n.prototype.setPreload=function(t){this.set(om,t)},n.prototype.setUseInterimTilesOnError=function(t){this.set(sm,t)},n}($m),Fg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Gg(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].clone());return n}var Dg=function(t){function n(n){var i=t.call(this)||this;return i.uv=n||null,i.av=[],i.hv(),i}return Fg(n,t),n.prototype.fv=function(){this.av.forEach(H),this.av.length=0},n.prototype.hv=function(){if(this.uv)for(var t=0,n=this.uv.length;t<n;++t)this.av.push($(this.uv[t],L,this.changed,this))},n.prototype.clone=function(){var t=new n(null);return t.setGeometries(this.uv),t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){if(r<gn(this.getExtent(),t,n))return r;for(var e=this.uv,o=0,s=e.length;o<s;++o)r=e[o].closestPointXY(t,n,i,r);return r},n.prototype.containsXY=function(t,n){for(var i=this.uv,r=0,e=i.length;r<e;++r)if(i[r].containsXY(t,n))return!0;return!1},n.prototype.computeExtent=function(t){jn(t);for(var n=this.uv,i=0,r=n.length;i<r;++i)Cn(t,n[i].getExtent());return t},n.prototype.getGeometries=function(){return Gg(this.uv)},n.prototype.getGeometriesArray=function(){return this.uv},n.prototype.getGeometriesArrayRecursive=function(){for(var t=[],n=this.uv,i=0,r=n.length;i<r;++i)n[i].getType()===this.getType()?t=t.concat(n[i].getGeometriesArrayRecursive()):t.push(n[i]);return t},n.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 i=[],r=this.uv,e=!1,o=0,s=r.length;o<s;++o){var u=r[o],a=u.getSimplifiedGeometry(t);i.push(a),a!==u&&(e=!0)}if(e){var h=new n(null);return h.setGeometriesArray(i),h}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},n.prototype.getType=function(){return"GeometryCollection"},n.prototype.intersectsExtent=function(t){for(var n=this.uv,i=0,r=n.length;i<r;++i)if(n[i].intersectsExtent(t))return!0;return!1},n.prototype.isEmpty=function(){return 0===this.uv.length},n.prototype.rotate=function(t,n){for(var i=this.uv,r=0,e=i.length;r<e;++r)i[r].rotate(t,n);this.changed()},n.prototype.scale=function(t,n,i){var r=i;r||(r=qn(this.getExtent()));for(var e=this.uv,o=0,s=e.length;o<s;++o)e[o].scale(t,n,r);this.changed()},n.prototype.setGeometries=function(t){this.setGeometriesArray(Gg(t))},n.prototype.setGeometriesArray=function(t){this.fv(),this.uv=t,this.hv(),this.changed()},n.prototype.applyTransform=function(t){for(var n=this.uv,i=0,r=n.length;i<r;++i)n[i].applyTransform(t);this.changed()},n.prototype.translate=function(t,n){for(var i=this.uv,r=0,e=i.length;r<e;++r)i[r].translate(t,n);this.changed()},n.prototype.disposeInternal=function(){this.fv(),t.prototype.disposeInternal.call(this)},n}(Wr),qg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Ug(t){if("string"==typeof t){var n=JSON.parse(t);return n||null}return null!==t?t:null}var Bg=function(t){function n(){return t.call(this)||this}return qg(n,t),n.prototype.getType=function(){return"json"},n.prototype.readFeature=function(t,n){return this.readFeatureFromObject(Ug(t),this.getReadOptions(t,n))},n.prototype.readFeatures=function(t,n){return this.readFeaturesFromObject(Ug(t),this.getReadOptions(t,n))},n.prototype.readFeatureFromObject=function(t,n){return r()},n.prototype.readFeaturesFromObject=function(t,n){return r()},n.prototype.readGeometry=function(t,n){return this.readGeometryFromObject(Ug(t),this.getReadOptions(t,n))},n.prototype.readGeometryFromObject=function(t,n){return r()},n.prototype.readProjection=function(t){return this.readProjectionFromObject(Ug(t))},n.prototype.readProjectionFromObject=function(t){return r()},n.prototype.writeFeature=function(t,n){return JSON.stringify(this.writeFeatureObject(t,n))},n.prototype.writeFeatureObject=function(t,n){return r()},n.prototype.writeFeatures=function(t,n){return JSON.stringify(this.writeFeaturesObject(t,n))},n.prototype.writeFeaturesObject=function(t,n){return r()},n.prototype.writeGeometry=function(t,n){return JSON.stringify(this.writeGeometryObject(t,n))},n.prototype.writeGeometryObject=function(t,n){return r()},n}(jg),Xg=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Vg(t,n){if(!t)return null;var i;switch(t.type){case"Point":i=function(t){return new Se(t.coordinates)}(t);break;case"LineString":i=function(t){return new ng(t.coordinates)}(t);break;case"Polygon":i=function(t){return new We(t.coordinates)}(t);break;case"MultiPoint":i=function(t){return new Kw(t.coordinates)}(t);break;case"MultiLineString":i=function(t){return new rg(t.coordinates)}(t);break;case"MultiPolygon":i=function(t){return new sg(t.coordinates)}(t);break;case"GeometryCollection":i=function(t,n){var i=t.geometries.map((function(t){return Vg(t,n)}));return new Dg(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Eg(i,!1,n)}function Wg(t,n){var i,r=(t=Eg(t,!0,n)).getType();switch(r){case"Point":i=function(t,n){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case"LineString":i=function(t,n){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case"Polygon":i=function(t,n){var i;n&&(i=n.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,n);break;case"MultiPoint":i=function(t,n){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case"MultiLineString":i=function(t,n){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case"MultiPolygon":i=function(t,n){var i;n&&(i=n.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,n);break;case"GeometryCollection":i=function(t,n){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=A({},n);return delete i.featureProjection,Wg(t,i)}))}}(t,n);break;case"Circle":i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return i}var Yg,Zg=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this)||this).dataProjection=yr(r.dataProjection?r.dataProjection:"EPSG:4326"),r.featureProjection&&(i.defaultFeatureProjection=yr(r.featureProjection)),i.K=r.geometryName,i.cv=r.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return Xg(n,t),n.prototype.readFeatureFromObject=function(t,n){var i=null,r=Vg((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,n),e=new Et;return this.K?e.setGeometryName(this.K):this.cv&&"geometry_name"in i!==void 0&&e.setGeometryName(i.geometry_name),e.setGeometry(r),"id"in i&&e.setId(i.id),i.properties&&e.setProperties(i.properties,!0),e},n.prototype.readFeaturesFromObject=function(t,n){var i=null;if("FeatureCollection"===t.type){i=[];for(var r=t.features,e=0,o=r.length;e<o;++e)i.push(this.readFeatureFromObject(r[e],n))}else i=[this.readFeatureFromObject(t,n)];return i},n.prototype.readGeometryFromObject=function(t,n){return Vg(t,n)},n.prototype.readProjectionFromObject=function(t){var n,i=t.crs;return i?"name"==i.type?n=yr(i.properties.name):"EPSG"===i.type?n=yr("EPSG:"+i.properties.code):St(!1,36):n=this.dataProjection,n},n.prototype.writeFeatureObject=function(t,n){n=this.adaptOptions(n);var i={type:"Feature",geometry:null,properties:null},r=t.getId();if(void 0!==r&&(i.id=r),!t.hasProperties())return i;var e=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=Wg(o,n),delete e[t.getGeometryName()]),k(e)||(i.properties=e),i},n.prototype.writeFeaturesObject=function(t,n){n=this.adaptOptions(n);for(var i=[],r=0,e=t.length;r<e;++r)i.push(this.writeFeatureObject(t[r],n));return{type:"FeatureCollection",features:i}},n.prototype.writeGeometryObject=function(t,n){return Wg(t,this.adaptOptions(n))},n}(Bg),$g={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Kg(t){return(t=Math.round(t))<0?0:t>255?255:t}function Hg(t){return t<0?0:t>1?1:t}function Jg(t){return"%"===t[t.length-1]?Kg(parseFloat(t)/100*255):Kg(parseInt(t))}function Qg(t){return"%"===t[t.length-1]?Hg(parseFloat(t)/100):Hg(parseFloat(t))}function tb(t,n,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(n-t)*i*6:2*i<1?n:3*i<2?t+(n-t)*(2/3-i)*6:t}try{Yg={}.parseCSSColor=function(t){var n,i=t.replace(/ /g,"").toLowerCase();if(i in $g)return $g[i].slice();if("#"===i[0])return 4===i.length?(n=parseInt(i.substr(1),16))>=0&&n<=4095?[(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1]:null:7===i.length&&(n=parseInt(i.substr(1),16))>=0&&n<=16777215?[(16711680&n)>>16,(65280&n)>>8,255&n,1]:null;var r=i.indexOf("("),e=i.indexOf(")");if(-1!==r&&e+1===i.length){var o=i.substr(0,r),s=i.substr(r+1,e-(r+1)).split(","),u=1;switch(o){case"rgba":if(4!==s.length)return null;u=Qg(s.pop());case"rgb":return 3!==s.length?null:[Jg(s[0]),Jg(s[1]),Jg(s[2]),u];case"hsla":if(4!==s.length)return null;u=Qg(s.pop());case"hsl":if(3!==s.length)return null;var a=(parseFloat(s[0])%360+360)%360/360,h=Qg(s[1]),f=Qg(s[2]),c=f<=.5?f*(h+1):f+h-f*h,l=2*f-c;return[Kg(255*tb(l,c,a+1/3)),Kg(255*tb(l,c,a)),Kg(255*tb(l,c,a-1/3)),u];default:return null}}return null}}catch(t){}var nb=function(t,n,i,r){void 0===r&&(r=1),this.r=t,this.g=n,this.b=i,this.a=r};function ib(t){return"object"==typeof t?["literal",t]:t}function rb(t,n){var i=t.stops;if(!i)return function(t,n){var i=["get",t.property];if(void 0===t.default)return"string"===n.type?["string",i]:i;if("enum"===n.type)return["match",i,Object.keys(n.values),i,t.default];var r=["color"===n.type?"to-color":n.type,i,ib(t.default)];return"array"===n.type&&r.splice(1,0,n.value,n.length||null),r}(t,n);var r=i&&"object"==typeof i[0][0],e=r||void 0!==t.property,o=r||!e;return i=i.map((function(t){return!e&&n.tokens&&"string"==typeof t[1]?[t[0],fb(t[1])]:[t[0],ib(t[1])]})),r?function(t,n,i){for(var r={},e={},o=[],s=0;s<i.length;s++){var u=i[s],a=u[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:t.type,property:t.property,default:t.default},e[a]=[],o.push(a)),e[a].push([u[0].value,u[1]])}if("exponential"===hb({},n)){for(var h=[eb(t),["linear"],["zoom"]],f=0,c=o;f<c.length;f+=1){var l=c[f];ab(h,l,sb(r[l],n,e[l]),!1)}return h}for(var v=["step",["zoom"]],d=0,p=o;d<p.length;d+=1){var y=p[d];ab(v,y,sb(r[y],n,e[y]),!0)}return ub(v),v}(t,n,i):o?function(t,n,i,r){void 0===r&&(r=["zoom"]);var e,o=hb(t,n),s=!1;if("interval"===o)e=["step",r],s=!0;else{if("exponential"!==o)throw new Error('Unknown zoom function type "'+o+'"');var u=void 0!==t.base?t.base:1;e=[eb(t),1===u?["linear"]:["exponential",u],r]}for(var a=0,h=i;a<h.length;a+=1){var f=h[a];ab(e,f[0],f[1],s)}return ub(e),e}(t,n,i):sb(t,n,i)}function eb(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function ob(t,n){var i,r,e=ib((i=t.default,r=n.default,void 0!==i?i:void 0!==r?r:void 0));return void 0===e&&"resolvedImage"===n.type?"":e}function sb(t,n,i){var r=hb(t,n),e=["get",t.property];if("categorical"===r&&"boolean"==typeof i[0][0]){for(var o=["case"],s=0,u=i;s<u.length;s+=1){var a=u[s];o.push(["==",e,a[0]],a[1])}return o.push(ob(t,n)),o}if("categorical"===r){for(var h=["match",e],f=0,c=i;f<c.length;f+=1){var l=c[f];ab(h,l[0],l[1],!1)}return h.push(ob(t,n)),h}if("interval"===r){for(var v=["step",["number",e]],d=0,p=i;d<p.length;d+=1){var y=p[d];ab(v,y[0],y[1],!0)}return ub(v),void 0===t.default?v:["case",["==",["typeof",e],"number"],v,ib(t.default)]}if("exponential"===r){for(var m=void 0!==t.base?t.base:1,w=[eb(t),1===m?["linear"]:["exponential",m],["number",e]],g=0,b=i;g<b.length;g+=1){var x=b[g];ab(w,x[0],x[1],!1)}return void 0===t.default?w:["case",["==",["typeof",e],"number"],w,ib(t.default)]}throw new Error("Unknown property function type "+r)}function ub(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function ab(t,n,i,r){t.length>3&&n===t[t.length-2]||(r&&2===t.length||t.push(n),t.push(i))}function hb(t,n){return t.type?t.type:n.expression.interpolated?"exponential":"interval"}function fb(t){for(var n=["concat"],i=/{([^{}]+)}/g,r=0,e=i.exec(t);null!==e;e=i.exec(t)){var o=t.slice(r,i.lastIndex-e[0].length);r=i.lastIndex,o.length>0&&n.push(o),n.push(["get",e[1]])}if(1===n.length)return t;if(r<t.length)n.push(t.slice(r));else if(2===n.length)return["to-string",n[1]];return n}nb.parse=function(t){if(t){if(t instanceof nb)return t;if("string"==typeof t){var n=Yg(t);if(n)return new nb(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3])}}},nb.prototype.toString=function(){var t=this.toArray(),n=t[0],i=t[1],r=t[2],e=t[3];return"rgba("+Math.round(n)+","+Math.round(i)+","+Math.round(r)+","+e+")"},nb.prototype.toArray=function(){var t=this,n=t.r,i=t.g,r=t.b,e=t.a;return 0===e?[0,0,0,0]:[255*n/e,255*i/e,255*r/e,e]},nb.black=new nb(0,0,0,1),nb.white=new nb(1,1,1,1),nb.transparent=new nb(0,0,0,0),nb.red=new nb(1,0,0,1),nb.blue=new nb(0,0,1,1);var cb=function(t){function n(n,i){t.call(this,i),this.message=i,this.key=n}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n}(Error),lb=function(t,n){void 0===n&&(n=[]),this.parent=t,this.bindings={};for(var i=0,r=n;i<r.length;i+=1){var e=r[i],o=e[0],s=e[1];this.bindings[o]=s}};lb.prototype.concat=function(t){return new lb(this,t)},lb.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},lb.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var vb={kind:"null"},db={kind:"number"},pb={kind:"string"},yb={kind:"boolean"},mb={kind:"color"},wb={kind:"object"},gb={kind:"value"},bb={kind:"collator"},xb={kind:"formatted"},Mb={kind:"resolvedImage"};function _b(t,n){return{kind:"array",itemType:t,N:n}}function Sb(t){if("array"===t.kind){var n=Sb(t.itemType);return"number"==typeof t.N?"array<"+n+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+n+">"}return t.kind}var Ob=[vb,db,pb,yb,mb,xb,wb,_b(gb),Mb];function jb(t,n){if("error"===n.kind)return null;if("array"===t.kind){if("array"===n.kind&&(0===n.N&&"value"===n.itemType.kind||!jb(t.itemType,n.itemType))&&("number"!=typeof t.N||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if("value"===t.kind)for(var i=0,r=Ob;i<r.length;i+=1){if(!jb(r[i],n))return null}}return"Expected "+Sb(t)+" but found "+Sb(n)+" instead."}function Eb(t,n){return n.some((function(n){return n.kind===t.kind}))}function Tb(t,n){return n.some((function(n){return"null"===n?null===t:"array"===n?Array.isArray(t):"object"===n?t&&!Array.isArray(t)&&"object"==typeof t:n===typeof t}))}var Ab=function(t,n,i){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};Ab.prototype.compare=function(t,n){return this.collator.compare(t,n)},Ab.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Pb=function(t,n,i,r,e){this.text=t.normalize?t.normalize():t,this.image=n,this.scale=i,this.fontStack=r,this.textColor=e},Cb=function(t){this.sections=t};Cb.fromString=function(t){return new Cb([new Pb(t,null,null,null,null)])},Cb.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},Cb.factory=function(t){return t instanceof Cb?t:Cb.fromString(t)},Cb.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},Cb.prototype.serialize=function(){for(var t=["format"],n=0,i=this.sections;n<i.length;n+=1){var r=i[n];if(r.image)t.push(["image",r.image.name]);else{t.push(r.text);var e={};r.fontStack&&(e["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(e["font-scale"]=r.scale),r.textColor&&(e["text-color"]=["rgba"].concat(r.textColor.toArray())),t.push(e)}}return t};var kb=function(t){this.name=t.name,this.available=t.available};function Ib(t,n,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,n,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,n,i,r]:[t,n,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function Nb(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof nb)return!0;if(t instanceof Ab)return!0;if(t instanceof Cb)return!0;if(t instanceof kb)return!0;if(Array.isArray(t)){for(var n=0,i=t;n<i.length;n+=1){if(!Nb(i[n]))return!1}return!0}if("object"==typeof t){for(var r in t)if(!Nb(t[r]))return!1;return!0}return!1}function Lb(t){if(null===t)return vb;if("string"==typeof t)return pb;if("boolean"==typeof t)return yb;if("number"==typeof t)return db;if(t instanceof nb)return mb;if(t instanceof Ab)return bb;if(t instanceof Cb)return xb;if(t instanceof kb)return Mb;if(Array.isArray(t)){for(var n,i=t.length,r=0,e=t;r<e.length;r+=1){var o=Lb(e[r]);if(n){if(n===o)continue;n=gb;break}n=o}return _b(n||gb,i)}return wb}function zb(t){var n=typeof t;return null===t?"":"string"===n||"number"===n||"boolean"===n?String(t):t instanceof nb||t instanceof Cb||t instanceof kb?t.toString():JSON.stringify(t)}kb.prototype.toString=function(){return this.name},kb.fromString=function(t){return t?new kb({name:t,available:!1}):null},kb.prototype.serialize=function(){return["image",this.name]};var Rb=function(t,n){this.type=t,this.value=n};Rb.parse=function(t,n){if(2!==t.length)return n.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!Nb(t[1]))return n.error("invalid value");var i=t[1],r=Lb(i),e=n.expectedType;return"array"!==r.kind||0!==r.N||!e||"array"!==e.kind||"number"==typeof e.N&&0!==e.N||(r=e),new Rb(r,i)},Rb.prototype.evaluate=function(){return this.value},Rb.prototype.eachChild=function(){},Rb.prototype.outputDefined=function(){return!0},Rb.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof nb?["rgba"].concat(this.value.toArray()):this.value instanceof Cb?this.value.serialize():this.value};var Fb=function(t){this.name="ExpressionEvaluationError",this.message=t};Fb.prototype.toJSON=function(){return this.message};var Gb={string:pb,number:db,boolean:yb,object:wb},Db=function(t,n){this.type=t,this.args=n};Db.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var i,r=1,e=t[0];if("array"===e){var o,s;if(t.length>2){var u=t[1];if("string"!=typeof u||!(u in Gb)||"object"===u)return n.error('The item type argument of "array" must be one of string, number, boolean',1);o=Gb[u],r++}else o=gb;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);s=t[2],r++}i=_b(o,s)}else i=Gb[e];for(var a=[];r<t.length;r++){var h=n.parse(t[r],r,gb);if(!h)return null;a.push(h)}return new Db(i,a)},Db.prototype.evaluate=function(t){for(var n=0;n<this.args.length;n++){var i=this.args[n].evaluate(t);if(!jb(this.type,Lb(i)))return i;if(n===this.args.length-1)throw new Fb("Expected value to be of type "+Sb(this.type)+", but found "+Sb(Lb(i))+" instead.")}return null},Db.prototype.eachChild=function(t){this.args.forEach(t)},Db.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Db.prototype.serialize=function(){var t=this.type,n=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){n.push(i.kind);var r=t.N;("number"==typeof r||this.args.length>1)&&n.push(r)}}return n.concat(this.args.map((function(t){return t.serialize()})))};var qb=function(t){this.type=xb,this.sections=t};qb.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return n.error("First argument must be an image or text section.");for(var r=[],e=!1,o=1;o<=t.length-1;++o){var s=t[o];if(e&&"object"==typeof s&&!Array.isArray(s)){e=!1;var u=null;if(s["font-scale"]&&!(u=n.parse(s["font-scale"],1,db)))return null;var a=null;if(s["text-font"]&&!(a=n.parse(s["text-font"],1,_b(pb))))return null;var h=null;if(s["text-color"]&&!(h=n.parse(s["text-color"],1,mb)))return null;var f=r[r.length-1];f.scale=u,f.font=a,f.textColor=h}else{var c=n.parse(t[o],1,gb);if(!c)return null;var l=c.type.kind;if("string"!==l&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");e=!0,r.push({content:c,scale:null,font:null,textColor:null})}}return new qb(r)},qb.prototype.evaluate=function(t){return new Cb(this.sections.map((function(n){var i=n.content.evaluate(t);return Lb(i)===Mb?new Pb("",i,null,null,null):new Pb(zb(i),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)})))},qb.prototype.eachChild=function(t){for(var n=0,i=this.sections;n<i.length;n+=1){var r=i[n];t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}},qb.prototype.outputDefined=function(){return!1},qb.prototype.serialize=function(){for(var t=["format"],n=0,i=this.sections;n<i.length;n+=1){var r=i[n];t.push(r.content.serialize());var e={};r.scale&&(e["font-scale"]=r.scale.serialize()),r.font&&(e["text-font"]=r.font.serialize()),r.textColor&&(e["text-color"]=r.textColor.serialize()),t.push(e)}return t};var Ub=function(t){this.type=Mb,this.input=t};Ub.parse=function(t,n){if(2!==t.length)return n.error("Expected two arguments.");var i=n.parse(t[1],1,pb);return i?new Ub(i):n.error("No image name provided.")},Ub.prototype.evaluate=function(t){var n=this.input.evaluate(t),i=kb.fromString(n);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(n)>-1),i},Ub.prototype.eachChild=function(t){t(this.input)},Ub.prototype.outputDefined=function(){return!1},Ub.prototype.serialize=function(){return["image",this.input.serialize()]};var Bb={"to-boolean":yb,"to-color":mb,"to-number":db,"to-string":pb},Xb=function(t,n){this.type=t,this.args=n};Xb.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return n.error("Expected one argument.");for(var r=Bb[i],e=[],o=1;o<t.length;o++){var s=n.parse(t[o],o,gb);if(!s)return null;e.push(s)}return new Xb(r,e)},Xb.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var n,i,r=0,e=this.args;r<e.length;r+=1){if(i=null,(n=e[r].evaluate(t))instanceof nb)return n;if("string"==typeof n){var o=t.parseColor(n);if(o)return o}else if(Array.isArray(n)&&!(i=n.length<3||n.length>4?"Invalid rbga value "+JSON.stringify(n)+": expected an array containing either three or four numeric values.":Ib(n[0],n[1],n[2],n[3])))return new nb(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new Fb(i||"Could not parse color from value '"+("string"==typeof n?n:String(JSON.stringify(n)))+"'")}if("number"===this.type.kind){for(var s=null,u=0,a=this.args;u<a.length;u+=1){if(null===(s=a[u].evaluate(t)))return 0;var h=Number(s);if(!isNaN(h))return h}throw new Fb("Could not convert "+JSON.stringify(s)+" to number.")}return"formatted"===this.type.kind?Cb.fromString(zb(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?kb.fromString(zb(this.args[0].evaluate(t))):zb(this.args[0].evaluate(t))},Xb.prototype.eachChild=function(t){this.args.forEach(t)},Xb.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Xb.prototype.serialize=function(){if("formatted"===this.type.kind)return new qb([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ub(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(n){t.push(n.serialize())})),t};var Vb=["Unknown","Point","LineString","Polygon"],Wb=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null};Wb.prototype.id=function(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null},Wb.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Vb[this.feature.type]:this.feature.type:null},Wb.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Wb.prototype.canonicalID=function(){return this.canonical},Wb.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Wb.prototype.distanceFromCenter=function(){if(this.featureTileCoord&&this.featureDistanceData){var t=this.featureDistanceData.center,n=this.featureDistanceData.scale,i=this.featureTileCoord,r=i.x,e=i.y,o=r*n-t[0],s=e*n-t[1];return this.featureDistanceData.bearing[0]*o+this.featureDistanceData.bearing[1]*s}return 0},Wb.prototype.parseColor=function(t){var n=this._parseColorCache[t];return n||(n=this._parseColorCache[t]=nb.parse(t)),n};var Yb=function(t,n,i,r){this.name=t,this.type=n,this._evaluate=i,this.args=r};Yb.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Yb.prototype.eachChild=function(t){this.args.forEach(t)},Yb.prototype.outputDefined=function(){return!1},Yb.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Yb.parse=function(t,n){var i,r=t[0],e=Yb.definitions[r];if(!e)return n.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(e)?e[0]:e.type,s=Array.isArray(e)?[[e[1],e[2]]]:e.overloads,u=s.filter((function(n){var i=n[0];return!Array.isArray(i)||i.length===t.length-1})),a=null,h=0,f=u;h<f.length;h+=1){var c=f[h],l=c[0],v=c[1];a=new mx(n.registry,n.path,null,n.scope);for(var d=[],p=!1,y=1;y<t.length;y++){var m=t[y],w=Array.isArray(l)?l[y-1]:l.type,g=a.parse(m,1+d.length,w);if(!g){p=!0;break}d.push(g)}if(!p)if(Array.isArray(l)&&l.length!==d.length)a.error("Expected "+l.length+" arguments, but found "+d.length+" instead.");else{for(var b=0;b<d.length;b++){var x=Array.isArray(l)?l[b]:l.type,M=d[b];a.concat(b+1).checkSubtype(x,M.type)}if(0===a.errors.length)return new Yb(r,o,v,d)}}if(1===u.length)(i=n.errors).push.apply(i,a.errors);else{for(var _=(u.length?u:s).map((function(t){var n,i=t[0];return n=i,Array.isArray(n)?"("+n.map(Sb).join(", ")+")":"("+Sb(n.type)+"...)"})).join(" | "),S=[],O=1;O<t.length;O++){var j=n.parse(t[O],1+S.length);if(!j)return null;S.push(Sb(j.type))}n.error("Expected arguments of type "+_+", but found ("+S.join(", ")+") instead.")}return null},Yb.register=function(t,n){for(var i in Yb.definitions=n,n)t[i]=Yb};var Zb=function(t,n,i){this.type=bb,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=n};Zb.parse=function(t,n){if(2!==t.length)return n.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return n.error("Collator options argument must be an object.");var r=n.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,yb);if(!r)return null;var e=n.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,yb);if(!e)return null;var o=null;return i.locale&&!(o=n.parse(i.locale,1,pb))?null:new Zb(r,e,o)},Zb.prototype.evaluate=function(t){return new Ab(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Zb.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Zb.prototype.outputDefined=function(){return!1},Zb.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var $b=8192;function Kb(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function Hb(t,n){return!(t[0]<=n[0])&&(!(t[2]>=n[2])&&(!(t[1]<=n[1])&&!(t[3]>=n[3])))}function Jb(t,n){var i,r=(180+t[0])/360,e=(i=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360),o=Math.pow(2,n.z);return[Math.round(r*o*$b),Math.round(e*o*$b)]}function Qb(t,n,i){var r=t[0]-n[0],e=t[1]-n[1],o=t[0]-i[0],s=t[1]-i[1];return r*s-o*e==0&&r*o<=0&&e*s<=0}function tx(t,n,i){return n[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-n[0])*(t[1]-n[1])/(i[1]-n[1])+n[0]}function nx(t,n){for(var i=!1,r=0,e=n.length;r<e;r++)for(var o=n[r],s=0,u=o.length;s<u-1;s++){if(Qb(t,o[s],o[s+1]))return!1;tx(t,o[s],o[s+1])&&(i=!i)}return i}function ix(t,n){for(var i=0;i<n.length;i++)if(nx(t,n[i]))return!0;return!1}function rx(t,n,i,r){var e=t[0]-i[0],o=t[1]-i[1],s=n[0]-i[0],u=n[1]-i[1],a=r[0]-i[0],h=r[1]-i[1],f=e*h-a*o,c=s*h-a*u;return f>0&&c<0||f<0&&c>0}function ex(t,n,i){for(var r=0,e=i;r<e.length;r+=1)for(var o=e[r],s=0;s<o.length-1;++s)if(u=t,a=n,h=o[s],f=o[s+1],c=void 0,l=void 0,v=void 0,d=void 0,v=[a[0]-u[0],a[1]-u[1]],d=[f[0]-h[0],f[1]-h[1]],0!=(c=d)[0]*(l=v)[1]-c[1]*l[0]&&rx(u,a,h,f)&&rx(h,f,u,a))return!0;var u,a,h,f,c,l,v,d;return!1}function ox(t,n){for(var i=0;i<t.length;++i)if(!nx(t[i],n))return!1;for(var r=0;r<t.length-1;++r)if(ex(t[r],t[r+1],n))return!1;return!0}function sx(t,n){for(var i=0;i<n.length;i++)if(ox(t,n[i]))return!0;return!1}function ux(t,n,i){for(var r=[],e=0;e<t.length;e++){for(var o=[],s=0;s<t[e].length;s++){var u=Jb(t[e][s],i);Kb(n,u),o.push(u)}r.push(o)}return r}function ax(t,n,i){for(var r=[],e=0;e<t.length;e++){var o=ux(t[e],n,i);r.push(o)}return r}function hx(t,n,i,r){if(t[0]<i[0]||t[0]>i[2]){var e=.5*r,o=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===o&&(o=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=o}Kb(n,t)}function fx(t,n,i,r){var e=Math.pow(2,r.z)*$b,o=[r.x*$b,r.y*$b],s=[];if(!t)return s;for(var u=0,a=t;u<a.length;u+=1)for(var h=0,f=a[u];h<f.length;h+=1){var c=f[h],l=[c.x+o[0],c.y+o[1]];hx(l,n,i,e),s.push(l)}return s}function cx(t,n,i,r){var e=Math.pow(2,r.z)*$b,o=[r.x*$b,r.y*$b],s=[];if(!t)return s;for(var u=0,a=t;u<a.length;u+=1){for(var h=[],f=0,c=a[u];f<c.length;f+=1){var l=c[f],v=[l.x+o[0],l.y+o[1]];Kb(n,v),h.push(v)}s.push(h)}if(n[2]-n[0]<=e/2){!function(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}(n);for(var d=0,p=s;d<p.length;d+=1)for(var y=0,m=p[d];y<m.length;y+=1){hx(m[y],n,i,e)}}return s}var lx=function(t,n){this.type=yb,this.geojson=t,this.geometries=n};function vx(t){if(t instanceof Yb){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof lx)return!1;var n=!0;return t.eachChild((function(t){n&&!vx(t)&&(n=!1)})),n}function dx(t){if(t instanceof Yb&&"feature-state"===t.name)return!1;var n=!0;return t.eachChild((function(t){n&&!dx(t)&&(n=!1)})),n}function px(t,n){if(t instanceof Yb&&n.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!px(t,n)&&(i=!1)})),i}lx.parse=function(t,n){if(2!==t.length)return n.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(Nb(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var r=0;r<i.features.length;++r){var e=i.features[r].geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new lx(i,i.features[r].geometry)}else if("Feature"===i.type){var o=i.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new lx(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new lx(i,i)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")},lx.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,n){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],e=t.canonicalID();if(!e)return!1;if("Polygon"===n.type){var o=ux(n.coordinates,r,e),s=fx(t.geometry(),i,r,e);if(!Hb(i,r))return!1;for(var u=0,a=s;u<a.length;u+=1)if(!nx(a[u],o))return!1}if("MultiPolygon"===n.type){var h=ax(n.coordinates,r,e),f=fx(t.geometry(),i,r,e);if(!Hb(i,r))return!1;for(var c=0,l=f;c<l.length;c+=1)if(!ix(l[c],h))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,n){var i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],e=t.canonicalID();if(!e)return!1;if("Polygon"===n.type){var o=ux(n.coordinates,r,e),s=cx(t.geometry(),i,r,e);if(!Hb(i,r))return!1;for(var u=0,a=s;u<a.length;u+=1)if(!ox(a[u],o))return!1}if("MultiPolygon"===n.type){var h=ax(n.coordinates,r,e),f=cx(t.geometry(),i,r,e);if(!Hb(i,r))return!1;for(var c=0,l=f;c<l.length;c+=1)if(!sx(l[c],h))return!1}return!0}(t,this.geometries)}return!1},lx.prototype.eachChild=function(){},lx.prototype.outputDefined=function(){return!0},lx.prototype.serialize=function(){return["within",this.geojson]};var yx=function(t,n){this.type=n.type,this.name=t,this.boundExpression=n};yx.parse=function(t,n){if(2!==t.length||"string"!=typeof t[1])return n.error("'var' expression requires exactly one string literal argument.");var i=t[1];return n.scope.has(i)?new yx(i,n.scope.get(i)):n.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},yx.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},yx.prototype.eachChild=function(){},yx.prototype.outputDefined=function(){return!1},yx.prototype.serialize=function(){return["var",this.name]};var mx=function(t,n,i,r,e){void 0===n&&(n=[]),void 0===r&&(r=new lb),void 0===e&&(e=[]),this.registry=t,this.path=n,this.key=n.map((function(t){return"["+t+"]"})).join(""),this.scope=r,this.errors=e,this.expectedType=i};function wx(t){if(t instanceof yx)return wx(t.boundExpression);if(t instanceof Yb&&"error"===t.name)return!1;if(t instanceof Zb)return!1;if(t instanceof lx)return!1;var n=t instanceof Xb||t instanceof Db,i=!0;return t.eachChild((function(t){i=n?i&&wx(t):i&&t instanceof Rb})),!!i&&(vx(t)&&px(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function gx(t,n){for(var i,r,e=t.length-1,o=0,s=e,u=0;o<=s;)if(i=t[u=Math.floor((o+s)/2)],r=t[u+1],i<=n){if(u===e||n<r)return u;o=u+1}else{if(!(i>n))throw new Fb("Input is not a number.");s=u-1}return 0}mx.prototype.parse=function(t,n,i,r,e){return void 0===e&&(e={}),n?this.concat(n,i,r)._parse(t,e):this._parse(t,e)},mx.prototype._parse=function(t,n){function i(t,n,i){return"assert"===i?new Db(n,[t]):"coerce"===i?new Xb(n,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var e=this.registry[r];if(e){var o=e.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,u=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==u.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==u.kind&&"string"!==u.kind){if(this.checkSubtype(s,u))return null}else o=i(o,s,n.typeAnnotation||"coerce");else o=i(o,s,n.typeAnnotation||"assert")}if(!(o instanceof Rb)&&"resolvedImage"!==o.type.kind&&wx(o)){var a=new Wb;try{o=new Rb(o.type,o.evaluate(a))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},mx.prototype.concat=function(t,n,i){var r="number"==typeof t?this.path.concat(t):this.path,e=i?this.scope.concat(i):this.scope;return new mx(this.registry,r,n||null,e,this.errors)},mx.prototype.error=function(t){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];var r=""+this.key+n.map((function(t){return"["+t+"]"})).join("");this.errors.push(new cb(r,t))},mx.prototype.checkSubtype=function(t,n){var i=jb(t,n);return i&&this.error(i),i};var bx=function(t,n,i){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(var r=0,e=i;r<e.length;r+=1){var o=e[r],s=o[0],u=o[1];this.labels.push(s),this.outputs.push(u)}};bx.parse=function(t,n){if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");var i=n.parse(t[1],1,db);if(!i)return null;var r=[],e=null;n.expectedType&&"value"!==n.expectedType.kind&&(e=n.expectedType);for(var o=1;o<t.length;o+=2){var s=1===o?-1/0:t[o],u=t[o+1],a=o,h=o+1;if("number"!=typeof s)return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(r.length&&r[r.length-1][0]>=s)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);var f=n.parse(u,h,e);if(!f)return null;e=e||f.type,r.push([s,f])}return new bx(e,i,r)},bx.prototype.evaluate=function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;return r>=n[e-1]?i[e-1].evaluate(t):i[gx(n,r)].evaluate(t)},bx.prototype.eachChild=function(t){t(this.input);for(var n=0,i=this.outputs;n<i.length;n+=1){t(i[n])}},bx.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},bx.prototype.serialize=function(){for(var t=["step",this.input.serialize()],n=0;n<this.labels.length;n++)n>0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t};var xx=Mx;function Mx(t,n,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(r-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=i,this.p2y=r}function _x(t,n,i){return t*(1-i)+n*i}Mx.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Mx.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Mx.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Mx.prototype.solveCurveX=function(t,n){var i,r,e,o,s;for(void 0===n&&(n=1e-6),e=t,s=0;s<8;s++){if(o=this.sampleCurveX(e)-t,Math.abs(o)<n)return e;var u=this.sampleCurveDerivativeX(e);if(Math.abs(u)<1e-6)break;e-=o/u}if((e=t)<(i=0))return i;if(e>(r=1))return r;for(;i<r;){if(o=this.sampleCurveX(e),Math.abs(o-t)<n)return e;t>o?i=e:r=e,e=.5*(r-i)+i}return e},Mx.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var Sx=Object.freeze({__proto__:null,number:_x,color:function(t,n,i){return new nb(_x(t.r,n.r,i),_x(t.g,n.g,i),_x(t.b,n.b,i),_x(t.a,n.a,i))},array:function(t,n,i){return t.map((function(t,r){return _x(t,n[r],i)}))}}),Ox=.95047,jx=1.08883,Ex=4/29,Tx=6/29,Ax=3*Tx*Tx,Px=Math.PI/180,Cx=180/Math.PI;function kx(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ax+Ex}function Ix(t){return t>Tx?t*t*t:Ax*(t-Ex)}function Nx(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Lx(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function zx(t){var n=Lx(t.r),i=Lx(t.g),r=Lx(t.b),e=kx((.4124564*n+.3575761*i+.1804375*r)/Ox),o=kx((.2126729*n+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(e-o),b:200*(o-kx((.0193339*n+.119192*i+.9503041*r)/jx)),alpha:t.a}}function Rx(t){var n=(t.l+16)/116,i=isNaN(t.a)?n:n+t.a/500,r=isNaN(t.b)?n:n-t.b/200;return n=1*Ix(n),i=Ox*Ix(i),r=jx*Ix(r),new nb(Nx(3.2404542*i-1.5371385*n-.4985314*r),Nx(-.969266*i+1.8760108*n+.041556*r),Nx(.0556434*i-.2040259*n+1.0572252*r),t.alpha)}function Fx(t,n,i){var r=n-t;return t+i*(r>180||r<-180?r-360*Math.round(r/360):r)}var Gx={forward:zx,reverse:Rx,interpolate:function(t,n,i){return{l:_x(t.l,n.l,i),a:_x(t.a,n.a,i),b:_x(t.b,n.b,i),alpha:_x(t.alpha,n.alpha,i)}}},Dx={forward:function(t){var n=zx(t),i=n.l,r=n.a,e=n.b,o=Math.atan2(e,r)*Cx;return{h:o<0?o+360:o,c:Math.sqrt(r*r+e*e),l:i,alpha:t.a}},reverse:function(t){var n=t.h*Px,i=t.c;return Rx({l:t.l,a:Math.cos(n)*i,b:Math.sin(n)*i,alpha:t.alpha})},interpolate:function(t,n,i){return{h:Fx(t.h,n.h,i),c:_x(t.c,n.c,i),l:_x(t.l,n.l,i),alpha:_x(t.alpha,n.alpha,i)}}},qx=function(t,n,i,r,e){this.type=t,this.operator=n,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var o=0,s=e;o<s.length;o+=1){var u=s[o],a=u[0],h=u[1];this.labels.push(a),this.outputs.push(h)}};function Ux(t,n,i,r){var e=r-i,o=t-i;return 0===e?0:1===n?o/e:(Math.pow(n,o)-1)/(Math.pow(n,e)-1)}qx.interpolationFactor=function(t,n,i,r){var e=0;if("exponential"===t.name)e=Ux(n,t.base,i,r);else if("linear"===t.name)e=Ux(n,1,i,r);else if("cubic-bezier"===t.name){var o=t.controlPoints;e=new xx(o[0],o[1],o[2],o[3]).solve(Ux(n,1,i,r))}return e},qx.parse=function(t,n){var i=t[0],r=t[1],e=t[2],o=t.slice(3);if(!Array.isArray(r)||0===r.length)return n.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var s=r[1];if("number"!=typeof s)return n.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:s}}else{if("cubic-bezier"!==r[0])return n.error("Unknown interpolation type "+String(r[0]),1,0);var u=r.slice(1);if(4!==u.length||u.some((function(t){return"number"!=typeof t||t<0||t>1})))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:u}}if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(e=n.parse(e,2,db)))return null;var a=[],h=null;"interpolate-hcl"===i||"interpolate-lab"===i?h=mb:n.expectedType&&"value"!==n.expectedType.kind&&(h=n.expectedType);for(var f=0;f<o.length;f+=2){var c=o[f],l=o[f+1],v=f+3,d=f+4;if("number"!=typeof c)return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',v);if(a.length&&a[a.length-1][0]>=c)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',v);var p=n.parse(l,d,h);if(!p)return null;h=h||p.type,a.push([c,p])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new qx(h,i,r,e,a):n.error("Type "+Sb(h)+" is not interpolatable.")},qx.prototype.evaluate=function(t){var n=this.labels,i=this.outputs;if(1===n.length)return i[0].evaluate(t);var r=this.input.evaluate(t);if(r<=n[0])return i[0].evaluate(t);var e=n.length;if(r>=n[e-1])return i[e-1].evaluate(t);var o=gx(n,r),s=n[o],u=n[o+1],a=qx.interpolationFactor(this.interpolation,r,s,u),h=i[o].evaluate(t),f=i[o+1].evaluate(t);return"interpolate"===this.operator?Sx[this.type.kind.toLowerCase()](h,f,a):"interpolate-hcl"===this.operator?Dx.reverse(Dx.interpolate(Dx.forward(h),Dx.forward(f),a)):Gx.reverse(Gx.interpolate(Gx.forward(h),Gx.forward(f),a))},qx.prototype.eachChild=function(t){t(this.input);for(var n=0,i=this.outputs;n<i.length;n+=1){t(i[n])}},qx.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},qx.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var n=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)n.push(this.labels[i],this.outputs[i].serialize());return n};var Bx=function(t,n){this.type=t,this.args=n};Bx.parse=function(t,n){if(t.length<2)return n.error("Expectected at least one argument.");var i=null,r=n.expectedType;r&&"value"!==r.kind&&(i=r);for(var e=[],o=0,s=t.slice(1);o<s.length;o+=1){var u=s[o],a=n.parse(u,1+e.length,i,void 0,{typeAnnotation:"omit"});if(!a)return null;i=i||a.type,e.push(a)}var h=r&&e.some((function(t){return jb(r,t.type)}));return new Bx(h?gb:i,e)},Bx.prototype.evaluate=function(t){for(var n,i=null,r=0,e=0,o=this.args;e<o.length;e+=1){if(r++,(i=o[e].evaluate(t))&&i instanceof kb&&!i.available&&(n||(n=i),i=null,r===this.args.length))return n;if(null!==i)break}return i},Bx.prototype.eachChild=function(t){this.args.forEach(t)},Bx.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Bx.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(n){t.push(n.serialize())})),t};var Xx=function(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n};Xx.prototype.evaluate=function(t){return this.result.evaluate(t)},Xx.prototype.eachChild=function(t){for(var n=0,i=this.bindings;n<i.length;n+=1){t(i[n][1])}t(this.result)},Xx.parse=function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],r=1;r<t.length-1;r+=2){var e=t[r];if("string"!=typeof e)return n.error("Expected string, but found "+typeof e+" instead.",r);if(/[^a-zA-Z0-9_]/.test(e))return n.error("Variable names must contain only alphanumeric characters or '_'.",r);var o=n.parse(t[r+1],r+1);if(!o)return null;i.push([e,o])}var s=n.parse(t[t.length-1],t.length-1,n.expectedType,i);return s?new Xx(i,s):null},Xx.prototype.outputDefined=function(){return this.result.outputDefined()},Xx.prototype.serialize=function(){for(var t=["let"],n=0,i=this.bindings;n<i.length;n+=1){var r=i[n],e=r[0],o=r[1];t.push(e,o.serialize())}return t.push(this.result.serialize()),t};var Vx=function(t,n,i){this.type=t,this.index=n,this.input=i};Vx.parse=function(t,n){if(3!==t.length)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,db),r=n.parse(t[2],2,_b(n.expectedType||gb));if(!i||!r)return null;var e=r.type;return new Vx(e.itemType,i,r)},Vx.prototype.evaluate=function(t){var n=this.index.evaluate(t),i=this.input.evaluate(t);if(n<0)throw new Fb("Array index out of bounds: "+n+" < 0.");if(n>=i.length)throw new Fb("Array index out of bounds: "+n+" > "+(i.length-1)+".");if(n!==Math.floor(n))throw new Fb("Array index must be an integer, but found "+n+" instead.");return i[n]},Vx.prototype.eachChild=function(t){t(this.index),t(this.input)},Vx.prototype.outputDefined=function(){return!1},Vx.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Wx=function(t,n){this.type=yb,this.needle=t,this.haystack=n};Wx.parse=function(t,n){if(3!==t.length)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,gb),r=n.parse(t[2],2,gb);return i&&r?Eb(i.type,[yb,pb,db,vb,gb])?new Wx(i,r):n.error("Expected first argument to be of type boolean, string, number or null, but found "+Sb(i.type)+" instead"):null},Wx.prototype.evaluate=function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!Tb(n,["boolean","string","number","null"]))throw new Fb("Expected first argument to be of type boolean, string, number or null, but found "+Sb(Lb(n))+" instead.");if(!Tb(i,["string","array"]))throw new Fb("Expected second argument to be of type array or string, but found "+Sb(Lb(i))+" instead.");return i.indexOf(n)>=0},Wx.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Wx.prototype.outputDefined=function(){return!0},Wx.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Yx=function(t,n,i){this.type=db,this.needle=t,this.haystack=n,this.fromIndex=i};Yx.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,gb),r=n.parse(t[2],2,gb);if(!i||!r)return null;if(!Eb(i.type,[yb,pb,db,vb,gb]))return n.error("Expected first argument to be of type boolean, string, number or null, but found "+Sb(i.type)+" instead");if(4===t.length){var e=n.parse(t[3],3,db);return e?new Yx(i,r,e):null}return new Yx(i,r)},Yx.prototype.evaluate=function(t){var n=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Tb(n,["boolean","string","number","null"]))throw new Fb("Expected first argument to be of type boolean, string, number or null, but found "+Sb(Lb(n))+" instead.");if(!Tb(i,["string","array"]))throw new Fb("Expected second argument to be of type array or string, but found "+Sb(Lb(i))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return i.indexOf(n,r)}return i.indexOf(n)},Yx.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Yx.prototype.outputDefined=function(){return!1},Yx.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Zx=function(t,n,i,r,e,o){this.inputType=t,this.type=n,this.input=i,this.cases=r,this.outputs=e,this.otherwise=o};Zx.parse=function(t,n){if(t.length<5)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return n.error("Expected an even number of arguments.");var i,r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);for(var e={},o=[],s=2;s<t.length-1;s+=2){var u=t[s],a=t[s+1];Array.isArray(u)||(u=[u]);var h=n.concat(s);if(0===u.length)return h.error("Expected at least one branch label.");for(var f=0,c=u;f<c.length;f+=1){var l=c[f];if("number"!=typeof l&&"string"!=typeof l)return h.error("Branch labels must be numbers or strings.");if("number"==typeof l&&Math.abs(l)>Number.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof l&&Math.floor(l)!==l)return h.error("Numeric branch labels must be integer values.");if(i){if(h.checkSubtype(i,Lb(l)))return null}else i=Lb(l);if(void 0!==e[String(l)])return h.error("Branch labels must be unique.");e[String(l)]=o.length}var v=n.parse(a,s,r);if(!v)return null;r=r||v.type,o.push(v)}var d=n.parse(t[1],1,gb);if(!d)return null;var p=n.parse(t[t.length-1],t.length-1,r);return p?"value"!==d.type.kind&&n.concat(1).checkSubtype(i,d.type)?null:new Zx(i,r,d,e,o,p):null},Zx.prototype.evaluate=function(t){var n=this.input.evaluate(t);return(Lb(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)},Zx.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Zx.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Zx.prototype.serialize=function(){for(var t=this,n=["match",this.input.serialize()],i=[],r={},e=0,o=Object.keys(this.cases).sort();e<o.length;e+=1){var s=o[e];void 0===(c=r[this.cases[s]])?(r[this.cases[s]]=i.length,i.push([this.cases[s],[s]])):i[c][1].push(s)}for(var u=function(n){return"number"===t.inputType.kind?Number(n):n},a=0,h=i;a<h.length;a+=1){var f=h[a],c=f[0],l=f[1];1===l.length?n.push(u(l[0])):n.push(l.map(u)),n.push(this.outputs[outputIndex$1].serialize())}return n.push(this.otherwise.serialize()),n};var $x=function(t,n,i){this.type=t,this.branches=n,this.otherwise=i};$x.parse=function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return n.error("Expected an odd number of arguments.");var i;n.expectedType&&"value"!==n.expectedType.kind&&(i=n.expectedType);for(var r=[],e=1;e<t.length-1;e+=2){var o=n.parse(t[e],e,yb);if(!o)return null;var s=n.parse(t[e+1],e+1,i);if(!s)return null;r.push([o,s]),i=i||s.type}var u=n.parse(t[t.length-1],t.length-1,i);return u?new $x(i,r,u):null},$x.prototype.evaluate=function(t){for(var n=0,i=this.branches;n<i.length;n+=1){var r=i[n],e=r[0],o=r[1];if(e.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},$x.prototype.eachChild=function(t){for(var n=0,i=this.branches;n<i.length;n+=1){var r=i[n],e=r[0],o=r[1];t(e),t(o)}t(this.otherwise)},$x.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},$x.prototype.serialize=function(){var t=["case"];return this.eachChild((function(n){t.push(n.serialize())})),t};var Kx=function(t,n,i,r){this.type=t,this.input=n,this.beginIndex=i,this.endIndex=r};function Hx(t,n){return"=="===t||"!="===t?"boolean"===n.kind||"string"===n.kind||"number"===n.kind||"null"===n.kind||"value"===n.kind:"string"===n.kind||"number"===n.kind||"value"===n.kind}function Jx(t,n,i,r){return 0===r.compare(n,i)}function Qx(t,n,i){var r="=="!==t&&"!="!==t;return function(){function e(t,n,i){this.type=yb,this.lhs=t,this.rhs=n,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===n.type.kind}return e.parse=function(t,n){if(3!==t.length&&4!==t.length)return n.error("Expected two or three arguments.");var i=t[0],o=n.parse(t[1],1,gb);if(!o)return null;if(!Hx(i,o.type))return n.concat(1).error('"'+i+"\" comparisons are not supported for type '"+Sb(o.type)+"'.");var s=n.parse(t[2],2,gb);if(!s)return null;if(!Hx(i,s.type))return n.concat(2).error('"'+i+"\" comparisons are not supported for type '"+Sb(s.type)+"'.");if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot compare types '"+Sb(o.type)+"' and '"+Sb(s.type)+"'.");r&&("value"===o.type.kind&&"value"!==s.type.kind?o=new Db(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new Db(o.type,[s])));var u=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return n.error("Cannot use collator to compare non-string types.");if(!(u=n.parse(t[3],3,bb)))return null}return new e(o,s,u)},e.prototype.evaluate=function(e){var o=this.lhs.evaluate(e),s=this.rhs.evaluate(e);if(r&&this.hasUntypedArgument){var u=Lb(o),a=Lb(s);if(u.kind!==a.kind||"string"!==u.kind&&"number"!==u.kind)throw new Fb('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+u.kind+", "+a.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var h=Lb(o),f=Lb(s);if("string"!==h.kind||"string"!==f.kind)return n(e,o,s)}return this.collator?i(e,o,s,this.collator.evaluate(e)):n(e,o,s)},e.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},e.prototype.outputDefined=function(){return!0},e.prototype.serialize=function(){var n=[t];return this.eachChild((function(t){n.push(t.serialize())})),n},e}()}Kx.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1,gb),r=n.parse(t[2],2,db);if(!i||!r)return null;if(!Eb(i.type,[_b(gb),pb,gb]))return n.error("Expected first argument to be of type array or string, but found "+Sb(i.type)+" instead");if(4===t.length){var e=n.parse(t[3],3,db);return e?new Kx(i.type,i,r,e):null}return new Kx(i.type,i,r)},Kx.prototype.evaluate=function(t){var n=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Tb(n,["string","array"]))throw new Fb("Expected first argument to be of type array or string, but found "+Sb(Lb(n))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return n.slice(i,r)}return n.slice(i)},Kx.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Kx.prototype.outputDefined=function(){return!1},Kx.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var tM=Qx("==",(function(t,n,i){return n===i}),Jx),nM=Qx("!=",(function(t,n,i){return n!==i}),(function(t,n,i,r){return!Jx(0,n,i,r)})),iM=Qx("<",(function(t,n,i){return n<i}),(function(t,n,i,r){return r.compare(n,i)<0})),rM=Qx(">",(function(t,n,i){return n>i}),(function(t,n,i,r){return r.compare(n,i)>0})),eM=Qx("<=",(function(t,n,i){return n<=i}),(function(t,n,i,r){return r.compare(n,i)<=0})),oM=Qx(">=",(function(t,n,i){return n>=i}),(function(t,n,i,r){return r.compare(n,i)>=0})),sM=function(t,n,i,r,e){this.type=pb,this.number=t,this.locale=n,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=e};sM.parse=function(t,n){if(3!==t.length)return n.error("Expected two arguments.");var i=n.parse(t[1],1,db);if(!i)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return n.error("NumberFormat options argument must be an object.");var e=null;if(r.locale&&!(e=n.parse(r.locale,1,pb)))return null;var o=null;if(r.currency&&!(o=n.parse(r.currency,1,pb)))return null;var s=null;if(r["min-fraction-digits"]&&!(s=n.parse(r["min-fraction-digits"],1,db)))return null;var u=null;return r["max-fraction-digits"]&&!(u=n.parse(r["max-fraction-digits"],1,db))?null:new sM(i,e,o,s,u)},sM.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},sM.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},sM.prototype.outputDefined=function(){return!1},sM.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var uM=function(t){this.type=db,this.input=t};uM.parse=function(t,n){if(2!==t.length)return n.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=n.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?n.error("Expected argument of type string or array, but found "+Sb(i.type)+" instead."):new uM(i):null},uM.prototype.evaluate=function(t){var n=this.input.evaluate(t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new Fb("Expected value to be of type string or array, but found "+Sb(Lb(n))+" instead.")},uM.prototype.eachChild=function(t){t(this.input)},uM.prototype.outputDefined=function(){return!1},uM.prototype.serialize=function(){var t=["length"];return this.eachChild((function(n){t.push(n.serialize())})),t};var aM={"==":tM,"!=":nM,">":rM,"<":iM,">=":oM,"<=":eM,array:Db,at:Vx,boolean:Db,case:$x,coalesce:Bx,collator:Zb,format:qb,image:Ub,in:Wx,"index-of":Yx,interpolate:qx,"interpolate-hcl":qx,"interpolate-lab":qx,length:uM,let:Xx,literal:Rb,match:Zx,number:Db,"number-format":sM,object:Db,slice:Kx,step:bx,string:Db,"to-boolean":Xb,"to-color":Xb,"to-number":Xb,"to-string":Xb,var:yx,within:lx};function hM(t,n){var i=n[0],r=n[1],e=n[2],o=n[3];i=i.evaluate(t),r=r.evaluate(t),e=e.evaluate(t);var s=o?o.evaluate(t):1,u=Ib(i,r,e,s);if(u)throw new Fb(u);return new nb(i/255*s,r/255*s,e/255*s,s)}function fM(t,n){return t in n}function cM(t,n){var i=n[t];return void 0===i?null:i}function lM(t){return{type:t}}function vM(t){return{result:"success",value:t}}function dM(t){return{result:"error",value:t}}function pM(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Yb.register(aM,{error:[{kind:"error"},[pb],function(t,n){var i=n[0];throw new Fb(i.evaluate(t))}],typeof:[pb,[gb],function(t,n){return Sb(Lb(n[0].evaluate(t)))}],"to-rgba":[_b(db,4),[mb],function(t,n){return n[0].evaluate(t).toArray()}],rgb:[mb,[db,db,db],hM],rgba:[mb,[db,db,db,db],hM],has:{type:yb,overloads:[[[pb],function(t,n){return fM(n[0].evaluate(t),t.properties())}],[[pb,wb],function(t,n){var i=n[0],r=n[1];return fM(i.evaluate(t),r.evaluate(t))}]]},get:{type:gb,overloads:[[[pb],function(t,n){return cM(n[0].evaluate(t),t.properties())}],[[pb,wb],function(t,n){var i=n[0],r=n[1];return cM(i.evaluate(t),r.evaluate(t))}]]},"feature-state":[gb,[pb],function(t,n){return cM(n[0].evaluate(t),t.featureState||{})}],properties:[wb,[],function(t){return t.properties()}],"geometry-type":[pb,[],function(t){return t.geometryType()}],id:[gb,[],function(t){return t.id()}],zoom:[db,[],function(t){return t.globals.zoom}],pitch:[db,[],function(t){return t.globals.pitch||0}],"distance-from-center":[db,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[db,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[db,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[db,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[gb,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[db,lM(db),function(t,n){for(var i=0,r=0,e=n;r<e.length;r+=1){i+=e[r].evaluate(t)}return i}],"*":[db,lM(db),function(t,n){for(var i=1,r=0,e=n;r<e.length;r+=1){i*=e[r].evaluate(t)}return i}],"-":{type:db,overloads:[[[db,db],function(t,n){var i=n[0],r=n[1];return i.evaluate(t)-r.evaluate(t)}],[[db],function(t,n){return-n[0].evaluate(t)}]]},"/":[db,[db,db],function(t,n){var i=n[0],r=n[1];return i.evaluate(t)/r.evaluate(t)}],"%":[db,[db,db],function(t,n){var i=n[0],r=n[1];return i.evaluate(t)%r.evaluate(t)}],ln2:[db,[],function(){return Math.LN2}],pi:[db,[],function(){return Math.PI}],e:[db,[],function(){return Math.E}],"^":[db,[db,db],function(t,n){var i=n[0],r=n[1];return Math.pow(i.evaluate(t),r.evaluate(t))}],sqrt:[db,[db],function(t,n){var i=n[0];return Math.sqrt(i.evaluate(t))}],log10:[db,[db],function(t,n){var i=n[0];return Math.log(i.evaluate(t))/Math.LN10}],ln:[db,[db],function(t,n){var i=n[0];return Math.log(i.evaluate(t))}],log2:[db,[db],function(t,n){var i=n[0];return Math.log(i.evaluate(t))/Math.LN2}],sin:[db,[db],function(t,n){var i=n[0];return Math.sin(i.evaluate(t))}],cos:[db,[db],function(t,n){var i=n[0];return Math.cos(i.evaluate(t))}],tan:[db,[db],function(t,n){var i=n[0];return Math.tan(i.evaluate(t))}],asin:[db,[db],function(t,n){var i=n[0];return Math.asin(i.evaluate(t))}],acos:[db,[db],function(t,n){var i=n[0];return Math.acos(i.evaluate(t))}],atan:[db,[db],function(t,n){var i=n[0];return Math.atan(i.evaluate(t))}],min:[db,lM(db),function(t,n){return Math.min.apply(Math,n.map((function(n){return n.evaluate(t)})))}],max:[db,lM(db),function(t,n){return Math.max.apply(Math,n.map((function(n){return n.evaluate(t)})))}],abs:[db,[db],function(t,n){var i=n[0];return Math.abs(i.evaluate(t))}],round:[db,[db],function(t,n){var i=n[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[db,[db],function(t,n){var i=n[0];return Math.floor(i.evaluate(t))}],ceil:[db,[db],function(t,n){var i=n[0];return Math.ceil(i.evaluate(t))}],"filter-==":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1];return t.properties()[i.value]===r.value}],"filter-id-==":[yb,[gb],function(t,n){var i=n[0];return t.id()===i.value}],"filter-type-==":[yb,[pb],function(t,n){var i=n[0];return t.geometryType()===i.value}],"filter-<":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e<o}],"filter-id-<":[yb,[gb],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r<e}],"filter->":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e>o}],"filter-id->":[yb,[gb],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r>e}],"filter-<=":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e<=o}],"filter-id-<=":[yb,[gb],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r<=e}],"filter->=":[yb,[pb,gb],function(t,n){var i=n[0],r=n[1],e=t.properties()[i.value],o=r.value;return typeof e==typeof o&&e>=o}],"filter-id->=":[yb,[gb],function(t,n){var i=n[0],r=t.id(),e=i.value;return typeof r==typeof e&&r>=e}],"filter-has":[yb,[gb],function(t,n){return n[0].value in t.properties()}],"filter-has-id":[yb,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[yb,[_b(pb)],function(t,n){return n[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[yb,[_b(gb)],function(t,n){return n[0].value.indexOf(t.id())>=0}],"filter-in-small":[yb,[pb,_b(gb)],function(t,n){var i=n[0];return n[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[yb,[pb,_b(gb)],function(t,n){var i=n[0],r=n[1];return function(t,n,i,r){for(;i<=r;){var e=i+r>>1;if(n[e]===t)return!0;n[e]>t?r=e-1:i=e+1}return!1}(t.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:yb,overloads:[[[yb,yb],function(t,n){var i=n[0],r=n[1];return i.evaluate(t)&&r.evaluate(t)}],[lM(yb),function(t,n){for(var i=0,r=n;i<r.length;i+=1){if(!r[i].evaluate(t))return!1}return!0}]]},any:{type:yb,overloads:[[[yb,yb],function(t,n){var i=n[0],r=n[1];return i.evaluate(t)||r.evaluate(t)}],[lM(yb),function(t,n){for(var i=0,r=n;i<r.length;i+=1){if(r[i].evaluate(t))return!0}return!1}]]},"!":[yb,[yb],function(t,n){return!n[0].evaluate(t)}],"is-supported-script":[yb,[pb],function(t,n){var i=n[0],r=t.globals&&t.globals.isSupportedScript;return!r||r(i.evaluate(t))}],upcase:[pb,[pb],function(t,n){return n[0].evaluate(t).toUpperCase()}],downcase:[pb,[pb],function(t,n){return n[0].evaluate(t).toLowerCase()}],concat:[pb,lM(gb),function(t,n){return n.map((function(n){return zb(n.evaluate(t))})).join("")}],"resolved-locale":[pb,[bb],function(t,n){return n[0].evaluate(t).resolvedLocale()}]});var yM=function(t,n){this.expression=t,this._warningHistory={},this._evaluator=new Wb,this._defaultValue=n?function(t){return"color"===t.type&&pM(t.default)?new nb(0,0,0,0):"color"===t.type?nb.parse(t.default)||null:void 0===t.default?null:t.default}(n):null,this._enumValues=n&&"enum"===n.type?n.values:null};function mM(t,n){var i=new mx(aM,[],n?function(t){var n={color:mb,string:pb,number:db,enum:pb,boolean:yb,formatted:xb,resolvedImage:Mb};if("array"===t.type)return _b(n[t.value]||gb,t.length);return n[t.type]}(n):void 0),r=i.parse(t,void 0,void 0,void 0,n&&"string"===n.type?{typeAnnotation:"coerce"}:void 0);return r?vM(new yM(r,n)):dM(i.errors)}yM.prototype.evaluateWithoutErrorHandling=function(t,n,i,r,e,o,s,u){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=i,this._evaluator.canonical=r||null,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=u||null,this.expression.evaluate(this._evaluator)},yM.prototype.evaluate=function(t,n,i,r,e,o,s,u){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r||null,this._evaluator.availableImages=e||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=s||null,this._evaluator.featureDistanceData=u||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new Fb("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var wM=function(t,n){this.kind=t,this._styleExpression=n,this.isStateDependent="constant"!==t&&!dx(n.expression)};wM.prototype.evaluateWithoutErrorHandling=function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)},wM.prototype.evaluate=function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)};var gM=function(t,n,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=n,this.isStateDependent="camera"!==t&&!dx(n.expression),this.interpolationType=r};function bM(t,n){if("error"===(t=mM(t,n)).result)return t;var i=t.value.expression,r=vx(i);if(!r&&!function(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}(n))return dM([new cb("","data expressions not supported")]);var e=px(i,["zoom","pitch","distance-from-center"]);if(!e&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(n))return dM([new cb("","zoom expressions not supported")]);var o=xM(i);if(!o&&!e)return dM([new cb("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof cb)return dM([o]);if(o instanceof qx&&!function(t){return!!t.expression&&t.expression.interpolated}(n))return dM([new cb("",'"interpolate" expressions cannot be used with this property')]);if(!o)return vM(new wM(r?"constant":"source",t.value));var s=o instanceof qx?o.interpolation:void 0;return vM(new gM(r?"camera":"composite",t.value,o.labels,s))}function xM(t){var n=null;if(t instanceof Xx)n=xM(t.result);else if(t instanceof Bx)for(var i=0,r=t.args;i<r.length;i+=1){var e=r[i];if(n=xM(e))break}else(t instanceof bx||t instanceof qx)&&t.input instanceof Yb&&"zoom"===t.input.name&&(n=t);return n instanceof cb||t.eachChild((function(t){var i=xM(t);i instanceof cb?n=i:!n&&i?n=new cb("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&i&&n!==i&&(n=new cb("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}function MM(t){if(Array.isArray(t))return t.map(MM);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var n={};for(var i in t)n[i]=MM(t[i]);return n}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}gM.prototype.evaluateWithoutErrorHandling=function(t,n,i,r,e,o){return this._styleExpression.evaluateWithoutErrorHandling(t,n,i,r,e,o)},gM.prototype.evaluate=function(t,n,i,r,e,o){return this._styleExpression.evaluate(t,n,i,r,e,o)},gM.prototype.interpolationFactor=function(t,n,i){return this.interpolationType?qx.interpolationFactor(this.interpolationType,t,n,i):0};var _M={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},projection:{name:{type:"enum",values:{albers:{},equalEarth:{},equirectangular:{},lambertConformalConic:{},mercator:{},naturalEarth:{},winkelTripel:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,requires:[{name:["albers","lambertConformalConic"]}]}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{},atmosphere:{}},default:"atmosphere",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],transition:!1,requires:[{"sky-type":"gradient"}],expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",transition:!1,requires:[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};function SM(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var n=0,i=t.slice(1);n<i.length;n+=1){var r=i[n];if(!SM(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}function OM(t,n){if(void 0===n&&(n="fill"),null==t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};SM(t)||(t=kM(t));var i=t,r=!0;try{r=function(t){if(!TM(t))return t;var n=MM(t);return EM(n),n=jM(n)}(i)}catch(t){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n"+JSON.stringify(i,null,2)+"\n ")}var e=_M["filter_"+n],o=mM(r,e),s=null;if("error"===o.result)throw new Error(o.value.map((function(t){return t.key+": "+t.message})).join(", "));s=function(t,n,i){return o.value.evaluate(t,n,{},i)};var u=null,a=null;if(r!==i){var h=mM(i,e);if("error"===h.result)throw new Error(h.value.map((function(t){return t.key+": "+t.message})).join(", "));u=function(t,n,i,r,e){return h.value.evaluate(t,n,{},i,void 0,void 0,r,e)},a=!vx(h.value.expression)}return{filter:s=s,dynamicFilter:u||void 0,needGeometry:CM(r),needFeature:!!a}}function jM(t){if(!Array.isArray(t))return t;var n=function(t){if(AM.has(t[0]))for(var n=1;n<t.length;n++){if(TM(t[n]))return!0}return t}(t);return!0===n?n:n.map((function(t){return jM(t)}))}function EM(t){var n=!1,i=[];if("case"===t[0]){for(var r=1;r<t.length-1;r+=2)n=n||TM(t[r]),i.push(t[r+1]);i.push(t[t.length-1])}else if("match"===t[0]){n=n||TM(t[1]);for(var e=2;e<t.length-1;e+=2)i.push(t[e+1]);i.push(t[t.length-1])}else if("step"===t[0]){n=n||TM(t[1]);for(var o=1;o<t.length-1;o+=2)i.push(t[o+1])}n&&(t.length=0,t.push.apply(t,["any"].concat(i)));for(var s=1;s<t.length;s++)EM(t[s])}function TM(t){if(!Array.isArray(t))return!1;if("pitch"===(n=t[0])||"distance-from-center"===n)return!0;for(var n,i=1;i<t.length;i++){if(TM(t[i]))return!0}return!1}var AM=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function PM(t,n){return t<n?-1:t>n?1:0}function CM(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var n=1;n<t.length;n++)if(CM(t[n]))return!0;return!1}function kM(t){if(!t)return!0;var n,i=t[0];return t.length<=1?"any"!==i:"=="===i?IM(t[1],t[2],"=="):"!="===i?zM(IM(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?IM(t[1],t[2],i):"any"===i?(n=t.slice(1),["any"].concat(n.map(kM))):"all"===i?["all"].concat(t.slice(1).map(kM)):"none"===i?["all"].concat(t.slice(1).map(kM).map(zM)):"in"===i?NM(t[1],t.slice(2)):"!in"===i?zM(NM(t[1],t.slice(2))):"has"===i?LM(t[1]):"!has"===i?zM(LM(t[1])):"within"!==i||t}function IM(t,n,i){switch(t){case"$type":return["filter-type-"+i,n];case"$id":return["filter-id-"+i,n];default:return["filter-"+i,t,n]}}function NM(t,n){if(0===n.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some((function(t){return typeof t!=typeof n[0]}))?["filter-in-large",t,["literal",n.sort(PM)]]:["filter-in-small",t,["literal",n]]}}function LM(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function zM(t){return["!",t]}var RM=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function FM(t,n){var i={};for(var r in t)"ref"!==r&&(i[r]=t[r]);return RM.forEach((function(t){t in n&&(i[t]=n[t])})),i}var GM={thin:100,hairline:100,"ultra-light":100,"extra-light":100,light:200,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,heavy:800,black:800,"extra-bold":800,"ultra-black":900,"extra-black":900,"ultra-bold":900,"heavy-black":900,fat:900,poster:900},DM=" ",qM=/(italic|oblique)$/i,UM={},BM=function(t,n,i){var r=UM[t];if(!r){Array.isArray(t)||(t=[t]);for(var e=400,o="normal",s=[],u=0,a=t.length;u<a;++u){var h=t[u].split(" "),f=h[h.length-1].toLowerCase();for(var c in"normal"==f||"italic"==f||"oblique"==f?(o=f,h.pop(),f=h[h.length-1].toLowerCase()):qM.test(f)&&(f=f.replace(qM,""),o=h[h.length-1].replace(f,"")),GM){var l=h.length>1?h[h.length-2].toLowerCase():"";if(f==c||f==c.replace("-","")||l+"-"+f==c){e=GM[c],h.pop(),l&&c.startsWith(l)&&h.pop();break}}"number"==typeof f&&(e=f);var v=h.join(DM).replace("Klokantech Noto Sans","Noto Sans");-1!==v.indexOf(DM)&&(v='"'+v+'"'),s.push(v)}r=UM[t]=[o,e,s]}return r[0]+DM+r[1]+DM+n+"px"+(i?"/"+i:"")+DM+r[2]},XM="https://api.mapbox.com";function VM(t){var n="mapbox://";return 0!==t.indexOf(n)?"":t.slice(n.length)}function WM(t,n){var i=VM(t);if(!i)return decodeURI(new URL(t,location.href).href);var r="styles/";if(0!==i.indexOf(r))throw new Error("unexpected style url: "+t);var e=i.slice(r.length);return XM+"/styles/v1/"+e+"?&access_token="+n}function YM(t,n,i,r){var e=new URL(t,r),o=VM(t);return o?"https://{a-d}.tiles.mapbox.com/v4/"+o+"/{z}/{x}/{y}.vector.pbf?access_token="+n:n?(e.searchParams.set(i,n),decodeURI(e.href)):decodeURI(e.href)}function ZM(t){return t*Math.PI/180}var $M=function(){for(var t=[],n=78271.51696402048;t.length<=24;n/=2)t.push(n);return t}();function KM(t,n){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,n);var i=document.createElement("canvas");return i.width=t,i.height=n,i}var HM={};function JM(t,n,i){if(void 0===i&&(i={}),n in HM)return HM[n];var r=i.transformRequest&&i.transformRequest(n,t)||new Request(n);r.headers.get("Accept")||r.headers.set("Accept","application/json");var e=fetch(r).then((function(t){return delete HM[n],t.ok?t.json():Promise.reject(new Error("Error fetching source "+n))})).catch((function(t){return delete HM[n],Promise.reject(new Error("Error fetching source "+n))}));return HM[n]=e,e}function QM(t,n){if("string"!=typeof t)return Promise.resolve(t);if(!t.trim().startsWith("{"))return JM("Style",t=WM(t,n.accessToken),n);try{var i=JSON.parse(t);return Promise.resolve(i)}catch(t){return Promise.reject(t)}}var t_={};function n_(t,n,i){void 0===i&&(i={});var r=[n,JSON.stringify(t)].toString(),e=t_[r];if(!e||i.transformRequest){var o=t.url;if(o){var s=YM(o,i.accessToken,i.accessTokenParam||"access_token",n||location.href);e=o.startsWith("mapbox://")?Promise.resolve(A({},t,{url:void 0,tiles:s})):JM("Source",s,i).then((function(t){for(var n=0,r=t.tiles.length;n<r;++n){var e=t.tiles[n];if(i.transformRequest){var o=i.transformRequest(s,"Source");o&&(s=o.url)}var u=YM(e,i.accessToken,i.accessTokenParam||"access_token",s);if(i.transformRequest){var a=i.transformRequest(u,"Tiles");a instanceof Request&&(u=decodeURI(a.url))}t.tiles[n]=u}return Promise.resolve(t)}))}else t=A({},t,{tiles:t.tiles.map((function(t){return YM(t,i.accessToken,i.accessTokenParam||"access_token",n||location.href)}))}),e=Promise.resolve(A({},t));t_[r]=e}return e}var i_,r_=Array(256).join("");function e_(t,n){if(n>=.05){for(var i="",r=t.split("\n"),e=r_.slice(0,Math.round(n/.1)),o=0,s=r.length;o<s;++o)o>0&&(i+="\n"),i+=r[o].split("").join(e);return i}return t}function o_(){return i_||(i_=KM(1,1).getContext("2d")),i_}function s_(t,n){return o_().measureText(t).width+(t.length-1)*n}var u_={};function a_(t,n,i,r){if(-1!==t.indexOf("\n")){for(var e=t.split("\n"),o=[],s=0,u=e.length;s<u;++s)o.push(a_(e[s],n,i,r));return o.join("\n")}var a=i+","+n+","+t+","+r,h=u_[a];if(!h){var f=t.split(" ");if(f.length>1){var c=o_();c.font=n;for(var l=c.measureText("M").width*i,v="",d=[],p=0,y=f.length;p<y;++p){var m=f[p],w=v+(v?" ":"")+m;s_(w,r)<=l?v=w:(v&&d.push(v),v=m)}v&&d.push(v);for(var g=0,b=d.length;g<b&&b>1;++g){var x=d[g];if(s_(x,r)<.35*l){var M=g>0?s_(d[g-1],r):1/0,_=g<b-1?s_(d[g+1],r):1/0;d.splice(g,1),b-=1,M<_?(d[g-1]+=" "+x,g-=1):d[g]=x+" "+d[g]}}for(var S=0,O=d.length-1;S<O;++S){var j=d[S],E=d[S+1];if(s_(j,r)>.7*l&&s_(E,r)<.6*l){var T=j.split(" "),A=T.pop();s_(A,r)<.2*l&&(d[S]=T.join(" "),d[S+1]=A+" "+E),O-=1}}h=d.join("\n")}else h=t;h=e_(h,r),u_[a]=h}return h}var h_,f_=/font-family: ?([^;]*);/,c_=/("|')/g;function l_(t){if(!h_){h_={};for(var n=document.styleSheets,i=0,r=n.length;i<r;++i){var e=n[i];try{var o=e.rules||e.cssRules;if(o)for(var s=0,u=o.length;s<u;++s){var a=o[s];if(5==a.type){var h=a.cssText.match(f_);h_[h[1].replace(c_,"")]=!0}}}catch(t){}}}return t in h_}var v_={};function d_(t){var n=t.toString();if(n in v_)return v_[n];for(var i=[],r=0,e=t.length;r<e;++r){t[r]=t[r].replace("Arial Unicode MS","Arial");var o=t[r],s=BM(o,1);Bs(s);var u=s.split(" ");i.push([u.slice(3).join(" ").replace(/"/g,""),u[1],u[0]])}for(var a=0,h=i.length;a<h;++a){var f=i[a],c=f[0];if(!l_(c)&&100!==Rs.get(f[2]+"\n"+f[1]+" \n"+c)){var l="https://fonts.googleapis.com/css?family="+c.replace(/ /g,"+")+":"+f[1]+f[2];if(!document.querySelector('link[href="'+l+'"]')){var v=document.createElement("link");v.href=l,v.rel="stylesheet",document.head.appendChild(v)}}}return v_[n]=t,t}var p_,y_,m_={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},w_={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},g_={},b_={zoom:0};function x_(t,n,i,r,e,o,s){var u=t.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[u]||(o[u]={});var a,h=o[u];if(!h[i]){var f=(t[n]||g_)[i],c=_M[n+"_"+t.type][i];void 0===f&&(f=c.default);var l=(a=f,Array.isArray(a)&&a.length>0&&"string"==typeof a[0]&&a[0]in aM);if(!l&&pM(f)&&(f=rb(f,c),l=!0),l){var v=function(t,n){var i=bM(t,n);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(f,c);h[i]=v.evaluate.bind(v)}else"color"==c.type&&(f=nb.parse(f)),h[i]=function(){return f}}return b_.zoom=r,h[i](b_,e,s)}function M_(t,n,i,r){return x_(t,"layout","icon-allow-overlap",n,i,r)?x_(t,"layout","icon-ignore-placement",n,i,r)?"none":"obstacle":"declutter"}function __(t,n,i,r,e){return e||console.warn("No filterCache provided to evaluateFilter()"),t in e||(e[t]=OM(n).filter),b_.zoom=r,e[t](b_,i)}var S_=!1;function O_(t,n){if(t){if(!S_&&(0===t.a||0===n))return;var i=t.a;return n=void 0===n?1:n,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*n+")"}return t}var j_=/^([^]*)\{(.*)\}([^]*)$/;function E_(t,n){var i;do{if(i=t.match(j_)){var r=n[i[2]]||"";t=i[1]+r+i[3]}}while(i);return t}var T_=!1;function A_(t,n,i,r,e,o,s){if(void 0===r&&(r=$M),void 0===e&&(e=void 0),void 0===o&&(o=void 0),void 0===s&&(s=void 0),"string"==typeof n&&(n=JSON.parse(n)),8!=n.version)throw new Error("glStyle version 8 required.");var u,a;if(o)if("undefined"!=typeof Image){var h=new Image;h.crossOrigin="anonymous",h.onload=function(){u=h,a=[h.width,h.height],t.changed(),h.onload=null},h.src=o}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var f=self;f.postMessage({action:"loadImage",src:o}),f.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(u=t.data.image,a=[u.width,u.height])}))}for(var c,l=function(t){t=t.slice();for(var n=Object.create(null),i=0;i<t.length;i++)n[t[i].id]=t[i];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=FM(t[r],n[t[r].ref]));return t}(n.layers),v={},d=[],p={},y={},m={},w={},g=0,b=l.length;g<b;++g){var x=l[g],M=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(M)){var _=x["source-layer"];if(c){if(x.source!==c)throw new Error('Layer "'+M+'" does not use source "'+c)}else{c=x.source;var S=n.sources[c];if(!S)throw new Error('Source "'+c+'" is not defined');var O=S.type;if("vector"!==O&&"geojson"!==O)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+O+'"')}var j=v[_];j||(j=[],v[_]=j),j.push({layer:x,index:g}),d.push(M)}}var E=new mv,T=new rv,A=[],P=function(n,i){var o=n.getProperties(),h=v[o.layer];if(h){var f=r.indexOf(i);-1==f&&(f=function(t,n){for(var i=0,r=n.length;i<r;++i)if(n[i]<t&&i+1<r){var e=n[i]/n[i+1];return i+Math.log(n[i]/t)/Math.log(e)}return r-1}(i,r));for(var c,l=m_[n.getGeometry().getType()],d={properties:o,type:l},g=t.get("mapbox-featurestate")[n.getId()],b=-1,x=0,M=h.length;x<M;++x){var _=h[x],S=_.layer,O=S.id,j=S.layout||g_,P=S.paint||g_;if(!("none"===j.visibility||"minzoom"in S&&f<S.minzoom||"maxzoom"in S&&f>=S.maxzoom)){var C=S.filter;if(!C||__(O,C,d,f,w)){c=S;var k=void 0,I=void 0,N=void 0,L=void 0,z=void 0,R=void 0,F=_.index;if(3==l&&("fill"==S.type||"fill-extrusion"==S.type))if(I=x_(S,"paint",S.type+"-opacity",f,d,m,g),S.type+"-pattern"in P){var G=x_(S,"paint",S.type+"-pattern",f,d,m,g);if(G){var D="string"==typeof G?E_(G,o):G.toString();if(u&&e&&e[D]){++b,(R=A[b])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new Sv({fill:new rv}),A[b]=R),N=R.getFill(),R.setZIndex(F);var q=D+"."+I,U=y[q];if(!U){var B=e[D],X=KM(B.width,B.height),V=X.getContext("2d");V.globalAlpha=I,V.drawImage(u,B.x,B.y,B.width,B.height,0,0,B.width,B.height),U=V.createPattern(X,"repeat"),y[q]=U}N.setColor(U)}}}else k=O_(x_(S,"paint",S.type+"-color",f,d,m,g),I),S.type+"-outline-color"in P&&(z=O_(x_(S,"paint",S.type+"-outline-color",f,d,m,g),I)),z||(z=k),(k||z)&&(++b,(!(R=A[b])||k&&!R.getFill()||!k&&R.getFill()||z&&!R.getStroke()||!z&&R.getStroke()||R.getText())&&(R=new Sv({fill:k?new rv:void 0,stroke:z?new mv:void 0}),A[b]=R),k&&(N=R.getFill()).setColor(k),z&&((L=R.getStroke()).setColor(z),L.setWidth(.5)),R.setZIndex(F));if(1!=l&&"line"==S.type){k=!("line-pattern"in P)&&"line-color"in P?O_(x_(S,"paint","line-color",f,d,m,g),x_(S,"paint","line-opacity",f,d,m,g)):void 0;var W=x_(S,"paint","line-width",f,d,m,g);k&&W>0&&(++b,(R=A[b])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new Sv({stroke:new mv}),A[b]=R),(L=R.getStroke()).setLineCap(x_(S,"layout","line-cap",f,d,m,g)),L.setLineJoin(x_(S,"layout","line-join",f,d,m,g)),L.setMiterLimit(x_(S,"layout","line-miter-limit",f,d,m,g)),L.setColor(k),L.setWidth(W),L.setLineDash(P["line-dasharray"]?x_(S,"paint","line-dasharray",f,d,m,g).map((function(t){return t*W})):null),R.setZIndex(F))}var Y=!1,Z=null,$=0,K=void 0,H=void 0,J=void 0;if((1==l||2==l)&&"icon-image"in j){var Q=x_(S,"layout","icon-image",f,d,m,g);if(Q){K="string"==typeof Q?E_(Q,o):Q.toString();var tt=void 0;if(u&&e&&e[K]){var nt=x_(S,"layout","icon-rotation-alignment",f,d,m,g);if(2==l){var it=n.getGeometry();if(it.getFlatMidpoint||it.getFlatMidpoints){var rt=it.getExtent();if(Math.sqrt(Math.max(Math.pow((rt[2]-rt[0])/i,2),Math.pow((rt[3]-rt[1])/i,2)))>150){var et="MultiLineString"===it.getType()?it.getFlatMidpoints():it.getFlatMidpoint();if(y_||(y_=new fg("Point",p_=[NaN,NaN],[],{},null)),tt=y_,p_[0]=et[0],p_[1]=et[1],"line"===x_(S,"layout","symbol-placement",f,d,m,g)&&"map"===nt)for(var ot=it.getStride(),st=it.getFlatCoordinates(),ut=0,at=st.length-ot;ut<at;ut+=ot){var ht=st[ut],ft=st[ut+1],ct=st[ut+ot],lt=st[ut+ot+1],vt=Math.min(ht,ct),dt=Math.min(ft,lt),pt=Math.max(ht,ct),yt=Math.max(ft,lt);if(et[0]>=vt&&et[0]<=pt&&et[1]>=dt&&et[1]<=yt){$=Math.atan2(ft-lt,ct-ht);break}}}}}if(2!==l||tt){var mt=x_(S,"layout","icon-size",f,d,m,g),wt=void 0!==P["icon-color"]?x_(S,"paint","icon-color",f,d,m,g):null;if(!wt||0!==wt.a){var gt=K+"."+mt;if(null!==wt&&(gt+="."+wt),!(H=p[gt])){var bt=e[K],xt=M_(S,f,d,m);H=new yv({color:wt?[255*wt.r,255*wt.g,255*wt.b,wt.a]:void 0,img:u,imgSize:a,size:[bt.width,bt.height],offset:[bt.x,bt.y],rotateWithView:"map"===nt,scale:mt/bt.pixelRatio,displacement:"icon-offset"in j?x_(S,"layout","icon-offset",f,d,m,g).map((function(t){return-t*bt.pixelRatio})):void 0,declutterMode:xt}),p[gt]=H}}H&&(++b,(R=A[b])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new Sv,A[b]=R),R.setGeometry(tt),H.setRotation($+ZM(x_(S,"layout","icon-rotate",f,d,m,g))),H.setOpacity(x_(S,"paint","icon-opacity",f,d,m,g)),H.setAnchor(w_[x_(S,"layout","icon-anchor",f,d,m,g)]),R.setImage(H),Z=R.getText(),R.setText(void 0),R.setZIndex(F),Y=!0,J=!1)}else J=!0}}}if(1==l&&"circle"===S.type){++b,(R=A[b])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new Sv,A[b]=R);var Mt="circle-radius"in P?x_(S,"paint","circle-radius",f,d,m,g):5,_t=O_(x_(S,"paint","circle-stroke-color",f,d,m,g),x_(S,"paint","circle-stroke-opacity",f,d,m,g)),St=O_(x_(S,"paint","circle-color",f,d,m,g),x_(S,"paint","circle-opacity",f,d,m,g)),Ot=x_(S,"paint","circle-stroke-width",f,d,m,g),jt=Mt+"."+_t+"."+St+"."+Ot;(H=p[jt])||(H=new iv({radius:Mt,stroke:_t&&Ot>0?new mv({width:Ot,color:_t}):void 0,fill:St?new rv({color:St}):void 0,declutterMode:"none"}),p[jt]=H),R.setImage(H),Z=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(F),Y=!0}var Et=void 0,Tt=void 0,At=void 0,Pt=void 0,Ct=void 0,kt=void 0;if("text-field"in j){Pt=Math.round(x_(S,"layout","text-size",f,d,m,g));var It=x_(S,"layout","text-font",f,d,m,g);At=x_(S,"layout","text-line-height",f,d,m,g),(Tt=BM(s?s(It):It,Pt,At)).includes("sans-serif")||(Tt+=",sans-serif"),Ct=x_(S,"layout","text-letter-spacing",f,d,m,g),kt=x_(S,"layout","text-max-width",f,d,m,g);var Nt=x_(S,"layout","text-field",f,d,m,g);Et="object"==typeof Nt&&Nt.sections?1===Nt.sections.length?Nt.toString():Nt.sections.reduce((function(t,n,i){var r=n.fontStack?n.fontStack.split(","):It,e=BM(s?s(r):r,Pt*(n.scale||1),At),o=n.text;if("\n"===o)return t.push("\n",""),t;if(2!=l){for(var u=0,a=(o=a_(o,e,kt,Ct).split("\n")).length;u<a;++u)u>0&&t.push("\n",""),t.push(o[u],e);return t}t.push(e_(o,Ct),e)}),[]):E_(Nt,o).trim(),I=x_(S,"paint","text-opacity",f,d,m,g)}if(Et&&I&&!J){Y||(++b,(R=A[b])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new Sv,A[b]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(Z||new Ev({padding:[2,2,2,2]})),Z=R.getText();var Lt=j["text-transform"];"uppercase"==Lt?Et=Array.isArray(Et)?Et.map((function(t,n){return n%2?t:t.toUpperCase()})):Et.toUpperCase():"lowercase"==Lt&&(Et=Array.isArray(Et)?Et.map((function(t,n){return n%2?t:t.toLowerCase()})):Et.toLowerCase());var zt=Array.isArray(Et)?Et:2==l?e_(Et,Ct):a_(Et,Tt,kt,Ct);Z.setText(zt),Z.setFont(Tt),Z.setRotation(ZM(x_(S,"layout","text-rotate",f,d,m,g)));var Rt=x_(S,"layout","text-anchor",f,d,m,g),Ft=Y||1==l?"point":x_(S,"layout","symbol-placement",f,d,m,g);Z.setPlacement(Ft),Z.setOverflow("point"===Ft);var Gt=x_(S,"paint","text-halo-width",f,d,m,g),Dt=x_(S,"layout","text-offset",f,d,m,g),qt=x_(S,"paint","text-translate",f,d,m,g),Ut=0,Bt=0;if("point"==Ft){var Xt="center";-1!==Rt.indexOf("left")?(Xt="left",Bt=Gt):-1!==Rt.indexOf("right")&&(Xt="right",Bt=-Gt),Z.setTextAlign(Xt);var Vt=x_(S,"layout","text-rotation-alignment",f,d,m,g);Z.setRotateWithView("map"==Vt)}else Z.setMaxAngle(ZM(x_(S,"layout","text-max-angle",f,d,m,g))*Et.length/zt.length),Z.setTextAlign(),Z.setRotateWithView(!1);var Wt="middle";0==Rt.indexOf("bottom")?(Wt="bottom",Ut=-Gt-.5*(At-1)*Pt):0==Rt.indexOf("top")&&(Wt="top",Ut=Gt+.5*(At-1)*Pt),Z.setTextBaseline(Wt),Z.setOffsetX(Dt[0]*Pt+Bt+qt[0]),Z.setOffsetY(Dt[1]*Pt+Ut+qt[1]),T.setColor(O_(x_(S,"paint","text-color",f,d,m,g),I)),Z.setFill(T);var Yt=O_(x_(S,"paint","text-halo-color",f,d,m,g),I);if(Yt){E.setColor(Yt),Gt*=2;var Zt=.5*Pt;E.setWidth(Gt<=Zt?Gt:Zt),Z.setStroke(E)}else Z.setStroke(void 0);var $t=x_(S,"layout","text-padding",f,d,m,g),Kt=Z.getPadding();$t!==Kt[0]&&(Kt[0]=$t,Kt[1]=$t,Kt[2]=$t,Kt[3]=$t),R.setZIndex(F)}}}}return b>-1?(A.length=b+1,T_&&("function"==typeof n.set?n.set("mapbox-layer",c):n.getProperties()["mapbox-layer"]=c),A):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",d),t.set("mapbox-featurestate",{}),P}function P_(t,n){n.accessToken||(n=A({},n),new URL(t).searchParams.forEach((function(t,i){n.accessToken=t,n.accessTokenParam=i})));return n}function C_(t,n,i,r,e){var o,s,u;return void 0===i&&(i=""),void 0===r&&(r={}),void 0===e&&(e=void 0),"string"==typeof r?(o=r,u={}):(o=r.styleUrl,u=r),e||(e=u.resolutions),o||"string"!=typeof n||n.trim().startsWith("{")||(o=n),o&&(o=o.startsWith("data:")?location.href:WM(o,u.accessToken),u=P_(o,u)),new Promise((function(r,a){QM(n,u).then((function(n){if(8!=n.version)return a(new Error("glStyle version 8 required."));if(!(t instanceof lg||t instanceof Rg))return a(new Error("Can only apply to VectorLayer or VectorTileLayer"));var h,f,c,l=t instanceof Rg?"vector":"geojson";if(i?s=Array.isArray(i)?n.layers.find((function(t){return t.id===i[0]})).source:i:(s=Object.keys(n.sources).find((function(t){return n.sources[t].type===l})),i=s),!s)return a(new Error("No "+l+" source found in the glStyle."));function v(){if(t instanceof Rg)return z_(n.sources[s],o,u).then((function(n){var i=t.getSource();if(i?n!==i&&(i.setTileUrlFunction(n.getTileUrlFunction()),i.ze||(i.ze=n.ze),i.getAttributions()||i.setAttributions(n.getAttributions()),i.getTileLoadFunction()===Uy&&i.setTileLoadFunction(n.getTileLoadFunction()),Sr(i.getProjection(),n.getProjection())&&(i.tileGrid=n.getTileGrid())):t.setSource(n),!isFinite(t.getMaxResolution())&&!isFinite(t.getMinZoom())){var r=t.getSource().getTileGrid();t.setMaxResolution(r.getResolution(r.getMinZoom()))}}));var i=n.sources[s],r=t.getSource();r&&r.get("mapbox-source")===i||(r=F_(i,o,u));var e=t.getSource();return e?r!==e&&(e.getAttributions()||e.setAttributions(r.getAttributions()),e.ze||(e.ze=r.getFormat()),e.Fe=r.getUrl()):t.setSource(r),Promise.resolve()}function d(){c||n.sprite&&!h?c?(t.setStyle(c),v().then(r).catch(a)):a(new Error("Something went wrong trying to apply style.")):(c=A_(t,n,i,e,h,f,d_),t.getStyle()?v().then(r).catch(a):a(new Error("Nothing to show for source ["+s+"]")))}if(n.sprite){var p=new URL(function(t,n,i){var r=VM(t);if(!r)return decodeURI(new URL(t,i).href);var e="sprites/";if(0!==r.indexOf(e))throw new Error("unexpected sprites url: "+t);var o=r.slice(e.length);return XM+"/styles/v1/"+o+"/sprite?access_token="+n}(n.sprite,u.accessToken,o||location.href)),y=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",m=p.origin+p.pathname+y+".json"+p.search;new Promise((function(t,n){JM("Sprite",m,u).then(t).catch((function(i){JM("Sprite",m=p.origin+p.pathname+".json"+p.search,u).then(t).catch(n)}))})).then((function(t){void 0===t&&a(new Error("No sprites found.")),h=t,f=p.origin+p.pathname+y+".png"+p.search,d()})).catch((function(t){a(new Error("Sprites cannot be loaded: "+m+": "+t.message))}))}else d()})).catch(a)}))}var k_={};function I_(t,n){var i={id:n.id,type:n.type},r={};function e(e){var o=n.layout||{},s=n.paint||{};i.paint=s;var u,a,h="function"==typeof t.getSource?t.getSource().getTileGrid().getZForResolution(e):t.getView().getZoom(),f="function"==typeof t.getTargetElement?t.getTargetElement():void 0;if(void 0!==s["background-color"]&&(u=x_(i,"paint","background-color",h,k_,r),f&&(f.style.background=nb.parse(u).toString())),void 0!==s["background-opacity"]&&(a=x_(i,"paint","background-opacity",h,k_,r),f&&(f.style.opacity=a)),"none"!=o.visibility)return O_(u,a);f&&(f.style.backgroundColor="",f.style.opacity="")}if("function"==typeof t.getTargetElement)t.getTargetElement()&&e(),t.on(["change:resolution","change:target"],e);else{if("function"!=typeof t.setBackground)throw new Error("Unable to apply background.");t.setBackground(e)}}function N_(t,n){n.layers.some((function(n){if("background"===n.type)return I_(t,n),!0}))}function L_(t){var n=t.bounds;if(n){var i=_r([n[0],n[1]]),r=_r([n[2],n[3]]);return[i[0],i[1],r[0],r[1]]}}function z_(t,n,i){return new Promise((function(r,e){n_(t,n,i).then((function(t){var n=new Gm({tileJSON:t}),i=n.getTileJSON(),e=n.getTileGrid(),o=L_(i),s=i.minzoom||0,u=i.maxzoom||22,a={attributions:n.getAttributions(),format:new Lg,tileGrid:new xf({origin:e.getOrigin(0),extent:o||e.getExtent(),minZoom:s,resolutions:$M.slice(0,u+1),tileSize:512})};Array.isArray(i.tiles)?a.urls=i.tiles:a.url=i.tiles,t.olSourceOptions&&Object.assign(a,t.olSourceOptions),r(new qy(a))})).catch(e)}))}var R_=new Zg;function F_(t,n,i){var r=t.data,e={};if("string"==typeof r){var o=YM(r,i.accessToken,i.accessTokenParam||"access_token",n||location.href);if(i.transformRequest){var s=i.transformRequest(o,"GeoJSON");s instanceof Request&&(o=encodeURI(s.url))}e.url=o}else e.features=R_.readFeatures(r,{featureProjection:Cr()||"EPSG:3857"});var u=new ad(A({attributions:t.attribution,format:R_},e));return u.set("mapbox-source",t),u}var G_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),D_=function(t){function n(n){var i=t.call(this,z)||this;return i.error=n,i}return G_(n,t),n}(c),q_=function(t){function n(n){var i=this,r=!("declutter"in n)||n.declutter,e=new qy({state:"loading",format:new Lg});i=t.call(this,{source:e,background:n.background,declutter:r,className:n.className,opacity:n.opacity,visible:n.visible,zIndex:n.zIndex,minResolution:n.minResolution,maxResolution:n.maxResolution,minZoom:n.minZoom,maxZoom:n.maxZoom,renderOrder:n.renderOrder,renderBuffer:n.renderBuffer,renderMode:n.renderMode,map:n.map,updateWhileAnimating:n.updateWhileAnimating,updateWhileInteracting:n.updateWhileInteracting,preload:n.preload,useInterimTilesOnError:n.useInterimTilesOnError,properties:n.properties})||this,n.accessToken&&(i.accessToken=n.accessToken);var o=n.styleUrl;return C_(i,o,n.layers||n.source,{accessToken:i.accessToken}).then((function(){e.setState("ready")})).catch((function(t){i.dispatchEvent(new D_(t)),i.getSource().setState("error")})),void 0===i.getBackground()&&function(t,n,i){void 0===i&&(i={}),"object"==typeof n?(N_(t,n),Promise.resolve()):QM(n,i).then((function(n){N_(t,n)}))}(i,n.styleUrl,{accessToken:i.accessToken}),i}return G_(n,t),n}(Rg),U_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),B_=function(t){function n(n){var i=this,r=n||{},e=A({},r);return delete e.imageRatio,(i=t.call(this,e)||this).lv=void 0!==r.imageRatio?r.imageRatio:1,i}return U_(n,t),n.prototype.getImageRatio=function(){return this.lv},n.prototype.createRenderer=function(){return new qw(this)},n}($m),X_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),V_=function(t){function n(n){var i=this,r=A({},n);return(i=t.call(this,r)||this).vv=Yl(n.style),i.dv=n.style.variables||{},i.pv=!!n.disableHitDetection,i}return X_(n,t),n.prototype.createRenderer=function(){return new Hm(this,{vertexShader:this.vv.builder.getSymbolVertexShader(),fragmentShader:this.vv.builder.getSymbolFragmentShader(),hitVertexShader:!this.pv&&this.vv.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.pv&&this.vv.builder.getSymbolFragmentShader(!0),uniforms:this.vv.uniforms,attributes:this.vv.attributes})},n.prototype.updateStyleVariables=function(t){A(this.dv,t),this.changed()},n}(ls),W_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Y_(t,n){var i="\n attribute vec2 ".concat(al.TEXTURE_COORD,";\n uniform mat4 ").concat(ul.TILE_TRANSFORM,";\n uniform float ").concat(ul.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(ul.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(ul.TEXTURE_RESOLUTION,";\n uniform float ").concat(ul.TEXTURE_ORIGIN_X,";\n uniform float ").concat(ul.TEXTURE_ORIGIN_Y,";\n uniform float ").concat(ul.DEPTH,";\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ").concat(al.TEXTURE_COORD,";\n v_mapCoord = vec2(\n ").concat(ul.TEXTURE_ORIGIN_X," + ").concat(ul.TEXTURE_RESOLUTION," * ").concat(ul.TEXTURE_PIXEL_WIDTH," * v_textureCoord[0],\n ").concat(ul.TEXTURE_ORIGIN_Y," - ").concat(ul.TEXTURE_RESOLUTION," * ").concat(ul.TEXTURE_PIXEL_HEIGHT," * v_textureCoord[1]\n );\n gl_Position = ").concat(ul.TILE_TRANSFORM," * vec4(").concat(al.TEXTURE_COORD,", ").concat(ul.DEPTH,", 1.0);\n }\n "),r={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:n},e=[];if(void 0!==t.color){var o=Cl(r,t.color,wl);e.push("color = ".concat(o,";"))}if(void 0!==t.contrast){var s=Cl(r,t.contrast,yl);e.push("color.rgb = clamp((".concat(s," + 1.0) * color.rgb - (").concat(s," / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.exposure){var u=Cl(r,t.exposure,yl);e.push("color.rgb = clamp((".concat(u," + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}if(void 0!==t.saturation){var a=Cl(r,t.saturation,yl);e.push("\n float saturation = ".concat(a," + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n "))}if(void 0!==t.gamma){var h=Cl(r,t.gamma,yl);e.push("color.rgb = pow(color.rgb, vec3(1.0 / ".concat(h,"));"))}if(void 0!==t.brightness){var f=Cl(r,t.brightness,yl);e.push("color.rgb = clamp(color.rgb + ".concat(f,", vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));"))}var c={},l=r.variables.length;if(l>1&&!t.variables)throw new Error("Missing variables in style (expected ".concat(r.variables,")"));for(var v=function(n){var i=r.variables[n];if(!(i in t.variables))throw new Error("Missing '".concat(i,"' in style variables"));var e=ql(i);c[e]=function(){var n=t.variables[i];return"string"==typeof n&&(n=Al(r,n)),void 0!==n?n:-9999999}},d=0;d<l;++d)v(d);var p=Object.keys(c).map((function(t){return"uniform float ".concat(t,";")})),y=Math.ceil(n/4);p.push("uniform sampler2D ".concat(ul.TILE_TEXTURE_ARRAY,"[").concat(y,"];")),r.paletteTextures&&p.push("uniform sampler2D ".concat(Ul,"[").concat(r.paletteTextures.length,"];"));var m=Object.keys(r.functions).map((function(t){return r.functions[t]}));return{vertexShader:i,fragmentShader:"\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n uniform vec4 ".concat(ul.RENDER_EXTENT,";\n uniform float ").concat(ul.TRANSITION_ALPHA,";\n uniform float ").concat(ul.TEXTURE_PIXEL_WIDTH,";\n uniform float ").concat(ul.TEXTURE_PIXEL_HEIGHT,";\n uniform float ").concat(ul.RESOLUTION,";\n uniform float ").concat(ul.ZOOM,";\n\n ").concat(p.join("\n"),"\n\n ").concat(m.join("\n"),"\n\n void main() {\n if (\n v_mapCoord[0] < ").concat(ul.RENDER_EXTENT,"[0] ||\n v_mapCoord[1] < ").concat(ul.RENDER_EXTENT,"[1] ||\n v_mapCoord[0] > ").concat(ul.RENDER_EXTENT,"[2] ||\n v_mapCoord[1] > ").concat(ul.RENDER_EXTENT,"[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(").concat(ul.TILE_TEXTURE_ARRAY,"[0], v_textureCoord);\n\n ").concat(e.join("\n"),"\n\n if (color.a == 0.0) {\n discard;\n }\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ").concat(ul.TRANSITION_ALPHA,";\n }"),uniforms:c,paletteTextures:r.paletteTextures}}var Z_=function(t){function n(n){var i=this,r=n?A({},n):{},e=r.style||{};delete r.style;var o=r.cacheSize;return delete r.cacheSize,(i=t.call(this,r)||this).yv=r.sources,i.mv=null,i.Ic=NaN,i.H=e,i.Jt=o,i.dv=i.H.variables||{},i.addChangeListener(ns,i.wv),i}return W_(n,t),n.prototype.getSources=function(t,n){var i=this.getSource();return this.yv?"function"==typeof this.yv?this.yv(t,n):this.yv:i?[i]:[]},n.prototype.getRenderSource=function(){return this.mv||this.getSource()},n.prototype.getSourceState=function(){var t=this.getRenderSource();return t?t.getState():"undefined"},n.prototype.wv=function(){this.getSource()&&this.setStyle(this.H)},n.prototype.gv=function(){var t=Number.MAX_SAFE_INTEGER,n=this.getSources([-t,-t,t,t],t);return n&&n.length&&"bandCount"in n[0]?n[0].bandCount:4},n.prototype.createRenderer=function(){var t=Y_(this.H,this.gv());return new pl(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.Jt,paletteTextures:t.paletteTextures})},n.prototype.renderSources=function(t,n){for(var i,r=this.getRenderer(),e=0,o=n.length;e<o;++e)this.mv=n[e],r.prepareFrame(t)&&(i=r.renderFrame(t));return i},n.prototype.render=function(t,n){var i=this;this.rendered=!0;for(var r=t.viewState,e=this.getSources(t.extent,r.resolution),o=!0,s=function(t,n){var r=e[t],s=r.getState();if("loading"==s){var u=function(){"ready"==r.getState()&&(r.removeEventListener("change",u),i.changed())};r.addEventListener("change",u)}o=o&&"ready"==s},u=0,a=e.length;u<a;++u)s(u);var h=this.renderSources(t,e);if(this.getRenderer().renderComplete&&o)return this.Ic=r.resolution,h;if(this.Ic>.5*r.resolution){var f=this.getSources(t.extent,this.Ic).filter((function(t){return!e.includes(t)}));if(f.length>0)return this.renderSources(t,f)}return h},n.prototype.setStyle=function(t){this.dv=t.variables||{},this.H=t;var n=Y_(this.H,this.gv());this.getRenderer().reset({vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms,paletteTextures:n.paletteTextures}),this.changed()},n.prototype.updateStyleVariables=function(t){A(this.dv,t),this.changed()},n}(am);Z_.prototype.dispose;var $_=Z_,K_=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),H_="addfeatures",J_=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.features=r,o.file=i,o.projection=e,o}return K_(n,t),n}(c),Q_=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{handleEvent:S})||this).on,i.once,i.un,i.bv=!1,i.xv=[];for(var e=r.formatConstructors?r.formatConstructors:[],o=0,s=e.length;o<s;++o){var u=e[o];"function"==typeof u&&(u=new u),i.xv.push(u),i.bv=i.bv||"arraybuffer"===u.getType()}return i.di=r.projection?yr(r.projection):null,i.Mv=null,i._v=r.source||null,i.target=r.target?r.target:null,i}return K_(n,t),n.prototype.Sv=function(t,n){var i,r=n.target.result,e=this.getMap(),o=this.di;o||(o=e.getView().getProjection());for(var s=this.xv,u=0,a=s.length;u<a;++u){var h=s[u],f=r;this.bv&&"arraybuffer"!==h.getType()&&(void 0===i&&(i=(new TextDecoder).decode(r)),f=i);var c=this.Ov(h,f,{featureProjection:o});if(c&&c.length>0){this._v&&(this._v.clear(),this._v.addFeatures(c)),this.dispatchEvent(new J_(H_,t,c,o));break}}},n.prototype.jv=function(){var t=this.getMap();if(t){var n=this.target?this.target:t.getViewport();this.Mv=[$(n,U,this.handleDrop,this),$(n,D,this.handleStop,this),$(n,q,this.handleStop,this),$(n,U,this.handleStop,this)]}},n.prototype.setActive=function(n){!this.getActive()&&n&&this.jv(),this.getActive()&&!n&&this.Ev(),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Ev(),t.prototype.setMap.call(this,n),this.getActive()&&this.jv()},n.prototype.Ov=function(t,n,i){try{return t.readFeatures(n,i)}catch(t){return null}},n.prototype.Ev=function(){this.Mv&&(this.Mv.forEach(H),this.Mv=null)},n.prototype.handleDrop=function(t){for(var n=t.dataTransfer.files,i=0,r=n.length;i<r;++i){var e=n.item(i),o=new FileReader;o.addEventListener(V,this.Sv.bind(this,e)),this.bv?o.readAsArrayBuffer(e):o.readAsText(e)}},n.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},n}(ma),tS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nS=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).Zr=r.condition?r.condition:Ia,i.Kr=void 0,i.Tv=void 0,i.je=0,i.Fr=void 0!==r.duration?r.duration:400,i}return tS(n,t),n.prototype.handleDragEvent=function(t){if(La(t)){var n=t.map,i=n.getSize(),r=t.pixel,e=r[0]-i[0]/2,o=i[1]/2-r[1],s=Math.atan2(o,e),u=Math.sqrt(e*e+o*o),a=n.getView();if(void 0!==this.Kr){var h=this.Kr-s;a.adjustRotationInternal(h)}this.Kr=s,void 0!==this.Tv&&a.adjustResolutionInternal(this.Tv/u),void 0!==this.Tv&&(this.je=this.Tv/u),this.Tv=u}},n.prototype.handleUpEvent=function(t){if(!La(t))return!0;var n=t.map.getView(),i=this.je>1?1:-1;return n.endInteraction(this.Fr,i),this.je=0,!1},n.prototype.handleDownEvent=function(t){return!!La(t)&&(!!this.Zr(t)&&(t.map.getView().beginInteraction(),this.Kr=void 0,this.Tv=void 0,!0))},n}(Ma),iS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rS=function(t){function n(n,i,r){var e=t.call(this)||this;if(void 0!==r&&void 0===i)e.setFlatCoordinates(r,n);else{var o=i||0;e.setCenterAndRadius(n,o,r)}return e}return iS(n,t),n.prototype.clone=function(){var t=new n(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},n.prototype.closestPointXY=function(t,n,i,r){var e=this.flatCoordinates,o=t-e[0],s=n-e[1],u=o*o+s*s;if(u<r){if(0===u)for(var a=0;a<this.stride;++a)i[a]=e[a];else{var h=this.getRadius()/Math.sqrt(u);i[0]=e[0]+h*o,i[1]=e[1]+h*s;for(a=2;a<this.stride;++a)i[a]=e[a]}return i.length=this.stride,u}return r},n.prototype.containsXY=function(t,n){var i=this.flatCoordinates,r=t-i[0],e=n-i[1];return r*r+e*e<=this.Av()},n.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.computeExtent=function(t){var n=this.flatCoordinates,i=n[this.stride]-n[0];return On(n[0]-i,n[1]-i,n[0]+i,n[1]+i,t)},n.prototype.getRadius=function(){return Math.sqrt(this.Av())},n.prototype.Av=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],n=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+n*n},n.prototype.getType=function(){return"Circle"},n.prototype.intersectsExtent=function(t){if(Kn(t,this.getExtent())){var n=this.getCenter();return t[0]<=n[0]&&t[2]>=n[0]||(t[1]<=n[1]&&t[3]>=n[1]||Rn(t,this.intersectsCoordinate.bind(this)))}return!1},n.prototype.setCenter=function(t){var n=this.stride,i=this.flatCoordinates[n]-this.flatCoordinates[0],r=t.slice();r[n]=r[0]+i;for(var e=1;e<n;++e)r[n+e]=t[e];this.setFlatCoordinates(this.layout,r),this.changed()},n.prototype.setCenterAndRadius=function(t,n,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,e=ee(r,0,t,this.stride);r[e++]=r[0]+n;for(var o=1,s=this.stride;o<s;++o)r[e++]=r[o];r.length=e,this.changed()},n.prototype.getCoordinates=function(){return null},n.prototype.setCoordinates=function(t,n){},n.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},n.prototype.rotate=function(t,n){var i=this.getCenter(),r=this.getStride();this.setCenter(qr(i,0,i.length,r,t,n,i)),this.changed()},n.prototype.translate=function(t,n){var i=this.getCenter(),r=this.getStride();this.setCenter(Br(i,0,i.length,r,t,n,i)),this.changed()},n}(Kr);rS.prototype.transform;var eS=rS,oS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),sS="Point",uS="LineString",aS="Polygon",hS="Circle",fS="drawstart",cS="drawend",lS="drawabort",vS=function(t){function n(n,i){var r=t.call(this,n)||this;return r.feature=i,r}return oS(n,t),n}(c);var dS=function(t){function n(n){var i=this,r=n;r.stopDown||(r.stopDown=O),(i=t.call(this,r)||this).on,i.once,i.un,i.Pv=!1,i.Cv=null,i.kv,i.Iv,i.Nv,i.Lv=!1,i._v=n.source?n.source:null,i.Re=n.features?n.features:null,i.zv=n.snapTolerance?n.snapTolerance:12,i.rl=n.type,i.pe=function(t){switch(t){case"Point":case"MultiPoint":return sS;case"LineString":case"MultiLineString":return uS;case"Polygon":case"MultiPolygon":return aS;case"Circle":return hS;default:throw new Error("Invalid type: "+t)}}(i.rl),i.Rv=!!n.stopClick,i.Fv=n.minPoints?n.minPoints:i.pe===aS?3:2,i.Gv=i.pe===hS?2:n.maxPoints?n.maxPoints:1/0,i.Dv=n.finishCondition?n.finishCondition:S,i.qv=n.geometryLayout?n.geometryLayout:Tt;var e,o=n.geometryFunction;if(!o){var s,u=i.pe;if(u===hS)o=function(t,n,i){var r=n||new eS([NaN,NaN]),e=Ir(t[0],i),o=Qi(e,Ir(t[t.length-1],i));r.setCenterAndRadius(e,Math.sqrt(o),this.qv);var s=Cr();return s&&r.transform(i,s),r};else u===sS?s=Se:u===uS?s=ng:u===aS&&(s=We),o=function(t,n,i){return n?u===aS?t[0].length?n.setCoordinates([t[0].concat([t[0][0]])],this.qv):n.setCoordinates([],this.qv):n.setCoordinates(t,this.qv):n=new s(t,this.qv),n}}return i.Bu=o,i.Uv=void 0!==n.dragVertexDelay?n.dragVertexDelay:500,i.Bv=null,i.Xv=null,i.Vv=null,i.Wv=null,i.Yv=null,i.Zv=null,i.$v=n.clickTolerance?n.clickTolerance*n.clickTolerance:36,i.Kv=new lg({source:new ad({useSpatialIndex:!1,wrapX:!!n.wrapX&&n.wrapX}),style:n.style?n.style:(e=Mv(),function(t,n){return e[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.K=n.geometryName,i.Zr=n.condition?n.condition:ka,i.Hv,n.freehand?i.Hv=Ta:i.Hv=n.freehandCondition?n.freehandCondition:Ia,i.addChangeListener(va,i.Jv),i}return oS(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),this.Jv()},n.prototype.getOverlay=function(){return this.Kv},n.prototype.handleEvent=function(n){n.originalEvent.type===R&&n.originalEvent.preventDefault(),this.Lv=this.pe!==sS&&this.Hv(n);var i=n.type===su.POINTERMOVE,r=!0;!this.Lv&&this.Iv&&n.type===su.POINTERDRAG&&(Date.now()-this.Iv>=this.Uv?(this.Cv=n.pixel,this.Pv=!this.Lv,i=!0):this.Iv=void 0,this.Pv&&void 0!==this.kv&&(clearTimeout(this.kv),this.kv=void 0));return this.Lv&&n.type===su.POINTERDRAG&&null!==this.Xv?(this.Qv(n.coordinate),r=!1):this.Lv&&n.type===su.POINTERDOWN?r=!1:i&&this.getPointerCount()<2?(r=n.type===su.POINTERMOVE)&&this.Lv?(this.Zn(n),this.Pv&&n.originalEvent.preventDefault()):("mouse"===n.originalEvent.pointerType||n.type===su.POINTERDRAG&&void 0===this.kv)&&this.Zn(n):n.type===su.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,n)&&r},n.prototype.handleDownEvent=function(t){return this.Pv=!this.Lv,this.Lv?(this.Cv=t.pixel,this.Bv||this.td(t.coordinate),!0):this.Zr(t)?(this.Iv=Date.now(),this.kv=setTimeout(function(){this.Zn(new ou(su.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.Uv),this.Cv=t.pixel,!0):(this.Iv=void 0,!1)},n.prototype.handleUpEvent=function(t){var n=!0;if(0===this.getPointerCount())if(this.kv&&(clearTimeout(this.kv),this.kv=void 0),this.Zn(t),this.Pv){var i=!this.Bv;i&&this.td(t.coordinate),!i&&this.Lv?this.finishDrawing():this.Lv||i&&this.pe!==sS||(this.rd(t.pixel)?this.Dv(t)&&this.finishDrawing():this.Qv(t.coordinate)),n=!1}else this.Lv&&this.abortDrawing();return!n&&this.Rv&&t.preventDefault(),n},n.prototype.Zn=function(t){if(this.Nv=t.originalEvent.pointerType,this.Cv&&(!this.Lv&&this.Pv||this.Lv&&!this.Pv)){var n=this.Cv,i=t.pixel,r=n[0]-i[0],e=n[1]-i[1],o=r*r+e*e;if(this.Pv=this.Lv?o>this.$v:o<=this.$v,!this.Pv)return}this.Bv?this.ed(t.coordinate):this.od(t.coordinate.slice())},n.prototype.rd=function(t){var n=!1;if(this.Xv){var i=!1,r=[this.Bv],e=this.pe;if(e===sS)n=!0;else if(e===hS)n=2===this.Wv.length;else if(e===uS)i=this.Wv.length>this.Fv;else if(e===aS){var o=this.Wv;i=o[0].length>this.Fv,r=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),u=0,a=r.length;u<a;u++){var h=r[u],f=s.getPixelFromCoordinate(h),c=t[0]-f[0],l=t[1]-f[1],v=this.Lv?1:this.zv;if(n=Math.sqrt(c*c+l*l)<=v){this.Bv=h;break}}}return n},n.prototype.od=function(t){this.Vv?this.Vv.getGeometry().setCoordinates(t):(this.Vv=new Et(new Se(t)),this.sd())},n.prototype.ud=function(t){this.Yv||(this.Yv=new Et);var n=t.getLinearRing(0),i=this.Yv.getGeometry();i?(i.setFlatCoordinates(n.getLayout(),n.getFlatCoordinates()),i.changed()):(i=new ng(n.getFlatCoordinates(),n.getLayout()),this.Yv.setGeometry(i))},n.prototype.td=function(t){for(var n=this.getMap().getView().getProjection(),i=Zr(this.qv);t.length<i;)t.push(0);this.Bv=t,this.pe===sS?this.Wv=t.slice():this.pe===aS?(this.Wv=[[t.slice(),t.slice()]],this.Zv=this.Wv[0]):this.Wv=[t.slice(),t.slice()],this.Zv&&(this.Yv=new Et(new ng(this.Zv)));var r=this.Bu(this.Wv,void 0,n);this.Xv=new Et,this.K&&this.Xv.setGeometryName(this.K),this.Xv.setGeometry(r),this.sd(),this.dispatchEvent(new vS(fS,this.Xv))},n.prototype.ed=function(t){for(var n,i,r=this.getMap(),e=this.Xv.getGeometry(),o=r.getView().getProjection(),s=Zr(this.qv);t.length<s;)t.push(0);(this.pe===sS?i=this.Wv:this.pe===aS?(i=(n=this.Wv[0])[n.length-1],this.rd(r.getPixelFromCoordinate(t))&&(t=this.Bv.slice())):i=(n=this.Wv)[n.length-1],i[0]=t[0],i[1]=t[1],this.Bu(this.Wv,e,o),this.Vv)&&this.Vv.getGeometry().setCoordinates(t);if("Polygon"===e.getType()&&this.pe!==aS)this.ud(e);else if(this.Zv){this.Yv.getGeometry().setCoordinates(this.Zv)}this.sd()},n.prototype.Qv=function(t){var n,i,r=this.Xv.getGeometry(),e=this.getMap().getView().getProjection(),o=this.pe;o===uS||o===hS?(this.Bv=t.slice(),(i=this.Wv).length>=this.Gv&&(this.Lv?i.pop():n=!0),i.push(t.slice()),this.Bu(i,r,e)):o===aS&&((i=this.Wv[0]).length>=this.Gv&&(this.Lv?i.pop():n=!0),i.push(t.slice()),n&&(this.Bv=i[0]),this.Bu(this.Wv,r,e)),this.od(t.slice()),this.sd(),n&&this.finishDrawing()},n.prototype.removeLastPoint=function(){if(this.Xv){var t,n=this.Xv.getGeometry(),i=this.getMap().getView().getProjection(),r=this.pe;if(r===uS||r===hS){if((t=this.Wv).splice(-2,1),t.length>=2){this.Bv=t[t.length-2].slice();var e=this.Bv.slice();t[t.length-1]=e,this.od(e)}this.Bu(t,n,i),"Polygon"===n.getType()&&this.Yv&&this.ud(n)}else if(r===aS){(t=this.Wv[0]).splice(-2,1);var o=this.Yv.getGeometry();if(t.length>=2){e=t[t.length-2].slice();t[t.length-1]=e,this.od(e)}o.setCoordinates(t),this.Bu(this.Wv,n,i)}1===t.length&&this.abortDrawing(),this.sd()}},n.prototype.finishDrawing=function(){var t=this.ad();if(t){var n=this.Wv,i=t.getGeometry(),r=this.getMap().getView().getProjection();this.pe===uS?(n.pop(),this.Bu(n,i,r)):this.pe===aS&&(n[0].pop(),this.Bu(n,i,r),n=i.getCoordinates()),"MultiPoint"===this.rl?t.setGeometry(new Kw([n])):"MultiLineString"===this.rl?t.setGeometry(new rg([n])):"MultiPolygon"===this.rl&&t.setGeometry(new sg([n])),this.dispatchEvent(new vS(cS,t)),this.Re&&this.Re.push(t),this._v&&this._v.addFeature(t)}},n.prototype.ad=function(){this.Bv=null;var t=this.Xv;return this.Xv=null,this.Vv=null,this.Yv=null,this.Kv.getSource().clear(!0),t},n.prototype.abortDrawing=function(){var t=this.ad();t&&this.dispatchEvent(new vS(lS,t))},n.prototype.appendCoordinates=function(t){var n,i=this.pe,r=!this.Xv;if(r&&this.td(t[0]),i===uS||i===hS)n=this.Wv;else{if(i!==aS)return;n=this.Wv&&this.Wv.length?this.Wv[0]:[]}r&&n.shift(),n.pop();for(var e=0;e<t.length;e++)this.Qv(t[e]);var o=t[t.length-1];this.Qv(o),this.ed(o)},n.prototype.extend=function(t){var n=t.getGeometry();this.Xv=t,this.Wv=n.getCoordinates();var i=this.Wv[this.Wv.length-1];this.Bv=i.slice(),this.Wv.push(i.slice()),this.Vv=new Et(new Se(i)),this.sd(),this.dispatchEvent(new vS(fS,this.Xv))},n.prototype.sd=function(){var t=[];this.Xv&&t.push(this.Xv),this.Yv&&t.push(this.Yv),this.Vv&&t.push(this.Vv);var n=this.Kv.getSource();n.clear(!0),n.addFeatures(t)},n.prototype.Jv=function(){var t=this.getMap(),n=this.getActive();t&&n||this.abortDrawing(),this.Kv.setMap(n?t:null)},n}(Ma),pS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yS="extentchanged",mS=function(t){function n(n){var i=t.call(this,yS)||this;return i.extent=n,i}return pS(n,t),n}(c);function wS(){var t=Mv();return function(n,i){return t.Point}}function gS(t){return function(n){return yn([t,n])}}function bS(t,n){return t[0]==n[0]?function(i){return yn([t,[i[0],n[1]]])}:t[1]==n[1]?function(i){return yn([t,[n[0],i[1]]])}:null}var xS=function(t){function n(n){var i,r=this,e=n||{};return(r=t.call(this,e)||this).on,r.once,r.un,r.Zr=e.condition?e.condition:Ta,r.st=null,r.hd=null,r.fd=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.ld=!1,r.vd=null,r.dd=null,n||(n={}),r.yd=new lg({source:new ad({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.boxStyle?n.boxStyle:(i=Mv(),function(t,n){return i.Polygon}),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.md=new lg({source:new ad({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.pointerStyle?n.pointerStyle:wS(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.extent&&r.setExtent(n.extent),r}return pS(n,t),n.prototype.wd=function(t,n){var i=n.getCoordinateFromPixelInternal(t),r=this.getExtentInternal();if(r){var e=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]]]]}(r);e.sort((function(t,n){return nr(i,t)-nr(i,n)}));var o=e[0],s=Yi(i,o),u=n.getPixelFromCoordinateInternal(s);if(tr(t,u)<=this.fd){var a=n.getPixelFromCoordinateInternal(o[0]),h=n.getPixelFromCoordinateInternal(o[1]),f=Qi(u,a),c=Qi(u,h),l=Math.sqrt(Math.min(f,c));return this.ld=l<=this.fd,this.ld&&(s=f>c?o[1]:o[0]),s}}return null},n.prototype.Zn=function(t){var n=t.pixel,i=t.map,r=this.wd(n,i);r||(r=i.getCoordinateFromPixelInternal(n)),this.gd(r)},n.prototype.bd=function(t){var n=this.vd;return n?t?n.setGeometry(Ze(t)):n.setGeometry(void 0):(n=new Et(t?Ze(t):{}),this.vd=n,this.yd.getSource().addFeature(n)),n},n.prototype.gd=function(t){var n=this.dd;n?n.getGeometry().setCoordinates(t):(n=new Et(new Se(t)),this.dd=n,this.md.getSource().addFeature(n));return n},n.prototype.handleEvent=function(n){return!n.originalEvent||!this.Zr(n)||(n.type!=su.POINTERMOVE||this.handlingDownUpSequence||this.Zn(n),t.prototype.handleEvent.call(this,n),!1)},n.prototype.handleDownEvent=function(t){var n=t.pixel,i=t.map,r=this.getExtentInternal(),e=this.wd(n,i),o=function(t){var n=null,i=null;return t[0]==r[0]?n=r[2]:t[0]==r[2]&&(n=r[0]),t[1]==r[1]?i=r[3]:t[1]==r[3]&&(i=r[1]),null!==n&&null!==i?[n,i]:null};if(e&&r){var s=e[0]==r[0]||e[0]==r[2]?e[0]:null,u=e[1]==r[1]||e[1]==r[3]?e[1]:null;null!==s&&null!==u?this.hd=gS(o(e)):null!==s?this.hd=bS(o([s,r[1]]),o([s,r[3]])):null!==u&&(this.hd=bS(o([r[0],u]),o([r[2],u])))}else e=i.getCoordinateFromPixelInternal(n),this.setExtent([e[0],e[1],e[0],e[1]]),this.hd=gS(e);return!0},n.prototype.handleDragEvent=function(t){if(this.hd){var n=t.coordinate;this.setExtent(this.hd(n)),this.gd(n)}},n.prototype.handleUpEvent=function(t){this.hd=null;var n=this.getExtentInternal();return n&&0!==Fn(n)||this.setExtent(null),!1},n.prototype.setMap=function(n){this.yd.setMap(n),this.md.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getExtent=function(){return Nr(this.getExtentInternal(),this.getMap().getView().getProjection())},n.prototype.getExtentInternal=function(){return this.st},n.prototype.setExtent=function(t){this.st=t||null,this.bd(t),this.dispatchEvent(new mS(this.st))},n}(Ma),MS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function _S(t){return parseFloat(t)}function SS(t){return function(t){return pi(t,5)}(t).toString()}function OS(t,n){return!isNaN(t)&&t!==_S(SS(n))}var jS=function(t){function n(n){var i,r=t.call(this)||this,e=A({animate:!0,replace:!1,prefix:""},n||{});return i=!0===e.animate?{duration:250}:e.animate?e.animate:null,r.xd=i,r.Md=e.replace,r._d=e.prefix,r.gn=[],r.Sd=!0,r.Jv=r.Jv.bind(r),r}return MS(n,t),n.prototype.Od=function(t){return this._d?this._d+t:t},n.prototype.jd=function(t,n){return t.get(this.Od(n))},n.prototype.Ed=function(t,n,i){t.set(this.Od(n),i)},n.prototype.Td=function(t,n){t.delete(this.Od(n))},n.prototype.setMap=function(n){var i=this.getMap();t.prototype.setMap.call(this,n),n!==i&&(i&&this.Ev(i),n&&(this.Sd=!0,this.Jv(),this.jv(n)))},n.prototype.jv=function(t){this.gn.push($(t,pu,this.Ad,this),$(t.getLayerGroup(),L,this.Ad,this),$(t,"change:layergroup",this.Pd,this)),this.Md||addEventListener("popstate",this.Jv)},n.prototype.Ev=function(t){for(var n=0,i=this.gn.length;n<i;++n)H(this.gn[n]);this.gn.length=0,this.Md||removeEventListener("popstate",this.Jv);var r=new URL(window.location.href),e=r.searchParams;this.Td(e,"x"),this.Td(e,"y"),this.Td(e,"z"),this.Td(e,"r"),this.Td(e,"l"),window.history.replaceState(null,"",r)},n.prototype.Pd=function(){var t=this.getMap();t&&(this.Ev(t),this.jv(t),this.Sd=!0,this.Ad())},n.prototype.Jv=function(){var t=this.getMap();if(t){var n=t.getView();if(n){var i=new URL(window.location.href).searchParams,r=!1,e={},o=_S(this.jd(i,"z"));OS(o,n.getZoom())&&(r=!0,e.zoom=o);var s=_S(this.jd(i,"r"));OS(s,n.getRotation())&&(r=!0,e.rotation=s);var u,a,h=[_S(this.jd(i,"x")),_S(this.jd(i,"y"))];u=h,a=n.getCenter(),(OS(u[0],a[0])||OS(u[1],a[1]))&&(r=!0,e.center=h),r&&(!this.Sd&&this.xd?n.animate(A(e,this.xd)):(e.center&&n.setCenter(e.center),"zoom"in e&&n.setZoom(e.zoom),"rotation"in e&&n.setRotation(e.rotation)));var f=t.getAllLayers(),c=this.jd(i,"l");if(c&&c.length===f.length)for(var l=0,v=f.length;l<v;++l){var d=parseInt(c[l]);if(!isNaN(d)){var p=Boolean(d),y=f[l];y.getVisible()!==p&&y.setVisible(p)}}}}},n.prototype.Ad=function(){var t=this.getMap();if(t){var n=t.getView();if(n){var i=this.Sd;this.Sd=!1;for(var r=n.getCenter(),e=n.getZoom(),o=n.getRotation(),s=t.getAllLayers(),u=new Array(s.length),a=0,h=s.length;a<h;++a)u[a]=s[a].getVisible()?"1":"0";var f=new URL(window.location.href),c=f.searchParams;this.Ed(c,"x",SS(r[0])),this.Ed(c,"y",SS(r[1])),this.Ed(c,"z",SS(e)),this.Ed(c,"r",SS(o)),this.Ed(c,"l",u.join("")),f.href!==window.location.href&&(i||this.Md?window.history.replaceState(null,"",f):window.history.pushState(null,"",f))}}},n}(ma),ES=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),TS=[0,0,0,0],AS=[],PS="modifystart",CS="modifyend",kS=function(t){function n(n,i,r){var e=t.call(this,n)||this;return e.features=i,e.mapBrowserEvent=r,e}return ES(n,t),n}(c);function IS(t,n){return t.index-n.index}function NS(t,n,i){var r=n.geometry;if("Circle"===r.getType()){var e=r;if(1===n.index){var o=Cr();o&&(e=e.clone().transform(o,i));var s=Qi(e.getCenter(),Ir(t,i)),u=Math.sqrt(s)-e.getRadius();return u*u}}var a=Ir(t,i);return AS[0]=Ir(n.segment[0],i),AS[1]=Ir(n.segment[1],i),nr(a,AS)}function LS(t,n,i){var r=n.geometry;if("Circle"===r.getType()&&1===n.index){var e=r,o=Cr();return o&&(e=e.clone().transform(o,i)),kr(e.getClosestPoint(Ir(t,i)),i)}var s=Ir(t,i);return AS[0]=Ir(n.segment[0],i),AS[1]=Ir(n.segment[1],i),kr(Yi(s,AS),i)}var zS=function(t){function n(n){var i,r,e=t.call(this,n)||this;if(e.on,e.once,e.un,e.Cd=e.$a.bind(e),e.Zr=n.condition?n.condition:za,e.kd=function(t){return Sa(t)&&Ca(t)},e.Id=n.deleteCondition?n.deleteCondition:e.kd,e.Nd=n.insertVertexCondition?n.insertVertexCondition:Ta,e.dd=null,e.Ld=null,e.zd=[0,0],e.Rd=!1,e.Fd=null,e.Gd=new Pv,e.fd=void 0!==n.pixelTolerance?n.pixelTolerance:10,e.ld=!1,e.Dd=!1,e.qd=[],e.Kv=new lg({source:new ad({useSpatialIndex:!1,wrapX:!!n.wrapX}),style:n.style?n.style:(i=Mv(),function(t,n){return i.Point}),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.Ud={Point:e.Bd.bind(e),LineString:e.Xd.bind(e),LinearRing:e.Xd.bind(e),Polygon:e.Vd.bind(e),MultiPoint:e.Wd.bind(e),MultiLineString:e.Yd.bind(e),MultiPolygon:e.Zd.bind(e),Circle:e.$d.bind(e),GeometryCollection:e.Kd.bind(e)},e._v=null,e.Hd=null,n.features?r=n.features:n.source&&(e._v=n.source,r=new ft(e._v.getFeatures()),e._v.addEventListener(Qv,e.Jd.bind(e)),e._v.addEventListener(id,e.Qd.bind(e))),!r)throw new Error("The modify interaction requires features, a source or a layer");return n.hitDetection&&(e.Hd=n.hitDetection),e.Re=r,e.Re.forEach(e.tp.bind(e)),e.Re.addEventListener(ot,e.np.bind(e)),e.Re.addEventListener(st,e.ip.bind(e)),e.rp=null,e.Br=[0,0],e.ep=void 0===n.snapToPointer?!e.Hd:n.snapToPointer,e}return ES(n,t),n.prototype.tp=function(t){var n=t.getGeometry();if(n){var i=this.Ud[n.getType()];i&&i(t,n)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.op(this.zd,r),t.addEventListener(L,this.Cd)},n.prototype.sp=function(t,n){if(!this.Fd){this.Fd=new ft;for(var i=this.Fd.getArray(),r=0,e=n.length;r<e;++r)for(var o=n[r],s=0,u=o.length;s<u;++s){var a=o[s].feature;a&&-1===i.indexOf(a)&&this.Fd.push(a)}0===this.Fd.getLength()?this.Fd=null:this.dispatchEvent(new kS(PS,this.Fd,t))}},n.prototype.up=function(t){this.ap(t),this.dd&&0===this.Re.getLength()&&(this.Kv.getSource().removeFeature(this.dd),this.dd=null),t.removeEventListener(L,this.Cd)},n.prototype.ap=function(t){var n=this.Gd,i=[];n.forEach((function(n){t===n.feature&&i.push(n)}));for(var r=i.length-1;r>=0;--r){for(var e=i[r],o=this.qd.length-1;o>=0;--o)this.qd[o][0]===e&&this.qd.splice(o,1);n.remove(e)}},n.prototype.setActive=function(n){this.dd&&!n&&(this.Kv.getSource().removeFeature(this.dd),this.dd=null),t.prototype.setActive.call(this,n)},n.prototype.setMap=function(n){this.Kv.setMap(n),t.prototype.setMap.call(this,n)},n.prototype.getOverlay=function(){return this.Kv},n.prototype.Jd=function(t){t.feature&&this.Re.push(t.feature)},n.prototype.Qd=function(t){t.feature&&this.Re.remove(t.feature)},n.prototype.np=function(t){this.tp(t.element)},n.prototype.$a=function(t){if(!this.Dd){var n=t.target;this.up(n),this.tp(n)}},n.prototype.ip=function(t){var n=t.element;this.up(n)},n.prototype.Bd=function(t,n){var i=n.getCoordinates(),r={feature:t,geometry:n,segment:[i,i]};this.Gd.insert(n.getExtent(),r)},n.prototype.Wd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r){var o=i[r],s={feature:t,geometry:n,depth:[r],index:r,segment:[o,o]};this.Gd.insert(n.getExtent(),s)}},n.prototype.Xd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length-1;r<e;++r){var o=i.slice(r,r+2),s={feature:t,geometry:n,index:r,segment:o};this.Gd.insert(yn(o),s)}},n.prototype.Yd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,u=o.length-1;s<u;++s){var a=o.slice(s,s+2),h={feature:t,geometry:n,depth:[r],index:s,segment:a};this.Gd.insert(yn(a),h)}},n.prototype.Vd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,u=o.length-1;s<u;++s){var a=o.slice(s,s+2),h={feature:t,geometry:n,depth:[r],index:s,segment:a};this.Gd.insert(yn(a),h)}},n.prototype.Zd=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,u=o.length;s<u;++s)for(var a=o[s],h=0,f=a.length-1;h<f;++h){var c=a.slice(h,h+2),l={feature:t,geometry:n,depth:[s,r],index:h,segment:c};this.Gd.insert(yn(c),l)}},n.prototype.$d=function(t,n){var i=n.getCenter(),r={feature:t,geometry:n,index:0,segment:[i,i]},e={feature:t,geometry:n,index:1,segment:[i,i]},o=[r,e];r.featureSegments=o,e.featureSegments=o,this.Gd.insert(En(i),r);var s=n,u=Cr();if(u&&this.getMap()){var a=this.getMap().getView().getProjection();s=$e(s=s.clone().transform(u,a)).transform(a,u)}this.Gd.insert(s.getExtent(),e)},n.prototype.Kd=function(t,n){for(var i=n.getGeometriesArray(),r=0;r<i.length;++r){var e=i[r];(0,this.Ud[e.getType()])(t,e)}},n.prototype.hp=function(t,n,i){var r=this.dd;r?r.getGeometry().setCoordinates(t):(r=new Et(new Se(t)),this.dd=r,this.Kv.getSource().addFeature(r));return r.set("features",n),r.set("geometries",i),r},n.prototype.handleEvent=function(n){return!n.originalEvent||(this.rp=n,n.map.getView().getInteracting()||n.type!=su.POINTERMOVE||this.handlingDownUpSequence||this.Zn(n),this.dd&&this.Id(n)&&(i=!(n.type!=su.SINGLECLICK||!this.Rd)||this.removePoint()),n.type==su.SINGLECLICK&&(this.Rd=!1),t.prototype.handleEvent.call(this,n)&&!i);var i},n.prototype.handleDragEvent=function(t){this.Rd=!1,this.sp(t,this.qd);for(var n=[t.coordinate[0]+this.Br[0],t.coordinate[1]+this.Br[1]],i=[],r=[],e=0,o=this.qd.length;e<o;++e){var s=this.qd[e],u=s[0],a=u.feature;-1===i.indexOf(a)&&i.push(a);var h=u.geometry;-1===r.indexOf(h)&&r.push(h);for(var f=u.depth,c=void 0,l=u.segment,v=s[1];n.length<h.getStride();)n.push(l[v][n.length]);switch(h.getType()){case"Point":c=n,l[0]=n,l[1]=n;break;case"MultiPoint":(c=h.getCoordinates())[u.index]=n,l[0]=n,l[1]=n;break;case"LineString":(c=h.getCoordinates())[u.index+v]=n,l[v]=n;break;case"MultiLineString":case"Polygon":(c=h.getCoordinates())[f[0]][u.index+v]=n,l[v]=n;break;case"MultiPolygon":(c=h.getCoordinates())[f[1]][f[0]][u.index+v]=n,l[v]=n;break;case"Circle":if(l[0]=n,l[1]=n,0===u.index)this.Dd=!0,h.setCenter(n),this.Dd=!1;else{this.Dd=!0;var d=t.map.getView().getProjection(),p=tr(Ir(h.getCenter(),d),Ir(n,d)),y=Cr();if(y){var m=h.clone().transform(y,d);m.setRadius(p),p=m.transform(d,y).getRadius()}h.setRadius(p),this.Dd=!1}}c&&this.fp(h,c)}this.hp(n,i,r)},n.prototype.handleDownEvent=function(t){if(!this.Zr(t))return!1;var n=t.coordinate;this.op(t.pixel,t.map,n),this.qd.length=0,this.Fd=null;var i=this.dd;if(i){var r=t.map.getView().getProjection(),e=[],s=i.getGeometry().getCoordinates(),u=yn([s]),a=this.Gd.getInExtent(u),h={};a.sort(IS);for(var f=0,c=a.length;f<c;++f){var l=a[f],v=l.segment,d=o(l.geometry),p=l.depth;if(p&&(d+="-"+p.join("-")),h[d]||(h[d]=new Array(2)),"Circle"!==l.geometry.getType()||1!==l.index)if(!Ki(v[0],s)||h[d][0])if(!Ki(v[1],s)||h[d][1])o(v)in this.Ld&&!h[d][0]&&!h[d][1]&&this.Nd(t)&&e.push(l);else{if(h[d][0]&&0===h[d][0].index){var y=l.geometry.getCoordinates();switch(l.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":y=y[p[1]];case"Polygon":if(l.index!==y[p[0]].length-2)continue}}this.qd.push([l,1]),h[d][1]=l}else this.qd.push([l,0]),h[d][0]=l;else Ki(LS(n,l,r),s)&&!h[d][0]&&(this.qd.push([l,0]),h[d][0]=l)}e.length&&this.sp(t,[e]);for(var m=e.length-1;m>=0;--m)this.cp(e[m],s)}return!!this.dd},n.prototype.handleUpEvent=function(t){for(var n=this.qd.length-1;n>=0;--n){var i=this.qd[n][0],r=i.geometry;if("Circle"===r.getType()){var e=r.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=e,o.segment[1]=e,s.segment[0]=e,s.segment[1]=e,this.Gd.update(En(e),o);var u=r,a=Cr();if(a){var h=t.map.getView().getProjection();u=$e(u=u.clone().transform(a,h)).transform(h,a)}this.Gd.update(u.getExtent(),s)}else this.Gd.update(yn(i.segment),i)}return this.Fd&&(this.dispatchEvent(new kS(CS,this.Fd,t)),this.Fd=null),!1},n.prototype.Zn=function(t){this.zd=t.pixel,this.op(t.pixel,t.map,t.coordinate)},n.prototype.op=function(t,n,i){var r,e,s=this,u=i||n.getCoordinateFromPixel(t),a=n.getView().getProjection();if(this.Hd){var h="object"==typeof this.Hd?function(t){return t===s.Hd}:void 0;n.forEachFeatureAtPixel(t,(function(t,n,i){if("Point"===(i=i||t.getGeometry()).getType()&&y(s.Re.getArray(),t)){e=i;var o=i.getFlatCoordinates().slice(0,2);r=[{feature:t,geometry:i,segment:[o,o]}]}return!0}),{layerFilter:h})}if(!r){var f=Nr(mn(Lr(En(u,TS),a),n.getView().getResolution()*this.fd,TS),a);r=this.Gd.getInExtent(f)}if(r&&r.length>0){var c=r.sort((function(t,n){return NS(u,t,a)-NS(u,n,a)}))[0],l=c.segment,v=LS(u,c,a),d=n.getPixelFromCoordinate(v),p=tr(t,d);if(e||p<=this.fd){var m={};if(m[o(l)]=!0,this.ep||(this.Br[0]=v[0]-u[0],this.Br[1]=v[1]-u[1]),"Circle"===c.geometry.getType()&&1===c.index)this.ld=!0,this.hp(v,[c.feature],[c.geometry]);else{var w=n.getPixelFromCoordinate(l[0]),g=n.getPixelFromCoordinate(l[1]),b=Qi(d,w),x=Qi(d,g);p=Math.sqrt(Math.min(b,x)),this.ld=p<=this.fd,this.ld&&(v=b>x?l[1]:l[0]),this.hp(v,[c.feature],[c.geometry]);var M={};M[o(c.geometry)]=!0;for(var _=1,S=r.length;_<S;++_){var O=r[_].segment;if(!(Ki(l[0],O[0])&&Ki(l[1],O[1])||Ki(l[0],O[1])&&Ki(l[1],O[0])))break;var j=o(r[_].geometry);j in M||(M[j]=!0,m[o(O)]=!0)}}return void(this.Ld=m)}}this.dd&&(this.Kv.getSource().removeFeature(this.dd),this.dd=null)},n.prototype.cp=function(t,n){for(var i,r=t.segment,e=t.feature,o=t.geometry,s=t.depth,u=t.index;n.length<o.getStride();)n.push(0);switch(o.getType()){case"MultiLineString":case"Polygon":(i=o.getCoordinates())[s[0]].splice(u+1,0,n);break;case"MultiPolygon":(i=o.getCoordinates())[s[1]][s[0]].splice(u+1,0,n);break;case"LineString":(i=o.getCoordinates()).splice(u+1,0,n);break;default:return}this.fp(o,i);var a=this.Gd;a.remove(t),this.lp(o,u,s,1);var h={segment:[r[0],n],feature:e,geometry:o,depth:s,index:u};a.insert(yn(h.segment),h),this.qd.push([h,1]);var f={segment:[n,r[1]],feature:e,geometry:o,depth:s,index:u+1};a.insert(yn(f.segment),f),this.qd.push([f,0]),this.Rd=!0},n.prototype.removePoint=function(){if(this.rp&&this.rp.type!=su.POINTERDRAG){var t=this.rp;this.sp(t,this.qd);var n=this.vp();return this.Fd&&this.dispatchEvent(new kS(CS,this.Fd,t)),this.Fd=null,n}return!1},n.prototype.vp=function(){var t,n,i,r,e,s,u,a,h,f,c,l=this.qd,v={},d=!1;for(e=l.length-1;e>=0;--e)c=o((f=(i=l[e])[0]).feature),f.depth&&(c+="-"+f.depth.join("-")),c in v||(v[c]={}),0===i[1]?(v[c].right=f,v[c].index=f.index):1==i[1]&&(v[c].left=f,v[c].index=f.index+1);for(c in v){switch(h=v[c].right,u=v[c].left,(a=(s=v[c].index)-1)<0&&(a=0),t=n=(r=(f=void 0!==u?u:h).geometry).getCoordinates(),d=!1,r.getType()){case"MultiLineString":n[f.depth[0]].length>2&&(n[f.depth[0]].splice(s,1),d=!0);break;case"LineString":n.length>2&&(n.splice(s,1),d=!0);break;case"MultiPolygon":t=t[f.depth[1]];case"Polygon":(t=t[f.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),d=!0,0===s&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.fp(r,n);var p=[];if(void 0!==u&&(this.Gd.remove(u),p.push(u.segment[0])),void 0!==h&&(this.Gd.remove(h),p.push(h.segment[1])),void 0!==u&&void 0!==h){var y={depth:f.depth,feature:f.feature,geometry:f.geometry,index:a,segment:p};this.Gd.insert(yn(y.segment),y)}this.lp(r,s,f.depth,-1),this.dd&&(this.Kv.getSource().removeFeature(this.dd),this.dd=null),l.length=0}}return d},n.prototype.fp=function(t,n){this.Dd=!0,t.setCoordinates(n),this.Dd=!1},n.prototype.lp=function(t,n,i,r){this.Gd.forEachInExtent(t.getExtent(),(function(e){e.geometry===t&&(void 0===i||void 0===e.depth||x(e.depth,i))&&e.index>n&&(e.index+=r)}))},n}(Ma),RS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),FS="select",GS=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.selected=i,o.deselected=r,o.mapBrowserEvent=e,o}return RS(n,t),n}(c),DS={};var qS=function(t){function n(n){var i=t.call(this)||this;i.on,i.once,i.un;var r,e,o=n||{};if(i.dp=i.tp.bind(i),i.pp=i.up.bind(i),i.Zr=o.condition?o.condition:Ca,i.yp=o.addCondition?o.addCondition:Pa,i.mp=o.removeCondition?o.removeCondition:Pa,i.wp=o.toggleCondition?o.toggleCondition:Ia,i.gp=!!o.multi&&o.multi,i.bp=o.filter?o.filter:S,i.xp=o.hitTolerance?o.hitTolerance:0,i.H=void 0!==o.style?o.style:(g((r=Mv()).Polygon,r.LineString),g(r.GeometryCollection,r.LineString),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),i.Re=o.features||new ft,o.layers)if("function"==typeof o.layers)e=o.layers;else{var s=o.layers;e=function(t){return y(s,t)}}else e=S;return i.Mp=e,i._p={},i}return RS(n,t),n.prototype.Sp=function(t,n){this._p[o(t)]=n},n.prototype.getFeatures=function(){return this.Re},n.prototype.getHitTolerance=function(){return this.xp},n.prototype.getLayer=function(t){return this._p[o(t)]},n.prototype.setHitTolerance=function(t){this.xp=t},n.prototype.setMap=function(n){this.getMap()&&this.H&&this.Re.forEach(this.Op.bind(this)),t.prototype.setMap.call(this,n),n?(this.Re.addEventListener(ot,this.dp),this.Re.addEventListener(st,this.pp),this.H&&this.Re.forEach(this.jp.bind(this))):(this.Re.removeEventListener(ot,this.dp),this.Re.removeEventListener(st,this.pp))},n.prototype.tp=function(t){var n=t.element;if(this.H&&this.jp(n),!this.getLayer(n)){var i=this.getMap().getAllLayers().find((function(t){if(t instanceof lg&&t.getSource()&&t.getSource().hasFeature(n))return t}));i&&this.Sp(n,i)}},n.prototype.up=function(t){var n=t.element;this.H&&this.Op(n)},n.prototype.getStyle=function(){return this.H},n.prototype.jp=function(t){var n=o(t);n in DS||(DS[n]=t.getStyle()),t.setStyle(this.H)},n.prototype.Op=function(t){for(var i=this.getMap().getInteractions().getArray(),r=i.length-1;r>=0;--r){var e=i[r];if(e!==this&&e instanceof n&&e.getStyle()&&-1!==e.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(e.getStyle())}var s=o(t);t.setStyle(DS[s]),delete DS[s]},n.prototype.Ep=function(t){delete this._p[o(t)]},n.prototype.handleEvent=function(t){if(!this.Zr(t))return!0;var n=this.yp(t),i=this.mp(t),r=this.wp(t),e=!n&&!i&&!r,o=t.map,s=this.getFeatures(),u=[],a=[];if(e){P(this._p),o.forEachFeatureAtPixel(t.pixel,function(t,n){if(this.bp(t,n))return this.Sp(t,n),a.push(t),!this.gp}.bind(this),{layerFilter:this.Mp,hitTolerance:this.xp});for(var h=s.getLength()-1;h>=0;--h){var f=s.item(h),c=a.indexOf(f);c>-1?a.splice(c,1):(s.remove(f),u.push(f))}0!==a.length&&s.extend(a)}else{o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.bp(t,e))return!n&&!r||y(s.getArray(),t)?(i||r)&&y(s.getArray(),t)&&(u.push(t),this.Ep(t)):(this.Sp(t,e),a.push(t)),!this.gp}.bind(this),{layerFilter:this.Mp,hitTolerance:this.xp});for(var l=u.length-1;l>=0;--l)s.remove(u[l]);s.extend(a)}return(a.length>0||u.length>0)&&this.dispatchEvent(new GS(FS,a,u,t)),!0},n}(ma),US=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function BS(t){return t.feature?t.feature:t.element?t.element:void 0}var XS=[],VS=function(t){function n(n){var i=this,r=n||{},e=r;return e.handleDownEvent||(e.handleDownEvent=S),e.stopDown||(e.stopDown=O),(i=t.call(this,e)||this)._v=r.source?r.source:null,i.Tp=void 0===r.vertex||r.vertex,i.Ap=void 0===r.edge||r.edge,i.Re=r.features?r.features:null,i.Pp=[],i.Cp={},i.kp={},i.Ip={},i.fd=void 0!==r.pixelTolerance?r.pixelTolerance:10,i.Gd=new Pv,i.Np={Point:i.Lp.bind(i),LineString:i.zp.bind(i),LinearRing:i.zp.bind(i),Polygon:i.Rp.bind(i),MultiPoint:i.Fp.bind(i),MultiLineString:i.Gp.bind(i),MultiPolygon:i.Dp.bind(i),GeometryCollection:i.qp.bind(i),Circle:i.Up.bind(i)},i}return US(n,t),n.prototype.addFeature=function(t,n){var i=void 0===n||n,r=o(t),e=t.getGeometry();if(e){var s=this.Np[e.getType()];if(s){this.kp[r]=e.getExtent([1/0,1/0,-1/0,-1/0]);var u=[];if(s(u,e),1===u.length)this.Gd.insert(yn(u[0]),{feature:t,segment:u[0]});else if(u.length>1){var a=u.map((function(t){return yn(t)})),h=u.map((function(n){return{feature:t,segment:n}}));this.Gd.load(a,h)}}}i&&(this.Cp[r]=$(t,L,this.$a,this))},n.prototype.Bp=function(t){this.addFeature(t)},n.prototype.Xp=function(t){this.removeFeature(t)},n.prototype.Vp=function(){var t;return this.Re?t=this.Re:this._v&&(t=this._v.getFeatures()),t},n.prototype.handleEvent=function(n){var i=this.snapTo(n.pixel,n.coordinate,n.map);return i&&(n.coordinate=i.vertex.slice(0,2),n.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,n)},n.prototype.np=function(t){var n=BS(t);this.addFeature(n)},n.prototype.ip=function(t){var n=BS(t);this.removeFeature(n)},n.prototype.$a=function(t){var n=t.target;if(this.handlingDownUpSequence){var i=o(n);i in this.Ip||(this.Ip[i]=n)}else this.Wp(n)},n.prototype.handleUpEvent=function(t){var n=C(this.Ip);return n.length&&(n.forEach(this.Wp.bind(this)),this.Ip={}),!1},n.prototype.removeFeature=function(t,n){var i=void 0===n||n,r=o(t),e=this.kp[r];if(e){var s=this.Gd,u=[];s.forEachInExtent(e,(function(n){t===n.feature&&u.push(n)}));for(var a=u.length-1;a>=0;--a)s.remove(u[a])}i&&(H(this.Cp[r]),delete this.Cp[r])},n.prototype.setMap=function(n){var i=this.getMap(),r=this.Pp,e=this.Vp();i&&(r.forEach(H),r.length=0,e.forEach(this.Xp.bind(this))),t.prototype.setMap.call(this,n),n&&(this.Re?r.push($(this.Re,ot,this.np,this),$(this.Re,st,this.ip,this)):this._v&&r.push($(this._v,Qv,this.np,this),$(this._v,id,this.ip,this)),e.forEach(this.Bp.bind(this)))},n.prototype.snapTo=function(t,n,i){var r=yn([i.getCoordinateFromPixel([t[0]-this.fd,t[1]+this.fd]),i.getCoordinateFromPixel([t[0]+this.fd,t[1]-this.fd])]),e=this.Gd.getInExtent(r),o=e.length;if(0===o)return null;var s,u=i.getView().getProjection(),a=Ir(n,u),h=1/0,f=this.fd*this.fd,c=function(){if(s){var n=i.getPixelFromCoordinate(s);if(Qi(t,n)<=f)return{vertex:s,vertexPixel:[Math.round(n[0]),Math.round(n[1])]}}return null};if(this.Tp){for(var l=0;l<o;++l){"Circle"!==(v=e[l]).feature.getGeometry().getType()&&v.segment.forEach((function(t){var n=Ir(t,u),i=Qi(a,n);i<h&&(s=t,h=i)}))}if(x=c())return x}if(this.Ap){for(l=0;l<o;++l){var v,d=null;if("Circle"===(v=e[l]).feature.getGeometry().getType()){var p=v.feature.getGeometry(),y=Cr();y&&(p=p.clone().transform(y,u)),d=kr(Wi(a,p),u)}else{var m=v.segment,w=m[0],g=m[1];g&&(XS[0]=Ir(w,u),XS[1]=Ir(g,u),d=Yi(a,XS))}if(d){var b=Qi(a,d);b<h&&(s=d,h=b)}}var x;if(x=c())return x}return null},n.prototype.Wp=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},n.prototype.Up=function(t,n){var i=this.getMap().getView().getProjection(),r=n,e=Cr();e&&(r=r.clone().transform(e,i));var o=$e(r);e&&o.transform(i,e);for(var s=o.getCoordinates()[0],u=0,a=s.length-1;u<a;++u)t.push(s.slice(u,u+2))},n.prototype.qp=function(t,n){for(var i=n.getGeometriesArray(),r=0;r<i.length;++r){var e=this.Np[i[r].getType()];e&&e(t,i[r])}},n.prototype.zp=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length-1;r<e;++r)t.push(i.slice(r,r+2))},n.prototype.Gp=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,u=o.length-1;s<u;++s)t.push(o.slice(s,s+2))},n.prototype.Fp=function(t,n){n.getCoordinates().forEach((function(n){t.push([n])}))},n.prototype.Dp=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,u=o.length;s<u;++s)for(var a=o[s],h=0,f=a.length-1;h<f;++h)t.push(a.slice(h,h+2))},n.prototype.Lp=function(t,n){t.push([n.getCoordinates()])},n.prototype.Rp=function(t,n){for(var i=n.getCoordinates(),r=0,e=i.length;r<e;++r)for(var o=i[r],s=0,u=o.length-1;s<u;++s)t.push(o.slice(s,s+2))},n}(Ma),WS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),YS="translatestart",ZS="translating",$S="translateend",KS=function(t){function n(n,i,r,e,o){var s=t.call(this,n)||this;return s.features=i,s.coordinate=r,s.startCoordinate=e,s.mapBrowserEvent=o,s}return WS(n,t),n}(c),HS=function(t){function n(n){var i,r=this,e=n||{};if((r=t.call(this,e)||this).on,r.once,r.un,r.Yp=null,r.Zp=null,r.Re=void 0!==e.features?e.features:null,e.layers&&!r.Re)if("function"==typeof e.layers)i=e.layers;else{var o=e.layers;i=function(t){return y(o,t)}}else i=S;return r.Mp=i,r.bp=e.filter&&!r.Re?e.filter:S,r.xp=e.hitTolerance?e.hitTolerance:0,r.Zr=e.condition?e.condition:Ta,r.$p=null,r.addChangeListener(va,r.Kp),r}return WS(n,t),n.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.Zr(t))return!1;if(this.$p=this.Hp(t.pixel,t.map),!this.Yp&&this.$p){this.Zp=t.coordinate,this.Yp=t.coordinate,this.handleMoveEvent(t);var n=this.Re||new ft([this.$p]);return this.dispatchEvent(new KS(YS,n,t.coordinate,this.Zp,t)),!0}return!1},n.prototype.handleUpEvent=function(t){if(this.Yp){this.Yp=null,this.handleMoveEvent(t);var n=this.Re||new ft([this.$p]);return this.dispatchEvent(new KS($S,n,t.coordinate,this.Zp,t)),this.Zp=null,!0}return!1},n.prototype.handleDragEvent=function(t){if(this.Yp){var n=t.coordinate,i=n[0]-this.Yp[0],r=n[1]-this.Yp[1],e=this.Re||new ft([this.$p]);e.forEach((function(t){var n=t.getGeometry();n.translate(i,r),t.setGeometry(n)})),this.Yp=n,this.dispatchEvent(new KS(ZS,e,n,this.Zp,t))}},n.prototype.handleMoveEvent=function(t){var n=t.map.getViewport();this.Hp(t.pixel,t.map)?(n.classList.remove(this.Yp?"ol-grab":"ol-grabbing"),n.classList.add(this.Yp?"ol-grabbing":"ol-grab")):n.classList.remove("ol-grab","ol-grabbing")},n.prototype.Hp=function(t,n){return n.forEachFeatureAtPixel(t,function(t,n){if(this.bp(t,n)&&(!this.Re||y(this.Re.getArray(),t)))return t}.bind(this),{layerFilter:this.Mp,hitTolerance:this.xp})},n.prototype.getHitTolerance=function(){return this.xp},n.prototype.setHitTolerance=function(t){this.xp=t},n.prototype.setMap=function(n){var i=this.getMap();t.prototype.setMap.call(this,n),this.Jv(i)},n.prototype.Kp=function(){this.Jv(null)},n.prototype.Jv=function(t){var n=this.getMap(),i=this.getActive();n&&i||(n=n||t)&&n.getViewport().classList.remove("ol-grab","ol-grabbing")},n}(Ma);function JS(t,n,i,r,e,o){var s,u;void 0!==e?(s=e,u=void 0!==o?o:0):(s=[],u=0);for(var a=n;a<i;){var h=t[a++];s[u++]=t[a++],s[u++]=h;for(var f=2;f<r;++f)s[u++]=t[a++]}return s.length=u,s}var QS=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),tO={Point:function(t){var n;n=void 0!==t.m&&void 0!==t.z?new Se([t.x,t.y,t.z,t.m],Ct):void 0!==t.z?new Se([t.x,t.y,t.z],At):void 0!==t.m?new Se([t.x,t.y,t.m],Pt):new Se([t.x,t.y]);return n},LineString:function(t){var n=rO(t);return new ng(t.paths[0],n)},Polygon:function(t){var n=rO(t);return new We(t.rings,n)},MultiPoint:function(t){var n=rO(t);return new Kw(t.points,n)},MultiLineString:function(t){var n=rO(t);return new rg(t.paths,n)},MultiPolygon:function(t){var n=rO(t);return new sg(t.rings,n)}},nO={Point:function(t,n){var i,r=t.getCoordinates(),e=t.getLayout();e===At?i={x:r[0],y:r[1],z:r[2]}:e===Pt?i={x:r[0],y:r[1],m:r[2]}:e===Ct?i={x:r[0],y:r[1],z:r[2],m:r[3]}:e===Tt?i={x:r[0],y:r[1]}:St(!1,34);return i},LineString:function(t,n){var i=eO(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},Polygon:function(t,n){var i=eO(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},MultiPoint:function(t,n){var i=eO(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},MultiLineString:function(t,n){var i=eO(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},MultiPolygon:function(t,n){for(var i=eO(t),r=t.getCoordinates(!1),e=[],o=0;o<r.length;o++)for(var s=r[o].length-1;s>=0;s--)e.push(r[o][s]);return{hasZ:i.hasZ,hasM:i.hasM,rings:e}}};function iO(t,n){var i,r,e;if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)e="Point";else if(t.points)e="MultiPoint";else if(t.paths){e=1===t.paths.length?"LineString":"MultiLineString"}else if(t.rings){var o=t,s=rO(o),u=function(t,n){var i,r,e=[],o=[],s=[];for(i=0,r=t.length;i<r;++i){e.length=0,oe(e,0,t[i],n.length),Fe(e,0,e.length,n.length)?o.push([t[i]]):s.push(t[i])}for(;s.length;){var u=s.shift(),a=!1;for(i=o.length-1;i>=0;i--){var h=o[i][0];if(xn(new Me(h).getExtent(),new Me(u).getExtent())){o[i].push(u),a=!0;break}}a||o.push([u.reverse()])}return o}(o.rings,s);1===u.length?(e="Polygon",t=A({},t,((i={}).rings=u[0],i))):(e="MultiPolygon",t=A({},t,((r={}).rings=u,r)))}return Eg((0,tO[e])(t),!1,n)}function rO(t){var n=Tt;return!0===t.hasZ&&!0===t.hasM?n=Ct:!0===t.hasZ?n=At:!0===t.hasM&&(n=Pt),n}function eO(t){var n=t.getLayout();return{hasZ:n===At||n===Ct,hasM:n===Pt||n===Ct}}function oO(t,n){return(0,nO[t.getType()])(Eg(t,!0,n),n)}var sO=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this)||this).K=r.geometryName,i}return QS(n,t),n.prototype.readFeatureFromObject=function(t,n,i){var r=t,e=iO(r.geometry,n),o=new Et;if(this.K&&o.setGeometryName(this.K),o.setGeometry(e),r.attributes){o.setProperties(r.attributes,!0);var s=r.attributes[i];void 0!==s&&o.setId(s)}return o},n.prototype.readFeaturesFromObject=function(t,n){var i=n||{};if(t.features){for(var r=[],e=t.features,o=0,s=e.length;o<s;++o)r.push(this.readFeatureFromObject(e[o],i,t.objectIdFieldName));return r}return[this.readFeatureFromObject(t,i)]},n.prototype.readGeometryFromObject=function(t,n){return iO(t,n)},n.prototype.readProjectionFromObject=function(t){return t.spatialReference&&void 0!==t.spatialReference.wkid?yr("EPSG:"+t.spatialReference.wkid):null},n.prototype.writeGeometryObject=function(t,n){return oO(t,this.adaptOptions(n))},n.prototype.writeFeatureObject=function(t,n){n=this.adaptOptions(n);var i={};if(!t.hasProperties())return i.attributes={},i;var r=t.getProperties(),e=t.getGeometry();if(e){i.geometry=oO(e,n);var o=n&&(n.dataProjection||n.featureProjection);o&&(i.geometry.spatialReference={wkid:Number(yr(o).getCode().split(":").pop())}),delete r[t.getGeometryName()]}return k(r)?i.attributes={}:i.attributes=r,i},n.prototype.writeFeaturesObject=function(t,n){n=this.adaptOptions(n);for(var i=[],r=0,e=t.length;r<e;++r)i.push(this.writeFeatureObject(t[r],n));return{features:i}},n}(Bg),uO=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),aO=function(t){function n(){var n=t.call(this)||this;return n.Jp=lc(),n}return uO(n,t),n.prototype.getType=function(){return"xml"},n.prototype.readFeature=function(t,n){if(t){if("string"==typeof t){var i=$f(t);return this.readFeatureFromDocument(i,n)}return Yf(t)?this.readFeatureFromDocument(t,n):this.readFeatureFromNode(t,n)}return null},n.prototype.readFeatureFromDocument=function(t,n){var i=this.readFeaturesFromDocument(t,n);return i.length>0?i[0]:null},n.prototype.readFeatureFromNode=function(t,n){return null},n.prototype.readFeatures=function(t,n){if(t){if("string"==typeof t){var i=$f(t);return this.readFeaturesFromDocument(i,n)}return Yf(t)?this.readFeaturesFromDocument(t,n):this.readFeaturesFromNode(t,n)}return[]},n.prototype.readFeaturesFromDocument=function(t,n){for(var i=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&g(i,this.readFeaturesFromNode(r,n));return i},n.prototype.readFeaturesFromNode=function(t,n){return r()},n.prototype.readGeometry=function(t,n){if(t){if("string"==typeof t){var i=$f(t);return this.readGeometryFromDocument(i,n)}return Yf(t)?this.readGeometryFromDocument(t,n):this.readGeometryFromNode(t,n)}return null},n.prototype.readGeometryFromDocument=function(t,n){return null},n.prototype.readGeometryFromNode=function(t,n){return null},n.prototype.readProjection=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readProjectionFromDocument(n)}return Yf(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,n){var i=this.writeFeatureNode(t,n);return this.Jp.serializeToString(i)},n.prototype.writeFeatureNode=function(t,n){return null},n.prototype.writeFeatures=function(t,n){var i=this.writeFeaturesNode(t,n);return this.Jp.serializeToString(i)},n.prototype.writeFeaturesNode=function(t,n){return null},n.prototype.writeGeometry=function(t,n){var i=this.writeGeometryNode(t,n);return this.Jp.serializeToString(i)},n.prototype.writeGeometryNode=function(t,n){return null},n}(jg),hO=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),fO="http://www.opengis.net/gml",cO=/^[\s\xa0]*$/,lO=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.featureType=r.featureType,i.featureNS=r.featureNS,i.srsName=r.srsName,i.schemaLocation="",i.FEATURE_COLLECTION_PARSERS={},i.FEATURE_COLLECTION_PARSERS[i.namespace]={featureMember:Hf(i.readFeaturesInternal),featureMembers:Jf(i.readFeaturesInternal)},i.supportedMediaTypes=["application/gml+xml"],i}return hO(n,t),n.prototype.readFeaturesInternal=function(t,n){var i=t.localName,r=null;if("FeatureCollection"==i)r=ac([],this.FEATURE_COLLECTION_PARSERS,t,n,this);else if("featureMembers"==i||"featureMember"==i||"member"==i){var e=n[0],o=e.featureType,s=e.featureNS;if(!o&&t.childNodes){o=[],s={};for(var u=0,a=t.childNodes.length;u<a;++u){var h=t.childNodes[u];if(1===h.nodeType){var f=h.nodeName.split(":").pop();if(-1===o.indexOf(f)){var c="",l=0,v=h.namespaceURI;for(var d in s){if(s[d]===v){c=d;break}++l}c||(s[c="p"+l]=v),o.push(c+":"+f)}}}"featureMember"!=i&&(e.featureType=o,e.featureNS=s)}if("string"==typeof s){var p=s;(s={}).p0=p}var y={},m=Array.isArray(o)?o:[o];for(var w in s){var g={};for(u=0,a=m.length;u<a;++u){(-1===m[u].indexOf(":")?"p0":m[u].split(":")[0])===w&&(g[m[u].split(":").pop()]="featureMembers"==i?Hf(this.readFeatureElement,this):Jf(this.readFeatureElement,this))}y[s[w]]=g}r=ac("featureMember"==i||"member"==i?void 0:[],y,t,n)}return null===r&&(r=[]),r},n.prototype.readGeometryOrExtent=function(t,n){var i=n[0];return i.srsName=t.firstElementChild.getAttribute("srsName"),i.srsDimension=t.firstElementChild.getAttribute("srsDimension"),ac(null,this.GEOMETRY_PARSERS,t,n,this)},n.prototype.readExtentElement=function(t,n){var i=n[0],r=this.readGeometryOrExtent(t,n);return r?Tg(r,i):void 0},n.prototype.readGeometryElement=function(t,n){var i=n[0],r=this.readGeometryOrExtent(t,n);return r?Eg(r,!1,i):void 0},n.prototype.readFeatureElementInternal=function(t,n,i){for(var r,e={},o=t.firstElementChild;o;o=o.nextElementSibling){var s=void 0,u=o.localName;0===o.childNodes.length||1===o.childNodes.length&&(3===o.firstChild.nodeType||4===o.firstChild.nodeType)?(s=Vf(o,!1),cO.test(s)&&(s=void 0)):(i&&(s="boundedBy"===u?this.readExtentElement(o,n):this.readGeometryElement(o,n)),s?"boundedBy"!==u&&(r=u):s=this.readFeatureElementInternal(o,n,!1));var a=o.attributes.length;if(a>0){s={Qp:s};for(var h=0;h<a;h++){s[o.attributes[h].name]=o.attributes[h].value}}e[u]?(e[u]instanceof Array||(e[u]=[e[u]]),e[u].push(s)):e[u]=s}if(i){var f=new Et(e);r&&f.setGeometryName(r);var c=t.getAttribute("fid")||Zf(t,this.namespace,"id");return c&&f.setId(c),f}return e},n.prototype.readFeatureElement=function(t,n){return this.readFeatureElementInternal(t,n,!0)},n.prototype.readPoint=function(t,n){var i=this.readFlatCoordinatesFromNode(t,n);if(i)return new Se(i,At)},n.prototype.readMultiPoint=function(t,n){var i=ac([],this.MULTIPOINT_PARSERS,t,n,this);return i?new Kw(i):void 0},n.prototype.readMultiLineString=function(t,n){var i=ac([],this.MULTILINESTRING_PARSERS,t,n,this);if(i)return new rg(i)},n.prototype.readMultiPolygon=function(t,n){var i=ac([],this.MULTIPOLYGON_PARSERS,t,n,this);if(i)return new sg(i)},n.prototype.pointMemberParser=function(t,n){uc(this.POINTMEMBER_PARSERS,t,n,this)},n.prototype.lineStringMemberParser=function(t,n){uc(this.LINESTRINGMEMBER_PARSERS,t,n,this)},n.prototype.polygonMemberParser=function(t,n){uc(this.POLYGONMEMBER_PARSERS,t,n,this)},n.prototype.readLineString=function(t,n){var i=this.readFlatCoordinatesFromNode(t,n);return i?new ng(i,At):void 0},n.prototype.readFlatLinearRing=function(t,n){var i=ac(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,n,this);return i||void 0},n.prototype.readLinearRing=function(t,n){var i=this.readFlatCoordinatesFromNode(t,n);if(i)return new Me(i,At)},n.prototype.readPolygon=function(t,n){var i=ac([null],this.FLAT_LINEAR_RINGS_PARSERS,t,n,this);if(i&&i[0]){var r,e=i[0],o=[e.length],s=void 0;for(s=1,r=i.length;s<r;++s)g(e,i[s]),o.push(e.length);return new We(e,At,o)}},n.prototype.readFlatCoordinatesFromNode=function(t,n){return ac(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,n,this)},n.prototype.readGeometryFromNode=function(t,n){var i=this.readGeometryElement(t,[this.getReadOptions(t,n||{})]);return i||null},n.prototype.readFeaturesFromNode=function(t,n){var i={featureType:this.featureType,featureNS:this.featureNS};return n&&A(i,this.getReadOptions(t,n)),this.readFeaturesInternal(t,[i])||[]},n.prototype.readProjectionFromNode=function(t){return yr(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))},n}(aO);lO.prototype.namespace=fO,lO.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},lO.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},lO.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},lO.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:Hf(lO.prototype.pointMemberParser),pointMembers:Hf(lO.prototype.pointMemberParser)}},lO.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:Hf(lO.prototype.lineStringMemberParser),lineStringMembers:Hf(lO.prototype.lineStringMemberParser)}},lO.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:Hf(lO.prototype.polygonMemberParser),polygonMembers:Hf(lO.prototype.polygonMemberParser)}},lO.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:Hf(lO.prototype.readFlatCoordinatesFromNode)}},lO.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:Hf(lO.prototype.readLineString)}},lO.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:Hf(lO.prototype.readPolygon)}},lO.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:Jf(lO.prototype.readFlatLinearRing)}};var vO=lO;function dO(t){return pO(Vf(t,!1))}function pO(t){var n=/^\s*(true|1)|(false|0)\s*$/.exec(t);return n?void 0!==n[1]||!1:void 0}function yO(t){var n=Vf(t,!1),i=Date.parse(n);return isNaN(i)?void 0:i/1e3}function mO(t){return wO(Vf(t,!1))}function wO(t){var n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return n?parseFloat(n[1]):void 0}function gO(t){return bO(Vf(t,!1))}function bO(t){var n=/^\s*(\d+)\s*$/.exec(t);return n?parseInt(n[1],10):void 0}function xO(t){return Vf(t,!1).trim()}function MO(t,n){EO(t,n?"1":"0")}function _O(t,n){t.appendChild(dc().createCDATASection(n))}function SO(t,n){var i=new Date(1e3*n),r=i.getUTCFullYear()+"-"+Bi(i.getUTCMonth()+1,2)+"-"+Bi(i.getUTCDate(),2)+"T"+Bi(i.getUTCHours(),2)+":"+Bi(i.getUTCMinutes(),2)+":"+Bi(i.getUTCSeconds(),2)+"Z";t.appendChild(dc().createTextNode(r))}function OO(t,n){var i=n.toPrecision();t.appendChild(dc().createTextNode(i))}function jO(t,n){var i=n.toString();t.appendChild(dc().createTextNode(i))}function EO(t,n){t.appendChild(dc().createTextNode(n))}var TO=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),AO={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},PO=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).FEATURE_COLLECTION_PARSERS[fO].featureMember=Hf(i.readFeaturesInternal),i.schemaLocation=r.schemaLocation?r.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",i}return TO(n,t),n.prototype.readFlatCoordinates=function(t,n){var i=Vf(t,!1).replace(/^\s*|\s*$/g,""),r=n[0].srsName,e="enu";if(r){var o=yr(r);o&&(e=o.getAxisOrientation())}for(var s=i.trim().split(/\s+/),u=[],a=0,h=s.length;a<h;a++){var f=s[a].split(/,+/),c=parseFloat(f[0]),l=parseFloat(f[1]),v=3===f.length?parseFloat(f[2]):0;"en"===e.substr(0,2)?u.push(c,l,v):u.push(l,c,v)}return u},n.prototype.readBox=function(t,n){var i=ac([null],this.ty,t,n,this);return On(i[1][0],i[1][1],i[1][3],i[1][4])},n.prototype.innerBoundaryIsParser=function(t,n){var i=ac(void 0,this.RING_PARSERS,t,n,this);i&&n[n.length-1].push(i)},n.prototype.outerBoundaryIsParser=function(t,n){var i=ac(void 0,this.RING_PARSERS,t,n,this);i&&(n[n.length-1][0]=i)},n.prototype.ny=function(t,n,i){var r,e=n[n.length-1],o=e.multiSurface,s=e.surface,u=e.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"MultiLineString"===r&&!0===u&&(r="MultiCurve"),Xf("http://www.opengis.net/gml",r)},n.prototype.writeFeatureElement=function(t,n,i){var r=n.getId();r&&t.setAttribute("fid",r);var e=i[i.length-1],o=e.featureNS,s=n.getGeometryName();e.serializers||(e.serializers={},e.serializers[o]={});var u=[],a=[];if(n.hasProperties()){var h=n.getProperties();for(var f in h){var c=h[f];null!==c&&(u.push(f),a.push(c),f==s||"function"==typeof c.getSimplifiedGeometry?f in e.serializers[o]||(e.serializers[o][f]=nc(this.writeGeometryElement,this)):f in e.serializers[o]||(e.serializers[o][f]=nc(EO)))}}var l=A({},e);l.node=t,fc(l,e.serializers,rc(void 0,o),a,i,u)},n.prototype.writeCurveOrLineString=function(t,n,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var e=this.iy(t.namespaceURI);t.appendChild(e),this.ey(e,n,i)}else if("Curve"===t.nodeName){var o=Xf(t.namespaceURI,"segments");t.appendChild(o),this.oy(o,n,i)}},n.prototype.writeLineStringOrCurveMember=function(t,n,i){var r=this.ny(n,i);r&&(t.appendChild(r),this.writeCurveOrLineString(r,n,i))},n.prototype.writeMultiCurveOrLineString=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var u=n.getLineStrings();fc({node:t,hasZ:e,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.sy,u,i,void 0,this)},n.prototype.writeGeometryElement=function(t,n,i){var r,e=i[i.length-1],o=A({},e);o.node=t,r=Array.isArray(n)?Tg(n,e):Eg(n,!0,e),fc(o,this.GEOMETRY_SERIALIZERS,this.ny,[r],i,void 0,this)},n.prototype.iy=function(t){var n=Xf(t,"coordinates");return n.setAttribute("decimal","."),n.setAttribute("cs",","),n.setAttribute("ts"," "),n},n.prototype.ey=function(t,n,i){for(var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=n.getCoordinates(),u=s.length,a=new Array(u),h=0;h<u;++h){var f=s[h];a[h]=this.uy(f,o,e)}EO(t,a.join(" "))},n.prototype.oy=function(t,n,i){var r=Xf(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString(r,n,i)},n.prototype.writeSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=n.getLinearRings();fc({node:t,hasZ:e,srsName:o},this.RING_SERIALIZERS,this.hy,s,i,void 0,this)}else if("Surface"===t.nodeName){var u=Xf(t.namespaceURI,"patches");t.appendChild(u),this.ly(u,n,i)}},n.prototype.hy=function(t,n,i){var r=n[n.length-1],e=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),Xf(e.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},n.prototype.ly=function(t,n,i){var r=Xf(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)},n.prototype.writeRing=function(t,n,i){var r=Xf(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing(r,n,i)},n.prototype.uy=function(t,n,i){var r="enu";n&&(r=yr(n).getAxisOrientation());var e="en"===r.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];i&&(e+=","+(t[2]||0));return e},n.prototype.writePoint=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=this.iy(t.namespaceURI);t.appendChild(s);var u=n.getCoordinates();EO(s,this.uy(u,o,e))},n.prototype.writeMultiPoint=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;o&&t.setAttribute("srsName",o);var s=n.getPoints();fc({node:t,hasZ:e,srsName:o},this.POINTMEMBER_SERIALIZERS,rc("pointMember"),s,i,void 0,this)},n.prototype.writePointMember=function(t,n,i){var r=Xf(t.namespaceURI,"Point");t.appendChild(r),this.writePoint(r,n,i)},n.prototype.writeLinearRing=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=this.iy(t.namespaceURI);t.appendChild(e),this.ey(e,n,i)},n.prototype.writeMultiSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var u=n.getPolygons();fc({node:t,hasZ:e,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.sy,u,i,void 0,this)},n.prototype.writeSurfaceOrPolygonMember=function(t,n,i){var r=this.ny(n,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))},n.prototype.writeEnvelope=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=[n[0]+" "+n[1],n[2]+" "+n[3]];fc({node:t},this.ENVELOPE_SERIALIZERS,ec,e,i,["lowerCorner","upperCorner"],this)},n.prototype.sy=function(t,n,i){var r=n[n.length-1].node;return Xf("http://www.opengis.net/gml",AO[r.nodeName])},n}(vO);PO.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:Jf(PO.prototype.readFlatCoordinates)}},PO.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:PO.prototype.innerBoundaryIsParser,outerBoundaryIs:PO.prototype.outerBoundaryIsParser}},PO.prototype.ty={"http://www.opengis.net/gml":{coordinates:Hf(PO.prototype.readFlatCoordinates)}},PO.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:Jf(vO.prototype.readPoint),MultiPoint:Jf(vO.prototype.readMultiPoint),LineString:Jf(vO.prototype.readLineString),MultiLineString:Jf(vO.prototype.readMultiLineString),LinearRing:Jf(vO.prototype.readLinearRing),Polygon:Jf(vO.prototype.readPolygon),MultiPolygon:Jf(vO.prototype.readMultiPolygon),Box:Jf(PO.prototype.readBox)}},PO.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:nc(PO.prototype.writeCurveOrLineString),MultiCurve:nc(PO.prototype.writeMultiCurveOrLineString),Point:nc(PO.prototype.writePoint),MultiPoint:nc(PO.prototype.writeMultiPoint),LineString:nc(PO.prototype.writeCurveOrLineString),MultiLineString:nc(PO.prototype.writeMultiCurveOrLineString),LinearRing:nc(PO.prototype.writeLinearRing),Polygon:nc(PO.prototype.writeSurfaceOrPolygon),MultiPolygon:nc(PO.prototype.writeMultiSurfaceOrPolygon),Surface:nc(PO.prototype.writeSurfaceOrPolygon),MultiSurface:nc(PO.prototype.writeMultiSurfaceOrPolygon),Envelope:nc(PO.prototype.writeEnvelope)}},PO.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:nc(PO.prototype.writeLineStringOrCurveMember),curveMember:nc(PO.prototype.writeLineStringOrCurveMember)}},PO.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:nc(PO.prototype.writeRing),innerBoundaryIs:nc(PO.prototype.writeRing)}},PO.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:nc(PO.prototype.writePointMember)}},PO.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:nc(PO.prototype.writeSurfaceOrPolygonMember),polygonMember:nc(PO.prototype.writeSurfaceOrPolygonMember)}},PO.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:nc(EO),upperCorner:nc(EO)}};var CO=PO,kO=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),IO={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"},NO=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).vy=void 0!==r.surface&&r.surface,i.py=void 0!==r.curve&&r.curve,i.yy=void 0===r.multiCurve||r.multiCurve,i.my=void 0===r.multiSurface||r.multiSurface,i.schemaLocation=r.schemaLocation?r.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",i.hasZ=void 0!==r.hasZ&&r.hasZ,i}return kO(n,t),n.prototype.readMultiCurve=function(t,n){var i=ac([],this.MULTICURVE_PARSERS,t,n,this);return i?new rg(i):void 0},n.prototype.readFlatCurveRing=function(t,n){for(var i=ac([],this.MULTICURVE_PARSERS,t,n,this),r=[],e=0,o=i.length;e<o;++e)g(r,i[e].getFlatCoordinates());return r},n.prototype.readMultiSurface=function(t,n){var i=ac([],this.MULTISURFACE_PARSERS,t,n,this);if(i)return new sg(i)},n.prototype.curveMemberParser=function(t,n){uc(this.CURVEMEMBER_PARSERS,t,n,this)},n.prototype.surfaceMemberParser=function(t,n){uc(this.SURFACEMEMBER_PARSERS,t,n,this)},n.prototype.readPatch=function(t,n){return ac([null],this.PATCHES_PARSERS,t,n,this)},n.prototype.readSegment=function(t,n){return ac([],this.SEGMENTS_PARSERS,t,n,this)},n.prototype.readPolygonPatch=function(t,n){return ac([null],this.FLAT_LINEAR_RINGS_PARSERS,t,n,this)},n.prototype.readLineStringSegment=function(t,n){return ac([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,n,this)},n.prototype.interiorParser=function(t,n){var i=ac(void 0,this.RING_PARSERS,t,n,this);i&&n[n.length-1].push(i)},n.prototype.exteriorParser=function(t,n){var i=ac(void 0,this.RING_PARSERS,t,n,this);i&&(n[n.length-1][0]=i)},n.prototype.readSurface=function(t,n){var i=ac([null],this.SURFACE_PARSERS,t,n,this);if(i&&i[0]){var r,e=i[0],o=[e.length],s=void 0;for(s=1,r=i.length;s<r;++s)g(e,i[s]),o.push(e.length);return new We(e,At,o)}},n.prototype.readCurve=function(t,n){var i=ac([null],this.CURVE_PARSERS,t,n,this);return i?new ng(i,At):void 0},n.prototype.readEnvelope=function(t,n){var i=ac([null],this.ENVELOPE_PARSERS,t,n,this);return On(i[1][0],i[1][1],i[2][0],i[2][1])},n.prototype.readFlatPos=function(t,n){for(var i,r=Vf(t,!1),e=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,o=[];i=e.exec(r);)o.push(parseFloat(i[1])),r=r.substr(i[0].length);if(""===r){var s=n[0].srsName,u="enu";if(s)u=yr(s).getAxisOrientation();if("neu"===u){var a,h=void 0;for(h=0,a=o.length;h<a;h+=3){var f=o[h],c=o[h+1];o[h]=c,o[h+1]=f}}var l=o.length;if(2==l&&o.push(0),0!==l)return o}},n.prototype.readFlatPosList=function(t,n){var i=Vf(t,!1).replace(/^\s*|\s*$/g,""),r=n[0],e=r.srsName,o=r.srsDimension,s="enu";e&&(s=yr(e).getAxisOrientation());var u,a,h,f=i.split(/\s+/),c=2;t.getAttribute("srsDimension")?c=bO(t.getAttribute("srsDimension")):t.getAttribute("dimension")?c=bO(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?c=bO(t.parentNode.getAttribute("srsDimension")):o&&(c=bO(o));for(var l=[],v=0,d=f.length;v<d;v+=c)u=parseFloat(f[v]),a=parseFloat(f[v+1]),h=3===c?parseFloat(f[v+2]):0,"en"===s.substr(0,2)?l.push(u,a,h):l.push(a,u,h);return l},n.prototype.wy=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=e?"3":"2";t.setAttribute("srsDimension",o);var s=r.srsName,u="enu";s&&(u=yr(s).getAxisOrientation());var a,h=n.getCoordinates();(a="en"===u.substr(0,2)?h[0]+" "+h[1]:h[1]+" "+h[0],e)&&(a+=" "+(h[2]||0));EO(t,a)},n.prototype.uy=function(t,n,i){var r="enu";n&&(r=yr(n).getAxisOrientation());var e="en"===r.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];i&&(e+=" "+(t[2]||0));return e},n.prototype.gy=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=e?"3":"2";t.setAttribute("srsDimension",o);for(var s,u=r.srsName,a=n.getCoordinates(),h=a.length,f=new Array(h),c=0;c<h;++c)s=a[c],f[c]=this.uy(s,u,e);EO(t,f.join(" "))},n.prototype.writePoint=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=Xf(t.namespaceURI,"pos");t.appendChild(e),this.wy(e,n,i)},n.prototype.writeEnvelope=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=[n[0]+" "+n[1],n[2]+" "+n[3]];fc({node:t},this.ENVELOPE_SERIALIZERS,ec,e,i,["lowerCorner","upperCorner"],this)},n.prototype.writeLinearRing=function(t,n,i){var r=i[i.length-1].srsName;r&&t.setAttribute("srsName",r);var e=Xf(t.namespaceURI,"posList");t.appendChild(e),this.gy(e,n,i)},n.prototype.hy=function(t,n,i){var r=n[n.length-1],e=r.node,o=r.exteriorWritten;return void 0===o&&(r.exteriorWritten=!0),Xf(e.namespaceURI,void 0!==o?"interior":"exterior")},n.prototype.writeSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName;if("PolygonPatch"!==t.nodeName&&o&&t.setAttribute("srsName",o),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){var s=n.getLinearRings();fc({node:t,hasZ:e,srsName:o},this.RING_SERIALIZERS,this.hy,s,i,void 0,this)}else if("Surface"===t.nodeName){var u=Xf(t.namespaceURI,"patches");t.appendChild(u),this.ly(u,n,i)}},n.prototype.writeCurveOrLineString=function(t,n,i){var r=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&r&&t.setAttribute("srsName",r),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){var e=Xf(t.namespaceURI,"posList");t.appendChild(e),this.gy(e,n,i)}else if("Curve"===t.nodeName){var o=Xf(t.namespaceURI,"segments");t.appendChild(o),this.oy(o,n,i)}},n.prototype.writeMultiSurfaceOrPolygon=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.surface;o&&t.setAttribute("srsName",o);var u=n.getPolygons();fc({node:t,hasZ:e,srsName:o,surface:s},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.sy,u,i,void 0,this)},n.prototype.writeMultiPoint=function(t,n,i){var r=i[i.length-1],e=r.srsName,o=r.hasZ;e&&t.setAttribute("srsName",e);var s=n.getPoints();fc({node:t,hasZ:o,srsName:e},this.POINTMEMBER_SERIALIZERS,rc("pointMember"),s,i,void 0,this)},n.prototype.writeMultiCurveOrLineString=function(t,n,i){var r=i[i.length-1],e=r.hasZ,o=r.srsName,s=r.curve;o&&t.setAttribute("srsName",o);var u=n.getLineStrings();fc({node:t,hasZ:e,srsName:o,curve:s},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.sy,u,i,void 0,this)},n.prototype.writeRing=function(t,n,i){var r=Xf(t.namespaceURI,"LinearRing");t.appendChild(r),this.writeLinearRing(r,n,i)},n.prototype.writeSurfaceOrPolygonMember=function(t,n,i){var r=this.ny(n,i);r&&(t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i))},n.prototype.writePointMember=function(t,n,i){var r=Xf(t.namespaceURI,"Point");t.appendChild(r),this.writePoint(r,n,i)},n.prototype.writeLineStringOrCurveMember=function(t,n,i){var r=this.ny(n,i);r&&(t.appendChild(r),this.writeCurveOrLineString(r,n,i))},n.prototype.ly=function(t,n,i){var r=Xf(t.namespaceURI,"PolygonPatch");t.appendChild(r),this.writeSurfaceOrPolygon(r,n,i)},n.prototype.oy=function(t,n,i){var r=Xf(t.namespaceURI,"LineStringSegment");t.appendChild(r),this.writeCurveOrLineString(r,n,i)},n.prototype.writeGeometryElement=function(t,n,i){var r,e=i[i.length-1],o=A({},e);o.node=t,r=Array.isArray(n)?Tg(n,e):Eg(n,!0,e),fc(o,this.GEOMETRY_SERIALIZERS,this.ny,[r],i,void 0,this)},n.prototype.writeFeatureElement=function(t,n,i){var r=n.getId();r&&t.setAttribute("fid",r);var e=i[i.length-1],o=e.featureNS,s=n.getGeometryName();e.serializers||(e.serializers={},e.serializers[o]={});var u=[],a=[];if(n.hasProperties()){var h=n.getProperties();for(var f in h){var c=h[f];null!==c&&(u.push(f),a.push(c),f==s||"function"==typeof c.getSimplifiedGeometry?f in e.serializers[o]||(e.serializers[o][f]=nc(this.writeGeometryElement,this)):f in e.serializers[o]||(e.serializers[o][f]=nc(EO)))}}var l=A({},e);l.node=t,fc(l,e.serializers,rc(void 0,o),a,i,u)},n.prototype.xy=function(t,n,i){var r=i[i.length-1],e=r.featureType,o=r.featureNS,s={};s[o]={},s[o][e]=nc(this.writeFeatureElement,this);var u=A({},r);u.node=t,fc(u,s,rc(e,o),n,i)},n.prototype.sy=function(t,n,i){var r=n[n.length-1].node;return Xf(this.namespace,IO[r.nodeName])},n.prototype.ny=function(t,n,i){var r,e=n[n.length-1],o=e.multiSurface,s=e.surface,u=e.curve,a=e.multiCurve;return Array.isArray(t)?r="Envelope":"MultiPolygon"===(r=t.getType())&&!0===o?r="MultiSurface":"Polygon"===r&&!0===s?r="Surface":"LineString"===r&&!0===u?r="Curve":"MultiLineString"===r&&!0===a&&(r="MultiCurve"),Xf(this.namespace,r)},n.prototype.writeGeometryNode=function(t,n){n=this.adaptOptions(n);var i=Xf(this.namespace,"geom"),r={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.py,surface:this.vy,multiSurface:this.my,multiCurve:this.yy};return n&&A(r,n),this.writeGeometryElement(i,t,[r]),i},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=Xf(this.namespace,"featureMembers");i.setAttributeNS(Bf,"xsi:schemaLocation",this.schemaLocation);var r={srsName:this.srsName,hasZ:this.hasZ,curve:this.py,surface:this.vy,multiSurface:this.my,multiCurve:this.yy,featureNS:this.featureNS,featureType:this.featureType};return n&&A(r,n),this.xy(i,t,[r]),i},n}(vO);NO.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:Jf(NO.prototype.readFlatPos),posList:Jf(NO.prototype.readFlatPosList),coordinates:Jf(CO.prototype.readFlatCoordinates)}},NO.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:NO.prototype.interiorParser,exterior:NO.prototype.exteriorParser}},NO.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:Jf(vO.prototype.readPoint),MultiPoint:Jf(vO.prototype.readMultiPoint),LineString:Jf(vO.prototype.readLineString),MultiLineString:Jf(vO.prototype.readMultiLineString),LinearRing:Jf(vO.prototype.readLinearRing),Polygon:Jf(vO.prototype.readPolygon),MultiPolygon:Jf(vO.prototype.readMultiPolygon),Surface:Jf(NO.prototype.readSurface),MultiSurface:Jf(NO.prototype.readMultiSurface),Curve:Jf(NO.prototype.readCurve),MultiCurve:Jf(NO.prototype.readMultiCurve),Envelope:Jf(NO.prototype.readEnvelope)}},NO.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:Hf(NO.prototype.curveMemberParser),curveMembers:Hf(NO.prototype.curveMemberParser)}},NO.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:Hf(NO.prototype.surfaceMemberParser),surfaceMembers:Hf(NO.prototype.surfaceMemberParser)}},NO.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:Hf(vO.prototype.readLineString),Curve:Hf(NO.prototype.readCurve)}},NO.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:Hf(vO.prototype.readPolygon),Surface:Hf(NO.prototype.readSurface)}},NO.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:Jf(NO.prototype.readPatch)}},NO.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:Jf(NO.prototype.readSegment)}},NO.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:Hf(NO.prototype.readFlatPosList),upperCorner:Hf(NO.prototype.readFlatPosList)}},NO.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:Jf(NO.prototype.readPolygonPatch)}},NO.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:Kf(NO.prototype.readLineStringSegment)}},vO.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:Jf(vO.prototype.readFlatLinearRing),Ring:Jf(NO.prototype.readFlatCurveRing)}},NO.prototype.writeFeatures,NO.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:nc(NO.prototype.writeRing),interior:nc(NO.prototype.writeRing)}},NO.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:nc(EO),upperCorner:nc(EO)}},NO.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:nc(NO.prototype.writeSurfaceOrPolygonMember),polygonMember:nc(NO.prototype.writeSurfaceOrPolygonMember)}},NO.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:nc(NO.prototype.writePointMember)}},NO.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:nc(NO.prototype.writeLineStringOrCurveMember),curveMember:nc(NO.prototype.writeLineStringOrCurveMember)}},NO.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:nc(NO.prototype.writeCurveOrLineString),MultiCurve:nc(NO.prototype.writeMultiCurveOrLineString),Point:nc(NO.prototype.writePoint),MultiPoint:nc(NO.prototype.writeMultiPoint),LineString:nc(NO.prototype.writeCurveOrLineString),MultiLineString:nc(NO.prototype.writeMultiCurveOrLineString),LinearRing:nc(NO.prototype.writeLinearRing),Polygon:nc(NO.prototype.writeSurfaceOrPolygon),MultiPolygon:nc(NO.prototype.writeMultiSurfaceOrPolygon),Surface:nc(NO.prototype.writeSurfaceOrPolygon),MultiSurface:nc(NO.prototype.writeMultiSurfaceOrPolygon),Envelope:nc(NO.prototype.writeEnvelope)}};var LO=NO,zO=LO;zO.prototype.writeFeatures,zO.prototype.writeFeaturesNode;var RO=zO,FO=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),GO=function(t){function n(n){var i=this,r=n||{};return(i=t.call(this,r)||this).schemaLocation=r.schemaLocation?r.schemaLocation:i.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd",i}return FO(n,t),n}(LO);GO.prototype.namespace="http://www.opengis.net/gml/3.2",GO.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:Jf(LO.prototype.readFlatPos),posList:Jf(LO.prototype.readFlatPosList),coordinates:Jf(CO.prototype.readFlatCoordinates)}},GO.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:LO.prototype.interiorParser,exterior:LO.prototype.exteriorParser}},GO.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:Jf(vO.prototype.readPoint),MultiPoint:Jf(vO.prototype.readMultiPoint),LineString:Jf(vO.prototype.readLineString),MultiLineString:Jf(vO.prototype.readMultiLineString),LinearRing:Jf(vO.prototype.readLinearRing),Polygon:Jf(vO.prototype.readPolygon),MultiPolygon:Jf(vO.prototype.readMultiPolygon),Surface:Jf(GO.prototype.readSurface),MultiSurface:Jf(LO.prototype.readMultiSurface),Curve:Jf(GO.prototype.readCurve),MultiCurve:Jf(LO.prototype.readMultiCurve),Envelope:Jf(GO.prototype.readEnvelope)}},GO.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:Hf(LO.prototype.curveMemberParser),curveMembers:Hf(LO.prototype.curveMemberParser)}},GO.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:Hf(LO.prototype.surfaceMemberParser),surfaceMembers:Hf(LO.prototype.surfaceMemberParser)}},GO.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:Hf(vO.prototype.readLineString),Curve:Hf(LO.prototype.readCurve)}},GO.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:Hf(vO.prototype.readPolygon),Surface:Hf(LO.prototype.readSurface)}},GO.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:Jf(LO.prototype.readPatch)}},GO.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:Jf(LO.prototype.readSegment)}},GO.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:Hf(LO.prototype.readFlatPosList),upperCorner:Hf(LO.prototype.readFlatPosList)}},GO.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:Jf(LO.prototype.readPolygonPatch)}},GO.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:Kf(LO.prototype.readLineStringSegment)}},GO.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:Hf(vO.prototype.pointMemberParser),pointMembers:Hf(vO.prototype.pointMemberParser)}},GO.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:Hf(vO.prototype.lineStringMemberParser),lineStringMembers:Hf(vO.prototype.lineStringMemberParser)}},GO.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:Hf(vO.prototype.polygonMemberParser),polygonMembers:Hf(vO.prototype.polygonMemberParser)}},GO.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:Hf(vO.prototype.readFlatCoordinatesFromNode)}},GO.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:Hf(vO.prototype.readLineString)}},GO.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:Hf(vO.prototype.readPolygon)}},GO.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:Jf(vO.prototype.readFlatLinearRing),Ring:Jf(GO.prototype.readFlatCurveRing)}},GO.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:nc(LO.prototype.writeRing),interior:nc(LO.prototype.writeRing)}},GO.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:nc(EO),upperCorner:nc(EO)}},GO.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:nc(LO.prototype.writeSurfaceOrPolygonMember),polygonMember:nc(LO.prototype.writeSurfaceOrPolygonMember)}},GO.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:nc(LO.prototype.writePointMember)}},GO.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:nc(LO.prototype.writeLineStringOrCurveMember),curveMember:nc(LO.prototype.writeLineStringOrCurveMember)}},GO.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:nc(LO.prototype.writeCurveOrLineString),MultiCurve:nc(LO.prototype.writeMultiCurveOrLineString),Point:nc(GO.prototype.writePoint),MultiPoint:nc(LO.prototype.writeMultiPoint),LineString:nc(LO.prototype.writeCurveOrLineString),MultiLineString:nc(LO.prototype.writeMultiCurveOrLineString),LinearRing:nc(LO.prototype.writeLinearRing),Polygon:nc(LO.prototype.writeSurfaceOrPolygon),MultiPolygon:nc(LO.prototype.writeMultiSurfaceOrPolygon),Surface:nc(LO.prototype.writeSurfaceOrPolygon),MultiSurface:nc(LO.prototype.writeMultiSurfaceOrPolygon),Envelope:nc(LO.prototype.writeEnvelope)}};var DO=GO,qO=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),UO=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],BO={rte:mj,trk:wj,wpt:gj},XO=sc(UO,{rte:Hf(mj),trk:Hf(wj),wpt:Hf(gj)}),VO=sc(UO,{text:tc(xO,"linkText"),type:tc(xO,"linkType")}),WO=sc(UO,{rte:nc((function(t,n,i){var r=i[0],e=n.getProperties(),o={node:t};o.properties=e;var s=n.getGeometry();if("LineString"==s.getType()){var u=Eg(s,!0,r);o.geometryLayout=u.getLayout(),e.rtept=u.getCoordinates()}var a=i[i.length-1].node,h=ij[a.namespaceURI],f=oc(e,h);fc(o,rj,ec,f,i,h)})),trk:nc((function(t,n,i){var r=i[0],e=n.getProperties(),o={node:t};o.properties=e;var s=n.getGeometry();if("MultiLineString"==s.getType()){var u=Eg(s,!0,r);e.trkseg=u.getLineStrings()}var a=i[i.length-1].node,h=oj[a.namespaceURI],f=oc(e,h);fc(o,sj,ec,f,i,h)})),wpt:nc((function(t,n,i){var r=i[0],e=i[i.length-1];e.properties=n.getProperties();var o=n.getGeometry();if("Point"==o.getType()){var s=Eg(o,!0,r);e.geometryLayout=s.getLayout(),xj(t,s.getCoordinates(),i)}}))}),YO=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=yr("EPSG:4326"),i.My=r.readExtensions,i}return qO(n,t),n.prototype._y=function(t){t||(t=[]);for(var n=0,i=t.length;n<i;++n){var r=t[n];if(this.My){var e=r.get("extensionsNode_")||null;this.My(r,e)}r.set("extensionsNode_",void 0)}},n.prototype.readFeatureFromNode=function(t,n){if(!y(UO,t.namespaceURI))return null;var i=BO[t.localName];if(!i)return null;var r=i(t,[this.getReadOptions(t,n)]);return r?(this._y([r]),r):null},n.prototype.readFeaturesFromNode=function(t,n){if(!y(UO,t.namespaceURI))return[];if("gpx"==t.localName){var i=ac([],XO,t,[this.getReadOptions(t,n)]);return i?(this._y(i),i):[]}return[]},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=Xf("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",Bf),i.setAttributeNS(Bf,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),fc({node:i},WO,lj,t,[n]),i},n}(aO),ZO=sc(UO,{name:tc(xO),cmt:tc(xO),desc:tc(xO),src:tc(xO),link:pj,number:tc(gO),extensions:yj,type:tc(xO),rtept:function(t,n){var i=ac({},$O,t,n);if(i){var r=n[n.length-1],e=r.flatCoordinates,o=r.layoutOptions;vj(e,o,t,i)}}}),$O=sc(UO,{ele:tc(mO),time:tc(yO)}),KO=sc(UO,{name:tc(xO),cmt:tc(xO),desc:tc(xO),src:tc(xO),link:pj,number:tc(gO),type:tc(xO),extensions:yj,trkseg:function(t,n){var i=n[n.length-1];uc(HO,t,n);var r=i.flatCoordinates;i.ends.push(r.length)}}),HO=sc(UO,{trkpt:function(t,n){var i=ac({},JO,t,n);if(i){var r=n[n.length-1],e=r.flatCoordinates,o=r.layoutOptions;vj(e,o,t,i)}}}),JO=sc(UO,{ele:tc(mO),time:tc(yO)}),QO=sc(UO,{ele:tc(mO),time:tc(yO),magvar:tc(mO),geoidheight:tc(mO),name:tc(xO),cmt:tc(xO),desc:tc(xO),src:tc(xO),link:pj,sym:tc(xO),type:tc(xO),fix:tc(xO),sat:tc(gO),hdop:tc(mO),vdop:tc(mO),pdop:tc(mO),ageofdgpsdata:tc(mO),dgpsid:tc(gO),extensions:yj}),tj=["text","type"],nj=sc(UO,{text:nc(EO),type:nc(EO)}),ij=sc(UO,["name","cmt","desc","src","link","number","type","rtept"]),rj=sc(UO,{name:nc(EO),cmt:nc(EO),desc:nc(EO),src:nc(EO),link:nc(bj),number:nc(jO),type:nc(EO),rtept:ic(nc(xj))}),ej=sc(UO,["ele","time"]),oj=sc(UO,["name","cmt","desc","src","link","number","type","trkseg"]),sj=sc(UO,{name:nc(EO),cmt:nc(EO),desc:nc(EO),src:nc(EO),link:nc(bj),number:nc(jO),type:nc(EO),trkseg:ic(nc((function(t,n,i){var r={node:t};r.geometryLayout=n.getLayout(),r.properties={},fc(r,aj,uj,n.getCoordinates(),i)})))}),uj=rc("trkpt"),aj=sc(UO,{trkpt:nc(xj)}),hj=sc(UO,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),fj=sc(UO,{ele:nc(OO),time:nc(SO),magvar:nc(OO),geoidheight:nc(OO),name:nc(EO),cmt:nc(EO),desc:nc(EO),src:nc(EO),link:nc(bj),sym:nc(EO),type:nc(EO),fix:nc(EO),sat:nc(jO),hdop:nc(OO),vdop:nc(OO),pdop:nc(OO),ageofdgpsdata:nc(OO),dgpsid:nc(jO)}),cj={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function lj(t,n,i){var r=t.getGeometry();if(r){var e=cj[r.getType()];if(e)return Xf(n[n.length-1].node.namespaceURI,e)}}function vj(t,n,i,r){return t.push(parseFloat(i.getAttribute("lon")),parseFloat(i.getAttribute("lat"))),"ele"in r?(t.push(r.ele),delete r.ele,n.hasZ=!0):t.push(0),"time"in r?(t.push(r.time),delete r.time,n.hasM=!0):t.push(0),t}function dj(t,n,i){var r=Tt,e=2;if(t.hasZ&&t.hasM?(r=Ct,e=4):t.hasZ?(r=At,e=3):t.hasM&&(r=Pt,e=3),4!==e){for(var o=0,s=n.length/4;o<s;o++)n[o*e]=n[4*o],n[o*e+1]=n[4*o+1],t.hasZ&&(n[o*e+2]=n[4*o+2]),t.hasM&&(n[o*e+2]=n[4*o+3]);if(n.length=n.length/4*e,i)for(o=0,s=i.length;o<s;o++)i[o]=i[o]/4*e}return r}function pj(t,n){var i=n[n.length-1],r=t.getAttribute("href");null!==r&&(i.link=r),uc(VO,t,n)}function yj(t,n){n[n.length-1].Sy=t}function mj(t,n){var i=n[0],r=ac({flatCoordinates:[],layoutOptions:{}},ZO,t,n);if(r){var e=r.flatCoordinates;delete r.flatCoordinates;var o=r.layoutOptions;delete r.layoutOptions;var s=dj(o,e),u=new ng(e,s);Eg(u,!1,i);var a=new Et(u);return a.setProperties(r,!0),a}}function wj(t,n){var i=n[0],r=ac({flatCoordinates:[],ends:[],layoutOptions:{}},KO,t,n);if(r){var e=r.flatCoordinates;delete r.flatCoordinates;var o=r.ends;delete r.ends;var s=r.layoutOptions;delete r.layoutOptions;var u=dj(s,e,o),a=new rg(e,u,o);Eg(a,!1,i);var h=new Et(a);return h.setProperties(r,!0),h}}function gj(t,n){var i=n[0],r=ac({},QO,t,n);if(r){var e={},o=vj([],e,t,r),s=dj(e,o),u=new Se(o,s);Eg(u,!1,i);var a=new Et(u);return a.setProperties(r,!0),a}}function bj(t,n,i){t.setAttribute("href",n);var r=i[i.length-1].properties,e=[r.linkText,r.linkType];fc({node:t},nj,ec,e,i,tj)}function xj(t,n,i){var r=i[i.length-1],e=r.node.namespaceURI,o=r.properties;switch(t.setAttributeNS(null,"lat",String(n[1])),t.setAttributeNS(null,"lon",String(n[0])),r.geometryLayout){case Ct:0!==n[3]&&(o.time=n[3]);case At:0!==n[2]&&(o.ele=n[2]);break;case Pt:0!==n[2]&&(o.time=n[2])}var s="rtept"==t.nodeName?ej[e]:hj[e],u=oc(o,s);fc({node:t,properties:o},fj,ec,u,i,s)}var Mj=YO,_j=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function Sj(t){return"string"==typeof t?t:""}var Oj,jj,Ej,Tj,Aj,Pj,Cj=function(t){function n(){return t.call(this)||this}return _j(n,t),n.prototype.getType=function(){return"text"},n.prototype.readFeature=function(t,n){return this.readFeatureFromText(Sj(t),this.adaptOptions(n))},n.prototype.readFeatureFromText=function(t,n){return r()},n.prototype.readFeatures=function(t,n){return this.readFeaturesFromText(Sj(t),this.adaptOptions(n))},n.prototype.readFeaturesFromText=function(t,n){return r()},n.prototype.readGeometry=function(t,n){return this.readGeometryFromText(Sj(t),this.adaptOptions(n))},n.prototype.readGeometryFromText=function(t,n){return r()},n.prototype.readProjection=function(t){return this.readProjectionFromText(Sj(t))},n.prototype.readProjectionFromText=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,n){return this.writeFeatureText(t,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){return r()},n.prototype.writeFeatures=function(t,n){return this.writeFeaturesText(t,this.adaptOptions(n))},n.prototype.writeFeaturesText=function(t,n){return r()},n.prototype.writeGeometry=function(t,n){return this.writeGeometryText(t,this.adaptOptions(n))},n.prototype.writeGeometryText=function(t,n){return r()},n}(jg),kj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ij="barometric",Nj="gps",Lj="none",zj=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,Rj=/^H.([A-Z]{3}).*?:(.*)/,Fj=/^HFDTE(\d{2})(\d{2})(\d{2})/,Gj=/\r\n|\r|\n/,Dj=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=yr("EPSG:4326"),i.Oy=r.altitudeMode?r.altitudeMode:Lj,i}return kj(n,t),n.prototype.readFeatureFromText=function(t,n){var i,r,e=this.Oy,o=t.split(Gj),s={},u=[],a=2e3,h=0,f=1,c=-1;for(i=0,r=o.length;i<r;++i){var l=o[i],v=void 0;if("B"==l.charAt(0)){if(v=zj.exec(l)){var d=parseInt(v[1],10),p=parseInt(v[2],10),y=parseInt(v[3],10),m=parseInt(v[4],10)+parseInt(v[5],10)/6e4;"S"==v[6]&&(m=-m);var w=parseInt(v[7],10)+parseInt(v[8],10)/6e4;if("W"==v[9]&&(w=-w),u.push(w,m),e!=Lj){var g=void 0;g=e==Nj?parseInt(v[11],10):e==Ij?parseInt(v[12],10):0,u.push(g)}var b=Date.UTC(a,h,f,d,p,y);b<c&&(b=Date.UTC(a,h,f+1,d,p,y)),u.push(b/1e3),c=b}}else"H"==l.charAt(0)&&((v=Fj.exec(l))?(f=parseInt(v[1],10),h=parseInt(v[2],10)-1,a=2e3+parseInt(v[3],10)):(v=Rj.exec(l))&&(s[v[1]]=v[2].trim()))}if(0===u.length)return null;var x=new ng(u,e==Lj?Pt:Ct),M=new Et(Eg(x,!1,n));return M.setProperties(s,!0),M},n.prototype.readFeaturesFromText=function(t,n){var i=this.readFeatureFromText(t,n);return i?[i]:[]},n}(Cj),qj=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Uj=["http://www.google.com/kml/ext/2.2"],Bj=[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"],Xj={fraction:ev,pixels:ov,insetPixels:ov},Vj=sc(Bj,{ExtendedData:UE,Region:BE,MultiGeometry:tc(IE,"geometry"),LineString:tc(PE,"geometry"),LinearRing:tc(CE,"geometry"),Point:tc(NE,"geometry"),Polygon:tc(zE,"geometry"),Style:tc(FE),StyleMap:function(t,n){var i=yE.call(this,t,n);if(!i)return;var r=n[n.length-1];Array.isArray(i)?r.Style=i:"string"==typeof i?r.styleUrl=i:St(!1,38)},address:tc(xO),description:tc(xO),name:tc(xO),open:tc(dO),phoneNumber:tc(xO),styleUrl:tc(vE),visibility:tc(dO)},sc(Uj,{MultiTrack:tc((function(t,n){var i=ac([],_E,t,n);if(!i)return;return new rg(i)}),"geometry"),Track:tc(OE,"geometry")})),Wj=sc(Bj,{ExtendedData:UE,Region:BE,Link:function(t,n){uc(Yj,t,n)},address:tc(xO),description:tc(xO),name:tc(xO),open:tc(dO),phoneNumber:tc(xO),visibility:tc(dO)}),Yj=sc(Bj,{href:tc(lE)}),Zj=sc(Bj,{LatLonAltBox:function(t,n){var i=ac({},WE,t,n);if(!i)return;var r=n[n.length-1],e=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];r.extent=e,r.altitudeMode=i.altitudeMode,r.minAltitude=parseFloat(i.minAltitude),r.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,n){var i=ac({},YE,t,n);if(!i)return;var r=n[n.length-1];r.minLodPixels=parseFloat(i.minLodPixels),r.maxLodPixels=parseFloat(i.maxLodPixels),r.minFadeExtent=parseFloat(i.minFadeExtent),r.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),$j=sc(Bj,["Document","Placemark"]),Kj=sc(Bj,{Document:nc((function(t,n,i){fc({node:t},JE,QE,n,i,void 0,this)})),Placemark:nc(_T)}),Hj=null;var Jj,Qj=null;var tE,nE=null;var iE=null;var rE=null;var eE,oE=null;function sE(t){return 32/Math.min(t[0],t[1])}function uE(t){return t}var aE=function(t){function n(n){var i=t.call(this)||this,r=n||{};return oE||(Hj=new rv({color:Oj=[255,255,255,1]}),Pj="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Qj=new yv({anchor:jj=[20,2],anchorOrigin:sv,anchorXUnits:Ej=ov,anchorYUnits:Tj=ov,crossOrigin:"anonymous",rotation:0,scale:sE(Aj=[64,64]),size:Aj,src:Pj}),Jj="NO_IMAGE",nE=new mv({color:Oj,width:1}),tE=new mv({color:[51,51,51,1],width:2}),iE=new Ev({font:"bold 16px Helvetica",fill:Hj,stroke:tE,scale:.8}),rE=new Sv({fill:Hj,image:Qj,text:iE,stroke:nE,zIndex:0}),oE=[rE]),i.dataProjection=yr("EPSG:4326"),i.jy=r.defaultStyle?r.defaultStyle:oE,i.Ey=void 0===r.extractStyles||r.extractStyles,i.Ty=void 0===r.writeStyles||r.writeStyles,i.Ay={},i.Py=void 0===r.showPointNames||r.showPointNames,i.Bt=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",i.Cy=r.iconUrlFunction?r.iconUrlFunction:uE,i.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],i}return qj(n,t),n.prototype.ky=function(t,n){var i=ac([],sc(Bj,{Document:Kf(this.ky,this),Folder:Kf(this.ky,this),Placemark:Hf(this.Iy,this),Style:this.Ny.bind(this),StyleMap:this.Ly.bind(this)}),t,n,this);return i||void 0},n.prototype.Iy=function(t,n){var i=ac({geometry:null},Vj,t,n,this);if(i){var r=new Et,e=t.getAttribute("id");null!==e&&r.setId(e);var o=n[0],s=i.geometry;if(s&&Eg(s,!1,o),r.setGeometry(s),delete i.geometry,this.Ey){var u=function(t,n,i,r,e){return function(o,s){var u=e,a="",h=[];if(u){var f=o.getGeometry();if(f)if(f instanceof Dg)u=(h=f.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"Point"===n||"MultiPoint"===n}))).length>0;else{var c=f.getType();u="Point"===c||"MultiPoint"===c}}u&&(a=o.get("name"),(u=u&&!!a)&&a.search(/&[^&]+;/)>-1&&(eE||(eE=document.createElement("textarea")),eE.innerHTML=a,a=eE.value));var l=i;if(t?l=t:n&&(l=hE(n,i,r)),u){var v=function(t,n){var i=[0,0],r="start",e=t.getImage();if(e){var o=e.getSize();if(o&&2==o.length){var s=e.getScaleArray(),u=e.getAnchor();i[0]=s[0]*(o[0]-u[0]),i[1]=s[1]*(o[1]/2-u[1]),r="left"}}var a=t.getText();a?((a=a.clone()).setFont(a.getFont()||iE.getFont()),a.setScale(a.getScale()||iE.getScale()),a.setFill(a.getFill()||iE.getFill()),a.setStroke(a.getStroke()||tE)):a=iE.clone();return a.setText(n),a.setOffsetX(i[0]),a.setOffsetY(i[1]),a.setTextAlign(r),new Sv({image:e,text:a})}(l[0],a);return h.length>0?(v.setGeometry(new Dg(h)),[v,new Sv({geometry:l[0].getGeometry(),image:null,fill:l[0].getFill(),stroke:l[0].getStroke(),text:null})].concat(l.slice(1))):v}return l}}(i.Style,i.styleUrl,this.jy,this.Ay,this.Py);r.setStyle(u)}return delete i.Style,r.setProperties(i,!0),r}},n.prototype.Ny=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=FE.call(this,t,n);if(r){var e=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Ay[e]=r}}},n.prototype.Ly=function(t,n){var i=t.getAttribute("id");if(null!==i){var r=yE.call(this,t,n);if(r){var e,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)e=new URL("#"+i,o).href;else e="#"+i;this.Ay[e]=r}}},n.prototype.readFeatureFromNode=function(t,n){if(!y(Bj,t.namespaceURI))return null;var i=this.Iy(t,[this.getReadOptions(t,n)]);return i||null},n.prototype.readFeaturesFromNode=function(t,n){if(!y(Bj,t.namespaceURI))return[];var i,r=t.localName;if("Document"==r||"Folder"==r)return(i=this.ky(t,[this.getReadOptions(t,n)]))||[];if("Placemark"==r){var e=this.Iy(t,[this.getReadOptions(t,n)]);return e?[e]:[]}if("kml"==r){i=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,n);s&&g(i,s)}return i}return[]},n.prototype.readName=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readNameFromDocument(n)}return Yf(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},n.prototype.readNameFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE){var i=this.readNameFromNode(n);if(i)return i}},n.prototype.readNameFromNode=function(t){for(var n=t.firstElementChild;n;n=n.nextElementSibling)if(y(Bj,n.namespaceURI)&&"name"==n.localName)return xO(n);for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;if(y(Bj,n.namespaceURI)&&("Document"==i||"Folder"==i||"Placemark"==i||"kml"==i)){var r=this.readNameFromNode(n);if(r)return r}}},n.prototype.readNetworkLinks=function(t){var n=[];if("string"==typeof t){var i=$f(t);g(n,this.readNetworkLinksFromDocument(i))}else Yf(t)?g(n,this.readNetworkLinksFromDocument(t)):g(n,this.readNetworkLinksFromNode(t));return n},n.prototype.readNetworkLinksFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&g(n,this.readNetworkLinksFromNode(i));return n},n.prototype.readNetworkLinksFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(Bj,i.namespaceURI)&&"NetworkLink"==i.localName){var r=ac({},Wj,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(Bj,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||g(n,this.readNetworkLinksFromNode(i))}return n},n.prototype.readRegion=function(t){var n=[];if("string"==typeof t){var i=$f(t);g(n,this.readRegionFromDocument(i))}else Yf(t)?g(n,this.readRegionFromDocument(t)):g(n,this.readRegionFromNode(t));return n},n.prototype.readRegionFromDocument=function(t){for(var n=[],i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&g(n,this.readRegionFromNode(i));return n},n.prototype.readRegionFromNode=function(t){for(var n=[],i=t.firstElementChild;i;i=i.nextElementSibling)if(y(Bj,i.namespaceURI)&&"Region"==i.localName){var r=ac({},Zj,i,[]);n.push(r)}for(i=t.firstElementChild;i;i=i.nextElementSibling){var e=i.localName;!y(Bj,i.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||g(n,this.readRegionFromNode(i))}return n},n.prototype.writeFeaturesNode=function(t,n){n=this.adaptOptions(n);var i=Xf(Bj[4],"kml"),r="http://www.w3.org/2000/xmlns/";i.setAttributeNS(r,"xmlns:gx",Uj[0]),i.setAttributeNS(r,"xmlns:xsi",Bf),i.setAttributeNS(Bf,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var e={node:i},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=$j[i.namespaceURI],u=oc(o,s);return fc(e,Kj,ec,u,[n],s,this),i},n}(aO);function hE(t,n,i){return Array.isArray(t)?t:"string"==typeof t?hE(i[t],n,i):n}function fE(t){var n=Vf(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(n);if(i){var r=i[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function cE(t){var n=Vf(t,!1),i=[];n=n.replace(/\s*,\s*/g,",");for(var r,e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=e.exec(n);){var o=parseFloat(r[1]),s=parseFloat(r[2]),u=r[3]?parseFloat(r[3]):0;i.push(o,s,u),n=n.substr(r[0].length)}if(""===n)return i}function lE(t){var n=Vf(t,!1).trim(),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function vE(t){var n=Vf(t,!1).trim().replace(/^(?!.*#)/,"#"),i=t.baseURI;return i&&"about:blank"!=i||(i=window.location.href),i?new URL(n,i).href:n}function dE(t){return mO(t)}var pE=sc(Bj,{Pair:function(t,n){var i=ac({},XE,t,n,this);if(!i)return;var r=i.key;if(r&&"normal"==r){var e=i.styleUrl;e&&(n[n.length-1]=e);var o=i.Style;o&&(n[n.length-1]=o)}}});function yE(t,n){return ac(void 0,pE,t,n,this)}var mE=sc(Bj,{Icon:tc((function(t,n){var i=ac({},jE,t,n);return i||null})),color:tc(fE),heading:tc(mO),hotSpot:tc((function(t){var n,i=t.getAttribute("xunits"),r=t.getAttribute("yunits");return n="insetPixels"!==i?"insetPixels"!==r?sv:av:"insetPixels"!==r?uv:hv,{x:parseFloat(t.getAttribute("x")),xunits:Xj[i],y:parseFloat(t.getAttribute("y")),yunits:Xj[r],origin:n}})),scale:tc(dE)});var wE=sc(Bj,{color:tc(fE),scale:tc(dE)});var gE=sc(Bj,{color:tc(fE),width:tc(mO)});var bE=sc(Bj,{color:tc(fE),fill:tc(dO),outline:tc(dO)});var xE=sc(Bj,{coordinates:Jf(cE)});function ME(t,n){return ac(null,xE,t,n)}var _E=sc(Uj,{Track:Hf(OE)});var SE=sc(Bj,{when:function(t,n){var i=n[n.length-1].whens,r=Vf(t,!1),e=Date.parse(r);i.push(isNaN(e)?0:e)}},sc(Uj,{coord:function(t,n){var i=n[n.length-1].coordinates,r=Vf(t,!1),e=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(e){var o=parseFloat(e[1]),s=parseFloat(e[2]),u=parseFloat(e[3]);i.push([o,s,u])}else i.push([])}}));function OE(t,n){var i=ac({coordinates:[],whens:[]},SE,t,n);if(i){for(var r=[],e=i.coordinates,o=i.whens,s=0,u=Math.min(e.length,o.length);s<u;++s)3==e[s].length&&r.push(e[s][0],e[s][1],e[s][2],o[s]);return new ng(r,Ct)}}var jE=sc(Bj,{href:tc(lE)},sc(Uj,{x:tc(mO),y:tc(mO),w:tc(mO),h:tc(mO)}));var EE=sc(Bj,{coordinates:Jf(cE)});function TE(t,n){return ac(null,EE,t,n)}var AE=sc(Bj,{extrude:tc(dO),tessellate:tc(dO),altitudeMode:tc(xO)});function PE(t,n){var i=ac({},AE,t,n),r=TE(t,n);if(r){var e=new ng(r,At);return e.setProperties(i,!0),e}}function CE(t,n){var i=ac({},AE,t,n),r=TE(t,n);if(r){var e=new We(r,At,[r.length]);return e.setProperties(i,!0),e}}var kE=sc(Bj,{LineString:Hf(PE),LinearRing:Hf(CE),MultiGeometry:Hf(IE),Point:Hf(NE),Polygon:Hf(zE)});function IE(t,n){var i,r=ac([],kE,t,n);if(!r)return null;if(0===r.length)return new Dg(r);for(var e=!0,o=r[0].getType(),s=1,u=r.length;s<u;++s)if(r[s].getType()!=o){e=!1;break}if(e){var a=void 0,h=void 0;if("Point"==o){var f=r[0];a=f.getLayout(),h=f.getFlatCoordinates();for(s=1,u=r.length;s<u;++s)g(h,r[s].getFlatCoordinates());GE(i=new Kw(h,a),r)}else"LineString"==o?GE(i=new rg(r),r):"Polygon"==o?GE(i=new sg(r),r):"GeometryCollection"==o?i=new Dg(r):St(!1,37)}else i=new Dg(r);return i}function NE(t,n){var i=ac({},AE,t,n),r=TE(t,n);if(r){var e=new Se(r,At);return e.setProperties(i,!0),e}}var LE=sc(Bj,{innerBoundaryIs:function(t,n){var i=ac([],ZE,t,n);if(i.length>0){var r=n[n.length-1];r.push.apply(r,i)}},outerBoundaryIs:function(t,n){var i=ac(void 0,$E,t,n);if(i){n[n.length-1][0]=i}}});function zE(t,n){var i=ac({},AE,t,n),r=ac([null],LE,t,n);if(r&&r[0]){for(var e=r[0],o=[e.length],s=1,u=r.length;s<u;++s)g(e,r[s]),o.push(e.length);var a=new We(e,At,o);return a.setProperties(i,!0),a}}var RE=sc(Bj,{IconStyle:function(t,n){var i=ac({},mE,t,n);if(i){var r,e,o,s,u=n[n.length-1],a="Icon"in i?i.Icon:{},h=!("Icon"in i)||Object.keys(a).length>0,f=a.href;f?r=f:h&&(r=Pj);var c,l=sv,v=i.hotSpot;v?(e=[v.x,v.y],o=v.xunits,s=v.yunits,l=v.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(/pushpin/.test(r)?(e=jj,o=Ej,s=Tj):/arrow-reverse/.test(r)?(e=[54,42],o=Ej,s=Tj):/paddle/.test(r)&&(e=[32,1],o=Ej,s=Tj));var d,p=a.x,y=a.y;void 0!==p&&void 0!==y&&(c=[p,y]);var m,w=a.w,g=a.h;void 0!==w&&void 0!==g&&(d=[w,g]);var b=i.heading;void 0!==b&&(m=li(b));var x=i.scale,M=i.color;if(h){r==Pj&&(d=Aj);var _=new yv({anchor:e,anchorOrigin:l,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.Bt,offset:c,offsetOrigin:sv,rotation:m,scale:x,size:d,src:this.Cy(r),color:M}),S=_.getScaleArray()[0],O=_.getSize();if(null===O){var j=_.getImageState();if(j===lo||j===vo){var E=function(){var t=_.getImageState();if(t!==lo&&t!==vo){var n=_.getSize();if(n&&2==n.length){var i=sE(n);_.setScale(S*i)}_.unlistenImageChange(E)}};_.listenImageChange(E),j===lo&&_.load()}}else if(2==O.length){var T=sE(O);_.setScale(S*T)}u.imageStyle=_}else u.imageStyle=Jj}},LabelStyle:function(t,n){var i=ac({},wE,t,n);if(i){var r=n[n.length-1],e=new Ev({fill:new rv({color:"color"in i?i.color:Oj}),scale:i.scale});r.textStyle=e}},LineStyle:function(t,n){var i=ac({},gE,t,n);if(i){var r=n[n.length-1],e=new mv({color:"color"in i?i.color:Oj,width:"width"in i?i.width:1});r.strokeStyle=e}},PolyStyle:function(t,n){var i=ac({},bE,t,n);if(i){var r=n[n.length-1],e=new rv({color:"color"in i?i.color:Oj});r.fillStyle=e;var o=i.fill;void 0!==o&&(r.fill=o);var s=i.outline;void 0!==s&&(r.outline=s)}}});function FE(t,n){var i=ac({},RE,t,n,this);if(!i)return null;var r,e="fillStyle"in i?i.fillStyle:Hj,o=i.fill;void 0===o||o||(e=null),"imageStyle"in i?i.imageStyle!=Jj&&(r=i.imageStyle):r=Qj;var s="textStyle"in i?i.textStyle:iE,u="strokeStyle"in i?i.strokeStyle:nE,a=i.outline;return void 0===a||a?[new Sv({fill:e,image:r,stroke:u,text:s,zIndex:void 0})]:[new Sv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return"GeometryCollection"===i?new Dg(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"Polygon"!==n&&"MultiPolygon"!==n}))):"Polygon"!==i&&"MultiPolygon"!==i?n:void 0},fill:e,image:r,stroke:u,text:s,zIndex:void 0}),new Sv({geometry:function(t){var n=t.getGeometry(),i=n.getType();return"GeometryCollection"===i?new Dg(n.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"Polygon"===n||"MultiPolygon"===n}))):"Polygon"===i||"MultiPolygon"===i?n:void 0},fill:e,stroke:null,zIndex:void 0})]}function GE(t,n){var i,r,e,o=n.length,s=new Array(n.length),u=new Array(n.length),a=new Array(n.length);i=!1,r=!1,e=!1;for(var h=0;h<o;++h){var f=n[h];s[h]=f.get("extrude"),u[h]=f.get("tessellate"),a[h]=f.get("altitudeMode"),i=i||void 0!==s[h],r=r||void 0!==u[h],e=e||a[h]}i&&t.set("extrude",s),r&&t.set("tessellate",u),e&&t.set("altitudeMode",a)}var DE=sc(Bj,{displayName:tc(xO),value:tc(xO)});var qE=sc(Bj,{Data:function(t,n){var i=t.getAttribute("name");uc(DE,t,n);var r=n[n.length-1];i&&r.displayName?r[i]={value:r.value,displayName:r.displayName,toString:function(){return r.value}}:null!==i?r[i]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,n){uc(VE,t,n)}});function UE(t,n){uc(qE,t,n)}function BE(t,n){uc(Zj,t,n)}var XE=sc(Bj,{Style:tc(FE),key:tc(xO),styleUrl:tc(vE)});var VE=sc(Bj,{SimpleData:function(t,n){var i=t.getAttribute("name");if(null!==i){var r=xO(t);n[n.length-1][i]=r}}});var WE=sc(Bj,{altitudeMode:tc(xO),minAltitude:tc(mO),maxAltitude:tc(mO),north:tc(mO),south:tc(mO),east:tc(mO),west:tc(mO)});var YE=sc(Bj,{minLodPixels:tc(mO),maxLodPixels:tc(mO),minFadeExtent:tc(mO),maxFadeExtent:tc(mO)});var ZE=sc(Bj,{LinearRing:Hf(ME)});var $E=sc(Bj,{LinearRing:Jf(ME)});function KE(t,n){for(var i=Go(n),r=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]],e=0;e<4;++e){var o=Math.floor(r[e]).toString(16);r[e]=1==o.length?"0"+o:o}EO(t,r.join(""))}var HE=sc(Bj,{Data:nc((function(t,n,i){t.setAttribute("name",n.name);var r={node:t},e=n.value;"object"==typeof e?(null!==e&&e.displayName&&fc(r,HE,ec,[e.displayName],i,["displayName"]),null!==e&&e.value&&fc(r,HE,ec,[e.value],i,["value"])):fc(r,HE,ec,[e],i,["value"])})),value:nc((function(t,n){EO(t,n)})),displayName:nc((function(t,n){_O(t,n)}))});var JE=sc(Bj,{Placemark:nc(_T)}),QE=function(t,n,i){return Xf(n[n.length-1].node.namespaceURI,"Placemark")};var tT=rc("Data");var nT=sc(Bj,["href"],sc(Uj,["x","y","w","h"])),iT=sc(Bj,{href:nc(EO)},sc(Uj,{x:nc(OO),y:nc(OO),w:nc(OO),h:nc(OO)})),rT=function(t,n,i){return Xf(Uj[0],"gx:"+i)};var eT=sc(Bj,["scale","heading","Icon","color","hotSpot"]),oT=sc(Bj,{Icon:nc((function(t,n,i){var r={node:t},e=i[i.length-1].node,o=nT[e.namespaceURI],s=oc(n,o);fc(r,iT,ec,s,i,o),s=oc(n,o=nT[Uj[0]]),fc(r,iT,rT,s,i,o)})),color:nc(KE),heading:nc(OO),hotSpot:nc((function(t,n){t.setAttribute("x",String(n.x)),t.setAttribute("y",String(n.y)),t.setAttribute("xunits",n.xunits),t.setAttribute("yunits",n.yunits)})),scale:nc(IT)});var sT=sc(Bj,["color","scale"]),uT=sc(Bj,{color:nc(KE),scale:nc(IT)});var aT=sc(Bj,["color","width"]),hT=sc(Bj,{color:nc(KE),width:nc(OO)});var fT={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},cT=function(t,n,i){if(t)return Xf(n[n.length-1].node.namespaceURI,fT[t.getType()])},lT=rc("Point"),vT=rc("LineString"),dT=rc("LinearRing"),pT=rc("Polygon"),yT=sc(Bj,{LineString:nc(jT),Point:nc(jT),Polygon:nc(CT),GeometryCollection:nc(mT)});function mT(t,n,i){var r,e={node:t},o=n.getType(),s=[];"GeometryCollection"===o?(n.getGeometriesArrayRecursive().forEach((function(t){var n=t.getType();"MultiPoint"===n?s=s.concat(t.getPoints()):"MultiLineString"===n?s=s.concat(t.getLineStrings()):"MultiPolygon"===n?s=s.concat(t.getPolygons()):"Point"===n||"LineString"===n||"Polygon"===n?s.push(t):St(!1,39)})),r=cT):"MultiPoint"===o?(s=n.getPoints(),r=lT):"MultiLineString"===o?(s=n.getLineStrings(),r=vT):"MultiPolygon"===o?(s=n.getPolygons(),r=pT):St(!1,39),fc(e,yT,r,s,i)}var wT=sc(Bj,{LinearRing:nc(jT)});function gT(t,n,i){fc({node:t},wT,dT,[n],i)}var bT=sc(Bj,{ExtendedData:nc((function(t,n,i){for(var r={node:t},e=n.names,o=n.values,s=e.length,u=0;u<s;u++)fc(r,HE,tT,[{name:e[u],value:o[u]}],i)})),MultiGeometry:nc(mT),LineString:nc(jT),LinearRing:nc(jT),Point:nc(jT),Polygon:nc(CT),Style:nc((function(t,n,i){var r={node:t},e={};if(n.pointStyles.length){var o=n.pointStyles[0].getText();o&&(e.LabelStyle=o);var s=n.pointStyles[0].getImage();s&&"function"==typeof s.getSrc&&(e.IconStyle=s)}if(n.lineStyles.length){(u=n.lineStyles[0].getStroke())&&(e.LineStyle=u)}if(n.polyStyles.length){var u;(u=n.polyStyles[0].getStroke())&&!e.LineStyle&&(e.LineStyle=u),e.PolyStyle=n.polyStyles[0]}var a=i[i.length-1].node,h=NT[a.namespaceURI],f=oc(e,h);fc(r,LT,ec,f,i,h)})),address:nc(EO),description:nc(EO),name:nc(EO),open:nc(MO),phoneNumber:nc(EO),styleUrl:nc(EO),visibility:nc(MO)}),xT=sc(Bj,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),MT=rc("ExtendedData");function _T(t,n,i){var r={node:t};n.getId()&&t.setAttribute("id",n.getId());var e=n.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[n.getGeometryName()]=1;var s=Object.keys(e||{}).sort().filter((function(t){return!o[t]})),u=n.getStyleFunction();if(u){var a=u(n,0);if(a){var h=Array.isArray(a)?a:[a],f=h;if(n.getGeometry()&&(f=h.filter((function(t){var i=t.getGeometryFunction()(n);if(i){var r=i.getType();return"GeometryCollection"===r?i.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"Point"===n||"MultiPoint"===n})).length:"Point"===r||"MultiPoint"===r}}))),this.Ty){var c=h,l=h;n.getGeometry()&&(c=h.filter((function(t){var i=t.getGeometryFunction()(n);if(i){var r=i.getType();return"GeometryCollection"===r?i.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"LineString"===n||"MultiLineString"===n})).length:"LineString"===r||"MultiLineString"===r}})),l=h.filter((function(t){var i=t.getGeometryFunction()(n);if(i){var r=i.getType();return"GeometryCollection"===r?i.getGeometriesArrayRecursive().filter((function(t){var n=t.getType();return"Polygon"===n||"MultiPolygon"===n})).length:"Polygon"===r||"MultiPolygon"===r}}))),e.Style={pointStyles:f,lineStyles:c,polyStyles:l}}if(f.length&&void 0===e.name){var v=f[0].getText();v&&(e.name=v.getText())}}}var d=i[i.length-1].node,p=xT[d.namespaceURI],y=oc(e,p);if(fc(r,bT,ec,y,i,p),s.length>0){var m=oc(e,s);fc(r,bT,MT,[{names:s,values:m}],i)}var w=i[0],g=n.getGeometry();g&&(g=Eg(g,!0,w)),fc(r,bT,cT,[g],i)}var ST=sc(Bj,["extrude","tessellate","altitudeMode","coordinates"]),OT=sc(Bj,{extrude:nc(MO),tessellate:nc(MO),altitudeMode:nc(EO),coordinates:nc((function(t,n,i){var r,e=i[i.length-1],o=e.layout,s=e.stride;o==Tt||o==Pt?r=2:o==At||o==Ct?r=3:St(!1,34);var u=n.length,a="";if(u>0){a+=n[0];for(var h=1;h<r;++h)a+=","+n[h];for(var f=s;f<u;f+=s){a+=" "+n[f];for(h=1;h<r;++h)a+=","+n[f+h]}}EO(t,a)}))});function jT(t,n,i){var r=n.getFlatCoordinates(),e={node:t};e.layout=n.getLayout(),e.stride=n.getStride();var o=n.getProperties();o.coordinates=r;var s=i[i.length-1].node,u=ST[s.namespaceURI],a=oc(o,u);fc(e,OT,ec,a,i,u)}var ET=sc(Bj,["color","fill","outline"]),TT=sc(Bj,{outerBoundaryIs:nc(gT),innerBoundaryIs:nc(gT)}),AT=rc("innerBoundaryIs"),PT=rc("outerBoundaryIs");function CT(t,n,i){var r=n.getLinearRings(),e=r.shift(),o={node:t};fc(o,TT,AT,r,i),fc(o,TT,PT,[e],i)}var kT=sc(Bj,{color:nc(KE),fill:nc(MO),outline:nc(MO)});function IT(t,n){OO(t,Math.round(1e6*n)/1e6)}var NT=sc(Bj,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),LT=sc(Bj,{IconStyle:nc((function(t,n,i){var r={node:t},e={},o=n.getSrc(),s=n.getSize(),u=n.getImageSize(),a={href:o};if(s){a.w=s[0],a.h=s[1];var h=n.getAnchor(),f=n.getOrigin();if(f&&u&&0!==f[0]&&f[1]!==s[1]&&(a.x=f[0],a.y=u[1]-(f[1]+s[1])),h&&(h[0]!==s[0]/2||h[1]!==s[1]/2)){var c={x:h[0],xunits:ov,y:s[1]-h[1],yunits:ov};e.hotSpot=c}}e.Icon=a;var l=n.getScaleArray()[0],v=s;null===v&&(v=Aj),2==v.length&&(l/=sE(v)),1!==l&&(e.scale=l);var d=n.getRotation();0!==d&&(e.heading=d);var p=n.getColor();p&&(e.color=p);var y=i[i.length-1].node,m=eT[y.namespaceURI],w=oc(e,m);fc(r,oT,ec,w,i,m)})),LabelStyle:nc((function(t,n,i){var r={node:t},e={},o=n.getFill();o&&(e.color=o.getColor());var s=n.getScale();s&&1!==s&&(e.scale=s);var u=i[i.length-1].node,a=sT[u.namespaceURI],h=oc(e,a);fc(r,uT,ec,h,i,a)})),LineStyle:nc((function(t,n,i){var r={node:t},e={color:n.getColor(),width:Number(n.getWidth())||1},o=i[i.length-1].node,s=aT[o.namespaceURI],u=oc(e,s);fc(r,hT,ec,u,i,s)})),PolyStyle:nc((function(t,n,i){var r={node:t},e=n.getFill(),o=n.getStroke(),s={color:e?e.getColor():void 0,fill:!!e&&void 0,outline:!!o&&void 0},u=i[i.length-1].node,a=ET[u.namespaceURI],h=oc(s,a);fc(r,kT,ec,h,i,a)}))});var zT=aE,RT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),FT=[null],GT=sc(FT,{nd:function(t,n){n[n.length-1].ndrefs.push(t.getAttribute("ref"))},tag:BT}),DT=sc(FT,{node:function(t,n){var i=n[0],r=n[n.length-1],e=t.getAttribute("id"),o=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];r.nodes[e]=o;var s=ac({tags:{}},UT,t,n);if(!k(s.tags)){var u=new Se(o);Eg(u,!1,i);var a=new Et(u);void 0!==e&&a.setId(e),a.setProperties(s.tags,!0),r.features.push(a)}},way:function(t,n){var i=ac({id:t.getAttribute("id"),ndrefs:[],tags:{}},GT,t,n);n[n.length-1].ways.push(i)}}),qT=function(t){function n(){var n=t.call(this)||this;return n.dataProjection=yr("EPSG:4326"),n}return RT(n,t),n.prototype.readFeaturesFromNode=function(t,n){var i=this.getReadOptions(t,n);if("osm"==t.localName){for(var r=ac({nodes:{},ways:[],features:[]},DT,t,[i]),e=0;e<r.ways.length;e++){for(var o=r.ways[e],s=[],u=0,a=o.ndrefs.length;u<a;u++){g(s,r.nodes[o.ndrefs[u]])}var h=void 0;Eg(h=o.ndrefs[0]==o.ndrefs[o.ndrefs.length-1]?new We(s,Tt,[s.length]):new ng(s,Tt),!1,i);var f=new Et(h);void 0!==o.id&&f.setId(o.id),f.setProperties(o.tags,!0),r.features.push(f)}if(r.features)return r.features}return[]},n}(aO),UT=sc(FT,{tag:BT});function BT(t,n){n[n.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}var XT=qT,VT=function(){function t(){}return t.prototype.read=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readFromDocument(n)}return Yf(t)?this.readFromDocument(t):this.readFromNode(t)}return null},t.prototype.readFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFromNode(n);return null},t.prototype.readFromNode=function(t){},t}();function WT(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}var YT=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ZT=[null,"http://www.opengis.net/ows/1.1"],$T=sc(ZT,{ServiceIdentification:tc((function(t,n){return ac({},aA,t,n)})),ServiceProvider:tc((function(t,n){return ac({},hA,t,n)})),OperationsMetadata:tc((function(t,n){return ac({},eA,t,n)}))}),KT=function(t){function n(){return t.call(this)||this}return YT(n,t),n.prototype.readFromNode=function(t){var n=ac({},$T,t,[]);return n||null},n}(VT),HT=sc(ZT,{DeliveryPoint:tc(xO),City:tc(xO),AdministrativeArea:tc(xO),PostalCode:tc(xO),Country:tc(xO),ElectronicMailAddress:tc(xO)}),JT=sc(ZT,{Value:Qf((function(t,n){return xO(t)}))}),QT=sc(ZT,{AllowedValues:tc((function(t,n){return ac({},JT,t,n)}))}),tA=sc(ZT,{Phone:tc((function(t,n){return ac({},oA,t,n)})),Address:tc((function(t,n){return ac({},HT,t,n)}))}),nA=sc(ZT,{HTTP:tc((function(t,n){return ac({},iA,t,n)}))}),iA=sc(ZT,{Get:Qf((function(t,n){var i=WT(t);if(!i)return;return ac({href:i},sA,t,n)})),Post:void 0}),rA=sc(ZT,{DCP:tc((function(t,n){return ac({},nA,t,n)}))}),eA=sc(ZT,{Operation:function(t,n){var i=t.getAttribute("name"),r=ac({},rA,t,n);if(!r)return;n[n.length-1][i]=r}}),oA=sc(ZT,{Voice:tc(xO),Facsimile:tc(xO)}),sA=sc(ZT,{Constraint:Qf((function(t,n){var i=t.getAttribute("name");if(!i)return;return ac({name:i},QT,t,n)}))}),uA=sc(ZT,{IndividualName:tc(xO),PositionName:tc(xO),ContactInfo:tc((function(t,n){return ac({},tA,t,n)}))}),aA=sc(ZT,{Abstract:tc(xO),AccessConstraints:tc(xO),Fees:tc(xO),Title:tc(xO),ServiceTypeVersion:tc(xO),ServiceType:tc(xO)}),hA=sc(ZT,{ProviderName:tc(xO),ProviderSite:tc(WT),ServiceContact:tc((function(t,n){return ac({},uA,t,n)}))});var fA=KT,cA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function lA(t,n,i){var r,e=i||1e5,o=new Array(n);for(r=0;r<n;++r)o[r]=0;for(var s=0,u=t.length;s<u;)for(r=0;r<n;++r,++s){var a=t[s],h=a-o[r];o[r]=a,t[s]=h}return dA(t,e)}function vA(t,n,i){var r,e=i||1e5,o=new Array(n);for(r=0;r<n;++r)o[r]=0;for(var s=pA(t,e),u=0,a=s.length;u<a;)for(r=0;r<n;++r,++u)o[r]+=s[u],s[u]=o[r];return s}function dA(t,n){for(var i=n||1e5,r=0,e=t.length;r<e;++r)t[r]=Math.round(t[r]*i);return yA(t)}function pA(t,n){for(var i=n||1e5,r=mA(t),e=0,o=r.length;e<o;++e)r[e]/=i;return r}function yA(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];t[n]=r<0?~(r<<1):r<<1}return wA(t)}function mA(t){for(var n=gA(t),i=0,r=n.length;i<r;++i){var e=n[i];n[i]=1&e?~(e>>1):e>>1}return n}function wA(t){for(var n="",i=0,r=t.length;i<r;++i)n+=bA(t[i]);return n}function gA(t){for(var n=[],i=0,r=0,e=0,o=t.length;e<o;++e){var s=t.charCodeAt(e)-63;i|=(31&s)<<r,s<32?(n.push(i),i=0,r=0):r+=5}return n}function bA(t){for(var n,i="";t>=32;)n=63+(32|31&t),i+=String.fromCharCode(n),t>>=5;return n=t+63,i+=String.fromCharCode(n)}var xA=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.dataProjection=yr("EPSG:4326"),i.zy=r.factor?r.factor:1e5,i.qv=r.geometryLayout?r.geometryLayout:Tt,i}return cA(n,t),n.prototype.readFeatureFromText=function(t,n){var i=this.readGeometryFromText(t,n);return new Et(i)},n.prototype.readFeaturesFromText=function(t,n){return[this.readFeatureFromText(t,n)]},n.prototype.readGeometryFromText=function(t,n){var i=Zr(this.qv),r=vA(t,i,this.zy);JS(r,0,r.length,i,r);var e=pe(r,0,r.length,i);return Eg(new ng(e,this.qv),!1,this.adaptOptions(n))},n.prototype.writeFeatureText=function(t,n){var i=t.getGeometry();return i?this.writeGeometryText(i,n):(St(!1,40),"")},n.prototype.writeFeaturesText=function(t,n){return this.writeFeatureText(t[0],n)},n.prototype.writeGeometryText=function(t,n){var i=(t=Eg(t,!0,this.adaptOptions(n))).getFlatCoordinates(),r=t.getStride();return JS(i,0,i.length,r,i),lA(i,r,this.zy)},n}(Cj),MA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_A=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.iv=r.layerName,i.Uh=r.layers?r.layers:null,i.dataProjection=yr(r.dataProjection?r.dataProjection:"EPSG:4326"),i}return MA(n,t),n.prototype.readFeaturesFromObject=function(t,n){if("Topology"==t.type){var i=t,r=void 0,e=null,o=null;i.transform&&(e=(r=i.transform).scale,o=r.translate);var s=i.arcs;r&&function(t,n,i){for(var r=0,e=t.length;r<e;++r)TA(t[r],n,i)}(s,e,o);var u=[],a=i.objects,h=this.iv,f=void 0;for(var c in a)this.Uh&&-1==this.Uh.indexOf(c)||("GeometryCollection"===a[c].type?(f=a[c],u.push.apply(u,jA(f,s,e,o,h,c,n))):(f=a[c],u.push(EA(f,s,e,o,h,c,n))));return u}return[]},n.prototype.readProjectionFromObject=function(t){return this.dataProjection},n}(Bg),SA={Point:function(t,n,i){var r=t.coordinates;n&&i&&AA(r,n,i);return new Se(r)},LineString:function(t,n){var i=OA(t.arcs,n);return new ng(i)},Polygon:function(t,n){for(var i=[],r=0,e=t.arcs.length;r<e;++r)i[r]=OA(t.arcs[r],n);return new We(i)},MultiPoint:function(t,n,i){var r=t.coordinates;if(n&&i)for(var e=0,o=r.length;e<o;++e)AA(r[e],n,i);return new Kw(r)},MultiLineString:function(t,n){for(var i=[],r=0,e=t.arcs.length;r<e;++r)i[r]=OA(t.arcs[r],n);return new rg(i)},MultiPolygon:function(t,n){for(var i=[],r=0,e=t.arcs.length;r<e;++r){for(var o=t.arcs[r],s=[],u=0,a=o.length;u<a;++u)s[u]=OA(o[u],n);i[r]=s}return new sg(i)}};function OA(t,n){for(var i,r=[],e=0,o=t.length;e<o;++e)if(i=t[e],e>0&&r.pop(),i>=0)for(var s=0,u=(a=n[i]).length;s<u;++s)r.push(a[s].slice(0));else{var a;for(s=(a=n[~i]).length-1;s>=0;--s)r.push(a[s].slice(0))}return r}function jA(t,n,i,r,e,o,s){for(var u=t.geometries,a=[],h=0,f=u.length;h<f;++h)a[h]=EA(u[h],n,i,r,e,o,s);return a}function EA(t,n,i,r,e,o,s){var u=null,a=t.type;if(a){var h=SA[a];u=Eg(u="Point"===a||"MultiPoint"===a?h(t,i,r):h(t,n),!1,s)}var f=new Et({geometry:u});void 0!==t.id&&f.setId(t.id);var c=t.properties;return e&&(c||(c={}),c[e]=o),c&&f.setProperties(c,!0),f}function TA(t,n,i){for(var r=0,e=0,o=0,s=t.length;o<s;++o){var u=t[o];r+=u[0],e+=u[1],u[0]=r,u[1]=e,AA(u,n,i)}}function AA(t,n,i){t[0]=t[0]*n[0]+i[0],t[1]=t[1]*n[1]+i[1]}var PA=_A,CA=function(){function t(t){this.Ry=t}return t.prototype.getTagName=function(){return this.Ry},t}(),kA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),IA=function(t){function n(n,i){var r=t.call(this,n)||this;return r.conditions=i,St(r.conditions.length>=2,57),r}return kA(n,t),n}(CA),NA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),LA=function(t){function n(n){return t.call(this,"And",Array.prototype.slice.call(arguments))||this}return NA(n,t),n}(IA),zA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),RA=function(t){function n(n,i,r){var e=t.call(this,"BBOX")||this;if(e.geometryName=n,e.extent=i,4!==i.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");return e.srsName=r,e}return zA(n,t),n}(CA),FA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),GA=function(t){function n(n,i,r,e){var o=t.call(this,n)||this;return o.geometryName=i||"the_geom",o.geometry=r,o.srsName=e,o}return FA(n,t),n}(CA),DA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),qA=function(t){function n(n,i,r){return t.call(this,"Contains",n,i,r)||this}return DA(n,t),n}(GA),UA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),BA=function(t){function n(n,i,r,e,o){var s=t.call(this,"DWithin",n,i,o)||this;return s.distance=r,s.unit=e,s}return UA(n,t),n}(GA),XA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),VA=function(t){function n(n,i,r){return t.call(this,"Disjoint",n,i,r)||this}return XA(n,t),n}(GA),WA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),YA=function(t){function n(n,i){var r=t.call(this,n)||this;return r.propertyName=i,r}return WA(n,t),n}(CA),ZA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$A=function(t){function n(n,i,r){var e=t.call(this,"During",n)||this;return e.begin=i,e.end=r,e}return ZA(n,t),n}(YA),KA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),HA=function(t){function n(n,i,r,e){var o=t.call(this,n,i)||this;return o.expression=r,o.matchCase=e,o}return KA(n,t),n}(YA),JA=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),QA=function(t){function n(n,i,r){return t.call(this,"PropertyIsEqualTo",n,i,r)||this}return JA(n,t),n}(HA),tP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nP=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThan",n,i)||this}return tP(n,t),n}(HA),iP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rP=function(t){function n(n,i){return t.call(this,"PropertyIsGreaterThanOrEqualTo",n,i)||this}return iP(n,t),n}(HA),eP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),oP=function(t){function n(n,i,r){return t.call(this,"Intersects",n,i,r)||this}return eP(n,t),n}(GA),sP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uP=function(t){function n(n,i,r){var e=t.call(this,"PropertyIsBetween",n)||this;return e.lowerBoundary=i,e.upperBoundary=r,e}return sP(n,t),n}(YA),aP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),hP=function(t){function n(n,i,r,e,o,s){var u=t.call(this,"PropertyIsLike",n)||this;return u.pattern=i,u.wildCard=void 0!==r?r:"*",u.singleChar=void 0!==e?e:".",u.escapeChar=void 0!==o?o:"!",u.matchCase=s,u}return aP(n,t),n}(YA),fP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),cP=function(t){function n(n){return t.call(this,"PropertyIsNull",n)||this}return fP(n,t),n}(YA),lP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vP=function(t){function n(n,i){return t.call(this,"PropertyIsLessThan",n,i)||this}return lP(n,t),n}(HA),dP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),pP=function(t){function n(n,i){return t.call(this,"PropertyIsLessThanOrEqualTo",n,i)||this}return dP(n,t),n}(HA),yP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mP=function(t){function n(n){var i=t.call(this,"Not")||this;return i.condition=n,i}return yP(n,t),n}(CA),wP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gP=function(t){function n(n,i,r){return t.call(this,"PropertyIsNotEqualTo",n,i,r)||this}return wP(n,t),n}(HA),bP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),xP=function(t){function n(n){return t.call(this,"Or",Array.prototype.slice.call(arguments))||this}return bP(n,t),n}(IA),MP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_P=function(t){function n(n){var i=t.call(this,"ResourceId")||this;return i.rid=n,i}return MP(n,t),n}(CA),SP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),OP=function(t){function n(n,i,r){return t.call(this,"Within",n,i,r)||this}return SP(n,t),n}(GA);function jP(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(LA,n))}function EP(t,n,i){return new RA(t,n,i)}var TP=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),AP={"http://www.opengis.net/gml":{boundedBy:tc(vO.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:Hf(vO.prototype.readFeaturesInternal)}},PP={"http://www.opengis.net/wfs":{totalInserted:tc(gO),totalUpdated:tc(gO),totalDeleted:tc(gO)},"http://www.opengis.net/wfs/2.0":{totalInserted:tc(gO),totalUpdated:tc(gO),totalDeleted:tc(gO)}},CP={"http://www.opengis.net/wfs":{TransactionSummary:tc(BP,"transactionSummary"),InsertResults:tc(YP,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:tc(BP,"transactionSummary"),InsertResults:tc(YP,"insertIds")}},kP={"http://www.opengis.net/wfs":{PropertyName:nc(EO)},"http://www.opengis.net/wfs/2.0":{PropertyName:nc(EO)}},IP={"http://www.opengis.net/wfs":{Insert:nc(ZP),Update:nc(JP),Delete:nc(HP),Property:nc(QP),Native:nc(tC)},"http://www.opengis.net/wfs/2.0":{Insert:nc(ZP),Update:nc(JP),Delete:nc(HP),Property:nc(QP),Native:nc(tC)}},NP="feature",LP="http://www.w3.org/2000/xmlns/",zP={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},RP={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},FP={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},GP={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","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"},DP={"2.0.0":DO,"1.1.0":LO,"1.0.0":CO},qP=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.af=r.version?r.version:"1.1.0",i.Fy=r.featureType,i.Gy=r.featureNS,i.Dy=r.gmlFormat?r.gmlFormat:new DP[i.af],i.qy=r.schemaLocation?r.schemaLocation:GP[i.af],i}return TP(n,t),n.prototype.getFeatureType=function(){return this.Fy},n.prototype.setFeatureType=function(t){this.Fy=t},n.prototype.readFeaturesFromNode=function(t,n){var i={node:t};A(i,{featureType:this.Fy,featureNS:this.Gy}),A(i,this.getReadOptions(t,n||{}));var r=[i],e=ac([],"2.0.0"===this.af?AP:this.Dy.FEATURE_COLLECTION_PARSERS,t,r,this.Dy);return e||(e=[]),e},n.prototype.readTransactionResponse=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readTransactionResponseFromDocument(n)}return Yf(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}},n.prototype.readFeatureCollectionMetadata=function(t){if(t){if("string"==typeof t){var n=$f(t);return this.readFeatureCollectionMetadataFromDocument(n)}return Yf(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}},n.prototype.readFeatureCollectionMetadataFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(n)},n.prototype.readFeatureCollectionMetadataFromNode=function(t){var n={},i=bO(t.getAttribute("numberOfFeatures"));return n.numberOfFeatures=i,ac(n,AP,t,[],this.Dy)},n.prototype.readTransactionResponseFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(n)},n.prototype.readTransactionResponseFromNode=function(t){return ac({},CP,t,[])},n.prototype.writeGetFeature=function(t){var n=this,i=Xf(RP[this.af],"GetFeature");i.setAttribute("service","WFS"),i.setAttribute("version",this.af),t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&i.setAttribute("count",String(t.count)),void 0!==t.viewParams&&i.setAttribute("viewParams",t.viewParams),i.setAttributeNS(Bf,"xsi:schemaLocation",this.qy);var r={node:i};if(A(r,{version:this.af,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.Gy,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),St(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){var e=t.filter;t.bbox&&(St(t.geometryName,12),e=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,e)),A(r,{geometryName:t.geometryName,filter:e}),wC(i,t.featureTypes,[r])}else t.featureTypes.forEach((function(e){var o=n.combineBboxAndFilter(e.geometryName,e.bbox,t.srsName,t.filter);A(r,{geometryName:e.geometryName,filter:o}),wC(i,[e.name],[r])}));return i},n.prototype.combineBboxAndFilter=function(t,n,i,r){var e=EP(t,n,i);return r?jP(r,e):e},n.prototype.writeTransaction=function(t,n,i,r){var e,o=[],s=r.version?r.version:this.af,u=Xf(RP[s],"Transaction");u.setAttribute("service","WFS"),u.setAttribute("version",s),r&&(e=r.gmlOptions?r.gmlOptions:{},r.handle&&u.setAttribute("handle",r.handle)),u.setAttributeNS(Bf,"xsi:schemaLocation",GP[s]);var a=function(t,n,i,r){var e,o=r.featurePrefix?r.featurePrefix:NP;"1.0.0"===i?e=2:"1.1.0"===i?e=3:"2.0.0"===i&&(e=3.2);return A({node:t},{version:i,featureNS:r.featureNS,featureType:r.featureType,featurePrefix:o,gmlVersion:e,hasZ:r.hasZ,srsName:r.srsName},n)}(u,e,s,r);return t&&UP("Insert",t,o,a),n&&UP("Update",n,o,a),i&&UP("Delete",i,o,a),r.nativeElements&&UP("Native",r.nativeElements,o,a),u},n.prototype.readProjectionFromDocument=function(t){for(var n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(n);return null},n.prototype.readProjectionFromNode=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(var n=(t=t.firstElementChild.firstElementChild).firstElementChild;n;n=n.nextElementSibling)if(0!==n.childNodes.length&&(1!==n.childNodes.length||3!==n.firstChild.nodeType)){var i=[{}];return this.Dy.readGeometryElement(n,i),yr(i.pop().srsName)}return null},n}(aO);function UP(t,n,i,r){fc(r,IP,rc(t),n,i)}function BP(t,n){return ac({},PP,t,n)}var XP={"http://www.opengis.net/ogc":{FeatureId:Hf((function(t,n){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:Hf((function(t,n){return t.getAttribute("fid")}))}};function VP(t,n){uc(XP,t,n)}var WP={"http://www.opengis.net/wfs":{Feature:VP},"http://www.opengis.net/wfs/2.0":{Feature:VP}};function YP(t,n){return ac([],WP,t,n)}function ZP(t,n,i){var r=i[i.length-1],e=r.featureType,o=r.featureNS,s=r.gmlVersion,u=Xf(o,e);t.appendChild(u),2===s?CO.prototype.writeFeatureElement(u,n,i):3===s?LO.prototype.writeFeatureElement(u,n,i):DO.prototype.writeFeatureElement(u,n,i)}function $P(t,n,i){var r=i[i.length-1].version,e=zP[r],o=Xf(e,"Filter"),s=Xf(e,"FeatureId");o.appendChild(s),s.setAttribute("fid",n),t.appendChild(o)}function KP(t,n){var i=(t=t||NP)+":";return 0===n.indexOf(i)?n:i+n}function HP(t,n,i){var r=i[i.length-1];St(void 0!==n.getId(),26);var e=r.featureType,o=r.featurePrefix,s=r.featureNS,u=KP(o,e);t.setAttribute("typeName",u),t.setAttributeNS(LP,"xmlns:"+o,s);var a=n.getId();void 0!==a&&$P(t,a,i)}function JP(t,n,i){var r=i[i.length-1];St(void 0!==n.getId(),27);var e=r.version,o=r.featureType,s=r.featurePrefix,u=r.featureNS,a=KP(s,o),h=n.getGeometryName();t.setAttribute("typeName",a),t.setAttributeNS(LP,"xmlns:"+s,u);var f=n.getId();if(void 0!==f){for(var c=n.getKeys(),l=[],v=0,d=c.length;v<d;v++){var p=n.get(c[v]);if(void 0!==p){var y=c[v];p&&"function"==typeof p.getSimplifiedGeometry&&(y=h),l.push({name:y,value:p})}}fc({version:e,gmlVersion:r.gmlVersion,node:t,hasZ:r.hasZ,srsName:r.srsName},IP,rc("Property"),l,i),$P(t,f,i)}}function QP(t,n,i){var r=i[i.length-1],e=r.version,o=RP[e],s=Xf(o,"Name"),u=r.gmlVersion;if(t.appendChild(s),EO(s,n.name),void 0!==n.value&&null!==n.value){var a=Xf(o,"Value");t.appendChild(a),n.value&&"function"==typeof n.value.getSimplifiedGeometry?2===u?CO.prototype.writeGeometryElement(a,n.value,i):3===u?LO.prototype.writeGeometryElement(a,n.value,i):DO.prototype.writeGeometryElement(a,n.value,i):EO(a,n.value)}}function tC(t,n,i){n.vendorId&&t.setAttribute("vendorId",n.vendorId),void 0!==n.safeToIgnore&&t.setAttribute("safeToIgnore",String(n.safeToIgnore)),void 0!==n.value&&EO(t,n.value)}var nC={"http://www.opengis.net/wfs":{Query:nc(iC)},"http://www.opengis.net/wfs/2.0":{Query:nc(iC)},"http://www.opengis.net/ogc":{During:nc(uC),And:nc(aC),Or:nc(aC),Not:nc(hC),BBOX:nc(eC),Contains:nc(oC),Intersects:nc(oC),Within:nc(oC),DWithin:nc(sC),PropertyIsEqualTo:nc(fC),PropertyIsNotEqualTo:nc(fC),PropertyIsLessThan:nc(fC),PropertyIsLessThanOrEqualTo:nc(fC),PropertyIsGreaterThan:nc(fC),PropertyIsGreaterThanOrEqualTo:nc(fC),PropertyIsNull:nc(cC),PropertyIsBetween:nc(lC),PropertyIsLike:nc(vC)},"http://www.opengis.net/fes/2.0":{During:nc(uC),And:nc(aC),Or:nc(aC),Not:nc(hC),BBOX:nc(eC),Contains:nc(oC),Disjoint:nc(oC),Intersects:nc(oC),ResourceId:nc((function(t,n,i){t.setAttribute("rid",n.rid)})),Within:nc(oC),DWithin:nc(sC),PropertyIsEqualTo:nc(fC),PropertyIsNotEqualTo:nc(fC),PropertyIsLessThan:nc(fC),PropertyIsLessThanOrEqualTo:nc(fC),PropertyIsGreaterThan:nc(fC),PropertyIsGreaterThanOrEqualTo:nc(fC),PropertyIsNull:nc(cC),PropertyIsBetween:nc(lC),PropertyIsLike:nc(vC)}};function iC(t,n,i){var r,e,o=i[i.length-1],s=o.version,u=o.featurePrefix,a=o.featureNS,h=o.propertyNames,f=o.srsName;r=u?KP(u,n):n,e="2.0.0"===s?"typeNames":"typeName",t.setAttribute(e,r),f&&t.setAttribute("srsName",f),a&&t.setAttributeNS(LP,"xmlns:"+u,a);var c=A({},o);c.node=t,fc(c,kP,rc("PropertyName"),h,i);var l=o.filter;if(l){var v=Xf(gC(s),"Filter");t.appendChild(v),rC(v,l,i)}}function rC(t,n,i){var r=i[i.length-1],e={node:t};A(e,{context:r}),fc(e,nC,rc(n.getTagName()),[n],i)}function eC(t,n,i){var r=i[i.length-1],e=r.context.version;r.srsName=n.srsName;var o=DP[e];yC(e,t,n.geometryName),o.prototype.writeGeometryElement(t,n.extent,i)}function oC(t,n,i){var r=i[i.length-1],e=r.context.version;r.srsName=n.srsName;var o=DP[e];yC(e,t,n.geometryName),o.prototype.writeGeometryElement(t,n.geometry,i)}function sC(t,n,i){var r=i[i.length-1].context.version;oC(t,n,i);var e=Xf(gC(r),"Distance");EO(e,n.distance.toString()),"2.0.0"===r?e.setAttribute("uom",n.unit):e.setAttribute("units",n.unit),t.appendChild(e)}function uC(t,n,i){var r=i[i.length-1].context.version;dC(FP[r],"ValueReference",t,n.propertyName);var e=Xf(fO,"TimePeriod");t.appendChild(e);var o=Xf(fO,"begin");e.appendChild(o),mC(o,n.begin);var s=Xf(fO,"end");e.appendChild(s),mC(s,n.end)}function aC(t,n,i){var r=i[i.length-1].context,e={node:t};A(e,{context:r});for(var o=n.conditions,s=0,u=o.length;s<u;++s){var a=o[s];fc(e,nC,rc(a.getTagName()),[a],i)}}function hC(t,n,i){var r=i[i.length-1].context,e={node:t};A(e,{context:r});var o=n.condition;fc(e,nC,rc(o.getTagName()),[o],i)}function fC(t,n,i){var r=i[i.length-1].context.version;void 0!==n.matchCase&&t.setAttribute("matchCase",n.matchCase.toString()),yC(r,t,n.propertyName),pC(r,t,""+n.expression)}function cC(t,n,i){yC(i[i.length-1].context.version,t,n.propertyName)}function lC(t,n,i){var r=i[i.length-1].context.version,e=gC(r);yC(r,t,n.propertyName);var o=Xf(e,"LowerBoundary");t.appendChild(o),pC(r,o,""+n.lowerBoundary);var s=Xf(e,"UpperBoundary");t.appendChild(s),pC(r,s,""+n.upperBoundary)}function vC(t,n,i){var r=i[i.length-1].context.version;t.setAttribute("wildCard",n.wildCard),t.setAttribute("singleChar",n.singleChar),t.setAttribute("escapeChar",n.escapeChar),void 0!==n.matchCase&&t.setAttribute("matchCase",n.matchCase.toString()),yC(r,t,n.propertyName),pC(r,t,""+n.pattern)}function dC(t,n,i,r){var e=Xf(t,n);EO(e,r),i.appendChild(e)}function pC(t,n,i){dC(gC(t),"Literal",n,i)}function yC(t,n,i){"2.0.0"===t?dC(FP[t],"ValueReference",n,i):dC(zP[t],"PropertyName",n,i)}function mC(t,n){var i=Xf(fO,"TimeInstant");t.appendChild(i);var r=Xf(fO,"timePosition");i.appendChild(r),EO(r,n)}function wC(t,n,i){var r=i[i.length-1],e=A({},r);e.node=t,fc(e,nC,rc("Query"),n,i)}function gC(t){return"2.0.0"===t?FP[t]:zP[t]}var bC=qP,xC=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),MC=1,_C=2,SC=3,OC=4,jC=5,EC=6,TC=7,AC=15,PC=16,CC=17,kC=function(){function t(t){this.Uy=t,this.By=0,this.Xy=!1,this.Vy=!1,this.Wy=!1,this.Yy=!1,this.Zy=null,this.$y=Tt}return t.prototype.readUint8=function(){return this.Uy.getUint8(this.By++)},t.prototype.readUint32=function(t){return this.Uy.getUint32((this.By+=4)-4,void 0!==t?t:this.Vy)},t.prototype.readDouble=function(t){return this.Uy.getFloat64((this.By+=8)-8,void 0!==t?t:this.Vy)},t.prototype.readPoint=function(){var t=[];return t.push(this.readDouble()),t.push(this.readDouble()),this.Wy&&t.push(this.readDouble()),this.Yy&&t.push(this.readDouble()),t},t.prototype.readLineString=function(){for(var t=this.readUint32(),n=[],i=0;i<t;i++)n.push(this.readPoint());return n},t.prototype.readPolygon=function(){for(var t=this.readUint32(),n=[],i=0;i<t;i++)n.push(this.readLineString());return n},t.prototype.readWkbHeader=function(t){var n=this.readUint8()>0,i=this.readUint32(n),r=Math.floor((268435455&i)/1e3),e=Boolean(2147483648&i)||1===r||3===r,o=Boolean(1073741824&i)||2===r||3===r,s=Boolean(536870912&i),u=(268435455&i)%1e3,a=["XY",e?"Z":"",o?"M":""].join(""),h=s?this.readUint32(n):null;if(void 0!==t&&t!==u)throw new Error("Unexpected WKB geometry type "+u);if(this.Xy){if(this.Vy!==n)throw new Error("Inconsistent endian");if(this.$y!==a)throw new Error("Inconsistent geometry layout");if(h&&this.Zy!==h)throw new Error("Inconsistent coordinate system (SRID)")}else this.Vy=n,this.Wy=e,this.Yy=o,this.$y=a,this.Zy=h,this.Xy=!0;return u},t.prototype.readWkbPayload=function(t){switch(t){case MC:return this.readPoint();case _C:return this.readLineString();case SC:case CC:return this.readPolygon();case OC:return this.readMultiPoint();case jC:return this.readMultiLineString();case EC:case AC:case PC:return this.readMultiPolygon();case TC:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}},t.prototype.readWkbBlock=function(t){return this.readWkbPayload(this.readWkbHeader(t))},t.prototype.readWkbCollection=function(t,n){for(var i=this.readUint32(),r=[],e=0;e<i;e++){var o=t.call(this,n);o&&r.push(o)}return r},t.prototype.readMultiPoint=function(){return this.readWkbCollection(this.readWkbBlock,MC)},t.prototype.readMultiLineString=function(){return this.readWkbCollection(this.readWkbBlock,_C)},t.prototype.readMultiPolygon=function(){return this.readWkbCollection(this.readWkbBlock,SC)},t.prototype.readGeometryCollection=function(){return this.readWkbCollection(this.readGeometry)},t.prototype.readGeometry=function(){var t=this.readWkbHeader(),n=this.readWkbPayload(t);switch(t){case MC:return new Se(n,this.$y);case _C:return new ng(n,this.$y);case SC:case CC:return new We(n,this.$y);case OC:return new Kw(n,this.$y);case jC:return new rg(n,this.$y);case EC:case AC:case PC:return new sg(n,this.$y);case TC:return new Dg(n);default:return null}},t.prototype.getSrid=function(){return this.Zy},t}(),IC=function(){function t(t){t=t||{},this.$y=t.layout,this.Vy=!1!==t.littleEndian,this.Ky=!1!==t.ewkb,this.Hy=[],this.Jy=A({X:0,Y:0,Z:0,M:0},t.nodata)}return t.prototype.writeUint8=function(t){this.Hy.push([1,t])},t.prototype.writeUint32=function(t){this.Hy.push([4,t])},t.prototype.writeDouble=function(t){this.Hy.push([8,t])},t.prototype.writePoint=function(t,n){for(var i=A.apply(null,n.split("").map((function(n,i){var r;return(r={})[n]=t[i],r}))),r=0,e=this.$y;r<e.length;r++){var o=e[r];this.writeDouble(o in i?i[o]:this.Jy[o])}},t.prototype.writeLineString=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writePoint(t[i],n)},t.prototype.writePolygon=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeLineString(t[i],n)},t.prototype.writeWkbHeader=function(t,n){t%=1e3,this.$y.indexOf("Z")>=0&&(t+=this.Ky?2147483648:1e3),this.$y.indexOf("M")>=0&&(t+=this.Ky?1073741824:2e3),this.Ky&&Number.isInteger(n)&&(t|=536870912),this.writeUint8(this.Vy?1:0),this.writeUint32(t),this.Ky&&Number.isInteger(n)&&this.writeUint32(n)},t.prototype.writeMultiPoint=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeWkbHeader(1),this.writePoint(t[i],n)},t.prototype.writeMultiLineString=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeWkbHeader(2),this.writeLineString(t[i],n)},t.prototype.writeMultiPolygon=function(t,n){this.writeUint32(t.length);for(var i=0;i<t.length;i++)this.writeWkbHeader(3),this.writePolygon(t[i],n)},t.prototype.writeGeometryCollection=function(t){this.writeUint32(t.length);for(var n=0;n<t.length;n++)this.writeGeometry(t[n])},t.prototype.findMinimumLayout=function(t,n){void 0===n&&(n=Ct);var i,r;if(t instanceof Kr)return(i=t.getLayout())===(r=n)?i:i===Ct?r:r===Ct?i:Tt;if(t instanceof Dg)for(var e=t.getGeometriesArray(),o=0;o<e.length&&n!==Tt;o++)n=this.findMinimumLayout(e[o],n);return n},t.prototype.writeGeometry=function(t,n){var i={Point:MC,LineString:_C,Polygon:SC,MultiPoint:OC,MultiLineString:jC,MultiPolygon:EC,GeometryCollection:TC},r=t.getType(),e=i[r];if(!e)throw new Error("GeometryType "+r+" is not supported");(this.$y||(this.$y=this.findMinimumLayout(t)),this.writeWkbHeader(e,n),t instanceof Kr)?{Point:this.writePoint,LineString:this.writeLineString,Polygon:this.writePolygon,MultiPoint:this.writeMultiPoint,MultiLineString:this.writeMultiLineString,MultiPolygon:this.writeMultiPolygon}[r].call(this,t.getCoordinates(),t.getLayout()):t instanceof Dg&&this.writeGeometryCollection(t.getGeometriesArray())},t.prototype.getBuffer=function(){var t=this,n=this.Hy.reduce((function(t,n){return t+n[0]}),0),i=new ArrayBuffer(n),r=new DataView(i),e=0;return this.Hy.forEach((function(n){switch(n[0]){case 1:r.setUint8(e,n[1]);break;case 4:r.setUint32(e,n[1],t.Vy);break;case 8:r.setFloat64(e,n[1],t.Vy)}e+=n[0]})),i},t}();function NC(t){return"string"==typeof t?function(t){for(var n=new Uint8Array(t.length/2),i=0;i<t.length/2;i++)n[i]=parseInt(t.substr(2*i,2),16);return new DataView(n.buffer)}(t):ArrayBuffer.isView(t)?t instanceof DataView?t:new DataView(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new DataView(t):null}var LC=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.splitCollection=Boolean(r.splitCollection),i.Qy=null,i.tm=!1!==r.hex,i.nm=!1!==r.littleEndian,i.im=!1!==r.ewkb,i.$y=r.geometryLayout,i.rm=r.nodataZ||0,i.om=r.nodataM||0,i.Zy=r.srid,i}return xC(n,t),n.prototype.getType=function(){return this.tm?"text":"arraybuffer"},n.prototype.readFeature=function(t,n){return new Et({geometry:this.readGeometry(t,n)})},n.prototype.readFeatures=function(t,n){var i=this.readGeometry(t,n);return(this.splitCollection&&i instanceof Dg?i.getGeometriesArray():[i]).map((function(t){return new Et({geometry:t})}))},n.prototype.readGeometry=function(t,n){var i=NC(t);if(!i)return null;var r=new kC(i).readGeometry();this.Qy=i;var e=this.getReadOptions(t,n);return this.Qy=null,Eg(r,!1,e)},n.prototype.readProjection=function(t){var n=this.Qy||NC(t);if(n){var i=new kC(n);return i.readWkbHeader(),i.getSrid()&&yr("EPSG:"+i.getSrid())||void 0}},n.prototype.writeFeature=function(t,n){return this.writeGeometry(t.getGeometry(),n)},n.prototype.writeFeatures=function(t,n){return this.writeGeometry(new Dg(t.map((function(t){return t.getGeometry()}))),n)},n.prototype.writeGeometry=function(t,n){var i=this.adaptOptions(n),r=new IC({layout:this.$y,littleEndian:this.nm,ewkb:this.im,nodata:{Z:this.rm,M:this.om}}),e=Number.isInteger(this.Zy)?Number(this.Zy):null;if(!1!==this.Zy&&!Number.isInteger(this.Zy)){var o=i.dataProjection&&yr(i.dataProjection);if(o){var s=o.getCode();0===s.indexOf("EPSG:")&&(e=Number(s.substring(5)))}}r.writeGeometry(Eg(t,!0,i),e);var u=r.getBuffer();return this.tm?function(t){var n=new Uint8Array(t);return Array.from(n.values()).map((function(t){return(t<16?"0":"")+Number(t).toString(16).toUpperCase()})).join("")}(u):u},n}(jg),zC=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),RC={POINT:Se,LINESTRING:ng,POLYGON:We,MULTIPOINT:Kw,MULTILINESTRING:rg,MULTIPOLYGON:sg},FC="EMPTY",GC=0,DC=1,qC=2,UC=3,BC=4,XC=5,VC=6,WC={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"},YC=function(){function t(t){this.wkt=t,this.sm=-1}return t.prototype.um=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},t.prototype.am=function(t,n){return t>="0"&&t<="9"||"."==t&&!(void 0!==n&&n)},t.prototype.hm=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},t.prototype.fm=function(){return this.wkt.charAt(++this.sm)},t.prototype.nextToken=function(){var t,n=this.fm(),i=this.sm,r=n;if("("==n)t=qC;else if(","==n)t=XC;else if(")"==n)t=UC;else if(this.am(n)||"-"==n)t=BC,r=this.lm();else if(this.um(n))t=DC,r=this.vm();else{if(this.hm(n))return this.nextToken();if(""!==n)throw new Error("Unexpected character: "+n);t=VC}return{position:i,value:r,type:t}},t.prototype.lm=function(){var t,n=this.sm,i=!1,r=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(r=!0),t=this.fm()}while(this.am(t,i)||!r&&("e"==t||"E"==t)||r&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(n,this.sm--))},t.prototype.vm=function(){var t,n=this.sm;do{t=this.fm()}while(this.um(t));return this.wkt.substring(n,this.sm--).toUpperCase()},t}(),ZC=function(){function t(t){this.dm=t,this.pm={position:0,type:GC},this.$y=Tt}return t.prototype.ym=function(){this.pm=this.dm.nextToken()},t.prototype.isTokenType=function(t){return this.pm.type==t},t.prototype.match=function(t){var n=this.isTokenType(t);return n&&this.ym(),n},t.prototype.parse=function(){return this.ym(),this.wm()},t.prototype.gm=function(){var t=Tt,n=this.pm;if(this.isTokenType(DC)){var i=n.value;"Z"===i?t=At:"M"===i?t=Pt:"ZM"===i&&(t=Ct),t!==Tt&&this.ym()}return t},t.prototype.bm=function(){if(this.match(qC)){var t=[];do{t.push(this.wm())}while(this.match(XC));if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Mm=function(){if(this.match(qC)){var t=this._m();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Sm=function(){if(this.match(qC)){var t=this.Om();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.jm=function(){if(this.match(qC)){var t=this.Em();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Tm=function(){if(this.match(qC)){var t=void 0;if(t=this.pm.type==qC?this.Am():this.Om(),this.match(UC))return t}throw new Error(this.xm())},t.prototype.Pm=function(){if(this.match(qC)){var t=this.Em();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype.Cm=function(){if(this.match(qC)){var t=this.km();if(this.match(UC))return t}throw new Error(this.xm())},t.prototype._m=function(){for(var t=[],n=this.$y.length,i=0;i<n;++i){var r=this.pm;if(!this.match(BC))break;t.push(r.value)}if(t.length==n)return t;throw new Error(this.xm())},t.prototype.Om=function(){for(var t=[this._m()];this.match(XC);)t.push(this._m());return t},t.prototype.Am=function(){for(var t=[this.Mm()];this.match(XC);)t.push(this.Mm());return t},t.prototype.Em=function(){for(var t=[this.Sm()];this.match(XC);)t.push(this.Sm());return t},t.prototype.km=function(){for(var t=[this.jm()];this.match(XC);)t.push(this.jm());return t},t.prototype.Im=function(){var t=this.isTokenType(DC)&&this.pm.value==FC;return t&&this.ym(),t},t.prototype.xm=function(){return"Unexpected `"+this.pm.value+"` at position "+this.pm.position+" in `"+this.dm.wkt+"`"},t.prototype.wm=function(){var t=this.pm;if(this.match(DC)){var n=t.value;this.$y=this.gm();var i=this.Im();if("GEOMETRYCOLLECTION"==n){if(i)return new Dg([]);var r=this.bm();return new Dg(r)}var e=RC[n];if(!e)throw new Error("Invalid geometry type: "+n);var o=void 0;if(i)o="POINT"==n?[NaN,NaN]:[];else switch(n){case"POINT":o=this.Mm();break;case"LINESTRING":o=this.Sm();break;case"POLYGON":o=this.jm();break;case"MULTIPOINT":o=this.Tm();break;case"MULTILINESTRING":o=this.Pm();break;case"MULTIPOLYGON":o=this.Cm()}return new e(o,this.$y)}throw new Error(this.xm())},t}(),$C=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Nm=void 0!==r.splitCollection&&r.splitCollection,i}return zC(n,t),n.prototype.Lm=function(t){var n=new YC(t);return new ZC(n).parse()},n.prototype.readFeatureFromText=function(t,n){var i=this.readGeometryFromText(t,n),r=new Et;return r.setGeometry(i),r},n.prototype.readFeaturesFromText=function(t,n){for(var i=[],r=this.readGeometryFromText(t,n),e=[],o=0,s=(i=this.Nm&&"GeometryCollection"==r.getType()?r.getGeometriesArray():[r]).length;o<s;++o){var u=new Et;u.setGeometry(i[o]),e.push(u)}return e},n.prototype.readGeometryFromText=function(t,n){return Eg(this.Lm(t),!1,n)},n.prototype.writeFeatureText=function(t,n){var i=t.getGeometry();return i?this.writeGeometryText(i,n):""},n.prototype.writeFeaturesText=function(t,n){if(1==t.length)return this.writeFeatureText(t[0],n);for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r].getGeometry());var o=new Dg(i);return this.writeGeometryText(o,n)},n.prototype.writeGeometryText=function(t,n){return tk(Eg(t,!0,n))},n}(Cj);function KC(t){var n=t.getCoordinates();return 0===n.length?"":n.join(" ")}function HC(t){for(var n=t.getCoordinates(),i=[],r=0,e=n.length;r<e;++r)i.push(n[r].join(" "));return i.join(",")}function JC(t){for(var n=[],i=t.getLinearRings(),r=0,e=i.length;r<e;++r)n.push("("+HC(i[r])+")");return n.join(",")}var QC={Point:KC,LineString:HC,Polygon:JC,MultiPoint:function(t){for(var n=[],i=t.getPoints(),r=0,e=i.length;r<e;++r)n.push("("+KC(i[r])+")");return n.join(",")},MultiLineString:function(t){for(var n=[],i=t.getLineStrings(),r=0,e=i.length;r<e;++r)n.push("("+HC(i[r])+")");return n.join(",")},MultiPolygon:function(t){for(var n=[],i=t.getPolygons(),r=0,e=i.length;r<e;++r)n.push("("+JC(i[r])+")");return n.join(",")},GeometryCollection:function(t){for(var n=[],i=t.getGeometries(),r=0,e=i.length;r<e;++r)n.push(tk(i[r]));return n.join(",")}};function tk(t){var n=t.getType(),i=(0,QC[n])(t),r=WC[n];if("function"==typeof t.getFlatCoordinates){var e=function(t){var n=t.getLayout(),i="";return n!==At&&n!==Ct||(i+="Z"),n!==Pt&&n!==Ct||(i+="M"),i}(t);e.length>0&&(r+=" "+e)}return 0===i.length?r+" "+FC:r+"("+i+")"}var nk=$C,ik=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rk=[null,"http://www.opengis.net/wms"],ek=sc(rk,{Service:tc((function(t,n){return ac({},uk,t,n)})),Capability:tc((function(t,n){return ac({},ok,t,n)}))}),ok=sc(rk,{Request:tc((function(t,n){return ac({},pk,t,n)})),Exception:tc((function(t,n){return ac([],ck,t,n)})),Layer:tc((function(t,n){var i=ac({},lk,t,n);if(void 0===i.Layer)return Object.assign(i,Mk(t,n));return i}))}),sk=function(t){function n(){var n=t.call(this)||this;return n.version=void 0,n}return ik(n,t),n.prototype.readFromNode=function(t){this.version=t.getAttribute("version").trim();var n=ac({version:this.version},ek,t,[]);return n||null},n}(VT),uk=sc(rk,{Name:tc(xO),Title:tc(xO),Abstract:tc(xO),KeywordList:tc(jk),OnlineResource:tc(WT),ContactInformation:tc((function(t,n){return ac({},ak,t,n)})),Fees:tc(xO),AccessConstraints:tc(xO),LayerLimit:tc(gO),MaxWidth:tc(gO),MaxHeight:tc(gO)}),ak=sc(rk,{ContactPersonPrimary:tc((function(t,n){return ac({},hk,t,n)})),ContactPosition:tc(xO),ContactAddress:tc((function(t,n){return ac({},fk,t,n)})),ContactVoiceTelephone:tc(xO),ContactFacsimileTelephone:tc(xO),ContactElectronicMailAddress:tc(xO)}),hk=sc(rk,{ContactPerson:tc(xO),ContactOrganization:tc(xO)}),fk=sc(rk,{AddressType:tc(xO),Address:tc(xO),City:tc(xO),StateOrProvince:tc(xO),PostCode:tc(xO),Country:tc(xO)}),ck=sc(rk,{Format:Hf(xO)}),lk=sc(rk,{Name:tc(xO),Title:tc(xO),Abstract:tc(xO),KeywordList:tc(jk),CRS:Qf(xO),EX_GeographicBoundingBox:tc((function(t,n){var i=ac({},dk,t,n);if(!i)return;var r=i.westBoundLongitude,e=i.southBoundLatitude,o=i.eastBoundLongitude,s=i.northBoundLatitude;if(void 0===r||void 0===e||void 0===o||void 0===s)return;return[r,e,o,s]})),BoundingBox:Qf((function(t,n){var i=[wO(t.getAttribute("minx")),wO(t.getAttribute("miny")),wO(t.getAttribute("maxx")),wO(t.getAttribute("maxy"))],r=[wO(t.getAttribute("resx")),wO(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:r}})),Dimension:Qf((function(t,n){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:pO(t.getAttribute("multipleValues")),nearestValue:pO(t.getAttribute("nearestValue")),current:pO(t.getAttribute("current")),values:xO(t)}})),Attribution:tc((function(t,n){return ac({},vk,t,n)})),AuthorityURL:Qf((function(t,n){var i=_k(t,n);if(i)return i.name=t.getAttribute("name"),i;return})),Identifier:Qf(xO),MetadataURL:Qf((function(t,n){var i=_k(t,n);if(i)return i.type=t.getAttribute("type"),i;return})),DataURL:Qf(_k),FeatureListURL:Qf(_k),Style:Qf((function(t,n){return ac({},gk,t,n)})),MinScaleDenominator:tc(mO),MaxScaleDenominator:tc(mO),Layer:Qf(Mk)}),vk=sc(rk,{Title:tc(xO),OnlineResource:tc(WT),LogoURL:tc(Ok)}),dk=sc(rk,{westBoundLongitude:tc(mO),eastBoundLongitude:tc(mO),southBoundLatitude:tc(mO),northBoundLatitude:tc(mO)}),pk=sc(rk,{GetCapabilities:tc(Sk),GetMap:tc(Sk),GetFeatureInfo:tc(Sk)}),yk=sc(rk,{Format:Qf(xO),DCPType:Qf((function(t,n){return ac({},mk,t,n)}))}),mk=sc(rk,{HTTP:tc((function(t,n){return ac({},wk,t,n)}))}),wk=sc(rk,{Get:tc(_k),Post:tc(_k)}),gk=sc(rk,{Name:tc(xO),Title:tc(xO),Abstract:tc(xO),LegendURL:Qf(Ok),StyleSheetURL:tc(_k),StyleURL:tc(_k)}),bk=sc(rk,{Format:tc(xO),OnlineResource:tc(WT)}),xk=sc(rk,{Keyword:Hf(xO)});function Mk(t,n){var i=n[n.length-1],r=ac({},lk,t,n);if(r){var e=pO(t.getAttribute("queryable"));void 0===e&&(e=i.queryable),r.queryable=void 0!==e&&e;var o=bO(t.getAttribute("cascaded"));void 0===o&&(o=i.cascaded),r.cascaded=o;var s=pO(t.getAttribute("opaque"));void 0===s&&(s=i.opaque),r.opaque=void 0!==s&&s;var u=pO(t.getAttribute("noSubsets"));void 0===u&&(u=i.noSubsets),r.noSubsets=void 0!==u&&u;var a=wO(t.getAttribute("fixedWidth"));a||(a=i.fixedWidth),r.fixedWidth=a;var h=wO(t.getAttribute("fixedHeight"));h||(h=i.fixedHeight),r.fixedHeight=h;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in i){var n=r[t]||[];r[t]=n.concat(i[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in r)){var n=i[t];r[t]=n}})),r}}function _k(t,n){return ac({},bk,t,n)}function Sk(t,n){return ac({},yk,t,n)}function Ok(t,n){var i=_k(t,n);if(i){var r=[bO(t.getAttribute("width")),bO(t.getAttribute("height"))];return i.size=r,i}}function jk(t,n){return ac([],xk,t,n)}var Ek=sk,Tk=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ak=function(t){function n(n){var i=t.call(this)||this,r=n||{};return i.Gy="http://mapserver.gis.umn.edu/mapserver",i.Dy=new CO,i.Uh=r.layers?r.layers:null,i}return Tk(n,t),n.prototype.getLayers=function(){return this.Uh},n.prototype.setLayers=function(t){this.Uh=t},n.prototype.zm=function(t,n){t.setAttribute("namespaceURI",this.Gy);var i=t.localName,r=[];if(0===t.childNodes.length)return r;if("msGMLOutput"==i)for(var e=0,o=t.childNodes.length;e<o;e++){var s=t.childNodes[e];if(s.nodeType===Node.ELEMENT_NODE){var u=s,a=n[0],h=u.localName.replace("_layer","");if(!this.Uh||y(this.Uh,h)){var f=h+"_feature";a.featureType=f,a.featureNS=this.Gy;var c={};c[f]=Hf(this.Dy.readFeatureElement,this.Dy);var l=sc([a.featureNS,null],c);u.setAttribute("namespaceURI",this.Gy);var v=ac([],l,u,n,this.Dy);v&&g(r,v)}}}if("FeatureCollection"==i){var d=ac([],this.Dy.FEATURE_COLLECTION_PARSERS,t,[{}],this.Dy);d&&(r=d)}return r},n.prototype.readFeaturesFromNode=function(t,n){var i={};return n&&A(i,this.getReadOptions(t,n)),this.zm(t,[i])},n}(aO),Pk=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ck=[null,"http://www.opengis.net/wmts/1.0"],kk=[null,"http://www.opengis.net/ows/1.1"],Ik=sc(Ck,{Contents:tc((function(t,n){return ac({},Lk,t,n)}))}),Nk=function(t){function n(){var n=t.call(this)||this;return n.Rm=new fA,n}return Pk(n,t),n.prototype.readFromNode=function(t){var n=t.getAttribute("version");n&&(n=n.trim());var i=this.Rm.readFromNode(t);return i?(i.version=n,(i=ac(i,Ik,t,[]))||null):null},n}(VT),Lk=sc(Ck,{Layer:Qf((function(t,n){return ac({},zk,t,n)})),TileMatrixSet:Qf((function(t,n){return ac({},Bk,t,n)}))}),zk=sc(Ck,{Style:Qf((function(t,n){var i=ac({},Rk,t,n);if(!i)return;var r="true"===t.getAttribute("isDefault");return i.isDefault=r,i})),Format:Qf(xO),TileMatrixSetLink:Qf((function(t,n){return ac({},Fk,t,n)})),Dimension:Qf((function(t,n){return ac({},qk,t,n)})),ResourceURL:Qf((function(t,n){var i=t.getAttribute("format"),r=t.getAttribute("template"),e=t.getAttribute("resourceType"),o={};i&&(o.format=i);r&&(o.template=r);e&&(o.resourceType=e);return o}))},sc(kk,{Title:tc(xO),Abstract:tc(xO),WGS84BoundingBox:tc(Vk),Identifier:tc(xO)})),Rk=sc(Ck,{LegendURL:Qf((function(t,n){var i={};return i.format=t.getAttribute("format"),i.href=WT(t),i}))},sc(kk,{Title:tc(xO),Identifier:tc(xO)})),Fk=sc(Ck,{TileMatrixSet:tc(xO),TileMatrixSetLimits:tc((function(t,n){return ac([],Gk,t,n)}))}),Gk=sc(Ck,{TileMatrixLimits:Hf((function(t,n){return ac({},Dk,t,n)}))}),Dk=sc(Ck,{TileMatrix:tc(xO),MinTileRow:tc(gO),MaxTileRow:tc(gO),MinTileCol:tc(gO),MaxTileCol:tc(gO)}),qk=sc(Ck,{Default:tc(xO),Value:Qf(xO)},sc(kk,{Identifier:tc(xO)})),Uk=sc(kk,{LowerCorner:Hf(Wk),UpperCorner:Hf(Wk)}),Bk=sc(Ck,{WellKnownScaleSet:tc(xO),TileMatrix:Qf((function(t,n){return ac({},Xk,t,n)}))},sc(kk,{SupportedCRS:tc(xO),Identifier:tc(xO),BoundingBox:tc(Vk)})),Xk=sc(Ck,{TopLeftCorner:tc(Wk),ScaleDenominator:tc(mO),TileWidth:tc(gO),TileHeight:tc(gO),MatrixWidth:tc(gO),MatrixHeight:tc(gO)},sc(kk,{Identifier:tc(xO)}));function Vk(t,n){var i=ac([],Uk,t,n);if(2==i.length)return yn(i)}function Wk(t,n){var i=xO(t).split(/\s+/);if(i&&2==i.length){var r=+i[0],e=+i[1];if(!isNaN(r)&&!isNaN(e))return[r,e]}}var Yk=Nk,Zk=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),$k=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],Kk="enterfullscreen",Hk="leavefullscreen";function Jk(t){var n=t.body;return!!(n.webkitRequestFullscreen||n.msRequestFullscreen&&t.msFullscreenEnabled||n.requestFullscreen&&t.fullscreenEnabled)}function Qk(t){return!!(t.webkitIsFullScreen||t.msFullscreenElement||t.fullscreenElement)}function tI(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var nI=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),target:r.target})||this).on,i.once,i.un,i.nf=void 0!==r.keys&&r.keys,i._v=r.source,i.Fm=!1,i.Gm=i.Dm.bind(i),i.qm=void 0!==r.className?r.className:"ol-full-screen",i.Um=[],i.Bm=void 0!==r.activeClassName?r.activeClassName.split(" "):[i.qm+"-true"],i.Xm=void 0!==r.inactiveClassName?r.inactiveClassName.split(" "):[i.qm+"-false"];var e=void 0!==r.label?r.label:"⤢";i.Vm="string"==typeof e?document.createTextNode(e):e;var o=void 0!==r.labelActive?r.labelActive:"×";i.Wm="string"==typeof o?document.createTextNode(o):o;var s=r.tipLabel?r.tipLabel:"Toggle full-screen";return i.Ym=document.createElement("button"),i.Ym.title=s,i.Ym.setAttribute("type","button"),i.Ym.appendChild(i.Vm),i.Ym.addEventListener(F,i.kr.bind(i),!1),i.Zm(i.Ym,i.Fm),i.element.className="".concat(i.qm," ").concat(bs," ").concat(Ms),i.element.appendChild(i.Ym),i}return Zk(n,t),n.prototype.kr=function(t){t.preventDefault(),this.$m()},n.prototype.$m=function(){var t=this.getMap();if(t){var n=t.getOwnerDocument();if(Jk(n))if(Qk(n))!function(t){t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()}(n);else{var i=void 0;i=this._v?"string"==typeof this._v?n.getElementById(this._v):this._v:t.getTargetElement(),this.nf?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():tI(t)}(i):tI(i)}}},n.prototype.Km=function(){var t=this.getMap();if(t){var n=this.Fm;this.Fm=Qk(t.getOwnerDocument()),n!==this.Fm&&(this.Zm(this.Ym,this.Fm),this.Fm?(Eo(this.Wm,this.Vm),this.dispatchEvent(Kk)):(Eo(this.Vm,this.Wm),this.dispatchEvent(Hk)),t.updateSize())}},n.prototype.Zm=function(t,n){var i,r,e,o;n?((i=t.classList).remove.apply(i,this.Xm),(r=t.classList).add.apply(r,this.Bm)):((e=t.classList).remove.apply(e,this.Bm),(o=t.classList).add.apply(o,this.Xm))},n.prototype.setMap=function(n){var i=this.getMap();i&&i.removeChangeListener(bu,this.Gm),t.prototype.setMap.call(this,n),this.Dm(),n&&n.addChangeListener(bu,this.Gm)},n.prototype.Dm=function(){for(var t=this.Um,n=0,i=t.length;n<i;++n)H(t[n]);t.length=0;var r=this.getMap();if(r){var e=r.getOwnerDocument();Jk(e)?this.element.classList.remove(xs):this.element.classList.add(xs);for(n=0,i=$k.length;n<i;++n)t.push($(e,$k[n],this.Km,this));this.Km()}},n}(oa),iI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rI="projection",eI="coordinateFormat",oI=function(t){function n(n){var i=this,r=n||{},e=document.createElement("div");e.className=void 0!==r.className?r.className:"ol-mouse-position",(i=t.call(this,{element:e,render:r.render,target:r.target})||this).on,i.once,i.un,i.addChangeListener(rI,i.Tt),r.coordinateFormat&&i.setCoordinateFormat(r.coordinateFormat),r.projection&&i.setProjection(r.projection);var o=!0,s="&#160;";return"undefinedHTML"in r?(void 0!==r.undefinedHTML&&(s=r.undefinedHTML),o=!!s):"placeholder"in r&&(!1===r.placeholder?o=!1:s=String(r.placeholder)),i.Hm=s,i.Jm=o,i.Qm=e.innerHTML,i.tw=null,i.jt=null,i}return iI(n,t),n.prototype.Tt=function(){this.jt=null},n.prototype.getCoordinateFormat=function(){return this.get(eI)},n.prototype.getProjection=function(){return this.get(rI)},n.prototype.handleMouseMove=function(t){var n=this.getMap();this.nw(n.getEventPixel(t))},n.prototype.handleMouseOut=function(t){this.nw(null)},n.prototype.setMap=function(n){if(t.prototype.setMap.call(this,n),n){var i=n.getViewport();this.listenerKeys.push($(i,uu,this.handleMouseMove,this)),this.Jm&&this.listenerKeys.push($(i,fu,this.handleMouseOut,this)),this.nw(null)}},n.prototype.setCoordinateFormat=function(t){this.set(eI,t)},n.prototype.setProjection=function(t){this.set(rI,yr(t))},n.prototype.nw=function(t){var n=this.Hm;if(t&&this.tw){if(!this.jt){var i=this.getProjection();this.jt=i?Or(this.tw,i):vr}var r=this.getMap().getCoordinateFromPixelInternal(t);if(r){var e=Cr();e&&(this.jt=Or(this.tw,e)),this.jt(r,r);var o=this.getCoordinateFormat();n=o?o(r):r.toString()}}this.Qm&&n===this.Qm||(this.element.innerHTML=n,this.Qm=n)},n.prototype.render=function(t){var n=t.frameState;n?this.tw!=n.viewState.projection&&(this.tw=n.viewState.projection,this.jt=null):this.tw=null},n}(oa),sI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),uI=.75,aI=.1,hI=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return sI(n,t),n.prototype.createRenderer=function(){return new Hs(this)},n}(ra),fI=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).iw=i.rw.bind(i),i.Sr=void 0===r.collapsed||r.collapsed,i.Tr=void 0===r.collapsible||r.collapsible,i.Tr||(i.Sr=!1),i.su=void 0!==r.rotateWithView&&r.rotateWithView,i.ew=void 0;var e=void 0!==r.className?r.className:"ol-overviewmap",o=void 0!==r.tipLabel?r.tipLabel:"Overview map",s=void 0!==r.collapseLabel?r.collapseLabel:"";"string"==typeof s?(i.Ar=document.createElement("span"),i.Ar.textContent=s):i.Ar=s;var u=void 0!==r.label?r.label:"";"string"==typeof u?(i.Pr=document.createElement("span"),i.Pr.textContent=u):i.Pr=u;var a=i.Tr&&!i.Sr?i.Ar:i.Pr,h=document.createElement("button");h.setAttribute("type","button"),h.title=o,h.appendChild(a),h.addEventListener(F,i.kr.bind(i),!1),i.ow=document.createElement("div"),i.ow.className="ol-overviewmap-map",i.Uy=r.view,i.sw=new hI({view:r.view});var f=i.sw;r.layers&&r.layers.forEach((function(t){f.addLayer(t)}));var c=document.createElement("div");c.className="ol-overviewmap-box",c.style.boxSizing="border-box",i.uw=new _h({position:[0,0],positioning:"center-center",element:c}),i.sw.addOverlay(i.uw);var l=e+" "+"ol-unselectable "+Ms+(i.Sr&&i.Tr?" ol-collapsed":"")+(i.Tr?"":" ol-uncollapsible"),v=i.element;v.className=l,v.appendChild(i.ow),v.appendChild(h);var d=i,p=i.uw,y=i.uw.getElement(),m=function(t){var n,i={clientX:(n=t).clientX,clientY:n.clientY},r=f.getEventCoordinateInternal(i);p.setPosition(r)},w=function(t){var n=f.getEventCoordinateInternal(t);d.getMap().getView().setCenterInternal(n),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",w)};return y.addEventListener("mousedown",(function(){window.addEventListener("mousemove",m),window.addEventListener("mouseup",w)})),i}return sI(n,t),n.prototype.setMap=function(n){var i=this.getMap();if(n!==i){if(i){var r=i.getView();r&&this.aw(r),this.sw.setTarget(null)}if(t.prototype.setMap.call(this,n),n){this.sw.setTarget(this.ow),this.listenerKeys.push($(n,l,this.hw,this));var e=n.getView();e&&(this.fw(e),e.isDef()&&(this.sw.updateSize(),this.cw())),this.sw.isRendered()||this.lw()}}},n.prototype.hw=function(t){if(t.key===xu){var n=t.oldValue;n&&this.aw(n);var i=this.getMap().getView();this.fw(i)}else this.sw.isRendered()||t.key!==bu&&t.key!==gu||this.sw.updateSize()},n.prototype.fw=function(t){if(!this.Uy){var n=new $u({projection:t.getProjection()});this.sw.setView(n)}t.addChangeListener(Au.ROTATION,this.iw),this.rw()},n.prototype.aw=function(t){t.removeChangeListener(Au.ROTATION,this.iw)},n.prototype.rw=function(){this.su&&this.sw.getView().setRotation(this.getMap().getView().getRotation())},n.prototype.dw=function(){var t=this.getMap(),n=this.sw;if(t.isRendered()&&n.isRendered()){var i=t.getSize(),r=t.getView().calculateExtentInternal(i);if(!this.ew||!An(r,this.ew)){this.ew=r;var e=n.getSize(),o=n.getView().calculateExtentInternal(e),s=n.getPixelFromCoordinateInternal(Yn(r)),u=n.getPixelFromCoordinateInternal(Dn(r)),a=Math.abs(s[0]-u[0]),h=Math.abs(s[1]-u[1]),f=e[0],c=e[1];a<f*aI||h<c*aI||a>f*uI||h>c*uI?this.cw():xn(o,r)||this.pw()}}},n.prototype.cw=function(){var t=this.getMap(),n=this.sw,i=t.getSize(),r=t.getView().calculateExtentInternal(i),e=n.getView(),o=Math.log(7.5)/Math.LN2;Qn(r,1/(Math.pow(2,o/2)*aI)),e.fitInternal(Ze(r))},n.prototype.pw=function(){var t=this.getMap(),n=this.sw,i=t.getView();n.getView().setCenterInternal(i.getCenterInternal())},n.prototype.yw=function(){var t=this.getMap(),n=this.sw;if(t.isRendered()&&n.isRendered()){var i=t.getSize(),r=t.getView(),e=n.getView(),o=this.su?0:-r.getRotation(),s=this.uw,u=this.uw.getElement(),a=r.getCenterInternal(),h=r.getResolution(),f=e.getResolution(),c=i[0]*h/f,l=i[1]*h/f;if(s.setPosition(a),u){u.style.width=c+"px",u.style.height=l+"px";var v="rotate("+o+"rad)";u.style.transform=v}}},n.prototype.lw=function(){this.mw||(this.mw=K(this.sw,vu,(function(t){delete this.mw,this.yw()}),this))},n.prototype.kr=function(t){t.preventDefault(),this.zr()},n.prototype.zr=function(){this.element.classList.toggle(_s),this.Sr?Eo(this.Ar,this.Pr):Eo(this.Pr,this.Ar),this.Sr=!this.Sr;var t=this.sw;if(!this.Sr){if(t.isRendered())return this.ew=void 0,void t.render();t.updateSize(),this.cw(),this.lw()}},n.prototype.getCollapsible=function(){return this.Tr},n.prototype.setCollapsible=function(t){this.Tr!==t&&(this.Tr=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.Sr&&this.zr())},n.prototype.setCollapsed=function(t){this.Tr&&this.Sr!==t&&this.zr()},n.prototype.getCollapsed=function(){return this.Sr},n.prototype.getRotateWithView=function(){return this.su},n.prototype.setRotateWithView=function(t){this.su!==t&&(this.su=t,0!==this.getMap().getView().getRotation()&&(this.su?this.rw():this.sw.getView().setRotation(0),this.ew=void 0,this.dw(),this.yw()))},n.prototype.getOverviewMap=function(){return this.sw},n.prototype.render=function(t){this.dw(),this.yw()},n}(oa),cI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),lI="units",vI="degrees",dI="imperial",pI="nautical",yI="metric",mI="us",wI=[1,2,5],gI=25.4/.28,bI=function(t){function n(n){var i=this,r=n||{},e=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,i.once,i.un,i.ww=document.createElement("div"),i.ww.className=e+"-inner",i.element.className=e+" "+bs,i.element.appendChild(i.ww),i.gw=null,i.bw=void 0!==r.minWidth?r.minWidth:64,i.xw=r.maxWidth,i.mn=!1,i.Mw=void 0,i.Qm="",i.addChangeListener(lI,i._w),i.setUnits(r.units||yI),i.Sw=r.bar||!1,i.Ow=r.steps||4,i.jw=r.text||!1,i.Ew=r.dpi||void 0,i}return cI(n,t),n.prototype.getUnits=function(){return this.get(lI)},n.prototype._w=function(){this.Lr()},n.prototype.setUnits=function(t){this.set(lI,t)},n.prototype.setDpi=function(t){this.Ew=t},n.prototype.Lr=function(){var t=this.gw;if(t){var n=t.center,i=t.projection,r=this.getUnits(),e=r==vI?Rt.DEGREES:Rt.METERS,o=mr(i,t.resolution,n,e),s=this.bw*(this.Ew||gI)/gI,u=void 0!==this.xw?this.xw*(this.Ew||gI)/gI:void 0,a=s*o,h="";if(r==vI){var f=Lt[Rt.DEGREES];(a*=f)<f/60?(h="″",o*=3600):a<f?(h="",o*=60):h="°"}else r==dI?a<.9144?(h="in",o/=.0254):a<1609.344?(h="ft",o/=.3048):(h="mi",o/=1609.344):r==pI?(o/=1852,h="NM"):r==yI?a<.001?(h="μm",o*=1e6):a<1?(h="mm",o*=1e3):a<1e3?h="m":(h="km",o/=1e3):r==mI?a<.9144?(h="in",o*=39.37):a<1609.344?(h="ft",o/=.30480061):(h="mi",o/=1609.3472):St(!1,33);for(var c,l,v,d,p,y,m,w=3*Math.floor(Math.log(s*o)/Math.log(10));;){v=Math.floor(w/3);var g=Math.pow(10,v);if(c=wI[(w%3+3)%3]*g,l=Math.round(c/o),isNaN(l))return this.element.style.display="none",void(this.mn=!1);if(void 0!==u&&l>=u){c=d,l=p,v=y;break}if(l>=s)break;d=c,p=l,y=v,++w}m=this.Sw?this.createScaleBar(l,c,h):c.toFixed(v<0?-v:0)+" "+h,this.Qm!=m&&(this.ww.innerHTML=m,this.Qm=m),this.Mw!=l&&(this.ww.style.width=l+"px",this.Mw=l),this.mn||(this.element.style.display="",this.mn=!0)}else this.mn&&(this.element.style.display="none",this.mn=!1)},n.prototype.createScaleBar=function(t,n,i){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),e=[],o=t/this.Ow,s="ol-scale-singlebar-odd",u=0;u<this.Ow;u++)0===u&&e.push(this.createMarker("absolute",u)),e.push('<div><div class="ol-scale-singlebar '+s+'" style="width: '+o+'px;"></div>'+this.createMarker("relative",u)+(u%2==0||2===this.Ow?this.createStepText(u,t,!1,n,i):"")+"</div>"),u===this.Ow-1&&e.push(this.createStepText(u+1,t,!0,n,i)),s="ol-scale-singlebar-odd"===s?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'<div style="display: flex;">'+(this.jw?'<div class="ol-scale-text" style="width: '+t+'px;">'+r+"</div>":"")+e.join("")+"</div>"},n.prototype.createMarker=function(t,n){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},n.prototype.createStepText=function(t,n,i,r,e){var o=(0===t?0:Math.round(r/this.Ow*t*100)/100)+(0===t?"":" "+e);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:n/this.Ow*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:n/this.Ow*2)+"px;left: "+(i?n+"px":"unset")+';">'+o+"</div>"},n.prototype.getScaleForResolution=function(){var t=mr(this.gw.projection,this.gw.resolution,this.gw.center,Rt.METERS),n=this.Ew||gI;return parseFloat(t.toString())*(1e3/25.4)*n},n.prototype.render=function(t){var n=t.frameState;this.gw=n?n.viewState:null,this.Lr()},n}(oa),xI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),MI=0,_I=1,SI=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),render:r.render})||this).kn=[],i.Tw=void 0,i.Aw=MI,i.Cn,i.Pw=0,i.Cw=0,i.kw,i.Iw,i.Nw=null,i.Lw=!1,i.Fr=void 0!==r.duration?r.duration:200;var e=void 0!==r.className?r.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=e+"-thumb "+bs;var s=i.element;return s.className=e+" "+"ol-unselectable "+Ms,s.appendChild(o),s.addEventListener(au,i.zw.bind(i),!1),s.addEventListener(uu,i.Rw.bind(i),!1),s.addEventListener(hu,i.Fw.bind(i),!1),s.addEventListener(F,i.Gw.bind(i),!1),o.addEventListener(F,f,!1),i}return xI(n,t),n.prototype.setMap=function(n){t.prototype.setMap.call(this,n),n&&n.render()},n.prototype.Dw=function(){var t=this.element,n=t.offsetWidth,i=t.offsetHeight;if(0===n&&0===i)return this.Lw=!1;var r=getComputedStyle(t);n-=parseFloat(r.paddingRight)+parseFloat(r.paddingLeft),i-=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);var e=t.firstElementChild,o=getComputedStyle(e),s=e.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),u=e.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);return this.Nw=[s,u],n>i?(this.Aw=_I,this.Cw=n-s):(this.Aw=MI,this.Pw=i-u),this.Lw=!0},n.prototype.Gw=function(t){var n=this.getMap().getView(),i=this.qw(t.offsetX-this.Nw[0]/2,t.offsetY-this.Nw[1]/2),r=this.Uw(i),e=n.getConstrainedZoom(n.getZoomForResolution(r));n.animateInternal({zoom:e,duration:this.Fr,easing:mt})},n.prototype.zw=function(t){if(!this.Cn&&t.target===this.element.firstElementChild){var n=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.kw=t.clientX-parseFloat(n.style.left),this.Iw=t.clientY-parseFloat(n.style.top),this.Cn=!0,0===this.kn.length){var i=this.Rw,r=this.Fw,e=this.getMap().getOwnerDocument();this.kn.push($(e,uu,i,this),$(e,hu,r,this))}}},n.prototype.Rw=function(t){if(this.Cn){var n=t.clientX-this.kw,i=t.clientY-this.Iw,r=this.qw(n,i);this.Tw=this.Uw(r),this.getMap().getView().setResolution(this.Tw)}},n.prototype.Fw=function(t){this.Cn&&(this.getMap().getView().endInteraction(),this.Cn=!1,this.kw=void 0,this.Iw=void 0,this.kn.forEach(H),this.kn.length=0)},n.prototype.Bw=function(t){var n=this.Xw(t),i=this.element.firstElementChild;this.Aw==_I?i.style.left=this.Cw*n+"px":i.style.top=this.Pw*n+"px"},n.prototype.qw=function(t,n){return oi(this.Aw===_I?t/this.Cw:n/this.Pw,0,1)},n.prototype.Uw=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},n.prototype.Xw=function(t){return oi(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)},n.prototype.render=function(t){if(t.frameState&&(this.Lw||this.Dw())){var n=t.frameState.viewState.resolution;this.Tw=n,this.Bw(n)}},n}(oa),OI=function(){var t=function(n,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(n,i)};return function(n,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=n}t(n,i),n.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),jI=function(t){function n(n){var i=this,r=n||{};(i=t.call(this,{element:document.createElement("div"),target:r.target})||this).extent=r.extent?r.extent:null;var e=void 0!==r.className?r.className:"ol-zoom-extent",o=void 0!==r.label?r.label:"E",s=void 0!==r.tipLabel?r.tipLabel:"Fit to extent",u=document.createElement("button");u.setAttribute("type","button"),u.title=s,u.appendChild("string"==typeof o?document.createTextNode(o):o),u.addEventListener(F,i.kr.bind(i),!1);var a=e+" "+"ol-unselectable "+Ms,h=i.element;return h.className=a,h.appendChild(u),i}return OI(n,t),n.prototype.kr=function(t){t.preventDefault(),this.handleZoomToExtent()},n.prototype.handleZoomToExtent=function(){var t=this.getMap().getView(),n=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(Ze(n))},n}(oa),EI={};EI.AssertionError=h,EI.Collection=ft,EI.Collection.CollectionEvent=ht,EI.DataTile=_t,EI.Disposable=v,EI.Feature=Et,EI.Feature.createStyleFunction=jt,EI.Geolocation=ho,EI.Image=bo,EI.Image.listenImage=go,EI.ImageBase=co,EI.ImageCanvas=Mo,EI.ImageTile=ko,EI.Kinetic=Io,EI.Map=yh,EI.MapBrowserEvent=ou,EI.MapBrowserEventHandler=lu,EI.MapEvent=ru,EI.Object=et,EI.Object.ObjectEvent=rt,EI.Observable=nt,EI.Observable.unByKey=tt,EI.Overlay=_h,EI.PluggableMap=ra,EI.Tile=xt,EI.TileCache=Ih,EI.TileQueue=Ou,EI.TileQueue.getTilePriority=ju,EI.TileRange=zh,EI.TileRange.createOrUpdate=Lh,EI.VectorRenderTile=Gh,EI.VectorTile=qh,EI.View=$u,EI.View.createCenterConstraint=Xu,EI.View.createResolutionConstraint=Vu,EI.View.createRotationConstraint=Wu,EI.View.isNoopAnimation=Yu,EI.array={},EI.array.binarySearch=d,EI.array.equals=x,EI.array.extend=g,EI.array.find=b,EI.array.findIndex=M,EI.array.includes=y,EI.array.isSorted=_,EI.array.linearFindNearest=m,EI.array.numberSafeCompareFunction=p,EI.array.remove=function(t,n){var i=t.indexOf(n),r=i>-1;return r&&t.splice(i,1),r},EI.array.reverseSubArray=w,EI.array.stableSort=function(t,n){var i,r=t.length,e=Array(t.length);for(i=0;i<r;i++)e[i]={index:i,value:t[i]};for(e.sort((function(t,i){return n(t.value,i.value)||t.index-i.index})),i=0;i<t.length;i++)t[i]=e[i].value},EI.asserts={},EI.asserts.assert=St,EI.centerconstraint={},EI.centerconstraint.createExtent=Cu,EI.centerconstraint.none=ku,EI.color={},EI.color.asArray=Go,EI.color.asString=zo,EI.color.fromString=Fo,EI.color.isStringColor=Uo,EI.color.normalize=Do,EI.color.toString=qo,EI.colorlike={},EI.colorlike.asColorLike=Uh,EI.control={},EI.control.Attribution=ua,EI.control.Control=oa,EI.control.FullScreen=nI,EI.control.MousePosition=oI,EI.control.OverviewMap=fI,EI.control.Rotate=ha,EI.control.ScaleLine=bI,EI.control.Zoom=ca,EI.control.ZoomSlider=SI,EI.control.ZoomToExtent=jI,EI.control.defaults=la,EI.coordinate={},EI.coordinate.add=Vi,EI.coordinate.closestOnCircle=Wi,EI.coordinate.closestOnSegment=Yi,EI.coordinate.createStringXY=function(t){return function(n){return ir(n,t)}},EI.coordinate.degreesToStringHDMS=Zi,EI.coordinate.distance=tr,EI.coordinate.equals=Ki,EI.coordinate.format=$i,EI.coordinate.getWorldsAway=er,EI.coordinate.rotate=Hi,EI.coordinate.scale=Ji,EI.coordinate.squaredDistance=Qi,EI.coordinate.squaredDistanceToSegment=nr,EI.coordinate.toStringHDMS=function(t,n){return t?Zi("NS",t[1],n)+" "+Zi("EW",t[0],n):""},EI.coordinate.toStringXY=ir,EI.coordinate.wrapX=rr,EI.css={},EI.css.CLASS_COLLAPSED=_s,EI.css.CLASS_CONTROL=Ms,EI.css.CLASS_HIDDEN=ws,EI.css.CLASS_SELECTABLE=gs,EI.css.CLASS_UNSELECTABLE=bs,EI.css.CLASS_UNSUPPORTED=xs,EI.css.getFontParameters=js,EI.dom={},EI.dom.createCanvasContext2D=_o,EI.dom.outerHeight=jo,EI.dom.outerWidth=Oo,EI.dom.releaseCanvas=So,EI.dom.removeChildren=Ao,EI.dom.removeNode=To,EI.dom.replaceChildren=Po,EI.dom.replaceNode=Eo,EI.easing={},EI.easing.easeIn=yt,EI.easing.easeOut=mt,EI.easing.inAndOut=wt,EI.easing.linear=gt,EI.easing.upAndDown=function(t){return t<.5?wt(2*t):1-wt(2*(t-.5))},EI.events={},EI.events.Event=c,EI.events.Event.preventDefault=function(t){t.preventDefault()},EI.events.Event.stopPropagation=f,EI.events.Target=N,EI.events.condition={},EI.events.condition.all=_a,EI.events.condition.altKeyOnly=Sa,EI.events.condition.altShiftKeysOnly=Oa,EI.events.condition.always=Ta,EI.events.condition.click=function(t){return t.type==su.CLICK},EI.events.condition.doubleClick=function(t){return t.type==su.DBLCLICK},EI.events.condition.focus=ja,EI.events.condition.focusWithTabindex=Ea,EI.events.condition.mouseActionButton=Aa,EI.events.condition.mouseOnly=La,EI.events.condition.never=Pa,EI.events.condition.noModifierKeys=ka,EI.events.condition.penOnly=function(t){var n=t.originalEvent;return St(void 0!==n,56),"pen"===n.pointerType},EI.events.condition.platformModifierKeyOnly=function(t){var n=t.originalEvent;return!n.altKey&&(Bt?n.metaKey:n.ctrlKey)&&!n.shiftKey},EI.events.condition.pointerMove=function(t){return"pointermove"==t.type},EI.events.condition.primaryAction=za,EI.events.condition.shiftKeyOnly=Ia,EI.events.condition.singleClick=Ca,EI.events.condition.targetNotEditable=Na,EI.events.condition.touchOnly=function(t){var n=t.originalEvent;return St(void 0!==n,56),"touch"===n.pointerType},EI.events.listen=$,EI.events.listenOnce=K,EI.events.unlistenByKey=H,EI.extent={},EI.extent.applyTransform=ni,EI.extent.approximatelyEquals=Pn,EI.extent.boundingExtent=yn,EI.extent.buffer=mn,EI.extent.clone=wn,EI.extent.closestSquaredDistanceXY=gn,EI.extent.containsCoordinate=bn,EI.extent.containsExtent=xn,EI.extent.containsXY=Mn,EI.extent.coordinateRelationship=_n,EI.extent.createEmpty=Sn,EI.extent.createOrUpdate=On,EI.extent.createOrUpdateEmpty=jn,EI.extent.createOrUpdateFromCoordinate=En,EI.extent.createOrUpdateFromCoordinates=function(t,n){return In(jn(n),t)},EI.extent.createOrUpdateFromFlatCoordinates=Tn,EI.extent.createOrUpdateFromRings=function(t,n){return Ln(jn(n),t)},EI.extent.equals=An,EI.extent.extend=Cn,EI.extent.extendCoordinate=kn,EI.extent.extendCoordinates=In,EI.extent.extendFlatCoordinates=Nn,EI.extent.extendRings=Ln,EI.extent.extendXY=zn,EI.extent.forEachCorner=Rn,EI.extent.getArea=Fn,EI.extent.getBottomLeft=Gn,EI.extent.getBottomRight=Dn,EI.extent.getCenter=qn,EI.extent.getCorner=Un,EI.extent.getEnlargedArea=function(t,n){var i=Math.min(t[0],n[0]),r=Math.min(t[1],n[1]);return(Math.max(t[2],n[2])-i)*(Math.max(t[3],n[3])-r)},EI.extent.getForViewAndSize=Bn,EI.extent.getHeight=Vn,EI.extent.getIntersection=Wn,EI.extent.getIntersectionArea=function(t,n){return Fn(Wn(t,n))},EI.extent.getMargin=function(t){return $n(t)+Vn(t)},EI.extent.getRotatedViewport=Xn,EI.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},EI.extent.getTopLeft=Yn,EI.extent.getTopRight=Zn,EI.extent.getWidth=$n,EI.extent.intersects=Kn,EI.extent.intersectsSegment=ti,EI.extent.isEmpty=Hn,EI.extent.returnOrUpdate=Jn,EI.extent.scaleFromCenter=Qn,EI.extent.wrapAndSliceX=ri,EI.extent.wrapX=ii,EI.featureloader={},EI.featureloader.loadFeaturesXhr=Xh,EI.featureloader.setWithCredentials=function(t){Bh=t},EI.featureloader.xhr=Vh,EI.format={},EI.format.EsriJSON=sO,EI.format.Feature=jg,EI.format.Feature.transformExtentWithOptions=Tg,EI.format.Feature.transformGeometryWithOptions=Eg,EI.format.GML=RO,EI.format.GML2=CO,EI.format.GML3=LO,EI.format.GML32=DO,EI.format.GMLBase=vO,EI.format.GMLBase.GMLNS=fO,EI.format.GPX=Mj,EI.format.GeoJSON=Zg,EI.format.IGC=Dj,EI.format.IIIFInfo=uy,EI.format.JSONFeature=Bg,EI.format.KML=zT,EI.format.KML.getDefaultFillStyle=function(){return Hj},EI.format.KML.getDefaultImageStyle=function(){return Qj},EI.format.KML.getDefaultStrokeStyle=function(){return nE},EI.format.KML.getDefaultStyle=function(){return rE},EI.format.KML.getDefaultStyleArray=function(){return oE},EI.format.KML.getDefaultTextStyle=function(){return iE},EI.format.KML.readFlatCoordinates=cE,EI.format.MVT=Lg,EI.format.OSMXML=XT,EI.format.OWS=fA,EI.format.Polyline=xA,EI.format.Polyline.decodeDeltas=vA,EI.format.Polyline.decodeFloats=pA,EI.format.Polyline.decodeSignedIntegers=mA,EI.format.Polyline.decodeUnsignedIntegers=gA,EI.format.Polyline.encodeDeltas=lA,EI.format.Polyline.encodeFloats=dA,EI.format.Polyline.encodeSignedIntegers=yA,EI.format.Polyline.encodeUnsignedInteger=bA,EI.format.Polyline.encodeUnsignedIntegers=wA,EI.format.TextFeature=Cj,EI.format.TopoJSON=PA,EI.format.WFS=bC,EI.format.WFS.writeFilter=function(t,n){var i=n||"1.1.0",r=Xf(gC(i),"Filter"),e={node:r};return A(e,{version:i,filter:t}),rC(r,t,[e]),r},EI.format.WKB=LC,EI.format.WKT=nk,EI.format.WMSCapabilities=Ek,EI.format.WMSGetFeatureInfo=Ak,EI.format.WMTSCapabilities=Yk,EI.format.XML=VT,EI.format.XMLFeature=aO,EI.format.filter={},EI.format.filter.And=LA,EI.format.filter.Bbox=RA,EI.format.filter.Comparison=YA,EI.format.filter.ComparisonBinary=HA,EI.format.filter.Contains=qA,EI.format.filter.DWithin=BA,EI.format.filter.Disjoint=VA,EI.format.filter.During=$A,EI.format.filter.EqualTo=QA,EI.format.filter.Filter=CA,EI.format.filter.GreaterThan=nP,EI.format.filter.GreaterThanOrEqualTo=rP,EI.format.filter.Intersects=oP,EI.format.filter.IsBetween=uP,EI.format.filter.IsLike=hP,EI.format.filter.IsNull=cP,EI.format.filter.LessThan=vP,EI.format.filter.LessThanOrEqualTo=pP,EI.format.filter.LogicalNary=IA,EI.format.filter.Not=mP,EI.format.filter.NotEqualTo=gP,EI.format.filter.Or=xP,EI.format.filter.ResourceId=_P,EI.format.filter.Spatial=GA,EI.format.filter.Within=OP,EI.format.filter.and=jP,EI.format.filter.bbox=EP,EI.format.filter.between=function(t,n,i){return new uP(t,n,i)},EI.format.filter.contains=function(t,n,i){return new qA(t,n,i)},EI.format.filter.disjoint=function(t,n,i){return new VA(t,n,i)},EI.format.filter.during=function(t,n,i){return new $A(t,n,i)},EI.format.filter.dwithin=function(t,n,i,r,e){return new BA(t,n,i,r,e)},EI.format.filter.equalTo=function(t,n,i){return new QA(t,n,i)},EI.format.filter.greaterThan=function(t,n){return new nP(t,n)},EI.format.filter.greaterThanOrEqualTo=function(t,n){return new rP(t,n)},EI.format.filter.intersects=function(t,n,i){return new oP(t,n,i)},EI.format.filter.isNull=function(t){return new cP(t)},EI.format.filter.lessThan=function(t,n){return new vP(t,n)},EI.format.filter.lessThanOrEqualTo=function(t,n){return new pP(t,n)},EI.format.filter.like=function(t,n,i,r,e,o){return new hP(t,n,i,r,e,o)},EI.format.filter.not=function(t){return new mP(t)},EI.format.filter.notEqualTo=function(t,n,i){return new gP(t,n,i)},EI.format.filter.or=function(t){var n=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(xP,n))},EI.format.filter.resourceId=function(t){return new _P(t)},EI.format.filter.within=function(t,n,i){return new OP(t,n,i)},EI.format.xlink={},EI.format.xlink.readHref=WT,EI.format.xsd={},EI.format.xsd.readBoolean=dO,EI.format.xsd.readBooleanString=pO,EI.format.xsd.readDateTime=yO,EI.format.xsd.readDecimal=mO,EI.format.xsd.readDecimalString=wO,EI.format.xsd.readNonNegativeIntegerString=bO,EI.format.xsd.readPositiveInteger=gO,EI.format.xsd.readString=xO,EI.format.xsd.writeBooleanTextNode=MO,EI.format.xsd.writeCDATASection=_O,EI.format.xsd.writeDateTimeTextNode=SO,EI.format.xsd.writeDecimalTextNode=OO,EI.format.xsd.writeNonNegativeIntegerTextNode=jO,EI.format.xsd.writeStringTextNode=EO,EI.functions={},EI.functions.FALSE=O,EI.functions.TRUE=S,EI.functions.VOID=j,EI.functions.memoizeOne=E,EI.functions.toPromise=T,EI.geom={},EI.geom.Circle=eS,EI.geom.Geometry=Wr,EI.geom.GeometryCollection=Dg,EI.geom.LineString=ng,EI.geom.LinearRing=Me,EI.geom.MultiLineString=rg,EI.geom.MultiPoint=Kw,EI.geom.MultiPolygon=sg,EI.geom.Point=Se,EI.geom.Polygon=We,EI.geom.Polygon.circular=Ye,EI.geom.Polygon.fromCircle=$e,EI.geom.Polygon.fromExtent=Ze,EI.geom.Polygon.makeRegular=Ke,EI.geom.SimpleGeometry=Kr,EI.geom.SimpleGeometry.getStrideForLayout=Zr,EI.geom.SimpleGeometry.transformGeom2D=$r,EI.geom.flat={},EI.geom.flat.area={},EI.geom.flat.area.linearRing=we,EI.geom.flat.area.linearRings=ge,EI.geom.flat.area.linearRingss=be,EI.geom.flat.center={},EI.geom.flat.center.linearRingss=eg,EI.geom.flat.closest={},EI.geom.flat.closest.arrayMaxSquaredDelta=Qr,EI.geom.flat.closest.assignClosestArrayPoint=ie,EI.geom.flat.closest.assignClosestMultiArrayPoint=re,EI.geom.flat.closest.assignClosestPoint=ne,EI.geom.flat.closest.maxSquaredDelta=Jr,EI.geom.flat.closest.multiArrayMaxSquaredDelta=te,EI.geom.flat.contains={},EI.geom.flat.contains.linearRingContainsExtent=Oe,EI.geom.flat.contains.linearRingContainsXY=je,EI.geom.flat.contains.linearRingsContainsXY=Ee,EI.geom.flat.contains.linearRingssContainsXY=Te,EI.geom.flat.deflate={},EI.geom.flat.deflate.deflateCoordinate=ee,EI.geom.flat.deflate.deflateCoordinates=oe,EI.geom.flat.deflate.deflateCoordinatesArray=se,EI.geom.flat.deflate.deflateMultiCoordinatesArray=ue,EI.geom.flat.flip={},EI.geom.flat.flip.flipXY=JS,EI.geom.flat.geodesic={},EI.geom.flat.geodesic.greatCircleArc=function(t,n,i,r,e,o){var s=yr("EPSG:4326"),u=Math.cos(li(n)),a=Math.sin(li(n)),h=Math.cos(li(r)),f=Math.sin(li(r)),c=Math.cos(li(i-t)),l=Math.sin(li(i-t)),v=a*f+u*h*c;return vg((function(n){if(1<=v)return[i,r];var e=n*Math.acos(v),o=Math.cos(e),s=Math.sin(e),d=l*h,p=u*f-a*h*c,y=Math.atan2(d,p),m=Math.asin(a*o+u*s*Math.cos(y));return[ci(li(t)+Math.atan2(Math.sin(y)*s*u,o-a*Math.sin(m))),ci(m)]}),jr(s,e),o)},EI.geom.flat.geodesic.meridian=dg,EI.geom.flat.geodesic.parallel=pg,EI.geom.flat.inflate={},EI.geom.flat.inflate.inflateCoordinates=pe,EI.geom.flat.inflate.inflateCoordinatesArray=ye,EI.geom.flat.inflate.inflateMultiCoordinatesArray=me,EI.geom.flat.interiorpoint={},EI.geom.flat.interiorpoint.getInteriorPointOfArray=Ae,EI.geom.flat.interiorpoint.getInteriorPointsOfMultiArray=Pe,EI.geom.flat.interpolate={},EI.geom.flat.interpolate.interpolatePoint=Hw,EI.geom.flat.interpolate.lineStringCoordinateAtM=Jw,EI.geom.flat.interpolate.lineStringsCoordinateAtM=Qw,EI.geom.flat.intersectsextent={},EI.geom.flat.intersectsextent.intersectsLineString=ke,EI.geom.flat.intersectsextent.intersectsLineStringArray=Ie,EI.geom.flat.intersectsextent.intersectsLinearRing=Ne,EI.geom.flat.intersectsextent.intersectsLinearRingArray=Le,EI.geom.flat.intersectsextent.intersectsLinearRingMultiArray=ze,EI.geom.flat.length={},EI.geom.flat.length.lineStringLength=gw,EI.geom.flat.length.linearRingLength=function(t,n,i,r){var e=gw(t,n,i,r),o=t[i-r]-t[n],s=t[i-r+1]-t[n+1];return e+=Math.sqrt(o*o+s*s)},EI.geom.flat.orient={},EI.geom.flat.orient.inflateEnds=Be,EI.geom.flat.orient.linearRingIsClockwise=Fe,EI.geom.flat.orient.linearRingsAreOriented=Ge,EI.geom.flat.orient.linearRingssAreOriented=De,EI.geom.flat.orient.orientLinearRings=qe,EI.geom.flat.orient.orientLinearRingsArray=Ue,EI.geom.flat.reverse={},EI.geom.flat.reverse.coordinates=Re,EI.geom.flat.segments={},EI.geom.flat.segments.forEach=Ce,EI.geom.flat.simplify={},EI.geom.flat.simplify.douglasPeucker=ae,EI.geom.flat.simplify.douglasPeuckerArray=he,EI.geom.flat.simplify.douglasPeuckerMultiArray=function(t,n,i,r,e,o,s,u){for(var a=0,h=i.length;a<h;++a){var f=i[a],c=[];s=he(t,n,f,r,e,o,s,c),u.push(c),n=f[f.length-1]}return s},EI.geom.flat.simplify.quantize=le,EI.geom.flat.simplify.quantizeArray=ve,EI.geom.flat.simplify.quantizeMultiArray=de,EI.geom.flat.simplify.radialDistance=fe,EI.geom.flat.simplify.simplifyLineString=function(t,n,i,r,e,o,s){var u=void 0!==s?s:[];return o||(i=fe(t,n,i,r,e,u,0),t=u,n=0,r=2),u.length=ae(t,n,i,r,e,u,0),u},EI.geom.flat.simplify.snap=ce,EI.geom.flat.straightchunk={},EI.geom.flat.straightchunk.matchingChunk=lw,EI.geom.flat.textpath={},EI.geom.flat.textpath.drawTextOnPath=ww,EI.geom.flat.topology={},EI.geom.flat.topology.lineStringIsClosed=function(t,n,i,r){var e=i-r;return t[n]===t[e]&&t[n+1]===t[e+1]&&(i-n)/r>3&&!!we(t,n,i,r)},EI.geom.flat.transform={},EI.geom.flat.transform.rotate=qr,EI.geom.flat.transform.scale=Ur,EI.geom.flat.transform.transform2D=Dr,EI.geom.flat.transform.translate=Br,EI.has={},EI.has.DEVICE_PIXEL_RATIO=Xt,EI.has.FIREFOX=Gt,EI.has.IMAGE_DECODE=Wt,EI.has.MAC=Bt,EI.has.PASSIVE_EVENT_LISTENERS=Yt,EI.has.SAFARI=Dt,EI.has.SAFARI_BUG_237906=qt,EI.has.WEBKIT=Ut,EI.has.WORKER_OFFSCREEN_CANVAS=Vt,EI.interaction={},EI.interaction.DoubleClickZoom=ga,EI.interaction.DragAndDrop=Q_,EI.interaction.DragAndDrop.DragAndDropEvent=J_,EI.interaction.DragBox=$a,EI.interaction.DragBox.DragBoxEvent=Za,EI.interaction.DragPan=Fa,EI.interaction.DragRotate=Da,EI.interaction.DragRotateAndZoom=nS,EI.interaction.DragZoom=Ha,EI.interaction.Draw=dS,EI.interaction.Draw.DrawEvent=vS,EI.interaction.Draw.createBox=function(){return function(t,n,i){var r=yn([t[0],t[t.length-1]].map((function(t){return Ir(t,i)}))),e=[[Gn(r),Dn(r),Zn(r),Yn(r),Gn(r)]],o=n;o?o.setCoordinates(e):o=new We(e);var s=Cr();return s&&o.transform(i,s),o}},EI.interaction.Draw.createRegularPolygon=function(t,n){return function(i,r,e){var o=Ir(i[0],e),s=Ir(i[i.length-1],e),u=Math.sqrt(Qi(o,s)),a=r||$e(new eS(o),t),h=n;if(!n&&0!==n){var f=s[0]-o[0],c=s[1]-o[1];h=Math.atan2(c,f)}Ke(a,o,u,h);var l=Cr();return l&&a.transform(e,l),a}},EI.interaction.Extent=xS,EI.interaction.Extent.ExtentEvent=mS,EI.interaction.Interaction=ma,EI.interaction.Interaction.pan=pa,EI.interaction.Interaction.zoomByDelta=ya,EI.interaction.KeyboardPan=rh,EI.interaction.KeyboardZoom=oh,EI.interaction.Link=jS,EI.interaction.Modify=zS,EI.interaction.Modify.ModifyEvent=kS,EI.interaction.MouseWheelZoom=hh,EI.interaction.PinchRotate=ch,EI.interaction.PinchZoom=vh,EI.interaction.Pointer=Ma,EI.interaction.Pointer.centroid=xa,EI.interaction.Select=qS,EI.interaction.Select.SelectEvent=GS,EI.interaction.Snap=VS,EI.interaction.Translate=HS,EI.interaction.Translate.TranslateEvent=KS,EI.interaction.defaults=dh,EI.layer={},EI.layer.Base=es,EI.layer.BaseImage=$y,EI.layer.BaseTile=am,EI.layer.BaseVector=$m,EI.layer.Graticule=gg,EI.layer.Group=nu,EI.layer.Group.GroupEvent=Qs,EI.layer.Heatmap=Og,EI.layer.Image=em,EI.layer.Layer=ls,EI.layer.Layer.inView=cs,EI.layer.MapboxVector=q_,EI.layer.Tile=lm,EI.layer.Vector=lg,EI.layer.VectorImage=B_,EI.layer.VectorTile=Rg,EI.layer.WebGLPoints=V_,EI.layer.WebGLTile=$_,EI.loadingstrategy={},EI.loadingstrategy.all=Wh,EI.loadingstrategy.bbox=function(t,n){return[t]},EI.loadingstrategy.tile=function(t){return function(n,i,r){var e=t.getZForResolution(Rr(i,r)),o=t.getTileRangeForExtentAndZ(Lr(n,r),e),s=[],u=[e,0,0];for(u[1]=o.minX;u[1]<=o.maxX;++u[1])for(u[2]=o.minY;u[2]<=o.maxY;++u[2])s.push(Nr(t.getTileCoordExtent(u),r));return s}},EI.math={},EI.math.ceil=wi,EI.math.clamp=oi,EI.math.cosh=si,EI.math.floor=mi,EI.math.lerp=di,EI.math.log2=ui,EI.math.modulo=vi,EI.math.round=yi,EI.math.solveLinearSystem=fi,EI.math.squaredDistance=hi,EI.math.squaredSegmentDistance=ai,EI.math.toDegrees=ci,EI.math.toFixed=pi,EI.math.toRadians=li,EI.net={},EI.net.ClientError=Hh,EI.net.ResponseError=Kh,EI.net.getJSON=Jh,EI.net.jsonp=Zh,EI.net.overrideXHR=function(t){"undefined"!=typeof XMLHttpRequest&&($h=XMLHttpRequest),global.XMLHttpRequest=t},EI.net.resolveUrl=Qh,EI.net.restoreXHR=function(){global.XMLHttpRequest=$h},EI.obj={},EI.obj.assign=A,EI.obj.clear=P,EI.obj.getValues=C,EI.obj.isEmpty=k,EI.proj={},EI.proj.Projection=ei,EI.proj.Units={},EI.proj.Units.METERS_PER_UNIT=Lt,EI.proj.Units.fromCode=Nt,EI.proj.addCommon=Gr,EI.proj.addCoordinateTransforms=Mr,EI.proj.addEquivalentProjections=wr,EI.proj.addEquivalentTransforms=gr,EI.proj.addProjection=dr,EI.proj.addProjections=pr,EI.proj.clearAllProjections=function(){zi(),Di()},EI.proj.clearUserProjection=function(){Ar=null},EI.proj.cloneTransform=lr,EI.proj.createProjection=br,EI.proj.createSafeCoordinateTransform=Fr,EI.proj.createTransformFromCoordinateTransform=xr,EI.proj.disableCoordinateWarning=cr,EI.proj.epsg3857={},EI.proj.epsg3857.EXTENT=Mi,EI.proj.epsg3857.HALF_SIZE=xi,EI.proj.epsg3857.MAX_SAFE_Y=Si,EI.proj.epsg3857.PROJECTIONS=ji,EI.proj.epsg3857.RADIUS=bi,EI.proj.epsg3857.WORLD_EXTENT=_i,EI.proj.epsg3857.fromEPSG4326=Ei,EI.proj.epsg3857.toEPSG4326=Ti,EI.proj.epsg4326={},EI.proj.epsg4326.EXTENT=Ci,EI.proj.epsg4326.METERS_PER_UNIT=ki,EI.proj.epsg4326.PROJECTIONS=Ni,EI.proj.epsg4326.RADIUS=Pi,EI.proj.equivalent=Sr,EI.proj.fromLonLat=_r,EI.proj.fromUserCoordinate=Ir,EI.proj.fromUserExtent=Lr,EI.proj.fromUserResolution=Rr,EI.proj.get=yr,EI.proj.getPointResolution=mr,EI.proj.getTransform=jr,EI.proj.getTransformFromProjections=Or,EI.proj.getUserProjection=Cr,EI.proj.identityTransform=vr,EI.proj.proj4={},EI.proj.proj4.register=function(t){var n,i,r=Object.keys(t.defs),e=r.length;for(n=0;n<e;++n){var o=r[n];if(!yr(o)){var s=t.defs(o),u=s.units;u||"longlat"!==s.projName||(u=Rt.DEGREES),dr(new ei({code:o,axisOrientation:s.axis,metersPerUnit:s.to_meter,units:u}))}}for(n=0;n<e;++n){var a=r[n],h=yr(a);for(i=0;i<e;++i){var f=r[i],c=yr(f);if(!Ui(a,f))if(t.defs[a]===t.defs[f])wr([h,c]);else{var l=t(a,f);Mr(h,c,Fr(h,c,l.forward),Fr(c,h,l.inverse))}}}},EI.proj.projections={},EI.proj.projections.add=Fi,EI.proj.projections.clear=zi,EI.proj.projections.get=Ri,EI.proj.setUserProjection=Pr,EI.proj.toLonLat=function(t,n){var i=Er(t,void 0!==n?n:"EPSG:3857","EPSG:4326"),r=i[0];return(r<-180||r>180)&&(i[0]=vi(r+180,360)-180),i},EI.proj.toUserCoordinate=kr,EI.proj.toUserExtent=Nr,EI.proj.toUserResolution=zr,EI.proj.transform=Er,EI.proj.transformExtent=Tr,EI.proj.transformWithProjections=function(t,n,i){return Or(n,i)(t)},EI.proj.transforms={},EI.proj.transforms.add=qi,EI.proj.transforms.clear=Di,EI.proj.transforms.get=Ui,EI.proj.transforms.remove=function(t,n){var i=t.getCode(),r=n.getCode(),e=Gi[i][r];return delete Gi[i][r],k(Gi[i])&&delete Gi[i],e},EI.proj.useGeographic=function(){Pr("EPSG:4326")},EI.render={},EI.render.Box=Ua,EI.render.Event=ms,EI.render.Feature=fg,EI.render.Feature.toFeature=function(t,n){var i=t.getId(),r=hg(t),e=t.getProperties(),o=new Et;return void 0!==n&&o.setGeometryName(n),o.setGeometry(r),void 0!==i&&o.setId(i),o.setProperties(e,!0),o},EI.render.Feature.toGeometry=hg,EI.render.VectorContext=tf,EI.render.canvas={},EI.render.canvas.Builder=ow,EI.render.canvas.BuilderGroup=mw,EI.render.canvas.Executor=Aw,EI.render.canvas.ExecutorGroup=Nw,EI.render.canvas.ExecutorGroup.getPixelIndexArray=Iw,EI.render.canvas.ImageBuilder=uw,EI.render.canvas.Immediate=rf,EI.render.canvas.Instruction={},EI.render.canvas.Instruction.beginPathInstruction=nw,EI.render.canvas.Instruction.closePathInstruction=iw,EI.render.canvas.Instruction.fillInstruction=Qm,EI.render.canvas.Instruction.strokeInstruction=tw,EI.render.canvas.LineStringBuilder=hw,EI.render.canvas.PolygonBuilder=cw,EI.render.canvas.TextBuilder=pw,EI.render.canvas.checkedFonts=Rs,EI.render.canvas.defaultFillStyle=Ts,EI.render.canvas.defaultFont=Es,EI.render.canvas.defaultLineCap=As,EI.render.canvas.defaultLineDash=Ps,EI.render.canvas.defaultLineDashOffset=0,EI.render.canvas.defaultLineJoin=Cs,EI.render.canvas.defaultLineWidth=1,EI.render.canvas.defaultMiterLimit=ks,EI.render.canvas.defaultPadding=zs,EI.render.canvas.defaultStrokeStyle=Is,EI.render.canvas.defaultTextAlign=Ns,EI.render.canvas.defaultTextBaseline=Ls,EI.render.canvas.drawImageOrLabel=$s,EI.render.canvas.getTextDimensions=Zs,EI.render.canvas.hitdetect={},EI.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=Lw,EI.render.canvas.hitdetect.createHitDetectionImageData=zw,EI.render.canvas.hitdetect.hitDetect=Rw,EI.render.canvas.labelCache=Fs,EI.render.canvas.measureAndCacheTextWidth=Ys,EI.render.canvas.measureTextHeight=Xs,EI.render.canvas.measureTextWidth=Ws,EI.render.canvas.registerFont=Bs,EI.render.canvas.rotateAtOffset=function(t,n,i,r){0!==n&&(t.translate(i,r),t.rotate(n),t.translate(-i,-r))},EI.render.canvas.textHeights=Us,EI.render.getRenderPixel=function(t,n){return tn(t.inversePixelTransform,n.slice(0))},EI.render.getVectorContext=ff,EI.render.toContext=function(t,n){var i=t.canvas,r=n||{},e=r.pixelRatio||Xt,o=r.size;o&&(i.width=o[0]*e,i.height=o[1]*e,i.style.width=o[0]+"px",i.style.height=o[1]+"px");var s=[0,0,i.width,i.height],u=rn([1,0,0,1,0,0],e,e);return new rf(t,e,s,u,0)},EI.renderer={},EI.renderer.Composite=Hs,EI.renderer.Layer=Kc,EI.renderer.Map=ps,EI.renderer.canvas={},EI.renderer.canvas.ImageLayer=im,EI.renderer.canvas.Layer=tm,EI.renderer.canvas.Layer.canvasPool=Hy,EI.renderer.canvas.TileLayer=fm,EI.renderer.canvas.VectorImageLayer=qw,EI.renderer.canvas.VectorLayer=Gw,EI.renderer.canvas.VectorTileLayer=Zw,EI.renderer.canvas.common={},EI.renderer.canvas.common.IMAGE_SMOOTHING_DISABLED=lf,EI.renderer.canvas.common.IMAGE_SMOOTHING_ENABLED=vf,EI.renderer.vector={},EI.renderer.vector.defaultOrder=of,EI.renderer.vector.getSquaredTolerance=sf,EI.renderer.vector.getTolerance=uf,EI.renderer.vector.renderFeature=af,EI.renderer.webgl={},EI.renderer.webgl.Layer=ol,EI.renderer.webgl.Layer.colorDecodeId=el,EI.renderer.webgl.Layer.colorEncodeId=rl,EI.renderer.webgl.Layer.getBlankImageData=function(){var t=document.createElement("canvas").getContext("2d").createImageData(1,1);return t.data[0]=255,t.data[1]=255,t.data[2]=255,t.data[3]=255,t},EI.renderer.webgl.Layer.writePointFeatureToBuffers=function(t,n,i,r,e,o){var s=3+e,u=t[n+0],a=t[n+1],h=tl;h.length=e;for(var f=0;f<h.length;f++)h[f]=t[n+2+f];var c=o?o.vertexPosition:0,l=o?o.indexPosition:0,v=c/s;return il(i,c,u,a,0),h.length&&i.set(h,c+3),il(i,c+=s,u,a,1),h.length&&i.set(h,c+3),il(i,c+=s,u,a,2),h.length&&i.set(h,c+3),il(i,c+=s,u,a,3),h.length&&i.set(h,c+3),c+=s,r[l++]=v,r[l++]=v+1,r[l++]=v+3,r[l++]=v+1,r[l++]=v+2,r[l++]=v+3,nl.vertexPosition=c,nl.indexPosition=l,nl},EI.renderer.webgl.PointsLayer=Hm,EI.renderer.webgl.TileLayer=pl,EI.renderer.webgl.TileLayer.Attributes=al,EI.renderer.webgl.TileLayer.Uniforms=ul,EI.reproj={},EI.reproj.Image=ly,EI.reproj.Tile=Bc,EI.reproj.Triangulation=qc,EI.reproj.calculateSourceExtentResolution=wf,EI.reproj.calculateSourceResolution=mf,EI.reproj.canvasPool=df,EI.reproj.common={},EI.reproj.common.ENABLE_RASTER_REPROJECTION=Dc,EI.reproj.common.ERROR_THRESHOLD=.5,EI.reproj.render=gf,EI.resolutionconstraint={},EI.resolutionconstraint.createMinMaxResolution=Ru,EI.resolutionconstraint.createSnapToPower=zu,EI.resolutionconstraint.createSnapToResolutions=Lu,EI.rotationconstraint={},EI.rotationconstraint.createSnapToN=Du,EI.rotationconstraint.createSnapToZero=qu,EI.rotationconstraint.disable=Fu,EI.rotationconstraint.none=Gu,EI.size={},EI.size.buffer=Ku,EI.size.hasArea=Hu,EI.size.scale=Ju,EI.size.toSize=Qu,EI.source={},EI.source.BingMaps=Zv,EI.source.BingMaps.quadKey=Yv,EI.source.CartoDB=Jv,EI.source.Cluster=fd,EI.source.DataTile=ld,EI.source.GeoTIFF=Wp,EI.source.IIIF=fy,EI.source.Image=gy,EI.source.Image.ImageSourceEvent=my,EI.source.Image.defaultImageLoadFunction=wy,EI.source.ImageArcGISRest=xy,EI.source.ImageCanvas=_y,EI.source.ImageMapGuide=Oy,EI.source.ImageStatic=Ey,EI.source.ImageWMS=Cy,EI.source.OGCMapTile=Gy,EI.source.OGCVectorTile=Xy,EI.source.OSM=Yy,EI.source.OSM.ATTRIBUTION=Wy,EI.source.Raster=Tm,EI.source.Raster.Processor=wm,EI.source.Raster.RasterSourceEvent=_m,EI.source.Raster.newImageData=pm,EI.source.Source=zv,EI.source.Stamen=Im,EI.source.Tile=Dv,EI.source.Tile.TileSourceEvent=Gv,EI.source.TileArcGISRest=Lm,EI.source.TileDebug=Rm,EI.source.TileImage=Vv,EI.source.TileJSON=Gm,EI.source.TileWMS=qm,EI.source.UTFGrid=Xm,EI.source.UTFGrid.CustomTile=Bm,EI.source.UrlTile=Uv,EI.source.Vector=ad,EI.source.Vector.VectorSourceEvent=ud,EI.source.VectorTile=qy,EI.source.VectorTile.defaultLoadFunction=Uy,EI.source.WMTS=Wm,EI.source.WMTS.optionsFromCapabilities=function(t,n){var i=b(t.Contents.Layer,(function(t,i,r){return t.Identifier==n.layer}));if(null===i)return null;var r,e=t.Contents.TileMatrixSet;(r=i.TileMatrixSetLink.length>1?M(i.TileMatrixSetLink,"projection"in n?function(t,i,r){var o=b(e,(function(n){return n.Identifier==t.TileMatrixSet})).SupportedCRS,s=yr(o),u=yr(n.projection);return s&&u?Sr(s,u):o==n.projection}:function(t,i,r){return t.TileMatrixSet==n.matrixSet}):0)<0&&(r=0);var o=i.TileMatrixSetLink[r].TileMatrixSet,s=i.TileMatrixSetLink[r].TileMatrixSetLimits,u=i.Format[0];"format"in n&&(u=n.format),(r=M(i.Style,(function(t,i,r){return"style"in n?t.Title==n.style:t.isDefault})))<0&&(r=0);var a=i.Style[r].Identifier,h={};"Dimension"in i&&i.Dimension.forEach((function(t,n,i){var r=t.Identifier,e=t.Default;void 0===e&&(e=t.Value[0]),h[r]=e}));var f,c=b(t.Contents.TileMatrixSet,(function(t,n,i){return t.Identifier==o})),l=c.SupportedCRS;if(l&&(f=yr(l)),"projection"in n){var v=yr(n.projection);v&&(f&&!Sr(v,f)||(f=v))}var d=!1,p="ne"==f.getAxisOrientation().substr(0,2),m=c.TileMatrix[0],w={MinTileCol:0,MinTileRow:0,MaxTileCol:m.MatrixWidth-1,MaxTileRow:m.MatrixHeight-1};if(s){w=s[s.length-1];var g=b(c.TileMatrix,(function(t){return t.Identifier===w.TileMatrix||c.Identifier+":"+t.Identifier===w.TileMatrix}));g&&(m=g)}var x=28e-5*m.ScaleDenominator/f.getMetersPerUnit(),_=p?[m.TopLeftCorner[1],m.TopLeftCorner[0]]:m.TopLeftCorner,S=m.TileWidth*x,O=m.TileHeight*x,j=c.BoundingBox;j&&p&&(j=[j[1],j[0],j[3],j[2]]);var E=[_[0]+S*w.MinTileCol,_[1]-O*(1+w.MaxTileRow),_[0]+S*(1+w.MaxTileCol),_[1]-O*w.MinTileRow];if(void 0!==j&&!xn(j,E)){var T=i.WGS84BoundingBox,A=yr("EPSG:4326").getExtent();if(E=j,T)d=T[0]===A[0]&&T[2]===A[2];else{var P=Tr(j,c.SupportedCRS,"EPSG:4326");d=P[0]-1e-10<=A[0]&&P[2]+1e-10>=A[2]}}var C=Hl(c,E,s),k=[],I=n.requestEncoding;if(I=void 0!==I?I:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var N=t.OperationsMetadata.GetTile.DCP.HTTP.Get,L=0,z=N.length;L<z;++L)if(N[L].Constraint){var R=b(N[L].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===I&&(I=R[0]),"KVP"!==I)break;y(R,"KVP")&&k.push(N[L].href)}else N[L].href&&(I="KVP",k.push(N[L].href));return 0===k.length&&(I="REST",i.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(u=t.format,k.push(t.template))}))),{urls:k,layer:n.layer,matrixSet:o,format:u,projection:f,requestEncoding:I,tileGrid:C,style:a,dimensions:h,wrapX:d,crossOrigin:n.crossOrigin}},EI.source.XYZ=Kv,EI.source.Zoomify=Hp,EI.source.Zoomify.CustomTile=Kp,EI.source.common={},EI.source.common.DEFAULT_WMS_VERSION="1.3.0",EI.source.ogcTileUtil={},EI.source.ogcTileUtil.getMapTileUrlTemplate=Ny,EI.source.ogcTileUtil.getTileSetInfo=Ry,EI.source.ogcTileUtil.getVectorTileUrlTemplate=Ly,EI.source.sourcesFromTileGrid=function(t,n){var i=new Sh(32),r=t.getExtent();return function(e,o){i.expireCache(),r&&(e=Wn(r,e));var s=t.getZForResolution(o),u=[];return t.forEachTileCoord(e,s,(function(t){var r=t.toString();if(!i.containsKey(r)){var e=n(t);i.set(r,e)}u.push(i.get(r))})),u}},EI.source.wms={},EI.source.wms.DEFAULT_VERSION=Ty,EI.sphere={},EI.sphere.DEFAULT_RADIUS=or,EI.sphere.getArea=function t(n,i){var r=i||{},e=r.radius||or,o=r.projection||"EPSG:3857",s=n.getType();"GeometryCollection"!==s&&(n=n.clone().transform(o,"EPSG:4326"));var u,a,h,f,c,l,v=0;switch(s){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":for(u=n.getCoordinates(),v=Math.abs(ar(u[0],e)),h=1,f=u.length;h<f;++h)v-=Math.abs(ar(u[h],e));break;case"MultiPolygon":for(h=0,f=(u=n.getCoordinates()).length;h<f;++h)for(a=u[h],v+=Math.abs(ar(a[0],e)),c=1,l=a.length;c<l;++c)v-=Math.abs(ar(a[c],e));break;case"GeometryCollection":var d=n.getGeometries();for(h=0,f=d.length;h<f;++h)v+=t(d[h],i);break;default:throw new Error("Unsupported geometry type: "+s)}return v},EI.sphere.getDistance=sr,EI.sphere.getLength=function t(n,i){var r=i||{},e=r.radius||or,o=r.projection||"EPSG:3857",s=n.getType();"GeometryCollection"!==s&&(n=n.clone().transform(o,"EPSG:4326"));var u,a,h,f,c,l,v=0;switch(s){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":v=ur(u=n.getCoordinates(),e);break;case"MultiLineString":case"Polygon":for(h=0,f=(u=n.getCoordinates()).length;h<f;++h)v+=ur(u[h],e);break;case"MultiPolygon":for(h=0,f=(u=n.getCoordinates()).length;h<f;++h)for(c=0,l=(a=u[h]).length;c<l;++c)v+=ur(a[c],e);break;case"GeometryCollection":var d=n.getGeometries();for(h=0,f=d.length;h<f;++h)v+=t(d[h],i);break;default:throw new Error("Unsupported geometry type: "+s)}return v},EI.sphere.offset=hr,EI.string={},EI.string.compareVersions=Xi,EI.string.padNumber=Bi,EI.structs={},EI.structs.LRUCache=Sh,EI.structs.LinkedList=Tv,EI.structs.PriorityQueue=_u,EI.structs.PriorityQueue.DROP=Mu,EI.structs.RBush=Pv,EI.style={},EI.style.Circle=iv,EI.style.Fill=rv,EI.style.Icon=yv,EI.style.IconImage=dv,EI.style.IconImage.get=vv,EI.style.IconImageCache=Vo,EI.style.IconImageCache.shared=Wo,EI.style.Image=Jl,EI.style.RegularShape=tv,EI.style.Stroke=mv,EI.style.Style=Sv,EI.style.Style.createDefaultStyle=xv,EI.style.Style.createEditingStyle=Mv,EI.style.Style.toFunction=gv,EI.style.Text=Ev,EI.style.expressions={},EI.style.expressions.Operators=_l,EI.style.expressions.PALETTE_TEXTURE_ARRAY=Ul,EI.style.expressions.arrayToGlsl=El,EI.style.expressions.colorToGlsl=Tl,EI.style.expressions.expressionToGlsl=Cl,EI.style.expressions.getStringNumberEquivalent=Al,EI.style.expressions.getValueType=Sl,EI.style.expressions.isTypeUnique=Ol,EI.style.expressions.numberToGlsl=jl,EI.style.expressions.stringToGlsl=Pl,EI.style.expressions.uniformNameForVariable=ql,EI.tilecoord={},EI.tilecoord.createOrUpdate=Oh,EI.tilecoord.fromKey=Ah,EI.tilecoord.getCacheKeyForTileKey=Th,EI.tilecoord.getKey=Eh,EI.tilecoord.getKeyZXY=jh,EI.tilecoord.hash=Ph,EI.tilecoord.withinExtentAndZ=Ch,EI.tilegrid={},EI.tilegrid.TileGrid=xf,EI.tilegrid.WMTS=Kl,EI.tilegrid.WMTS.createFromCapabilitiesMatrixSet=Hl,EI.tilegrid.common={},EI.tilegrid.common.DEFAULT_MAX_ZOOM=42,EI.tilegrid.common.DEFAULT_TILE_SIZE=Pu,EI.tilegrid.createForExtent=Sf,EI.tilegrid.createForProjection=Ef,EI.tilegrid.createXYZ=Of,EI.tilegrid.extentFromProjection=Tf,EI.tilegrid.getForProjection=Mf,EI.tilegrid.wrapX=_f,EI.tileurlfunction={};EI.tileurlfunction.createFromTemplate=Af,EI.tileurlfunction.createFromTemplates=Pf,EI.tileurlfunction.createFromTileUrlFunctions=Cf,EI.tileurlfunction.expandUrl=If,EI.tileurlfunction.nullTileUrlFunction=kf,EI.transform={},EI.transform.apply=tn,EI.transform.compose=sn,EI.transform.composeCssTransform=function(t,n,i,r,e,o,s){return hn(sn([1,0,0,1,0,0],t,n,i,r,e,o,s))},EI.transform.create=$t,EI.transform.determinant=an,EI.transform.invert=function(t){return un(t,t)},EI.transform.makeInverse=un,EI.transform.makeScale=en,EI.transform.multiply=Ht,EI.transform.reset=Kt,EI.transform.rotate=nn,EI.transform.scale=rn,EI.transform.set=Jt,EI.transform.setFromArray=Qt,EI.transform.toString=hn,EI.transform.translate=on,EI.uri={},EI.uri.appendParams=Nf,EI.util={},EI.util.VERSION=u,EI.util.abstract=r,EI.util.getUid=o,EI.vec={},EI.vec.mat4={},EI.vec.mat4.create=xc,EI.vec.mat4.fromTransform=Mc,EI.webgl={},EI.webgl.ARRAY_BUFFER=zf,EI.webgl.Buffer=mc,EI.webgl.Buffer.getArrayClassForType=yc,EI.webgl.DYNAMIC_DRAW=Gf,EI.webgl.ELEMENT_ARRAY_BUFFER=Rf,EI.webgl.FLOAT=Df,EI.webgl.Helper=zc,EI.webgl.Helper.computeAttributesStride=Nc,EI.webgl.PaletteTexture=Rc,EI.webgl.PostProcessingPass=bc,EI.webgl.RenderTarget=Gc,EI.webgl.STATIC_DRAW=Ff,EI.webgl.STREAM_DRAW=35040,EI.webgl.ShaderBuilder={},EI.webgl.ShaderBuilder.ShaderBuilder=Wl,EI.webgl.ShaderBuilder.parseLiteralStyle=Yl,EI.webgl.TileTexture=Zc,EI.webgl.UNSIGNED_BYTE=5121,EI.webgl.UNSIGNED_INT=5125,EI.webgl.UNSIGNED_SHORT=5123,EI.webgl.getContext=Uf,EI.webgl.getSupportedExtensions=function(){if(!Lf){var t=Uf(document.createElement("canvas"));t&&(Lf=t.getSupportedExtensions())}return Lf},EI.xml={},EI.xml.OBJECT_PROPERTY_NODE_FACTORY=ec,EI.xml.XML_SCHEMA_INSTANCE_URI=Bf,EI.xml.createElementNS=Xf,EI.xml.getAllTextContent=Vf,EI.xml.Vw=Wf,EI.xml.getAttributeNS=Zf,EI.xml.getDocument=dc,EI.xml.getXMLSerializer=lc,EI.xml.isDocument=Yf,EI.xml.makeArrayExtender=Kf,EI.xml.makeArrayPusher=Hf,EI.xml.makeArraySerializer=ic,EI.xml.makeChildAppender=nc,EI.xml.makeObjectPropertyPusher=Qf,EI.xml.makeObjectPropertySetter=tc,EI.xml.makeReplacer=Jf,EI.xml.makeSequence=oc,EI.xml.makeSimpleNodeFactory=rc,EI.xml.makeStructureNS=sc,EI.xml.parse=$f,EI.xml.parseNode=uc,EI.xml.pushParseAndPop=ac,EI.xml.pushSerializeAndPop=fc,EI.xml.registerDocument=function(t){vc=t},EI.xml.registerXMLSerializer=function(t){cc=t},EI.xml.serialize=hc;var TI=EI},150:function(t,n,i){"use strict";i.d(n,{Ie:function(){return a},It:function(){return o},L:function(){return r},L5:function(){return f},P1:function(){return l},Qb:function(){return c},pd:function(){return h},sf:function(){return u}});const r={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},e={};for(const t in r)r.hasOwnProperty(t)&&(e[r[t]]=parseInt(t,10));const o=[e.BitsPerSample,e.ExtraSamples,e.SampleFormat,e.StripByteCounts,e.StripOffsets,e.StripRowCounts,e.TileByteCounts,e.TileOffsets,e.SubIFDs],s={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},u={};for(const t in s)s.hasOwnProperty(t)&&(u[s[t]]=parseInt(t,10));const a={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},h={Unspecified:0,Assocalpha:1,Unassalpha:2},f={Version:0,AddCompression:1},c={None:0,Deflate:1},l={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},v={};for(const t in l)l.hasOwnProperty(t)&&(v[l[t]]=parseInt(t,10))}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return n[t].call(o.exports,o,o.exports,r),o.exports}r.m=n,r.d=function(t,n){for(var i in n)r.o(n,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},r.f={},r.e=function(t){return Promise.all(Object.keys(r.f).reduce((function(n,i){return r.f[i](t,n),n}),[]))},r.u=function(t){return t+".ol.js"},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},t={},r.l=function(n,i,e,o){if(t[n])t[n].push(i);else{var s,u;if(void 0!==e)for(var a=document.getElementsByTagName("script"),h=0;h<a.length;h++){var f=a[h];if(f.getAttribute("src")==n||f.getAttribute("data-webpack")=="ol:"+e){s=f;break}}s||(u=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack","ol:"+e),s.src=n),t[n]=[i];var c=function(i,r){s.onerror=s.onload=null,clearTimeout(l);var e=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),e&&e.forEach((function(t){return t(r)})),i)return i(r)},l=setTimeout(c.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=c.bind(null,s.onerror),s.onload=c.bind(null,s.onload),u&&document.head.appendChild(s)}},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t;r.g.importScripts&&(t=r.g.location+"");var n=r.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var i=n.getElementsByTagName("script");i.length&&(t=i[i.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t}(),function(){var t={179:0};r.f.j=function(n,i){var e=r.o(t,n)?t[n]:void 0;if(0!==e)if(e)i.push(e[2]);else{var o=new Promise((function(i,r){e=t[n]=[i,r]}));i.push(e[2]=o);var s=r.p+r.u(n),u=new Error;r.l(s,(function(i){if(r.o(t,n)&&(0!==(e=t[n])&&(t[n]=void 0),e)){var o=i&&("load"===i.type?"missing":i.type),s=i&&i.target&&i.target.src;u.message="Loading chunk "+n+" failed.\n("+o+": "+s+")",u.name="ChunkLoadError",u.type=o,u.request=s,e[1](u)}}),"chunk-"+n,n)}};var n=function(n,i){var e,o,s=i[0],u=i[1],a=i[2],h=0;if(s.some((function(n){return 0!==t[n]}))){for(e in u)r.o(u,e)&&(r.m[e]=u[e]);if(a)a(r)}for(n&&n(i);h<s.length;h++)o=s[h],r.o(t,o)&&t[o]&&t[o][0](),t[o]=0},i=self.webpackChunkol=self.webpackChunkol||[];i.forEach(n.bind(null,0)),i.push=n.bind(null,i.push.bind(i))}(),r(760);var e=r(429);return e=e.default}()}));
//# sourceMappingURL=ol.js.map