Socket
Socket
Sign inDemoInstall

@nextgis/webmap

Package Overview
Dependencies
Maintainers
3
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextgis/webmap - npm Package Compare versions

Comparing version 1.18.6 to 1.18.10

2

lib/webmap.esm-browser.prod.js

@@ -1,2 +0,2 @@

function t(t){return null!=t}function e(t,r,i=!1){let n=t;const s=r,o=Array.isArray(s);let a=o&&[]||{};return o&&Array.isArray(s)?i?(n=n||[],a=a.concat(n),s.forEach(((t,r)=>{void 0===a[r]?a[r]=t:"object"==typeof t?a[r]=e(n[r],t,i):-1===n.indexOf(t)&&a.push(t)}))):a=s:(n&&"object"==typeof n&&Object.keys(n).forEach((function(t){a[t]=n[t]})),Object.keys(s).forEach((function(t){a[t]="object"==typeof s[t]&&s[t]&&"object"==typeof n[t]&&"object"==typeof s[t]?e(n[t],s[t],i):s[t]}))),a}function r(t){return{type:"Polygon",coordinates:[i(t)]}}function i(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}function n(t){return"function"==typeof t}const s=(t,e,r)=>{try{const i=t(e,r);if(void 0!==i)return i}catch{}};function o(t){return(e,r)=>{for(const i of e){const e=s(t,i,r);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}const a={array:t=>{const[e,r,i]=t;let n,s,o;if("string"==typeof e&&["string","number","boolean"].includes(e)?(n=e,"number"==typeof r?(s=r,o=i):o=r):Array.isArray(e)&&(o=e),!Array.isArray(o))throw new Error("Expected an array");if(n&&!o.every((t=>typeof t===n)))throw new Error(`Expected all items in array to be of type ${n}`);if(s&&o.length!==s)throw new Error(`Expected array of length ${s}`);return o},boolean:o((t=>"boolean"==typeof t?t:void 0)),literal:([t])=>t,number:o((t=>"number"==typeof t?t:void 0)),object:o((t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t)),string:o((t=>"string"==typeof t?t:void 0)),"to-boolean":o(Boolean),"to-number":o(Number),"to-string":o(String),typeof:([t])=>typeof t};const l={get:function([t,e],r){const i=e||r;return i&&"object"==typeof i&&t in i?i[t]:null},length:([t])=>{if("string"==typeof t||Array.isArray(t))return t.length},at:function([t,e]){return e[t]},has:function([t,e],r){const i=e||r;return!(!i||"object"!=typeof i||!(t in i))},in:function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)},"index-of":function([t,e,r]){if("string"==typeof e)return e.indexOf(String(t),r);if(Array.isArray(e))return e.indexOf(t,r);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)},slice:function(t){const[e,r,i]=t;if("string"==typeof e)return e.slice(r,i);if(Array.isArray(e))return e.slice(r,i);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)}};const c=([t,e])=>{if(typeof t!=typeof e)throw new Error("Values have different types.")};const h={"!":function([t]){return!t},"!=":function([t,e]){return c([t,e]),t!==e},"<":function([t,e]){return c([t,e]),t<e},"<=":function([t,e]){return c([t,e]),t<=e},"==":function([t,e]){return c([t,e]),t===e},">":function([t,e]){return c([t,e]),t>e},">=":function([t,e]){return c([t,e]),t>=e},all:function(t){for(let e=0;e<t.length;e++){if(!t[e])return!1}return!0},any:function(t){for(let e=0;e<t.length;e++){if(t[e])return!0}return!1},case:function(t){if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');const e=t[t.length-1];if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let r=0;r<t.length-1;r+=2){if(t[r])return t[r+1]}return e},match:function(t){const[e,...r]=t,i=r.splice(-1,r.length%2)[0];for(let n=0;n<r.length-1;n+=2){if(r[n]===e)return r[n+1]}return i}};const d={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function u(t){if("string"==typeof(r=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(r))return f(t);if("string"==typeof(e=t)&&e in d)return function(t){return f(d[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let r;if(r=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)];if(r=t.match(e))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:r,a:i}){return[t,e,r,...void 0!==i?[i]:[]]}(t);var e,r;throw new Error(`The '${t}' cannot be converted to color`)}function f(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function p(t,e,r,i,n){if("number"==typeof r&&"number"==typeof n)return r+(t-e)/(i-e)*(n-r);try{const s=u(r),o=u(n);return function(t){return`rgb(${t.join(",")})`}(s.map(((r,n)=>Math.ceil(p(t,e,r,i,o[n])))))}catch(s){console.log(s)}throw new Error("Unsupported output type for linear interpolation.")}function y(t){if(Array.isArray(t)){const[e,...r]=t;return"string"==typeof e&&"literal"!==e&&e in m&&r.length>0}return!1}const m={...{"+":t=>t.reduce(((t,e)=>t+e),0),"-":t=>t.reduce(((t,e)=>t-e)),"*":t=>t.reduce(((t,e)=>t*e),1),"/":t=>t.reduce(((t,e)=>t/e)),"%":t=>t[0]%t[1],"^":t=>Math.pow(t[0],t[1]),abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log10(t[0]),log2:t=>Math.log2(t[0]),max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])},...a,...{concat:t=>t.reduce(((t,e)=>String(t)+String(e)),""),downcase:t=>String(t[0]).toLowerCase(),upcase:t=>String(t[0]).toUpperCase()},...l,...h,...{step:function(t){const[e,r,...i]=t;if("number"!=typeof e)return r;for(let n=0;n<i.length-2;n+=2){if(e>=i[n]&&e<i[n+2])return i[n+1]}return e>=i[i.length-2]?i[i.length-1]:r},interpolate:function([t,e,...r]){if(r.length<2)throw new Error("At least two stops are required");if("number"!=typeof e)throw new Error("Input must be a number.");if(r.length<2||r.length%2!=0)throw new Error("Invalid stops provided.");for(let i=0;i<r.length-2;i+=2){const n=r[i],s=r[i+2];if(e>=n&&e<=s&&"linear"===t[0])return p(e,n,r[i+1],s,r[i+3])}throw new Error("Invalid interpolation type.")}}};function g(t,e={}){const[r,...i]=t,n=m[r];if(n)return n(i.map((t=>y(t)?g(t,e):t)),e);throw new Error(`Expression "${r}" is not supported.`)}function v(t){return e=>{const r=e.properties;return!!r&&g(t,r)}}const b=["iconSize","iconAnchor"];function L(t,e,r){if((e=String(e))===(t=String(t)))return!0;if(r&&e.toUpperCase()===t.toUpperCase())return!0;const i=`^${n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var n;return null!==new RegExp(i,r?"i":"").exec(t)}const _={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>L(t,e),ilike:(t,e)=>L(t,e,!0)};function w(t,e){const r="string"==typeof e[0]?e[0]:"all",i=e=>{if(3===(r=e).length&&"string"==typeof r[0]&&"string"==typeof r[1]){const[r,i,n]=e,s=_[i];if(s){if(("like"===i||"ilike"===i)&&"string"==typeof r){let e="";const i=r.replace(/^%?(\w+)%?$/,((i,s)=>(e=t[s],r.replace(s,n))));return s(e,i)}return s(t[r],n)}return!1}return w(t,e);var r},n=e.filter((t=>Array.isArray(t)));return"any"===r?n.some(i):n.every(i)}function C(t){let e={};const r=[];for(const i of t)i&&(Array.isArray(i)?r.push(i):e=i);return t=>{const i=r.find((e=>function(t,e){const r={...t.properties};return!!r&&(r.$id=t.id,w(r,e))}(t,e[0])));return i?{...e,...i[1]}:e}}function A({paint:t,defaultPaint:e}){const r=function(t){let e=!1;const r={};for(const i in t)if(-1===b.indexOf(i)){const n=i,s=t[n];y(s)&&(e=!0,r[n]=v(s))}if(e)return e=>{const i={};for(const t in r)i[t]=r[t](e);return{...t,...i}}}(t);if(r){const i=t=>E({paint:r(t),defaultPaint:e});return i.paint=k({paint:t,defaultPaint:e}),i}return k({paint:t,defaultPaint:e})}function k({paint:t,defaultPaint:e}){var r;let i={...e};return i={...i,...t},i.fill=null===(r=i.fill)||void 0===r||r,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity),i}function E({paint:t,defaultPaint:e,getPaintFunctions:r}){if(!t)throw new Error("paint is empty");let i={...e};if(n(t)){const i=i=>{const n=E({paint:t(i),defaultPaint:e,getPaintFunctions:r});return n.type=t.type,n};return i.type=t.type,i}if(function(t){return!!Array.isArray(t)}(t))return i=>E({paint:C(t)(i),defaultPaint:e,getPaintFunctions:r});if("get-paint"===t.type){const n=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const r=e[t.from];if(r)return r(t.options)}}(t,r);n&&(i=E({paint:n,defaultPaint:e,getPaintFunctions:r}))}else{if("icon"===t.type)return t;i=A({paint:t,defaultPaint:e})}return n(i)||("color"in i&&(i.strokeColor||(i.strokeColor=i.color),i.fillColor||(i.fillColor=i.color)),"opacity"in i&&(void 0===i.strokeOpacity&&(i.strokeOpacity=i.opacity),void 0===i.fillOpacity&&(i.fillOpacity=i.opacity))),i}function P(t){const e={};for(let i=0;i<t.length;i++)e[t[i]]=1+(e[t[i]]||0);let r;for(const i in e){e[i]>((void 0!==r?e[r]:0)||0)&&(r=i)}return r}function O(t){let e;if("FeatureCollection"===t.type){e=P(t.features.map((t=>t.geometry.type)))}else if("GeometryCollection"===t.type){e=P(t.geometries.map((t=>t.type)))}else e="Feature"===t.type?t.geometry.type:t.type;return e}const S={polygon:"path",line:"path",point:"circle"},M={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function x(t){if(t.data){const e=M[O(t.data)],r=t.paint;r&&"[object Object]"===Object.prototype.toString.call(r)&&(r.type=r.type?r.type:"polygon"===e||"line"===e?"path":"html"in r||"className"in r?"icon":S[e]),t.type=t.type||e}return t}var F,I={exports:{}},j="object"==typeof Reflect?Reflect:null,T=j&&"function"==typeof j.apply?j.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};F=j&&"function"==typeof j.ownKeys?j.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var B=Number.isNaN||function(t){return t!=t};function z(){z.init.call(this)}I.exports=z,I.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}H(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&H(t,"error",e,r)}(t,n,{once:!0})}))},z.EventEmitter=z,z.prototype._events=void 0,z.prototype._eventsCount=0,z.prototype._maxListeners=void 0;var V=10;function $(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function R(t){return void 0===t._maxListeners?z.defaultMaxListeners:t._maxListeners}function N(t,e,r,i){var n,s,o,a;if($(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=R(t))>0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,a=l,console&&console.warn&&console.warn(a)}return t}function Z(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function q(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Z.bind(i);return n.listener=r,i.wrapFn=n,n}function J(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):D(n,n.length)}function G(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function D(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function H(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){i.once&&t.removeEventListener(e,n),r(s)}))}}Object.defineProperty(z,"defaultMaxListeners",{enumerable:!0,get:function(){return V},set:function(t){if("number"!=typeof t||t<0||B(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");V=t}}),z.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},z.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||B(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},z.prototype.getMaxListeners=function(){return R(this)},z.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)T(a,this,e);else{var l=a.length,c=D(a,l);for(r=0;r<l;++r)T(c[r],this,e)}return!0},z.prototype.on=z.prototype.addListener=function(t,e){return N(this,t,e,!1)},z.prototype.prependListener=function(t,e){return N(this,t,e,!0)},z.prototype.once=function(t,e){return $(e),this.on(t,q(this,t,e)),this},z.prototype.prependOnceListener=function(t,e){return $(e),this.prependListener(t,q(this,t,e)),this},z.prototype.removeListener=function(t,e){var r,i,n,s,o;if($(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||e)}return this},z.prototype.off=z.prototype.removeListener,z.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},z.prototype.listeners=function(t){return J(this,t,!0)},z.prototype.rawListeners=function(t){return J(this,t,!1)},z.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):G.call(t,e)},z.prototype.listenerCount=G,z.prototype.eventNames=function(){return this._eventsCount>0?F(this._events):[]};class K extends Error{constructor(){super(),this.name="CancelError",Object.setPrototypeOf(this,K.prototype)}}class U{constructor(t={}){this.options=t,this._promises=new Map}get isLoaded(){return this._promises.size>0}remove(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())}get(t){return this._promises.get(t)}add(t,e){const r=e||t,i=this._promises.get(r);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),i||(this._promises.set(r,t),t.finally((()=>{this.remove(r)})),t)}abort(){this.isLoaded&&(this._promises.forEach((t=>{t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())}waitFunc(t,e=""){const r=this.get(e=e||t.name);return r||this.add(t(),e)}WaitForMe(t=""){const e=this.get.bind(this),r=this.add.bind(this);return function(i,n,s){const o=s.value;return t=t||n,s.value=function(...i){const n=e(t);if(n)return n;return r(o.apply(this,i),t)},s}}GetOrCreateDecorator(t=""){return this.WaitForMe(t)}_onStop(){this.options.onStop&&!this.isLoaded&&this.options.onStop()}}class Q extends Error{constructor(){super(),this.name="TimeoutError",Object.setPrototypeOf(this,Q.prototype)}}const W=(t,e,r,i)=>{try{t(r(i))}catch(n){e(n)}};let X=0;class Y{constructor(t,e){this.id=X++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise(((t,e)=>{this._setCanceledCallback=e=>t(e||new K)}));const r=[this._cancelPromise,new Promise(((e,r)=>t((t=>{t instanceof Y?this.attach(t):this._isPending=!1,e(t)}),(t=>{this._isPending=!1,r(t)}),(t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)}))))];e&&r.push(new Promise(((t,r)=>{setTimeout((()=>{if(this._isPending)try{this.cancel()}finally{r(new Q)}}),e)}))),this._promise=Promise.race(r)}static createControl(t){return new U(t)}static resolve(t){return new Y((e=>e(t)))}static reject(t){return new Y(((e,r)=>r(t)))}static all(t){return new Y(((e,r)=>{Promise.all(t).then(e).catch(r)})).catch((e=>{if(e instanceof this.CancelError)for(const r of t){"cancel"in r&&r.cancel()}throw e}))}attach(t){this._isCanceled?t.cancel():this._children.push(t)}then(t,e){const r=new Y(((r,i)=>{if(this._promise){const n=t=>{e?W(r,i,e,t):i(t)};this._promise.then((e=>{this._isCanceled?n(e):t?W(r,i,t,e):r(e)}),n)}}));return r._parentPromise=this,this._children.push(r),r}catch(t){return this._isCanceled&&t&&t(new K),this.then(void 0,t)}finally(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new K:t)}cancel(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;const t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((t=>t.cancel())),this._isPending){if(this._cancelHandlers.length)try{for(const t of this._cancelHandlers)t()}catch(e){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this}_getTopParent(){let t=this._parentPromise,e=!!t;for(;e;)t&&t._parentPromise?(t=t._parentPromise,e=!!t):e=!1;return t}_destroy(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0}}Y.CancelError=K,Y.TimeoutError=Q,Y.PromiseControl=U,Object.setPrototypeOf(Y.prototype,Promise.prototype);var tt=Y;class et{constructor(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222}}class rt{constructor(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}getValue(){return this.value}setValue(t){this.value=t}}class it extends rt{constructor(){super(...arguments),this.name="center",this.event="moveend"}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(t){const e=t.map((t=>t.toFixed(5)));return e[0]+"_"+e[1]}parse(t){return t.split("_").map(Number)}}class nt extends rt{constructor(){super(...arguments),this.name="zoom",this.event="zoomend"}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(t){return String(t)}parse(t){return Number(t)}}let st=0;const ot={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0};class at{constructor(t){this.options=ot,this.emitter=new I.exports.EventEmitter,this.keys=at.keys,this.runtimeParams=[],this.getPaintFunctions=at.getPaintFunctions,this.mapState=[it,nt],this.id=st++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=t.mapAdapter,this._starterKits=t.starterKits||[],t&&(this.options=e(ot||{},t)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}async create(){return this.getEventStatus("create")||(await this._setInitMapState(this.mapState),await this._setupMap(),this._emitStatusEvent("create",this)),this}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}getState(){const t={};return this._mapState.forEach((e=>{t[e.name]=e.getValue()})),t}getRuntimeParams(){const t={};return this._mapState.forEach((e=>{for(const r of this.runtimeParams){const i=r.get(e.name);if(void 0!==i){t[e.name]=e.parse(i);break}}})),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:r(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(e,r){if(Array.isArray(e)){const i=e;this.mapAdapter.setView&&i&&t(r)?this.mapAdapter.setView(i,r):(i&&this.mapAdapter.setCenter(i),t(r)&&this.mapAdapter.setZoom(r))}else{this.mapAdapter.setView&&this.mapAdapter.setView(e)}}fitBounds(e,r){return e.every((e=>t(e)))&&(e[1]<-85.06&&(e[1]=-85.06),e[3]>85.06&&(e[3]=85.06),this.mapAdapter.fitBounds(e,r)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise((e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,(()=>{e(this)}))}))}onMapLoad(t){return new Promise((e=>{var r;const i=()=>{const r=this.mapAdapter;t&&t(r),r&&e(r)},n=null===(r=this.mapAdapter.isLoaded)||void 0===r||r;this.mapAdapter.map&&n?i():this.mapAdapter.emitter.once("create",(()=>{i()}))}))}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()}getCoordFromMapClick(){return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new tt(((t,e,r)=>{const i=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const n=()=>{this.setCursor(i),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",s),this._coordFromMapClickPromise=void 0},s=e=>{n(),function(t){!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat])}(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",s),r(n)})),this._coordFromMapClickPromise)}_emitStatusEvent(t,e){const r=t;this._eventsStatus[r]=!0,this.emitter.emit(r,e)}async _addLayerProviders(){}async _onLoadSync(){}async _setupMap(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return await this.mapAdapter.create(this.options),this._zoomToInitialExtent(),await this._addLayerProviders(),await this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this}_setTileJsonOptions(e){e.center&&(this.options.center=e.center),e.bounds&&(this.options.bounds=e.bounds),t(e.maxzoom)&&(this.options.zoom=e.maxzoom),t(e.minzoom)&&(this.options.zoom=e.minzoom),t(e.maxzoom)&&t(e.minzoom)&&(this.options.zoom=(e.maxzoom+e.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:r}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):r&&this.fitBounds(r)}_setInitMapState(t){for(const e of t){const t=new e(this);this._mapState.push(t);for(const e of this.runtimeParams){const r=e.get(t.name);if(void 0!==r){const e=t.parse(r);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter((e=>t.include.includes(e)))),e.forEach((t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){const e=this._mapState.find((e=>e.event===t));if(e){const t=e.toString(e.getValue());this.runtimeParams.forEach((r=>{r.set(e.name,t)}))}}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)}))}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter((e=>t.include.includes(e[0])))),e.forEach((([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)}))}}at.keys=new class{constructor(){this.keyCodeAlias=new et,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}};class lt extends at{constructor(t){super(t),this._layersIdCounter=1,this._layersOrderCounter=1,this._baselayers=[],this._layers={},this._selectedLayers=[];const e=this.options.tileJson;e&&this.emitter.once("build-map",(()=>this.addTileJsonLayer(e)))}async fitLayer(t,e){const r=this.getLayer(t),i=r&&(r.getBounds||r.getExtent);if(i){const t=await i.call(r);t&&this.fitBounds(t,e)}}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach((e=>{const r=this._layers[e];r&&t.push(r)})),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort(((t,e)=>t.order&&e.order?t.order-e.order:0))}findLayer(t){for(const e in this._layers){const r=this._layers[e];if(t(r))return r}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}async addBaseLayer(t,e){return await this.addLayer(t,{...e,baselayer:!0},void 0)}async addLayer(e,r={},i){var n,s;const o=this._layersIdCounter++,a=t(i)?i:void 0!==r.order?r.order:this.reserveOrder();let l;"string"==typeof e?l=this.getLayerAdapter(e):"function"==typeof e?l=e:"then"in e&&(l=await e);const c=r;this._updateGeoJsonOptions(c);const h=null===(n=(r={id:String(o),order:a,...r}).visibility)||void 0===n||n;if(r.visibility=!1,r.baselayer&&(r.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:r,adapter:l});t&&(t.options&&(r=t.options),t.adapter&&(l=t.adapter))}if(void 0!==l){const t=new l(this.mapAdapter.map,r);let e;t.options={...r,...t.options},t.options.baselayer&&(r.baselayer=!0,r.order=0,t.options.order=0),t.options.id&&(e=String(t.options.id),this._layers[e]=t),this._emitLayerEvent("layer:preadd",e||"",t),await this.onMapLoad(),t.map=this.mapAdapter.map;const i=await t.addLayer(t.options);if(t.layer=i,t.id=t.options.id||String(o),t.options.id=t.id,r.baselayer&&(t.options.order=0),t.order=null!==(s=t.options.order)&&void 0!==s?s:a,e&&delete this._layers[e],e=String(t.id),this._layers[e])throw Error(`layer with id '${e}' already exist`);e&&(this._layers[e]=t,c.filter&&this.filterLayer(t,c.filter),r.baselayer&&this._baselayers.push(e),h&&await this.showLayer(e));const n=r.opacity;void 0!==n&&n<=1&&this.setLayerOpacity(t,n);const d=i&&(t.getBounds||t.getExtent);if(r.fit&&d){const e=await d.call(t);e&&await this.fitBounds(e)}return r.onAdded&&r.onAdded(t),this._emitLayerEvent("layer:add",e,t),t}return Promise.reject("No adapter")}async addLayerFromAsyncAdapter(t,e,r){const i=r||void 0!==e.order?e.order:this.reserveOrder(),n=t(),s=await n;return s?this.addLayer(s,e,i):Promise.reject("No adapter")}removeLayers(t){for(const e in this._layers){let r=!0;t&&(r=t(e,this._layers[e])),r&&(this.removeLayer(e),delete this._layers[e])}}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers(((t,e)=>!(e&&e.options&&e.options.baselayer)))}removeLayer(t){const e=this.getLayer(t),r=e&&this.getLayerId(e);if(e&&r){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(r);t&&this._baselayers.splice(t,1)}delete this._layers[r],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=x(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",{...e,url:t})}addImageLayer(t,e){let r;return"string"==typeof t?r=t:(r=t.url,e=t),this.addLayer("IMAGE",{...e,url:r})}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,r={}){const i=this.getLayer(t),n=void 0!==e?e:!(i&&i.options.visibility),s=void 0!==r.silent&&r.silent,o=async t=>{const e=String(t.id),r=n?"layer:show":"layer:hide";if(s||(this._emitLayerEvent(n?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),n&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter((e=>e!==t.id&&this.isLayerVisible(e)));for(const t of e)await this.hideLayer(t)}t.showLayer?await t.showLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.showLayer(t.layer),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?await t.hideLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.hideLayer(t.layer);t.options.visibility=n,s||(this._emitLayerEvent(r,e,t),this._emitLayerEvent("layer:toggle",e,t))};return i?this.onMapLoad().then((()=>o(i))):Promise.resolve()}updateLayer(t){const e=this.getLayer(t);if(e){if(e.updateLayer)return Promise.resolve(e.updateLayer());if(this.isLayerVisible(e))return this.hideLayer(e,{silent:!0}).then((()=>this.showLayer(e,{silent:!0})))}return Promise.resolve()}setLayerOpacity(t,e){const r=this.getLayer(t);r&&(r.setOpacity?r.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(r.layer,e))}isLayerLabelVisible(t){var e;const r=this.getLayer(t);return r.isLabelVisible?r.isLabelVisible():null===(e=r.options.labelVisibility)||void 0===e||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const r=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),r&&(e?r.showLabel&&(r.options.labelVisibility=!0,r.showLabel()):r.hideLabel&&(r.options.labelVisibility=!1,r.hideLabel()),r.id&&this._emitLayerEvent("layer:label:toggle",r.id,r)),e}selectLayer(t,e){const r=this.getLayer(t);if(r){r&&r.select&&r.select(e);const t=this.getLayerId(r);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const r=this.getLayer(t);if(r){const t=r&&r;t.unselect&&t.unselect(e);const i=this.getLayerId(r);if(i){const t=this._selectedLayers.indexOf(i);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const r=this.getLayer(t);return r.filter?r.filter(e):[]}propertiesFilter(t,e,r){const i=this.getLayer(t);if(i){const t=i;if(t.propertiesFilter)return t.propertiesFilter(e,r);t.filter&&this.filterLayer(t,(t=>!t.feature||!t.feature.properties||w(t.feature.properties,e)))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((()=>!0))}setLayerData(t,e){const r=this.getLayer(t);if(r){if(r.setData)return r.setData(e);if(r.clearLayer&&r.addData)return r.clearLayer(),r.addData(e)}return Promise.resolve()}addLayerData(t,e){const r=this.getLayer(t);r.addData&&r.addData(e)}clearLayerData(t,e){const r=this.getLayer(t);r&&r.clearLayer&&r.clearLayer(e)}setLayerPaint(t,e){const r=this.getLayer(t);e&&r&&r.setPaint&&r.setPaint(e)}setLayerSelectedPaint(t,e){const r=this.getLayer(t);e&&r&&r.setSelectedPaint&&r.setSelectedPaint(e)}updateLayerPaint(t,e){const r=this.getLayer(t);e&&r&&r.updatePaint&&r.updatePaint(e)}updateLayerSelectedPaint(t,e){const r=this.getLayer(t);e&&r&&r.updateSelectedPaint&&r.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const r in this._layers){const i=this._layers[r];let n=!(void 0===t.onlyVisible||t.onlyVisible)||i.options.visibility;if(n&&t.onlyBaselayer&&(n=this._baselayers.includes(r)),n){const t=i.options&&i.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find((t=>this.isLayerVisible(t)));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})}_emitLayerEvent(e,r,i){const n=String(e);if(t(r)&&n.startsWith("layer:")){const t=n.replace("layer:","layer-"+r+":");this.emitter.emit(t,i)}this.emitter.emit(e,i)}async _onLayerClick(t){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)}async _onLayerSelect(t){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)}_updateGeoJsonOptions(e){const{onSelect:r,onLayerSelect:i,onClick:n,onLayerClick:s,onMouseOut:o,onMouseOver:a}=e,l=n||s;e.onClick=t=>(l&&l(t),this._onLayerClick(t)),e.onMouseOut=e=>{const r=e.layer.id;o&&o(e),t(r)&&this._emitLayerEvent("layer:mouseout",r,e)},e.onMouseOver=e=>{const r=e.layer.id;a&&a(e),t(r)&&this._emitLayerEvent("layer:mouseover",r,e)};const c=r||i;e.onSelect=t=>(c&&c(t),this._onLayerSelect(t)),e.nativePaint||(this.options.paint&&(e.paint=E({paint:e.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),e.selectedPaint&&this.options.selectedPaint&&(e.selectedPaint=E({paint:e.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}function ct(t,e){const r=document.createElement("div");let i=!1;e.getStatus?i=e.getStatus():e.status&&(i=e.status);const n=e.title||"",s=e.html;function o(){n&&(r.title="string"==typeof n?n:i?n.on:n.off,r.setAttribute("aria-label",r.title))}function a(t){t instanceof HTMLElement?(r.innerHTML="",r.appendChild(t)):"string"==typeof t&&(r.innerHTML=t)}function l(){s&&("string"==typeof s||s instanceof HTMLElement?a(s):a(i?s.on:s.off),r.setAttribute("aria-label",r.title))}function c(t,e){t.split(" ").forEach((t=>{e?r.classList.add(t):r.classList.remove(t)}))}function h(){e.addClassOn&&c(e.addClassOn,i),e.addClassOff&&c(e.addClassOff,!i)}o(),l(),e.addClass&&c(e.addClass,!0),h();const d=t=>{void 0!==t&&(i=t),l(),o(),h()},u=t=>{if(i=void 0!==t?t:!i,e.onClick){const t=e.onClick(i);Promise.resolve(t).then((()=>d())).catch((()=>i=!i))}else d()},f=t({html:r,onClick:u});return f.onClick=u,f.changeStatus=d,f}class ht extends lt{constructor(){super(...arguments),this._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},this._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1}}async addControl(t,e,r){let i;if(e=null!=e?e:"top-left",i="string"==typeof t?this.getControl(t,r):t,i)return new Promise((t=>{this._setControlQueue(e,(async()=>{const r=await i,n=this.mapAdapter.addControl(r,e);t(n)}))}))}async createControl(t,e){if(await this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)}async createButtonControl(t){if(await this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)}async createToggleControl(t){return await this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?ct(this.mapAdapter.createButtonControl,t):void 0}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((t=>{this.mapAdapter.removeControl(t)}))}getControl(t,e){const r=this.mapAdapter.controlAdapters[t];if(r)return new r(e);{const r=ht.controls[t];if(r)return r(this,e)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}async _applyControls(t){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];await e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1}}ht.controls={CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)};const dt={};function ut(t){return dt[t]}class ft extends ht{constructor(t){super(t),this._addControls(),dt[this.id]=this}static get(t){return ut(t)}async _addLayerProviders(){for await(const t of this._starterKits)if(t.getLayerAdapters){const e=await t.getLayerAdapters.call(t);if(e)for await(const t of e){const e=await t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}}async _onLoadSync(){for await(const e of this._starterKits)if(e.onLoadSync)try{await e.onLoadSync.call(e,this)}catch(t){console.error(t)}}_addControls(){this.options.controls&&this.options.controls.forEach((t=>{let e=t,r={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(r=this.options.controlsOptions[t],void 0!==r.control&&(e=r.control));const{position:i,...n}=r;this.addControl(e,i||"top-left",n)})),this._emitStatusEvent("controls:create")}}function pt(){return["ZOOM","ATTRIBUTION"]}async function yt(t){return new ft(t).onLoad()}export{ft as WebMap,ht as WebMapControls,lt as WebMapLayers,at as WebMapMain,ct as createToggleControl,yt as createWebMap,O as detectGeometryType,P as findMostFrequentGeomType,pt as getDefaultControls,ut as getWebMap,x as updateGeoJsonAdapterOptions};
function t(t){return null!=t}function e(t,r,i=!1){let n=t;const s=r,o=Array.isArray(s);let a=o&&[]||{};return o&&Array.isArray(s)?i?(n=n||[],a=a.concat(n),s.forEach(((t,r)=>{void 0===a[r]?a[r]=t:"object"==typeof t?a[r]=e(n[r],t,i):-1===n.indexOf(t)&&a.push(t)}))):a=s:(n&&"object"==typeof n&&Object.keys(n).forEach((function(t){a[t]=n[t]})),Object.keys(s).forEach((function(t){a[t]="object"==typeof s[t]&&s[t]&&"object"==typeof n[t]&&"object"==typeof s[t]?e(n[t],s[t],i):s[t]}))),a}function r(t){return{type:"Polygon",coordinates:[i(t)]}}function i(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}function n(t){return"function"==typeof t}const s=(t,e,r)=>{try{const i=t(e,r);if(void 0!==i)return i}catch{}};function o(t){return(e,r)=>{for(const i of e){const e=s(t,i,r);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}function a(t){return(e,r)=>{const i=e.map((t=>t()));return t(i,r)}}const l={array:a((t=>{const[e,r,i]=t;let n,s,o;if("string"==typeof e&&["string","number","boolean"].includes(e)?(n=e,"number"==typeof r?(s=r,o=i):o=r):Array.isArray(e)&&(o=e),!Array.isArray(o))throw new Error("Expected an array");if(n&&!o.every((t=>typeof t===n)))throw new Error(`Expected all items in array to be of type ${n}`);if(s&&o.length!==s)throw new Error(`Expected array of length ${s}`);return o})),boolean:a(o((t=>"boolean"==typeof t?t:void 0))),literal:a((([t])=>t)),number:a(o((t=>"number"==typeof t?t:void 0))),object:a(o((t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t))),string:a(o((t=>"string"==typeof t?t:void 0))),"to-boolean":a(o(Boolean)),"to-number":a(o(Number)),"to-string":a(o(String)),typeof:a((([t])=>typeof t))},c={"+":a((t=>t.reduce(((t,e)=>t+e),0))),"-":a((t=>t.reduce(((t,e)=>t-e)))),"*":a((t=>t.reduce(((t,e)=>t*e),1))),"/":a((t=>t.reduce(((t,e)=>t/e)))),"%":a((t=>t[0]%t[1])),"^":a((t=>Math.pow(t[0],t[1]))),abs:a((t=>Math.abs(t[0]))),acos:a((t=>Math.acos(t[0]))),asin:a((t=>Math.asin(t[0]))),atan:a((t=>Math.atan(t[0]))),ceil:a((t=>Math.ceil(t[0]))),cos:a((t=>Math.cos(t[0]))),e:()=>Math.E,floor:a((t=>Math.floor(t[0]))),ln:a((t=>Math.log(t[0]))),ln2:()=>Math.LN2,log10:a((t=>Math.log10(t[0]))),log2:a((t=>Math.log2(t[0]))),max:a((t=>Math.max(...t))),min:a((t=>Math.min(...t))),pi:()=>Math.PI,round:a((t=>Math.round(t[0]))),sin:a((t=>Math.sin(t[0]))),sqrt:a((t=>Math.sqrt(t[0]))),tan:a((t=>Math.tan(t[0])))};const h={get:a((function([t,e],r){const i=e||r;return i&&"object"==typeof i&&t in i?i[t]:null})),length:a((([t])=>{if("string"==typeof t||Array.isArray(t))return t.length})),at:a((function([t,e]){return e[t]})),has:a((function([t,e],r){const i=e||r;return!(!i||"object"!=typeof i||!(t in i))})),in:a((function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)})),"index-of":a((function([t,e,r]){if("string"==typeof e)return e.indexOf(String(t),r);if(Array.isArray(e))return e.indexOf(t,r);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)})),slice:a((function(t){const[e,r,i]=t;if("string"==typeof e)return e.slice(r,i);if(Array.isArray(e))return e.slice(r,i);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)}))},d={concat:a((t=>t.reduce(((t,e)=>String(t)+String(e)),""))),downcase:a((t=>String(t[0]).toLowerCase())),upcase:a((t=>String(t[0]).toUpperCase()))};const u=([t,e])=>{if(typeof t!=typeof e)throw new Error("Values have different types.")};const p={"!":a((function([t]){return!t})),"!=":a((function([t,e]){return u([t,e]),t!==e})),"<":a((function([t,e]){return u([t,e]),t<e})),"<=":a((function([t,e]){return u([t,e]),t<=e})),"==":a((function([t,e]){return u([t,e]),t===e})),">":a((function([t,e]){return u([t,e]),t>e})),">=":a((function([t,e]){return u([t,e]),t>=e})),all:t=>{for(let e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:t=>{for(let e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:t=>{if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let e=0;e<t.length-1;e+=2){const r=t[e](),i=t[e+1]();if(r)return i}return(0,t[t.length-1])()},match:t=>{const[e,...r]=t,i=e(),n=r.splice(-1,r.length%2)[0];for(let s=0;s<r.length-1;s+=2){if(r[s]()===i)return r[s+1]()}return n()}},f={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function y(t){if("string"==typeof(r=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(r))return m(t);if("string"==typeof(e=t)&&e in f)return function(t){return m(f[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let r;if(r=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10)];if(r=t.match(e))return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:r,a:i}){return[t,e,r,...void 0!==i?[i]:[]]}(t);var e,r;throw new Error(`The '${t}' cannot be converted to color`)}function m(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function g(t,e,r,i,n){if("number"==typeof r&&"number"==typeof n)return r+(t-e)/(i-e)*(n-r);try{const s=y(r),o=y(n);return function(t){return`rgb(${t.join(",")})`}(s.map(((r,n)=>Math.ceil(g(t,e,r,i,o[n])))))}catch(s){console.log(s)}throw new Error("Unsupported output type for linear interpolation.")}function v(t){if(Array.isArray(t)){const[e,...r]=t;return"string"==typeof e&&"literal"!==e&&e in b&&r.length>0}return!1}const b={...c,...l,...d,...h,...p,...{step:t=>{const[e,r,...i]=t,n=e();if("number"!=typeof n)return r();for(let s=0;s<i.length-2;s+=2){const t=i[s](),e=i[s+1](),r=i[s+2]();if(n>=t&&n<r)return e}return n>=i[i.length-2]()?i[i.length-1]():r()},interpolate:([t,e,...r])=>{if(r.length<2)throw new Error("At least two stops are required");if(r.length<2||r.length%2!=0)throw new Error("Invalid stops provided.");const i=e();if("number"!=typeof i)throw new Error("Input must be a number.");const n=t();for(let s=0;s<r.length-2;s+=2){const t=r[s](),e=r[s+1](),o=r[s+2](),a=r[s+3]();if(i>=t&&i<=o&&"linear"===n[0])return g(i,t,e,o,a)}throw new Error("Invalid interpolation type.")}}};function L(t,e={}){const[r,...i]=t,n=b[r];if(n)return n(i.map((t=>()=>v(t)?L(t,e):t)),e);throw new Error(`Expression "${r}" is not supported.`)}function _(t){return e=>{const r=e.properties;return!!r&&L(t,r)}}const w=["iconSize","iconAnchor"];function C(t,e,r){if((e=String(e))===(t=String(t)))return!0;if(r&&e.toUpperCase()===t.toUpperCase())return!0;const i=`^${n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var n;return null!==new RegExp(i,r?"i":"").exec(t)}const A={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>C(t,e),ilike:(t,e)=>C(t,e,!0)};function k(t,e){const r="string"==typeof e[0]?e[0]:"all",i=e=>{if(3===(r=e).length&&"string"==typeof r[0]&&"string"==typeof r[1]){const[r,i,n]=e,s=A[i];if(s){if(("like"===i||"ilike"===i)&&"string"==typeof r){let e="";const i=r.replace(/^%?(\w+)%?$/,((i,s)=>(e=t[s],r.replace(s,n))));return s(e,i)}return s(t[r],n)}return!1}return k(t,e);var r},n=e.filter((t=>Array.isArray(t)));return"any"===r?n.some(i):n.every(i)}function E(t){let e={};const r=[];for(const i of t)i&&(Array.isArray(i)?r.push(i):e=i);return t=>{const i=r.find((e=>function(t,e){const r={...t.properties};return!!r&&(r.$id=t.id,k(r,e))}(t,e[0])));return i?{...e,...i[1]}:e}}function P({paint:t,defaultPaint:e}){const r=function(t){let e=!1;const r={};for(const i in t)if(-1===w.indexOf(i)){const n=i,s=t[n];v(s)&&(e=!0,r[n]=_(s))}if(e)return e=>{const i={};for(const t in r)i[t]=r[t](e);return{...t,...i}}}(t);if(r){const i=t=>S({paint:r(t),defaultPaint:e});return i.paint=O({paint:t,defaultPaint:e}),i}return O({paint:t,defaultPaint:e})}function O({paint:t,defaultPaint:e}){var r;let i={...e};return i={...i,...t},i.fill=null===(r=i.fill)||void 0===r||r,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity),i}function S({paint:t,defaultPaint:e,getPaintFunctions:r}){if(!t)throw new Error("paint is empty");let i={...e};if(n(t)){const i=i=>{const n=S({paint:t(i),defaultPaint:e,getPaintFunctions:r});return n.type=t.type,n};return i.type=t.type,i}if(function(t){return!!Array.isArray(t)}(t))return i=>S({paint:E(t)(i),defaultPaint:e,getPaintFunctions:r});if("get-paint"===t.type){const n=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const r=e[t.from];if(r)return r(t.options)}}(t,r);n&&(i=S({paint:n,defaultPaint:e,getPaintFunctions:r}))}else{if("icon"===t.type)return t;i=P({paint:t,defaultPaint:e})}return n(i)||("color"in i&&(i.strokeColor||(i.strokeColor=i.color),i.fillColor||(i.fillColor=i.color)),"opacity"in i&&(void 0===i.strokeOpacity&&(i.strokeOpacity=i.opacity),void 0===i.fillOpacity&&(i.fillOpacity=i.opacity))),i}function M(t){const e={};for(let i=0;i<t.length;i++)e[t[i]]=1+(e[t[i]]||0);let r;for(const i in e){e[i]>((void 0!==r?e[r]:0)||0)&&(r=i)}return r}function x(t){let e;if("FeatureCollection"===t.type){e=M(t.features.map((t=>t.geometry.type)))}else if("GeometryCollection"===t.type){e=M(t.geometries.map((t=>t.type)))}else e="Feature"===t.type?t.geometry.type:t.type;return e}const F={polygon:"path",line:"path",point:"circle"},I={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function j(t){if(t.data){const e=I[x(t.data)],r=t.paint;r&&"[object Object]"===Object.prototype.toString.call(r)&&(r.type=r.type?r.type:"polygon"===e||"line"===e?"path":"html"in r||"className"in r?"icon":F[e]),t.type=t.type||e}return t}var T,B={exports:{}},z="object"==typeof Reflect?Reflect:null,V=z&&"function"==typeof z.apply?z.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};T=z&&"function"==typeof z.ownKeys?z.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var $=Number.isNaN||function(t){return t!=t};function R(){R.init.call(this)}B.exports=R,B.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,s),i(r)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}Q(t,e,s,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&Q(t,"error",e,r)}(t,n,{once:!0})}))},R.EventEmitter=R,R.prototype._events=void 0,R.prototype._eventsCount=0,R.prototype._maxListeners=void 0;var N=10;function Z(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function q(t){return void 0===t._maxListeners?R.defaultMaxListeners:t._maxListeners}function J(t,e,r,i){var n,s,o,a;if(Z(r),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),void 0===o)o=s[e]=r,++t._eventsCount;else if("function"==typeof o?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=q(t))>0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,a=l,console&&console.warn&&console.warn(a)}return t}function G(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function D(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=G.bind(i);return n.listener=r,i.wrapFn=n,n}function H(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):U(n,n.length)}function K(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function U(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function Q(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){i.once&&t.removeEventListener(e,n),r(s)}))}}Object.defineProperty(R,"defaultMaxListeners",{enumerable:!0,get:function(){return N},set:function(t){if("number"!=typeof t||t<0||$(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");N=t}}),R.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},R.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||$(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},R.prototype.getMaxListeners=function(){return q(this)},R.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)V(a,this,e);else{var l=a.length,c=U(a,l);for(r=0;r<l;++r)V(c[r],this,e)}return!0},R.prototype.on=R.prototype.addListener=function(t,e){return J(this,t,e,!1)},R.prototype.prependListener=function(t,e){return J(this,t,e,!0)},R.prototype.once=function(t,e){return Z(e),this.on(t,D(this,t,e)),this},R.prototype.prependOnceListener=function(t,e){return Z(e),this.prependListener(t,D(this,t,e)),this},R.prototype.removeListener=function(t,e){var r,i,n,s,o;if(Z(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||e)}return this},R.prototype.off=R.prototype.removeListener,R.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},R.prototype.listeners=function(t){return H(this,t,!0)},R.prototype.rawListeners=function(t){return H(this,t,!1)},R.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):K.call(t,e)},R.prototype.listenerCount=K,R.prototype.eventNames=function(){return this._eventsCount>0?T(this._events):[]};class W extends Error{constructor(){super(),this.name="CancelError",Object.setPrototypeOf(this,W.prototype)}}class X{constructor(t={}){this.options=t,this._promises=new Map}get isLoaded(){return this._promises.size>0}remove(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())}get(t){return this._promises.get(t)}add(t,e){const r=e||t,i=this._promises.get(r);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),i||(this._promises.set(r,t),t.finally((()=>{this.remove(r)})),t)}abort(){this.isLoaded&&(this._promises.forEach((t=>{t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())}waitFunc(t,e=""){const r=this.get(e=e||t.name);return r||this.add(t(),e)}WaitForMe(t=""){const e=this.get.bind(this),r=this.add.bind(this);return function(i,n,s){const o=s.value;return t=t||n,s.value=function(...i){const n=e(t);if(n)return n;return r(o.apply(this,i),t)},s}}GetOrCreateDecorator(t=""){return this.WaitForMe(t)}_onStop(){this.options.onStop&&!this.isLoaded&&this.options.onStop()}}class Y extends Error{constructor(){super(),this.name="TimeoutError",Object.setPrototypeOf(this,Y.prototype)}}const tt=(t,e,r,i)=>{try{t(r(i))}catch(n){e(n)}};let et=0;class rt{constructor(t,e){this.id=et++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise(((t,e)=>{this._setCanceledCallback=e=>t(e||new W)}));const r=[this._cancelPromise,new Promise(((e,r)=>t((t=>{t instanceof rt?this.attach(t):this._isPending=!1,e(t)}),(t=>{this._isPending=!1,r(t)}),(t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)}))))];e&&r.push(new Promise(((t,r)=>{setTimeout((()=>{if(this._isPending)try{this.cancel()}finally{r(new Y)}}),e)}))),this._promise=Promise.race(r)}static createControl(t){return new X(t)}static resolve(t){return new rt((e=>e(t)))}static reject(t){return new rt(((e,r)=>r(t)))}static all(t){return new rt(((e,r)=>{Promise.all(t).then(e).catch(r)})).catch((e=>{if(e instanceof this.CancelError)for(const r of t){"cancel"in r&&r.cancel()}throw e}))}attach(t){this._isCanceled?t.cancel():this._children.push(t)}then(t,e){const r=new rt(((r,i)=>{if(this._promise){const n=t=>{e?tt(r,i,e,t):i(t)};this._promise.then((e=>{this._isCanceled?n(e):t?tt(r,i,t,e):r(e)}),n)}}));return r._parentPromise=this,this._children.push(r),r}catch(t){return this._isCanceled&&t&&t(new W),this.then(void 0,t)}finally(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new W:t)}cancel(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;const t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((t=>t.cancel())),this._isPending){if(this._cancelHandlers.length)try{for(const t of this._cancelHandlers)t()}catch(e){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this}_getTopParent(){let t=this._parentPromise,e=!!t;for(;e;)t&&t._parentPromise?(t=t._parentPromise,e=!!t):e=!1;return t}_destroy(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0}}rt.CancelError=W,rt.TimeoutError=Y,rt.PromiseControl=X,Object.setPrototypeOf(rt.prototype,Promise.prototype);var it=rt;class nt{constructor(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222}}class st{constructor(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}getValue(){return this.value}setValue(t){this.value=t}}class ot extends st{constructor(){super(...arguments),this.name="center",this.event="moveend"}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(t){const e=t.map((t=>t.toFixed(5)));return e[0]+"_"+e[1]}parse(t){return t.split("_").map(Number)}}class at extends st{constructor(){super(...arguments),this.name="zoom",this.event="zoomend"}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(t){return String(t)}parse(t){return Number(t)}}let lt=0;const ct={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0};class ht{constructor(t){this.options=ct,this.emitter=new B.exports.EventEmitter,this.keys=ht.keys,this.runtimeParams=[],this.getPaintFunctions=ht.getPaintFunctions,this.mapState=[ot,at],this.id=lt++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=t.mapAdapter,this._starterKits=t.starterKits||[],t&&(this.options=e(ct||{},t)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}async create(){return this.getEventStatus("create")||(await this._setInitMapState(this.mapState),await this._setupMap(),this._emitStatusEvent("create",this)),this}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}getState(){const t={};return this._mapState.forEach((e=>{t[e.name]=e.getValue()})),t}getRuntimeParams(){const t={};return this._mapState.forEach((e=>{for(const r of this.runtimeParams){const i=r.get(e.name);if(void 0!==i){t[e.name]=e.parse(i);break}}})),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:r(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(e,r){if(Array.isArray(e)){const i=e;this.mapAdapter.setView&&i&&t(r)?this.mapAdapter.setView(i,r):(i&&this.mapAdapter.setCenter(i),t(r)&&this.mapAdapter.setZoom(r))}else{this.mapAdapter.setView&&this.mapAdapter.setView(e)}}fitBounds(e,r){return e.every((e=>t(e)))&&(e[1]<-85.06&&(e[1]=-85.06),e[3]>85.06&&(e[3]=85.06),this.mapAdapter.fitBounds(e,r)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise((e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,(()=>{e(this)}))}))}onMapLoad(t){return new Promise((e=>{var r;const i=()=>{const r=this.mapAdapter;t&&t(r),r&&e(r)},n=null===(r=this.mapAdapter.isLoaded)||void 0===r||r;this.mapAdapter.map&&n?i():this.mapAdapter.emitter.once("create",(()=>{i()}))}))}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()}getCoordFromMapClick(){return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new it(((t,e,r)=>{const i=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const n=()=>{this.setCursor(i),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",s),this._coordFromMapClickPromise=void 0},s=e=>{n(),function(t){!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat])}(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",s),r(n)})),this._coordFromMapClickPromise)}_emitStatusEvent(t,e){const r=t;this._eventsStatus[r]=!0,this.emitter.emit(r,e)}async _addLayerProviders(){}async _onLoadSync(){}async _setupMap(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return await this.mapAdapter.create(this.options),this._zoomToInitialExtent(),await this._addLayerProviders(),await this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this}_setTileJsonOptions(e){e.center&&(this.options.center=e.center),e.bounds&&(this.options.bounds=e.bounds),t(e.maxzoom)&&(this.options.zoom=e.maxzoom),t(e.minzoom)&&(this.options.zoom=e.minzoom),t(e.maxzoom)&&t(e.minzoom)&&(this.options.zoom=(e.maxzoom+e.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:r}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):r&&this.fitBounds(r)}_setInitMapState(t){for(const e of t){const t=new e(this);this._mapState.push(t);for(const e of this.runtimeParams){const r=e.get(t.name);if(void 0!==r){const e=t.parse(r);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter((e=>t.include.includes(e)))),e.forEach((t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){const e=this._mapState.find((e=>e.event===t));if(e){const t=e.toString(e.getValue());this.runtimeParams.forEach((r=>{r.set(e.name,t)}))}}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)}))}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter((e=>t.include.includes(e[0])))),e.forEach((([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)}))}}ht.keys=new class{constructor(){this.keyCodeAlias=new nt,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}};class dt extends ht{constructor(t){super(t),this._layersIdCounter=1,this._layersOrderCounter=1,this._baselayers=[],this._layers={},this._selectedLayers=[];const e=this.options.tileJson;e&&this.emitter.once("build-map",(()=>this.addTileJsonLayer(e)))}async fitLayer(t,e){const r=this.getLayer(t),i=r&&(r.getBounds||r.getExtent);if(i){const t=await i.call(r);t&&this.fitBounds(t,e)}}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach((e=>{const r=this._layers[e];r&&t.push(r)})),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort(((t,e)=>t.order&&e.order?t.order-e.order:0))}findLayer(t){for(const e in this._layers){const r=this._layers[e];if(t(r))return r}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}async addBaseLayer(t,e){return await this.addLayer(t,{...e,baselayer:!0},void 0)}async addLayer(e,r={},i){var n,s;const o=this._layersIdCounter++,a=t(i)?i:void 0!==r.order?r.order:this.reserveOrder();let l;"string"==typeof e?l=this.getLayerAdapter(e):"function"==typeof e?l=e:"then"in e&&(l=await e);const c=r;this._updateGeoJsonOptions(c);const h=null===(n=(r={id:String(o),order:a,...r}).visibility)||void 0===n||n;if(r.visibility=!1,r.baselayer&&(r.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:r,adapter:l});t&&(t.options&&(r=t.options),t.adapter&&(l=t.adapter))}if(void 0!==l){const t=new l(this.mapAdapter.map,r);let e;t.options={...r,...t.options},t.options.baselayer&&(r.baselayer=!0,r.order=0,t.options.order=0),t.options.id&&(e=String(t.options.id),this._layers[e]=t),this._emitLayerEvent("layer:preadd",e||"",t),await this.onMapLoad(),t.map=this.mapAdapter.map;const i=await t.addLayer(t.options);if(t.layer=i,t.id=t.options.id||String(o),t.options.id=t.id,r.baselayer&&(t.options.order=0),t.order=null!==(s=t.options.order)&&void 0!==s?s:a,e&&delete this._layers[e],e=String(t.id),this._layers[e])throw Error(`layer with id '${e}' already exist`);e&&(this._layers[e]=t,c.filter&&this.filterLayer(t,c.filter),r.baselayer&&this._baselayers.push(e),h&&await this.showLayer(e));const n=r.opacity;void 0!==n&&n<=1&&this.setLayerOpacity(t,n);const d=i&&(t.getBounds||t.getExtent);if(r.fit&&d){const e=await d.call(t);e&&await this.fitBounds(e)}return r.onAdded&&r.onAdded(t),this._emitLayerEvent("layer:add",e,t),t}return Promise.reject("No adapter")}async addLayerFromAsyncAdapter(t,e,r){const i=r||void 0!==e.order?e.order:this.reserveOrder(),n=t(),s=await n;return s?this.addLayer(s,e,i):Promise.reject("No adapter")}removeLayers(t){for(const e in this._layers){let r=!0;t&&(r=t(e,this._layers[e])),r&&(this.removeLayer(e),delete this._layers[e])}}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers(((t,e)=>!(e&&e.options&&e.options.baselayer)))}removeLayer(t){const e=this.getLayer(t),r=e&&this.getLayerId(e);if(e&&r){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(r);t&&this._baselayers.splice(t,1)}delete this._layers[r],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=j(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",{...e,url:t})}addImageLayer(t,e){let r;return"string"==typeof t?r=t:(r=t.url,e=t),this.addLayer("IMAGE",{...e,url:r})}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,r={}){const i=this.getLayer(t),n=void 0!==e?e:!(i&&i.options.visibility),s=void 0!==r.silent&&r.silent,o=async t=>{const e=String(t.id),r=n?"layer:show":"layer:hide";if(s||(this._emitLayerEvent(n?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),n&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter((e=>e!==t.id&&this.isLayerVisible(e)));for(const t of e)await this.hideLayer(t)}t.showLayer?await t.showLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.showLayer(t.layer),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?await t.hideLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.hideLayer(t.layer);t.options.visibility=n,s||(this._emitLayerEvent(r,e,t),this._emitLayerEvent("layer:toggle",e,t))};return i?this.onMapLoad().then((()=>o(i))):Promise.resolve()}updateLayer(t){const e=this.getLayer(t);if(e){if(e.updateLayer)return Promise.resolve(e.updateLayer());if(this.isLayerVisible(e))return this.hideLayer(e,{silent:!0}).then((()=>this.showLayer(e,{silent:!0})))}return Promise.resolve()}setLayerOpacity(t,e){const r=this.getLayer(t);r&&(r.setOpacity?r.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(r.layer,e))}isLayerLabelVisible(t){var e;const r=this.getLayer(t);return r.isLabelVisible?r.isLabelVisible():null===(e=r.options.labelVisibility)||void 0===e||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const r=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),r&&(e?r.showLabel&&(r.options.labelVisibility=!0,r.showLabel()):r.hideLabel&&(r.options.labelVisibility=!1,r.hideLabel()),r.id&&this._emitLayerEvent("layer:label:toggle",r.id,r)),e}selectLayer(t,e){const r=this.getLayer(t);if(r){r&&r.select&&r.select(e);const t=this.getLayerId(r);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const r=this.getLayer(t);if(r){const t=r&&r;t.unselect&&t.unselect(e);const i=this.getLayerId(r);if(i){const t=this._selectedLayers.indexOf(i);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const r=this.getLayer(t);return r.filter?r.filter(e):[]}propertiesFilter(t,e,r){const i=this.getLayer(t);if(i){const t=i;if(t.propertiesFilter)return t.propertiesFilter(e,r);t.filter&&this.filterLayer(t,(t=>!t.feature||!t.feature.properties||k(t.feature.properties,e)))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((()=>!0))}setLayerData(t,e){const r=this.getLayer(t);if(r){if(r.setData)return r.setData(e);if(r.clearLayer&&r.addData)return r.clearLayer(),r.addData(e)}return Promise.resolve()}addLayerData(t,e){const r=this.getLayer(t);r.addData&&r.addData(e)}clearLayerData(t,e){const r=this.getLayer(t);r&&r.clearLayer&&r.clearLayer(e)}setLayerPaint(t,e){const r=this.getLayer(t);e&&r&&r.setPaint&&r.setPaint(e)}setLayerSelectedPaint(t,e){const r=this.getLayer(t);e&&r&&r.setSelectedPaint&&r.setSelectedPaint(e)}updateLayerPaint(t,e){const r=this.getLayer(t);e&&r&&r.updatePaint&&r.updatePaint(e)}updateLayerSelectedPaint(t,e){const r=this.getLayer(t);e&&r&&r.updateSelectedPaint&&r.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const r in this._layers){const i=this._layers[r];let n=!(void 0===t.onlyVisible||t.onlyVisible)||i.options.visibility;if(n&&t.onlyBaselayer&&(n=this._baselayers.includes(r)),n){const t=i.options&&i.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find((t=>this.isLayerVisible(t)));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})}_emitLayerEvent(e,r,i){const n=String(e);if(t(r)&&n.startsWith("layer:")){const t=n.replace("layer:","layer-"+r+":");this.emitter.emit(t,i)}this.emitter.emit(e,i)}async _onLayerClick(t){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)}async _onLayerSelect(t){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)}_updateGeoJsonOptions(e){const{onSelect:r,onLayerSelect:i,onClick:n,onLayerClick:s,onMouseOut:o,onMouseOver:a}=e,l=n||s;e.onClick=t=>(l&&l(t),this._onLayerClick(t)),e.onMouseOut=e=>{const r=e.layer.id;o&&o(e),t(r)&&this._emitLayerEvent("layer:mouseout",r,e)},e.onMouseOver=e=>{const r=e.layer.id;a&&a(e),t(r)&&this._emitLayerEvent("layer:mouseover",r,e)};const c=r||i;e.onSelect=t=>(c&&c(t),this._onLayerSelect(t)),e.nativePaint||(this.options.paint&&(e.paint=S({paint:e.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),e.selectedPaint&&this.options.selectedPaint&&(e.selectedPaint=S({paint:e.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}function ut(t,e){const r=document.createElement("div");let i=!1;e.getStatus?i=e.getStatus():e.status&&(i=e.status);const n=e.title||"",s=e.html;function o(){n&&(r.title="string"==typeof n?n:i?n.on:n.off,r.setAttribute("aria-label",r.title))}function a(t){t instanceof HTMLElement?(r.innerHTML="",r.appendChild(t)):"string"==typeof t&&(r.innerHTML=t)}function l(){s&&("string"==typeof s||s instanceof HTMLElement?a(s):a(i?s.on:s.off),r.setAttribute("aria-label",r.title))}function c(t,e){t.split(" ").forEach((t=>{e?r.classList.add(t):r.classList.remove(t)}))}function h(){e.addClassOn&&c(e.addClassOn,i),e.addClassOff&&c(e.addClassOff,!i)}o(),l(),e.addClass&&c(e.addClass,!0),h();const d=t=>{void 0!==t&&(i=t),l(),o(),h()},u=t=>{if(i=void 0!==t?t:!i,e.onClick){const t=e.onClick(i);Promise.resolve(t).then((()=>d())).catch((()=>i=!i))}else d()},p=t({html:r,onClick:u});return p.onClick=u,p.changeStatus=d,p}class pt extends dt{constructor(){super(...arguments),this._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},this._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1}}async addControl(t,e,r){let i;if(e=null!=e?e:"top-left",i="string"==typeof t?this.getControl(t,r):t,i)return new Promise((t=>{this._setControlQueue(e,(async()=>{const r=await i,n=this.mapAdapter.addControl(r,e);t(n)}))}))}async createControl(t,e){if(await this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)}async createButtonControl(t){if(await this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)}async createToggleControl(t){return await this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?ut(this.mapAdapter.createButtonControl,t):void 0}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((t=>{this.mapAdapter.removeControl(t)}))}getControl(t,e){const r=this.mapAdapter.controlAdapters[t];if(r)return new r(e);{const r=pt.controls[t];if(r)return r(this,e)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}async _applyControls(t){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];await e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1}}pt.controls={CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)};const ft={};function yt(t){return ft[t]}class mt extends pt{constructor(t){super(t),this._addControls(),ft[this.id]=this}static get(t){return yt(t)}async _addLayerProviders(){for await(const t of this._starterKits)if(t.getLayerAdapters){const e=await t.getLayerAdapters.call(t);if(e)for await(const t of e){const e=await t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}}async _onLoadSync(){for await(const e of this._starterKits)if(e.onLoadSync)try{await e.onLoadSync.call(e,this)}catch(t){console.error(t)}}_addControls(){this.options.controls&&this.options.controls.forEach((t=>{let e=t,r={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(r=this.options.controlsOptions[t],void 0!==r.control&&(e=r.control));const{position:i,...n}=r;this.addControl(e,i||"top-left",n)})),this._emitStatusEvent("controls:create")}}function gt(){return["ZOOM","ATTRIBUTION"]}async function vt(t){return new mt(t).onLoad()}export{mt as WebMap,pt as WebMapControls,dt as WebMapLayers,ht as WebMapMain,ut as createToggleControl,vt as createWebMap,x as detectGeometryType,M as findMostFrequentGeomType,gt as getDefaultControls,yt as getWebMap,j as updateGeoJsonAdapterOptions};
//# sourceMappingURL=webmap.esm-browser.prod.js.map

@@ -1,2 +0,2 @@

var WebMap=function(t){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},e(t,r)};function r(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};function i(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(u){s=[6,u],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function a(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=a(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,i){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,i,(e=t[r](e)).done,e.value)}))}}}function u(t){return null!=t}function c(t,e,r){void 0===r&&(r=!1);var n=t,i=e,o=Array.isArray(i),a=o&&[]||{};return o&&Array.isArray(i)?r?(a=a.concat(n=n||[]),i.forEach((function(t,e){void 0===a[e]?a[e]=t:"object"==typeof t?a[e]=c(n[e],t,r):-1===n.indexOf(t)&&a.push(t)}))):a=i:(n&&"object"==typeof n&&Object.keys(n).forEach((function(t){a[t]=n[t]})),Object.keys(i).forEach((function(t){a[t]="object"==typeof i[t]&&i[t]&&"object"==typeof n[t]&&"object"==typeof i[t]?c(n[t],i[t],r):i[t]}))),a}function f(t){return{type:"Polygon",coordinates:[l(t)]}}function l(t){var e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}function p(t){return"function"==typeof t}"function"==typeof SuppressedError&&SuppressedError;var h=function(t,e,r){try{var n=t(e,r);if(void 0!==n)return n}catch(i){}};function d(t){return function(e,r){for(var n=0,i=e;n<i.length;n++){var o=h(t,i[n],r);if(void 0!==o)return o}throw new Error("Received a mismatched type")}}var y={array:function(t){var e,r=t[0],n=t[1],i=t[2],o=void 0,a=void 0;if("string"==typeof r&&["string","number","boolean"].includes(r)?(o=r,"number"==typeof n?(a=n,e=i):e=n):Array.isArray(r)&&(e=r),!Array.isArray(e))throw new Error("Expected an array");if(o&&!e.every((function(t){return typeof t===o})))throw new Error("Expected all items in array to be of type ".concat(o));if(a&&e.length!==a)throw new Error("Expected array of length ".concat(a));return e},boolean:d((function(t){return"boolean"==typeof t?t:void 0})),literal:function(t){return t[0]},number:d((function(t){return"number"==typeof t?t:void 0})),object:d((function(t){return null===t||"object"!=typeof t||Array.isArray(t)?void 0:t})),string:d((function(t){return"string"==typeof t?t:void 0})),"to-boolean":d(Boolean),"to-number":d(Number),"to-string":d(String),typeof:function(t){return typeof t[0]}};var v={get:function(t,e){var r=t[0],n=t[1]||e;return n&&"object"==typeof n&&r in n?n[r]:null},length:function(t){var e=t[0];if("string"==typeof e||Array.isArray(e))return e.length},at:function(t){return t[1][t[0]]},has:function(t,e){var r=t[1]||e;return!(!r||"object"!=typeof r||!(t[0]in r))},in:function(t){var e=t[0],r=t[1];if("string"==typeof r)return r.includes(String(e));if(Array.isArray(r))return r.includes(e);throw new Error("Invalid input type for 'in'. Expected string or array, got ".concat(typeof r,"."))},"index-of":function(t){var e=t[0],r=t[1],n=t[2];if("string"==typeof r)return r.indexOf(String(e),n);if(Array.isArray(r))return r.indexOf(e,n);throw new Error("Invalid input type for 'index-of'. Expected string or array, got ".concat(typeof r,"."))},slice:function(t){var e=t[0],r=t[1],n=t[2];if("string"==typeof e)return e.slice(r,n);if(Array.isArray(e))return e.slice(r,n);throw new Error("Invalid input type for 'slice'. Expected string or array, got ".concat(typeof e,"."))}},m={concat:function(t){return t.reduce((function(t,e){return String(t)+String(e)}),"")},downcase:function(t){return String(t[0]).toLowerCase()},upcase:function(t){return String(t[0]).toUpperCase()}};var g=function(t){if(typeof t[0]!=typeof t[1])throw new Error("Values have different types.")};var b={"!":function(t){return!t[0]},"!=":function(t){var e=t[0],r=t[1];return g([e,r]),e!==r},"<":function(t){var e=t[0],r=t[1];return g([e,r]),e<r},"<=":function(t){var e=t[0],r=t[1];return g([e,r]),e<=r},"==":function(t){var e=t[0],r=t[1];return g([e,r]),e===r},">":function(t){var e=t[0],r=t[1];return g([e,r]),e>r},">=":function(t){var e=t[0],r=t[1];return g([e,r]),e>=r},all:function(t){for(var e=0;e<t.length;e++){if(!t[e])return!1}return!0},any:function(t){for(var e=0;e<t.length;e++){if(t[e])return!0}return!1},case:function(t){if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');var e=t[t.length-1];if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(var r=0;r<t.length-1;r+=2){if(t[r])return t[r+1]}return e},match:function(t){for(var e=t[0],r=t.slice(1),n=r.splice(-1,r.length%2)[0],i=0;i<r.length-1;i+=2){if(r[i]===e)return r[i+1]}return n}};var L={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _(t){if("string"==typeof(o=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(o))return w(t);if("string"==typeof(i=t)&&i in L)return function(t){return w(L[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){var e,r=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(e=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)];if(e=t.match(r))return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])];throw new Error("The '".concat(t,"' Is not valid rgb"))}(t);if("object"==typeof(n=t)&&null!==n&&"r"in n&&"g"in n&&"b"in n&&(!("a"in n)||"number"==typeof n.a&&n.a>=0&&n.a<=1))return function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([(e=t).r,e.g,e.b],void 0!==(r=e.a)?[r]:[],!0);var e,r,n,i,o;throw new Error("The '".concat(t,"' cannot be converted to color"))}function w(t){var e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error("The '".concat(t,"' Is not valid hex"))}function C(t,e,r,n,i){if("number"==typeof r&&"number"==typeof i)return r+(t-e)/(n-e)*(i-r);try{var o=_(r),a=_(i);return function(t){return"rgb(".concat(t.join(","),")")}(o.map((function(r,i){return Math.ceil(C(t,e,r,n,a[i]))})))}catch(s){console.log(s)}throw new Error("Unsupported output type for linear interpolation.")}var A={step:function(t){var e=t[0],r=t[1],n=t.slice(2);if("number"!=typeof e)return r;for(var i=0;i<n.length-2;i+=2){if(e>=n[i]&&e<n[i+2])return n[i+1]}return e>=n[n.length-2]?n[n.length-1]:r},interpolate:function(t){var e=t[0],r=t[1],n=t.slice(2);if(n.length<2)throw new Error("At least two stops are required");if("number"!=typeof r)throw new Error("Input must be a number.");if(n.length<2||n.length%2!=0)throw new Error("Invalid stops provided.");for(var i=0;i<n.length-2;i+=2){var o=n[i],a=n[i+2];if(r>=o&&r<=a&&"linear"===e[0])return C(r,o,n[i+1],a,n[i+3])}throw new Error("Invalid interpolation type.")}};function P(t){if(Array.isArray(t)){var e=t[0],r=t.slice(1);return"string"==typeof e&&"literal"!==e&&e in E&&r.length>0}return!1}var E=n(n(n(n(n(n({},{"+":function(t){return t.reduce((function(t,e){return t+e}),0)},"-":function(t){return t.reduce((function(t,e){return t-e}))},"*":function(t){return t.reduce((function(t,e){return t*e}),1)},"/":function(t){return t.reduce((function(t,e){return t/e}))},"%":function(t){return t[0]%t[1]},"^":function(t){return Math.pow(t[0],t[1])},abs:function(t){return Math.abs(t[0])},acos:function(t){return Math.acos(t[0])},asin:function(t){return Math.asin(t[0])},atan:function(t){return Math.atan(t[0])},ceil:function(t){return Math.ceil(t[0])},cos:function(t){return Math.cos(t[0])},e:function(){return Math.E},floor:function(t){return Math.floor(t[0])},ln:function(t){return Math.log(t[0])},ln2:function(){return Math.LN2},log10:function(t){return Math.log10(t[0])},log2:function(t){return Math.log2(t[0])},max:function(t){return Math.max.apply(Math,t)},min:function(t){return Math.min.apply(Math,t)},pi:function(){return Math.PI},round:function(t){return Math.round(t[0])},sin:function(t){return Math.sin(t[0])},sqrt:function(t){return Math.sqrt(t[0])},tan:function(t){return Math.tan(t[0])}}),y),m),v),b),A);function k(t,e){void 0===e&&(e={});var r=t[0],n=t.slice(1),i=E[r];if(i)return i(n.map((function(t){return P(t)?k(t,e):t})),e);throw new Error('Expression "'.concat(r,'" is not supported.'))}function O(t){return function(e){var r=e.properties;return!!r&&k(t,r)}}var S=["iconSize","iconAnchor"];function M(t,e,r){if((e=String(e))===(t=String(t)))return!0;if(r&&e.toUpperCase()===t.toUpperCase())return!0;var n,i="^".concat((n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(i,r?"i":"").exec(t)}var x={gt:function(t,e){return t>e},lt:function(t,e){return t<e},ge:function(t,e){return t>=e},le:function(t,e){return t<=e},eq:function(t,e){return t===e},ne:function(t,e){return t!==e},in:function(t,e){return-1!==e.indexOf(t)},notin:function(t,e){return-1===e.indexOf(t)},like:function(t,e){return M(t,e)},ilike:function(t,e){return M(t,e,!0)}};function F(t,e){var r="string"==typeof e[0]?e[0]:"all",n=function(e){if(3===(u=e).length&&"string"==typeof u[0]&&"string"==typeof u[1]){var r=e[0],n=e[1],i=e[2],o=x[n];if(o){if(("like"===n||"ilike"===n)&&"string"==typeof r){var a="",s=r.replace(/^%?(\w+)%?$/,(function(e,n){return a=t[n],r.replace(n,i)}));return o(a,s)}return o(t[r],i)}return!1}return F(t,e);var u},i=e.filter((function(t){return Array.isArray(t)}));return"any"===r?i.some(n):i.every(n)}function I(t){for(var e={},r=[],i=0,o=t;i<o.length;i++){var a=o[i];a&&(Array.isArray(a)?r.push(a):e=a)}return function(t){var i=r.find((function(e){return function(t,e){var r=n({},t.properties);return!!r&&(r.$id=t.id,F(r,e))}(t,e[0])}));return i?n(n({},e),i[1]):e}}function j(t){var e=t.paint,r=t.defaultPaint,i=function(t){var e=!1,r={};for(var i in t)if(-1===S.indexOf(i)){var o=i,a=t[o];P(a)&&(e=!0,r[o]=O(a))}if(e)return function(e){var i={};for(var o in r)i[o]=r[o](e);return n(n({},t),i)}}(e);if(i){var o=function(t){return B({paint:i(t),defaultPaint:r})};return o.paint=T({paint:e,defaultPaint:r}),o}return T({paint:e,defaultPaint:r})}function T(t){var e,r=t.paint,i=n({},t.defaultPaint);return(i=n(n({},i),r)).fill=null===(e=i.fill)||void 0===e||e,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity),i}function B(t){var e=t.paint,r=t.defaultPaint,i=t.getPaintFunctions;if(!e)throw new Error("paint is empty");var o=n({},r);if(p(e)){var a=function(t){var n=B({paint:e(t),defaultPaint:r,getPaintFunctions:i});return n.type=e.type,n};return a.type=e.type,a}if(function(t){return!!Array.isArray(t)}(e))return function(t){return B({paint:I(e)(t),defaultPaint:r,getPaintFunctions:i})};if("get-paint"===e.type){var s=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){var r=e[t.from];if(r)return r(t.options)}}(e,i);s&&(o=B({paint:s,defaultPaint:r,getPaintFunctions:i}))}else{if("icon"===e.type)return e;o=j({paint:e,defaultPaint:r})}return p(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}function z(t){for(var e,r={},n=0;n<t.length;n++)r[t[n]]=1+(r[t[n]]||0);for(var i in r){r[i]>((void 0!==e?r[e]:0)||0)&&(e=i)}return e}function V(t){var e;if("FeatureCollection"===t.type)e=z(t.features.map((function(t){return t.geometry.type})));else if("GeometryCollection"===t.type){e=z(t.geometries.map((function(t){return t.type})))}else e="Feature"===t.type?t.geometry.type:t.type;return e}var R={polygon:"path",line:"path",point:"circle"},N={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function q(t){if(t.data){var e=N[V(t.data)],r=t.paint;r&&"[object Object]"===Object.prototype.toString.call(r)&&(r.type=r.type?r.type:"polygon"===e||"line"===e?"path":"html"in r||"className"in r?"icon":R[e]),t.type=t.type||e}return t}var Z,G={exports:{}},J="object"==typeof Reflect?Reflect:null,$=J&&"function"==typeof J.apply?J.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};Z=J&&"function"==typeof J.ownKeys?J.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var W=Number.isNaN||function(t){return t!=t};function D(){D.init.call(this)}G.exports=D,G.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}nt(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&nt(t,"error",e,r)}(t,i,{once:!0})}))},D.EventEmitter=D,D.prototype._events=void 0,D.prototype._eventsCount=0,D.prototype._maxListeners=void 0;var H=10;function K(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function U(t){return void 0===t._maxListeners?D.defaultMaxListeners:t._maxListeners}function Q(t,e,r,n){var i,o,a,s;if(K(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=U(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function X(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Y(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=X.bind(n);return i.listener=r,n.wrapFn=i,i}function tt(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):rt(i,i.length)}function et(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function rt(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function nt(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(D,"defaultMaxListeners",{enumerable:!0,get:function(){return H},set:function(t){if("number"!=typeof t||t<0||W(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");H=t}}),D.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},D.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||W(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},D.prototype.getMaxListeners=function(){return U(this)},D.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[t];if(void 0===s)return!1;if("function"==typeof s)$(s,this,e);else{var u=s.length,c=rt(s,u);for(r=0;r<u;++r)$(c[r],this,e)}return!0},D.prototype.on=D.prototype.addListener=function(t,e){return Q(this,t,e,!1)},D.prototype.prependListener=function(t,e){return Q(this,t,e,!0)},D.prototype.once=function(t,e){return K(e),this.on(t,Y(this,t,e)),this},D.prototype.prependOnceListener=function(t,e){return K(e),this.prependListener(t,Y(this,t,e)),this},D.prototype.removeListener=function(t,e){var r,n,i,o,a;if(K(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,a||e)}return this},D.prototype.off=D.prototype.removeListener,D.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},D.prototype.listeners=function(t){return tt(this,t,!0)},D.prototype.rawListeners=function(t){return tt(this,t,!1)},D.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):et.call(t,e)},D.prototype.listenerCount=et,D.prototype.eventNames=function(){return this._eventsCount>0?Z(this._events):[]};var it=function(t){function e(){var r=t.call(this)||this;return r.name="CancelError",Object.setPrototypeOf(r,e.prototype),r}return r(e,t),e}(Error),ot=function(){function t(t){void 0===t&&(t={}),this.options=t,this._promises=new Map}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._promises.size>0},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())},t.prototype.get=function(t){return this._promises.get(t)},t.prototype.add=function(t,e){var r=this,n=e||t,i=this._promises.get(n);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),i||(this._promises.set(n,t),t.finally((function(){r.remove(n)})),t)},t.prototype.abort=function(){this.isLoaded&&(this._promises.forEach((function(t){t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())},t.prototype.waitFunc=function(t,e){void 0===e&&(e="");var r=this.get(e=e||t.name);return r||this.add(t(),e)},t.prototype.WaitForMe=function(t){void 0===t&&(t="");var e=this.get.bind(this),r=this.add.bind(this);return function(n,i,o){var a=o.value;return t=t||i,o.value=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=e(t);return o||r(a.apply(this,n),t)},o}},t.prototype.GetOrCreateDecorator=function(t){return void 0===t&&(t=""),this.WaitForMe(t)},t.prototype._onStop=function(){this.options.onStop&&!this.isLoaded&&this.options.onStop()},t}(),at=function(t){function e(){var r=t.call(this)||this;return r.name="TimeoutError",Object.setPrototypeOf(r,e.prototype),r}return r(e,t),e}(Error),st=function(t,e,r,n){try{t(r(n))}catch(i){e(i)}},ut=0,ct=function(){function t(e,r){var n=this;this.id=ut++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise((function(t,e){n._setCanceledCallback=function(e){return t(e||new it)}}));var i=[this._cancelPromise,new Promise((function(r,i){return e((function(e){e instanceof t?n.attach(e):n._isPending=!1,r(e)}),(function(t){n._isPending=!1,i(t)}),(function(t){if(!n._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");n._cancelHandlers.push(t)}))}))];r&&i.push(new Promise((function(t,e){setTimeout((function(){if(n._isPending)try{n.cancel()}finally{e(new at)}}),r)}))),this._promise=Promise.race(i)}return t.createControl=function(t){return new ot(t)},t.resolve=function(e){return new t((function(t){return t(e)}))},t.reject=function(e){return new t((function(t,r){return r(e)}))},t.all=function(e){var r=this;return new t((function(t,r){Promise.all(e).then(t).catch(r)})).catch((function(t){if(t instanceof r.CancelError)for(var n=0,i=e;n<i.length;n++){var o=i[n];"cancel"in o&&o.cancel()}throw t}))},t.prototype.attach=function(t){this._isCanceled?t.cancel():this._children.push(t)},t.prototype.then=function(e,r){var n=this,i=new t((function(t,i){if(n._promise){var o=function(e){r?st(t,i,r,e):i(e)};n._promise.then((function(r){n._isCanceled?o(r):e?st(t,i,e,r):t(r)}),o)}}));return i._parentPromise=this,this._children.push(i),i},t.prototype.catch=function(t){return this._isCanceled&&t&&t(new it),this.then(void 0,t)},t.prototype.finally=function(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new it:t)},t.prototype.cancel=function(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;var t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((function(t){return t.cancel()})),this._isPending){if(this._cancelHandlers.length)try{for(var e=0,r=this._cancelHandlers;e<r.length;e++){(0,r[e])()}}catch(n){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this},t.prototype._getTopParent=function(){for(var t=this._parentPromise,e=!!t;e;)e=!(!t||!t._parentPromise)&&!!(t=t._parentPromise);return t},t.prototype._destroy=function(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0},t.CancelError=it,t.TimeoutError=at,t.PromiseControl=ot,t}();Object.setPrototypeOf(ct.prototype,Promise.prototype);var ft=ct,lt=function(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222},pt=function(){function t(){this.keyCodeAlias=new lt,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}return t.prototype.pressed=function(t){var e=this.keyCodeAlias[t];return!!e&&this.keys[e]},t.prototype.addKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))},t.prototype.removeKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))},t.prototype.keysPressed=function(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)},t.prototype.keysReleased=function(t){t.stopPropagation(),this.keys[t.keyCode]=!1},t.prototype.windowOnFocus=function(){this.keys={}},t}(),ht=function(){function t(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}return t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(t){this.value=t},t}(),dt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="center",e.event="moveend",e}return r(e,t),e.prototype.getValue=function(){return this.webMap.getCenter()},e.prototype.setValue=function(t){this.webMap.setCenter(t)},e.prototype.toString=function(t){var e=t.map((function(t){return t.toFixed(5)}));return e[0]+"_"+e[1]},e.prototype.parse=function(t){return t.split("_").map(Number)},e}(ht),yt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="zoom",e.event="zoomend",e}return r(e,t),e.prototype.getValue=function(){var t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0},e.prototype.setValue=function(t){this.webMap.setZoom(t)},e.prototype.toString=function(t){return String(t)},e.prototype.parse=function(t){return Number(t)},e}(ht);var vt=0,mt={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},gt=function(){function t(e){this.options=mt,this.emitter=new G.exports.EventEmitter,this.keys=t.keys,this.runtimeParams=[],this.getPaintFunctions=t.getPaintFunctions,this.mapState=[dt,yt],this.id=vt++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=c(mt||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}return t.prototype.getId=function(){return this.id},t.prototype.create=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.getEventStatus("create")?[3,3]:[4,this._setInitMapState(this.mapState)];case 1:return t.sent(),[4,this._setupMap()];case 2:t.sent(),this._emitStatusEvent("create",this),t.label=3;case 3:return[2,this]}}))}))},t.prototype.setRuntimeParams=function(t){this.runtimeParams.push(t)},t.prototype.destroy=function(){this._removeEventListeners(),function(t){for(var e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()},t.prototype.getState=function(){var t={};return this._mapState.forEach((function(e){t[e.name]=e.getValue()})),t},t.prototype.getRuntimeParams=function(){var t=this,e={};return this._mapState.forEach((function(r){for(var n=0,i=t.runtimeParams;n<i.length;n++){var o=i[n].get(r.name);if(void 0!==o){e[r.name]=r.parse(o);break}}})),e},t.prototype.getContainer=function(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){var t=document.getElementById(this.options.target);if(t)return t}}},t.prototype.setCursor=function(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)},t.prototype.getCursor=function(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();var t=this.getContainer();return t?t.style.cursor:void 0},t.prototype.setCenter=function(t){return this.mapAdapter.setCenter(t),this},t.prototype.getCenter=function(){return this.mapAdapter.getCenter()},t.prototype.getBounds=function(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()},t.prototype.getBoundsPolygon=function(){var t=this.getBounds();if(t)return{type:"Feature",properties:{},geometry:f(t)}},t.prototype.setZoom=function(t){return this.mapAdapter.setZoom(t),this},t.prototype.getZoom=function(){var t=this.mapAdapter.getZoom();if("number"==typeof t)return t},t.prototype.zoomIn=function(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t+1)}},t.prototype.zoomOut=function(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t-1)}},t.prototype.setView=function(t,e){if(Array.isArray(t)){var r=t;this.mapAdapter.setView&&r&&u(e)?this.mapAdapter.setView(r,e):(r&&this.mapAdapter.setCenter(r),u(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}},t.prototype.fitBounds=function(t,e){return t.every((function(t){return u(t)}))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this},t.prototype.getEventStatus=function(t){var e=this._eventsStatus[t];return null!=e&&e},t.prototype.onLoad=function(t){var e=this;return void 0===t&&(t="create"),new Promise((function(r){e.getEventStatus(t)?r(e):e.emitter.once(t,(function(){r(e)}))}))},t.prototype.onMapLoad=function(t){var e=this;return new Promise((function(r){var n,i=function(){var n=e.mapAdapter;t&&t(n),n&&r(n)},o=null===(n=e.mapAdapter.isLoaded)||void 0===n||n;e.mapAdapter.map&&o?i():e.mapAdapter.emitter.once("create",(function(){i()}))}))},t.prototype.getLayerAdapters=function(){return this.mapAdapter.layerAdapters},t.prototype.getLayerAdapter=function(t){return this.mapAdapter.layerAdapters[t]},t.prototype.locate=function(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:function(){return{}}}},t.prototype.stopGetCoordFromMapClick=function(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()},t.prototype.getCoordFromMapClick=function(){var t=this;return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new ft((function(e,r,n){var i=t.getCursor()||"grab";t._removeEventListeners({include:["click"]}),t.setCursor("crosshair");var o=function(){t.setCursor(i),t._addEventsListeners({include:["click"]}),t.mapAdapter.emitter.off("click",a),t._coordFromMapClickPromise=void 0},a=function(t){var r;o(),!(r=t).lngLat&&r.latLng&&(r.lngLat=[r.latLng.lng,r.latLng.lat]),e(t.lngLat)};t.mapAdapter.emitter.once("click",a),n(o)})),this._coordFromMapClickPromise)},t.prototype._emitStatusEvent=function(t,e){var r=t;this._eventsStatus[r]=!0,this.emitter.emit(r,e)},t.prototype._addLayerProviders=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2]}))}))},t.prototype._onLoadSync=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2]}))}))},t.prototype._setupMap=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return[4,this.mapAdapter.create(this.options)];case 1:return t.sent(),this._zoomToInitialExtent(),[4,this._addLayerProviders()];case 2:return t.sent(),[4,this._onLoadSync()];case 3:return t.sent(),this._emitStatusEvent("build-map",this.mapAdapter),[2,this]}}))}))},t.prototype._setTileJsonOptions=function(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),u(t.maxzoom)&&(this.options.zoom=t.maxzoom),u(t.minzoom)&&(this.options.zoom=t.minzoom),u(t.maxzoom)&&u(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)},t.prototype._zoomToInitialExtent=function(){var t,e=(t=this.options).center,r=t.zoom,n=t.bounds;this._extent?this.fitBounds(this._extent):e&&r?this.setView(e,r):n&&this.fitBounds(n)},t.prototype._setInitMapState=function(t){for(var e=0,r=t;e<r.length;e++){var n=new(0,r[e])(this);this._mapState.push(n);for(var i=0,o=this.runtimeParams;i<o.length;i++){var a=o[i].get(n.name);if(void 0!==a){var s=n.parse(a);this._initMapState[n.name]=s,Object.defineProperty(this.options,n.name,{value:s,configurable:!0,enumerable:!0});break}}}},t.prototype._addEventsListeners=function(t){var e=this,r=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(r=r.filter((function(e){return t.include.includes(e)}))),r.forEach((function(t){e._mapEvents[t]=function(r){if(e.runtimeParams.length){var n=e._mapState.find((function(e){return e.event===t}));if(n){var i=n.toString(n.getValue());e.runtimeParams.forEach((function(t){t.set(n.name,i)}))}}e._eventsStatus&&e.emitter.emit(t,r)};var r=e._mapEvents[t];r&&e.mapAdapter.emitter.on(t,r)}))},t.prototype._removeEventListeners=function(t){var e=this,r=Object.entries(this._mapEvents);t&&t.include&&(r=r.filter((function(e){return t.include.includes(e[0])}))),r.forEach((function(t){var r=t[1];r&&e.mapAdapter.emitter.removeListener(t[0],r)}))},t.keys=new pt,t}(),bt=function(t){function e(e){var r=t.call(this,e)||this;r._layersIdCounter=1,r._layersOrderCounter=1,r._baselayers=[],r._layers={},r._selectedLayers=[];var n=r.options.tileJson;return n&&r.emitter.once("build-map",(function(){return r.addTileJsonLayer(n)})),r}return r(e,t),e.prototype.fitLayer=function(t,e){return i(this,void 0,void 0,(function(){var r,n,i;return o(this,(function(o){switch(o.label){case 0:return r=this.getLayer(t),(n=r&&(r.getBounds||r.getExtent))?[4,n.call(r)]:[3,2];case 1:(i=o.sent())&&this.fitBounds(i,e),o.label=2;case 2:return[2]}}))}))},e.prototype.isBaseLayer=function(t){var e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)},e.prototype.getBaseLayers=function(){var t=this,e=[];return this._baselayers.forEach((function(r){var n=t._layers[r];n&&e.push(n)})),e},e.prototype.getBaseLayersIds=function(){return this._baselayers},e.prototype.getLayer=function(t){return"string"==typeof t?this._layers[t]:t},e.prototype.getLayerId=function(t){var e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")},e.prototype.getLayers=function(){return Object.keys(this._layers)},e.prototype.allLayers=function(){return this._layers},e.prototype.orderedLayers=function(){return Object.values(this._layers).sort((function(t,e){return t.order&&e.order?t.order-e.order:0}))},e.prototype.findLayer=function(t){for(var e in this._layers){var r=this._layers[e];if(t(r))return r}},e.prototype.isLayerVisible=function(t){var e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility},e.prototype.addBaseLayer=function(t,e){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.addLayer(t,n(n({},e),{baselayer:!0}),void 0)];case 1:return[2,r.sent()]}}))}))},e.prototype.addLayer=function(t,e,r){var a,s;return void 0===e&&(e={}),i(this,void 0,void 0,(function(){var i,c,f,l,p,h,d,y,v,m,g,b;return o(this,(function(o){switch(o.label){case 0:return i=this._layersIdCounter++,c=u(r)?r:void 0!==e.order?e.order:this.reserveOrder(),"string"!=typeof t?[3,1]:(f=this.getLayerAdapter(t),[3,4]);case 1:return"function"!=typeof t?[3,2]:(f=t,[3,4]);case 2:return"then"in t?[4,t]:[3,4];case 3:f=o.sent(),o.label=4;case 4:return this._updateGeoJsonOptions(l=e),e=n({id:String(i),order:c},e),p=null===(a=e.visibility)||void 0===a||a,e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer&&(h=this.options.onBeforeAddLayer({options:e,adapter:f}))&&(h.options&&(e=h.options),h.adapter&&(f=h.adapter)),void 0===f?[3,12]:((d=new f(this.mapAdapter.map,e)).options=n(n({},e),d.options),d.options.baselayer&&(e.baselayer=!0,e.order=0,d.options.order=0),y=void 0,d.options.id&&(y=String(d.options.id),this._layers[y]=d),this._emitLayerEvent("layer:preadd",y||"",d),[4,this.onMapLoad()]);case 5:return o.sent(),d.map=this.mapAdapter.map,[4,d.addLayer(d.options)];case 6:if(v=o.sent(),d.layer=v,d.id=d.options.id||String(i),d.options.id=d.id,e.baselayer&&(d.options.order=0),d.order=null!==(s=d.options.order)&&void 0!==s?s:c,y&&delete this._layers[y],y=String(d.id),this._layers[y])throw Error("layer with id '".concat(y,"' already exist"));return y?(this._layers[y]=d,l.filter&&this.filterLayer(d,l.filter),e.baselayer&&this._baselayers.push(y),p?[4,this.showLayer(y)]:[3,8]):[3,8];case 7:o.sent(),o.label=8;case 8:return void 0!==(m=e.opacity)&&m<=1&&this.setLayerOpacity(d,m),g=v&&(d.getBounds||d.getExtent),e.fit&&g?[4,g.call(d)]:[3,11];case 9:return(b=o.sent())?[4,this.fitBounds(b)]:[3,11];case 10:o.sent(),o.label=11;case 11:return e.onAdded&&e.onAdded(d),this._emitLayerEvent("layer:add",y,d),[2,d];case 12:return[2,Promise.reject("No adapter")]}}))}))},e.prototype.addLayerFromAsyncAdapter=function(t,e,r){return i(this,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=r||void 0!==e.order?e.order:this.reserveOrder(),[4,t()];case 1:return(i=o.sent())?[2,this.addLayer(i,e,n)]:[2,Promise.reject("No adapter")]}}))}))},e.prototype.removeLayers=function(t){for(var e in this._layers){var r=!0;t&&(r=t(e,this._layers[e])),r&&(this.removeLayer(e),delete this._layers[e])}},e.prototype.reserveOrder=function(){return this._layersOrderCounter++},e.prototype.removeOverlays=function(){this.removeLayers((function(t,e){return!(e&&e.options&&e.options.baselayer)}))},e.prototype.removeLayer=function(t){var e=this.getLayer(t),r=e&&this.getLayerId(e);if(e&&r){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){var n=this._baselayers.indexOf(r);n&&this._baselayers.splice(n,1)}delete this._layers[r],this.emitter.emit("layer:remove",e)}},e.prototype.addGeoJsonLayer=function(t,e){return void 0===t&&(t={}),(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=q(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)},e.prototype.addFeatureLayer=function(t){return void 0===t&&(t={}),this.addGeoJsonLayer(t)},e.prototype.addTileLayer=function(t,e){return void 0===e&&(e={}),this.addLayer("TILE",n(n({},e),{url:t}))},e.prototype.addImageLayer=function(t,e){var r;return"string"==typeof t?r=t:(r=t.url,e=t),this.addLayer("IMAGE",n(n({},e),{url:r}))},e.prototype.showLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!0,e)},e.prototype.hideLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!1,e)},e.prototype.toggleLayer=function(t,e,r){var n=this;void 0===r&&(r={});var a=this.getLayer(t),s=void 0!==e?e:!(a&&a.options.visibility),u=void 0!==r.silent&&r.silent;return a?this.onMapLoad().then((function(){return t=a,i(n,void 0,void 0,(function(){var e,r,n,i,a,c,f,l=this;return o(this,(function(o){switch(o.label){case 0:if(e=String(t.id),r=s?"layer:preshow":"layer:prehide",n=s?"layer:show":"layer:hide",u||(this._emitLayerEvent(r,e,t),this._emitLayerEvent("layer:pretoggle",e,t)),!s||!this.mapAdapter)return[3,9];if(i=t.options.baselayer?0:t.options.order,!t.options.baselayer||!this._baselayers.length)return[3,4];a=this._baselayers.filter((function(e){return e!==t.id&&l.isLayerVisible(e)})),c=0,f=a,o.label=1;case 1:return c<f.length?[4,this.hideLayer(f[c])]:[3,4];case 2:o.sent(),o.label=3;case 3:return c++,[3,1];case 4:return t.showLayer?[4,t.showLayer.call(t,t.layer)]:[3,6];case 5:return o.sent(),[3,8];case 6:return void 0===t.layer?[3,8]:[4,this.mapAdapter.showLayer(t.layer)];case 7:o.sent(),o.label=8;case 8:return void 0!==i&&this.mapAdapter.setLayerOrder(t.layer,i,this._layers),[3,13];case 9:return t.hideLayer?[4,t.hideLayer.call(t,t.layer)]:[3,11];case 10:return o.sent(),[3,13];case 11:return void 0===t.layer?[3,13]:[4,this.mapAdapter.hideLayer(t.layer)];case 12:o.sent(),o.label=13;case 13:return t.options.visibility=s,u||(this._emitLayerEvent(n,e,t),this._emitLayerEvent("layer:toggle",e,t)),[2]}}))}));var t})):Promise.resolve()},e.prototype.updateLayer=function(t){var e=this,r=this.getLayer(t);if(r){if(r.updateLayer)return Promise.resolve(r.updateLayer());if(this.isLayerVisible(r))return this.hideLayer(r,{silent:!0}).then((function(){return e.showLayer(r,{silent:!0})}))}return Promise.resolve()},e.prototype.setLayerOpacity=function(t,e){var r=this.getLayer(t);r&&(r.setOpacity?r.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(r.layer,e))},e.prototype.isLayerLabelVisible=function(t){var e,r=this.getLayer(t);return r.isLabelVisible?r.isLabelVisible():null===(e=r.options.labelVisibility)||void 0===e||e},e.prototype.showLayerLabel=function(t){this.toggleLayerLabel(t,!0)},e.prototype.hideLayerLabel=function(t){this.toggleLayerLabel(t,!1)},e.prototype.toggleLayerLabel=function(t,e){var r=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),r&&(e?r.showLabel&&(r.options.labelVisibility=!0,r.showLabel()):r.hideLabel&&(r.options.labelVisibility=!1,r.hideLabel()),r.id&&this._emitLayerEvent("layer:label:toggle",r.id,r)),e},e.prototype.selectLayer=function(t,e){var r=this.getLayer(t);if(r){r&&r.select&&r.select(e);var n=this.getLayerId(r);n&&this._selectedLayers.push(n)}},e.prototype.unSelectLayer=function(t,e){var r=this.getLayer(t);if(r){var n=r&&r;n.unselect&&n.unselect(e);var i=this.getLayerId(r);if(i){var o=this._selectedLayers.indexOf(i);-1!==o&&this._selectedLayers.splice(o,1)}}},e.prototype.unSelectLayers=function(){for(var t,e=0,r=Object.values(this.allLayers());e<r.length;e++)(t=r[e]).unselect&&t.unselect()},e.prototype.filterLayer=function(t,e){var r=this.getLayer(t);return r.filter?r.filter(e):[]},e.prototype.propertiesFilter=function(t,e,r){var n=this.getLayer(t);if(n){var i=n;if(i.propertiesFilter)return i.propertiesFilter(e,r);i.filter&&this.filterLayer(i,(function(t){return!t.feature||!t.feature.properties||F(t.feature.properties,e)}))}return Promise.resolve()},e.prototype.removeLayerFilter=function(t){var e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((function(){return!0}))},e.prototype.setLayerData=function(t,e){var r=this.getLayer(t);if(r){if(r.setData)return r.setData(e);if(r.clearLayer&&r.addData)return r.clearLayer(),r.addData(e)}return Promise.resolve()},e.prototype.addLayerData=function(t,e){var r=this.getLayer(t);r.addData&&r.addData(e)},e.prototype.clearLayerData=function(t,e){var r=this.getLayer(t);r&&r.clearLayer&&r.clearLayer(e)},e.prototype.setLayerPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.setPaint&&r.setPaint(e)},e.prototype.setLayerSelectedPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.setSelectedPaint&&r.setSelectedPaint(e)},e.prototype.updateLayerPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.updatePaint&&r.updatePaint(e)},e.prototype.updateLayerSelectedPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.updateSelectedPaint&&r.updateSelectedPaint(e)},e.prototype.getAttributions=function(t){var e=[];for(var r in this._layers){var n=this._layers[r],i=!(void 0===t.onlyVisible||t.onlyVisible)||n.options.visibility;if(i&&t.onlyBaselayer&&(i=this._baselayers.includes(r)),i){var o=n.options&&n.options.attribution;o&&e.push(o)}}return e},e.prototype.getActiveBaseLayer=function(){var t=this,e=this.getBaseLayers().find((function(e){return t.isLayerVisible(e)}));if(e)return this.getLayer(e)},e.prototype.addTileJsonLayer=function(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})},e.prototype._emitLayerEvent=function(t,e,r){var n=String(t);if(u(e)&&n.startsWith("layer:")){var i=n.replace("layer:","layer-"+e+":");this.emitter.emit(i,r)}this.emitter.emit(t,r)},e.prototype._onLayerClick=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return this._emitLayerEvent("layer:click",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},e.prototype._onLayerSelect=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return this._emitLayerEvent("layer:select",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},e.prototype._updateGeoJsonOptions=function(t){var e=this,r=t.onSelect,n=t.onLayerSelect,i=t.onMouseOut,o=t.onMouseOver,a=t.onClick||t.onLayerClick;t.onClick=function(t){return a&&a(t),e._onLayerClick(t)},t.onMouseOut=function(t){var r=t.layer.id;i&&i(t),u(r)&&e._emitLayerEvent("layer:mouseout",r,t)},t.onMouseOver=function(t){var r=t.layer.id;o&&o(t),u(r)&&e._emitLayerEvent("layer:mouseover",r,t)};var s=r||n;t.onSelect=function(t){return s&&s(t),e._onLayerSelect(t)},t.nativePaint||(this.options.paint&&(t.paint=B({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=B({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))},e}(gt);function Lt(t,e){var r=document.createElement("div"),n=!1;e.getStatus?n=e.getStatus():e.status&&(n=e.status);var i=e.title||"",o=e.html;function a(){i&&(r.title="string"==typeof i?i:n?i.on:i.off,r.setAttribute("aria-label",r.title))}function s(t){t instanceof HTMLElement?(r.innerHTML="",r.appendChild(t)):"string"==typeof t&&(r.innerHTML=t)}function u(){o&&("string"==typeof o||o instanceof HTMLElement?s(o):s(n?o.on:o.off),r.setAttribute("aria-label",r.title))}function c(t,e){t.split(" ").forEach((function(t){e?r.classList.add(t):r.classList.remove(t)}))}function f(){e.addClassOn&&c(e.addClassOn,n),e.addClassOff&&c(e.addClassOff,!n)}a(),u(),e.addClass&&c(e.addClass,!0),f();var l=function(t){void 0!==t&&(n=t),u(),a(),f()},p=function(t){if(n=void 0!==t?t:!n,e.onClick){var r=e.onClick(n);Promise.resolve(r).then((function(){return l()})).catch((function(){return n=!n}))}else l()},h=t({html:r,onClick:p});return h.onClick=p,h.changeStatus=l,h}var _t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},e._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1},e}return r(e,t),e.prototype.addControl=function(t,e,r){return i(this,void 0,void 0,(function(){var n,a=this;return o(this,(function(s){return e=null!=e?e:"top-left",(n="string"==typeof t?this.getControl(t,r):t)?[2,new Promise((function(t){a._setControlQueue(e,(function(){return i(a,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return[4,n];case 1:return r=o.sent(),i=this.mapAdapter.addControl(r,e),t(i),[2]}}))}))}))}))]:[2]}))}))},e.prototype.createControl=function(t,e){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.onLoad("build-map")];case 1:return r.sent(),this.mapAdapter.createControl?[2,this.mapAdapter.createControl(t,e)]:[2]}}))}))},e.prototype.createButtonControl=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createButtonControl?[2,this.mapAdapter.createButtonControl(t)]:[2]}}))}))},e.prototype.createToggleControl=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createToggleControl?[2,this.mapAdapter.createToggleControl(t)]:this.mapAdapter.createButtonControl?[2,Lt(this.mapAdapter.createButtonControl,t)]:[2]}}))}))},e.prototype.removeControl=function(t){var e=this;"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((function(t){e.mapAdapter.removeControl(t)}))},e.prototype.getControl=function(t,r){var n=this.mapAdapter.controlAdapters[t];if(n)return new n(r);var i=e.controls[t];return i?i(this,r):void 0},e.prototype.getControlContainer=function(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()},e.prototype._setControlQueue=function(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)},e.prototype._applyControls=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this._loadControlQueue[t].length?(this._isControlLoading[t]=!0,[4,(0,this._loadControlQueue[t][0])()]):[3,2];case 1:return e.sent(),this._loadControlQueue[t].splice(0,1),this._applyControls(t),[3,3];case 2:this._isControlLoading[t]=!1,e.label=3;case 3:return[2]}}))}))},e.controls={CONTROL:function(t,e){return t.createControl(e.control,e.options)},BUTTON:function(t,e){return t.createButtonControl(e)},TOGGLE:function(t,e){return t.createToggleControl(e)}},e}(bt),wt={};function Ct(t){return wt[t]}var At=function(t){function e(e){var r=t.call(this,e)||this;return r._addControls(),wt[r.id]=r,r}return r(e,t),e.get=function(t){return Ct(t)},e.prototype._addLayerProviders=function(){var t,e,r,n,a,u;return i(this,void 0,void 0,(function(){var i,c,f,l,p,h,d,y,v,m,g,b;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,18,19,24]),i=!0,c=s(this._starterKits),o.label=1;case 1:return[4,c.next()];case 2:return f=o.sent(),(t=f.done)?[3,17]:(i=!1,(l=f.value).getLayerAdapters?[4,l.getLayerAdapters.call(l)]:[3,16]);case 3:if(!(p=o.sent()))return[3,16];o.label=4;case 4:o.trys.push([4,10,11,16]),h=!0,a=void 0,d=s(p),o.label=5;case 5:return[4,d.next()];case 6:return y=o.sent(),(n=y.done)?[3,9]:(h=!1,[4,(v=y.value).createAdapter(this)]);case 7:(m=o.sent())&&(this.mapAdapter.layerAdapters[v.name]=m),o.label=8;case 8:return h=!0,[3,5];case 9:return[3,16];case 10:return g=o.sent(),a={error:g},[3,16];case 11:return o.trys.push([11,,14,15]),h||n||!(u=d.return)?[3,13]:[4,u.call(d)];case 12:o.sent(),o.label=13;case 13:return[3,15];case 14:if(a)throw a.error;return[7];case 15:return[7];case 16:return i=!0,[3,1];case 17:return[3,24];case 18:return b=o.sent(),e={error:b},[3,24];case 19:return o.trys.push([19,,22,23]),i||t||!(r=c.return)?[3,21]:[4,r.call(c)];case 20:o.sent(),o.label=21;case 21:return[3,23];case 22:if(e)throw e.error;return[7];case 23:return[7];case 24:return[2]}}))}))},e.prototype._onLoadSync=function(){var t,e,r;return i(this,void 0,void 0,(function(){var n,i,a,u,c,f;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,8,9,14]),n=!0,i=s(this._starterKits),o.label=1;case 1:return[4,i.next()];case 2:if(a=o.sent(),t=a.done)return[3,7];if(n=!1,!(u=a.value).onLoadSync)return[3,6];o.label=3;case 3:return o.trys.push([3,5,,6]),[4,u.onLoadSync.call(u,this)];case 4:return o.sent(),[3,6];case 5:return c=o.sent(),console.error(c),[3,6];case 6:return n=!0,[3,1];case 7:return[3,14];case 8:return f=o.sent(),e={error:f},[3,14];case 9:return o.trys.push([9,,12,13]),n||t||!(r=i.return)?[3,11]:[4,r.call(i)];case 10:o.sent(),o.label=11;case 11:return[3,13];case 12:if(e)throw e.error;return[7];case 13:return[7];case 14:return[2]}}))}))},e.prototype._addControls=function(){var t=this;this.options.controls&&this.options.controls.forEach((function(e){var r=e,n={};"string"==typeof e&&t.options.controlsOptions&&t.options.controlsOptions[e]&&void 0!==(n=t.options.controlsOptions[e]).control&&(r=n.control);var i=n.position,o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(n,["position"]);t.addControl(r,i||"top-left",o)})),this._emitStatusEvent("controls:create")},e}(_t);return t.WebMap=At,t.WebMapControls=_t,t.WebMapLayers=bt,t.WebMapMain=gt,t.createToggleControl=Lt,t.createWebMap=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return[2,new At(t).onLoad()]}))}))},t.detectGeometryType=V,t.findMostFrequentGeomType=z,t.getDefaultControls=function(){return["ZOOM","ATTRIBUTION"]},t.getWebMap=Ct,t.updateGeoJsonAdapterOptions=q,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
var WebMap=function(t){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},e(t,r)};function r(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)};function i(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(e){o(e)}}function s(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(u){s=[6,u],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function a(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=a(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,i){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,i,(e=t[r](e)).done,e.value)}))}}}function u(t){return null!=t}function c(t,e,r){void 0===r&&(r=!1);var n=t,i=e,o=Array.isArray(i),a=o&&[]||{};return o&&Array.isArray(i)?r?(a=a.concat(n=n||[]),i.forEach((function(t,e){void 0===a[e]?a[e]=t:"object"==typeof t?a[e]=c(n[e],t,r):-1===n.indexOf(t)&&a.push(t)}))):a=i:(n&&"object"==typeof n&&Object.keys(n).forEach((function(t){a[t]=n[t]})),Object.keys(i).forEach((function(t){a[t]="object"==typeof i[t]&&i[t]&&"object"==typeof n[t]&&"object"==typeof i[t]?c(n[t],i[t],r):i[t]}))),a}function f(t){return{type:"Polygon",coordinates:[l(t)]}}function l(t){var e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}function p(t){return"function"==typeof t}"function"==typeof SuppressedError&&SuppressedError;var h=function(t,e,r){try{var n=t(e,r);if(void 0!==n)return n}catch(i){}};function d(t){return function(e,r){for(var n=0,i=e;n<i.length;n++){var o=h(t,i[n],r);if(void 0!==o)return o}throw new Error("Received a mismatched type")}}function y(t){return function(e,r){var n=e.map((function(t){return t()}));return t(n,r)}}var v={array:y((function(t){var e,r=t[0],n=t[1],i=t[2],o=void 0,a=void 0;if("string"==typeof r&&["string","number","boolean"].includes(r)?(o=r,"number"==typeof n?(a=n,e=i):e=n):Array.isArray(r)&&(e=r),!Array.isArray(e))throw new Error("Expected an array");if(o&&!e.every((function(t){return typeof t===o})))throw new Error("Expected all items in array to be of type ".concat(o));if(a&&e.length!==a)throw new Error("Expected array of length ".concat(a));return e})),boolean:y(d((function(t){return"boolean"==typeof t?t:void 0}))),literal:y((function(t){return t[0]})),number:y(d((function(t){return"number"==typeof t?t:void 0}))),object:y(d((function(t){return null===t||"object"!=typeof t||Array.isArray(t)?void 0:t}))),string:y(d((function(t){return"string"==typeof t?t:void 0}))),"to-boolean":y(d(Boolean)),"to-number":y(d(Number)),"to-string":y(d(String)),typeof:y((function(t){return typeof t[0]}))},m={"+":y((function(t){return t.reduce((function(t,e){return t+e}),0)})),"-":y((function(t){return t.reduce((function(t,e){return t-e}))})),"*":y((function(t){return t.reduce((function(t,e){return t*e}),1)})),"/":y((function(t){return t.reduce((function(t,e){return t/e}))})),"%":y((function(t){return t[0]%t[1]})),"^":y((function(t){return Math.pow(t[0],t[1])})),abs:y((function(t){return Math.abs(t[0])})),acos:y((function(t){return Math.acos(t[0])})),asin:y((function(t){return Math.asin(t[0])})),atan:y((function(t){return Math.atan(t[0])})),ceil:y((function(t){return Math.ceil(t[0])})),cos:y((function(t){return Math.cos(t[0])})),e:function(){return Math.E},floor:y((function(t){return Math.floor(t[0])})),ln:y((function(t){return Math.log(t[0])})),ln2:function(){return Math.LN2},log10:y((function(t){return Math.log10(t[0])})),log2:y((function(t){return Math.log2(t[0])})),max:y((function(t){return Math.max.apply(Math,t)})),min:y((function(t){return Math.min.apply(Math,t)})),pi:function(){return Math.PI},round:y((function(t){return Math.round(t[0])})),sin:y((function(t){return Math.sin(t[0])})),sqrt:y((function(t){return Math.sqrt(t[0])})),tan:y((function(t){return Math.tan(t[0])}))};var g={get:y((function(t,e){var r=t[0],n=t[1]||e;return n&&"object"==typeof n&&r in n?n[r]:null})),length:y((function(t){var e=t[0];if("string"==typeof e||Array.isArray(e))return e.length})),at:y((function(t){return t[1][t[0]]})),has:y((function(t,e){var r=t[1]||e;return!(!r||"object"!=typeof r||!(t[0]in r))})),in:y((function(t){var e=t[0],r=t[1];if("string"==typeof r)return r.includes(String(e));if(Array.isArray(r))return r.includes(e);throw new Error("Invalid input type for 'in'. Expected string or array, got ".concat(typeof r,"."))})),"index-of":y((function(t){var e=t[0],r=t[1],n=t[2];if("string"==typeof r)return r.indexOf(String(e),n);if(Array.isArray(r))return r.indexOf(e,n);throw new Error("Invalid input type for 'index-of'. Expected string or array, got ".concat(typeof r,"."))})),slice:y((function(t){var e=t[0],r=t[1],n=t[2];if("string"==typeof e)return e.slice(r,n);if(Array.isArray(e))return e.slice(r,n);throw new Error("Invalid input type for 'slice'. Expected string or array, got ".concat(typeof e,"."))}))},b={concat:y((function(t){return t.reduce((function(t,e){return String(t)+String(e)}),"")})),downcase:y((function(t){return String(t[0]).toLowerCase()})),upcase:y((function(t){return String(t[0]).toUpperCase()}))};var L=function(t){if(typeof t[0]!=typeof t[1])throw new Error("Values have different types.")};var _={"!":y((function(t){return!t[0]})),"!=":y((function(t){var e=t[0],r=t[1];return L([e,r]),e!==r})),"<":y((function(t){var e=t[0],r=t[1];return L([e,r]),e<r})),"<=":y((function(t){var e=t[0],r=t[1];return L([e,r]),e<=r})),"==":y((function(t){var e=t[0],r=t[1];return L([e,r]),e===r})),">":y((function(t){var e=t[0],r=t[1];return L([e,r]),e>r})),">=":y((function(t){var e=t[0],r=t[1];return L([e,r]),e>=r})),all:function(t){for(var e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:function(t){for(var e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:function(t){if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(var e=0;e<t.length-1;e+=2){var r=t[e](),n=t[e+1]();if(r)return n}return(0,t[t.length-1])()},match:function(t){for(var e=t[0],r=t.slice(1),n=e(),i=r.splice(-1,r.length%2)[0],o=0;o<r.length-1;o+=2){if(r[o]()===n)return r[o+1]()}return i()}},w={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function C(t){if("string"==typeof(o=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(o))return A(t);if("string"==typeof(i=t)&&i in w)return function(t){return A(w[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){var e,r=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(e=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)];if(e=t.match(r))return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4])];throw new Error("The '".concat(t,"' Is not valid rgb"))}(t);if("object"==typeof(n=t)&&null!==n&&"r"in n&&"g"in n&&"b"in n&&(!("a"in n)||"number"==typeof n.a&&n.a>=0&&n.a<=1))return function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}([(e=t).r,e.g,e.b],void 0!==(r=e.a)?[r]:[],!0);var e,r,n,i,o;throw new Error("The '".concat(t,"' cannot be converted to color"))}function A(t){var e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error("The '".concat(t,"' Is not valid hex"))}function P(t,e,r,n,i){if("number"==typeof r&&"number"==typeof i)return r+(t-e)/(n-e)*(i-r);try{var o=C(r),a=C(i);return function(t){return"rgb(".concat(t.join(","),")")}(o.map((function(r,i){return Math.ceil(P(t,e,r,n,a[i]))})))}catch(s){console.log(s)}throw new Error("Unsupported output type for linear interpolation.")}var E={step:function(t){var e=t[0],r=t[1],n=t.slice(2),i=e();if("number"!=typeof i)return r();for(var o=0;o<n.length-2;o+=2){var a=n[o](),s=n[o+1](),u=n[o+2]();if(i>=a&&i<u)return s}return i>=n[n.length-2]()?n[n.length-1]():r()},interpolate:function(t){var e=t[0],r=t[1],n=t.slice(2);if(n.length<2)throw new Error("At least two stops are required");if(n.length<2||n.length%2!=0)throw new Error("Invalid stops provided.");var i=r();if("number"!=typeof i)throw new Error("Input must be a number.");for(var o=e(),a=0;a<n.length-2;a+=2){var s=n[a](),u=n[a+1](),c=n[a+2](),f=n[a+3]();if(i>=s&&i<=c&&"linear"===o[0])return P(i,s,u,c,f)}throw new Error("Invalid interpolation type.")}};function k(t){if(Array.isArray(t)){var e=t[0],r=t.slice(1);return"string"==typeof e&&"literal"!==e&&e in O&&r.length>0}return!1}var O=n(n(n(n(n(n({},m),v),b),g),_),E);function S(t,e){void 0===e&&(e={});var r=t[0],n=t.slice(1),i=O[r];if(i)return i(n.map((function(t){return function(){return k(t)?S(t,e):t}})),e);throw new Error('Expression "'.concat(r,'" is not supported.'))}function M(t){return function(e){var r=e.properties;return!!r&&S(t,r)}}var x=["iconSize","iconAnchor"];function F(t,e,r){if((e=String(e))===(t=String(t)))return!0;if(r&&e.toUpperCase()===t.toUpperCase())return!0;var n,i="^".concat((n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(i,r?"i":"").exec(t)}var I={gt:function(t,e){return t>e},lt:function(t,e){return t<e},ge:function(t,e){return t>=e},le:function(t,e){return t<=e},eq:function(t,e){return t===e},ne:function(t,e){return t!==e},in:function(t,e){return-1!==e.indexOf(t)},notin:function(t,e){return-1===e.indexOf(t)},like:function(t,e){return F(t,e)},ilike:function(t,e){return F(t,e,!0)}};function j(t,e){var r="string"==typeof e[0]?e[0]:"all",n=function(e){if(3===(u=e).length&&"string"==typeof u[0]&&"string"==typeof u[1]){var r=e[0],n=e[1],i=e[2],o=I[n];if(o){if(("like"===n||"ilike"===n)&&"string"==typeof r){var a="",s=r.replace(/^%?(\w+)%?$/,(function(e,n){return a=t[n],r.replace(n,i)}));return o(a,s)}return o(t[r],i)}return!1}return j(t,e);var u},i=e.filter((function(t){return Array.isArray(t)}));return"any"===r?i.some(n):i.every(n)}function T(t){for(var e={},r=[],i=0,o=t;i<o.length;i++){var a=o[i];a&&(Array.isArray(a)?r.push(a):e=a)}return function(t){var i=r.find((function(e){return function(t,e){var r=n({},t.properties);return!!r&&(r.$id=t.id,j(r,e))}(t,e[0])}));return i?n(n({},e),i[1]):e}}function B(t){var e=t.paint,r=t.defaultPaint,i=function(t){var e=!1,r={};for(var i in t)if(-1===x.indexOf(i)){var o=i,a=t[o];k(a)&&(e=!0,r[o]=M(a))}if(e)return function(e){var i={};for(var o in r)i[o]=r[o](e);return n(n({},t),i)}}(e);if(i){var o=function(t){return V({paint:i(t),defaultPaint:r})};return o.paint=z({paint:e,defaultPaint:r}),o}return z({paint:e,defaultPaint:r})}function z(t){var e,r=t.paint,i=n({},t.defaultPaint);return(i=n(n({},i),r)).fill=null===(e=i.fill)||void 0===e||e,i.stroke=void 0!==i.stroke?i.stroke:!i.fill||!(!i.strokeColor&&!i.strokeOpacity),i}function V(t){var e=t.paint,r=t.defaultPaint,i=t.getPaintFunctions;if(!e)throw new Error("paint is empty");var o=n({},r);if(p(e)){var a=function(t){var n=V({paint:e(t),defaultPaint:r,getPaintFunctions:i});return n.type=e.type,n};return a.type=e.type,a}if(function(t){return!!Array.isArray(t)}(e))return function(t){return V({paint:T(e)(t),defaultPaint:r,getPaintFunctions:i})};if("get-paint"===e.type){var s=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){var r=e[t.from];if(r)return r(t.options)}}(e,i);s&&(o=V({paint:s,defaultPaint:r,getPaintFunctions:i}))}else{if("icon"===e.type)return e;o=B({paint:e,defaultPaint:r})}return p(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}function R(t){for(var e,r={},n=0;n<t.length;n++)r[t[n]]=1+(r[t[n]]||0);for(var i in r){r[i]>((void 0!==e?r[e]:0)||0)&&(e=i)}return e}function N(t){var e;if("FeatureCollection"===t.type)e=R(t.features.map((function(t){return t.geometry.type})));else if("GeometryCollection"===t.type){e=R(t.geometries.map((function(t){return t.type})))}else e="Feature"===t.type?t.geometry.type:t.type;return e}var q={polygon:"path",line:"path",point:"circle"},Z={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function G(t){if(t.data){var e=Z[N(t.data)],r=t.paint;r&&"[object Object]"===Object.prototype.toString.call(r)&&(r.type=r.type?r.type:"polygon"===e||"line"===e?"path":"html"in r||"className"in r?"icon":q[e]),t.type=t.type||e}return t}var J,$={exports:{}},W="object"==typeof Reflect?Reflect:null,D=W&&"function"==typeof W.apply?W.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};J=W&&"function"==typeof W.ownKeys?W.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var H=Number.isNaN||function(t){return t!=t};function K(){K.init.call(this)}$.exports=K,$.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}ot(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&ot(t,"error",e,r)}(t,i,{once:!0})}))},K.EventEmitter=K,K.prototype._events=void 0,K.prototype._eventsCount=0,K.prototype._maxListeners=void 0;var U=10;function Q(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function X(t){return void 0===t._maxListeners?K.defaultMaxListeners:t._maxListeners}function Y(t,e,r,n){var i,o,a,s;if(Q(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=X(t))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function tt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function et(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=tt.bind(n);return i.listener=r,n.wrapFn=i,i}function rt(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):it(i,i.length)}function nt(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function it(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function ot(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(K,"defaultMaxListeners",{enumerable:!0,get:function(){return U},set:function(t){if("number"!=typeof t||t<0||H(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");U=t}}),K.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},K.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||H(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},K.prototype.getMaxListeners=function(){return X(this)},K.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[t];if(void 0===s)return!1;if("function"==typeof s)D(s,this,e);else{var u=s.length,c=it(s,u);for(r=0;r<u;++r)D(c[r],this,e)}return!0},K.prototype.on=K.prototype.addListener=function(t,e){return Y(this,t,e,!1)},K.prototype.prependListener=function(t,e){return Y(this,t,e,!0)},K.prototype.once=function(t,e){return Q(e),this.on(t,et(this,t,e)),this},K.prototype.prependOnceListener=function(t,e){return Q(e),this.prependListener(t,et(this,t,e)),this},K.prototype.removeListener=function(t,e){var r,n,i,o,a;if(Q(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,a||e)}return this},K.prototype.off=K.prototype.removeListener,K.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},K.prototype.listeners=function(t){return rt(this,t,!0)},K.prototype.rawListeners=function(t){return rt(this,t,!1)},K.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):nt.call(t,e)},K.prototype.listenerCount=nt,K.prototype.eventNames=function(){return this._eventsCount>0?J(this._events):[]};var at=function(t){function e(){var r=t.call(this)||this;return r.name="CancelError",Object.setPrototypeOf(r,e.prototype),r}return r(e,t),e}(Error),st=function(){function t(t){void 0===t&&(t={}),this.options=t,this._promises=new Map}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._promises.size>0},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())},t.prototype.get=function(t){return this._promises.get(t)},t.prototype.add=function(t,e){var r=this,n=e||t,i=this._promises.get(n);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),i||(this._promises.set(n,t),t.finally((function(){r.remove(n)})),t)},t.prototype.abort=function(){this.isLoaded&&(this._promises.forEach((function(t){t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())},t.prototype.waitFunc=function(t,e){void 0===e&&(e="");var r=this.get(e=e||t.name);return r||this.add(t(),e)},t.prototype.WaitForMe=function(t){void 0===t&&(t="");var e=this.get.bind(this),r=this.add.bind(this);return function(n,i,o){var a=o.value;return t=t||i,o.value=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=e(t);return o||r(a.apply(this,n),t)},o}},t.prototype.GetOrCreateDecorator=function(t){return void 0===t&&(t=""),this.WaitForMe(t)},t.prototype._onStop=function(){this.options.onStop&&!this.isLoaded&&this.options.onStop()},t}(),ut=function(t){function e(){var r=t.call(this)||this;return r.name="TimeoutError",Object.setPrototypeOf(r,e.prototype),r}return r(e,t),e}(Error),ct=function(t,e,r,n){try{t(r(n))}catch(i){e(i)}},ft=0,lt=function(){function t(e,r){var n=this;this.id=ft++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise((function(t,e){n._setCanceledCallback=function(e){return t(e||new at)}}));var i=[this._cancelPromise,new Promise((function(r,i){return e((function(e){e instanceof t?n.attach(e):n._isPending=!1,r(e)}),(function(t){n._isPending=!1,i(t)}),(function(t){if(!n._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");n._cancelHandlers.push(t)}))}))];r&&i.push(new Promise((function(t,e){setTimeout((function(){if(n._isPending)try{n.cancel()}finally{e(new ut)}}),r)}))),this._promise=Promise.race(i)}return t.createControl=function(t){return new st(t)},t.resolve=function(e){return new t((function(t){return t(e)}))},t.reject=function(e){return new t((function(t,r){return r(e)}))},t.all=function(e){var r=this;return new t((function(t,r){Promise.all(e).then(t).catch(r)})).catch((function(t){if(t instanceof r.CancelError)for(var n=0,i=e;n<i.length;n++){var o=i[n];"cancel"in o&&o.cancel()}throw t}))},t.prototype.attach=function(t){this._isCanceled?t.cancel():this._children.push(t)},t.prototype.then=function(e,r){var n=this,i=new t((function(t,i){if(n._promise){var o=function(e){r?ct(t,i,r,e):i(e)};n._promise.then((function(r){n._isCanceled?o(r):e?ct(t,i,e,r):t(r)}),o)}}));return i._parentPromise=this,this._children.push(i),i},t.prototype.catch=function(t){return this._isCanceled&&t&&t(new at),this.then(void 0,t)},t.prototype.finally=function(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new at:t)},t.prototype.cancel=function(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;var t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((function(t){return t.cancel()})),this._isPending){if(this._cancelHandlers.length)try{for(var e=0,r=this._cancelHandlers;e<r.length;e++){(0,r[e])()}}catch(n){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this},t.prototype._getTopParent=function(){for(var t=this._parentPromise,e=!!t;e;)e=!(!t||!t._parentPromise)&&!!(t=t._parentPromise);return t},t.prototype._destroy=function(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0},t.CancelError=at,t.TimeoutError=ut,t.PromiseControl=st,t}();Object.setPrototypeOf(lt.prototype,Promise.prototype);var pt=lt,ht=function(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222},dt=function(){function t(){this.keyCodeAlias=new ht,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}return t.prototype.pressed=function(t){var e=this.keyCodeAlias[t];return!!e&&this.keys[e]},t.prototype.addKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))},t.prototype.removeKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))},t.prototype.keysPressed=function(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)},t.prototype.keysReleased=function(t){t.stopPropagation(),this.keys[t.keyCode]=!1},t.prototype.windowOnFocus=function(){this.keys={}},t}(),yt=function(){function t(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}return t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(t){this.value=t},t}(),vt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="center",e.event="moveend",e}return r(e,t),e.prototype.getValue=function(){return this.webMap.getCenter()},e.prototype.setValue=function(t){this.webMap.setCenter(t)},e.prototype.toString=function(t){var e=t.map((function(t){return t.toFixed(5)}));return e[0]+"_"+e[1]},e.prototype.parse=function(t){return t.split("_").map(Number)},e}(yt),mt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="zoom",e.event="zoomend",e}return r(e,t),e.prototype.getValue=function(){var t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0},e.prototype.setValue=function(t){this.webMap.setZoom(t)},e.prototype.toString=function(t){return String(t)},e.prototype.parse=function(t){return Number(t)},e}(yt);var gt=0,bt={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},Lt=function(){function t(e){this.options=bt,this.emitter=new $.exports.EventEmitter,this.keys=t.keys,this.runtimeParams=[],this.getPaintFunctions=t.getPaintFunctions,this.mapState=[vt,mt],this.id=gt++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=c(bt||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}return t.prototype.getId=function(){return this.id},t.prototype.create=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.getEventStatus("create")?[3,3]:[4,this._setInitMapState(this.mapState)];case 1:return t.sent(),[4,this._setupMap()];case 2:t.sent(),this._emitStatusEvent("create",this),t.label=3;case 3:return[2,this]}}))}))},t.prototype.setRuntimeParams=function(t){this.runtimeParams.push(t)},t.prototype.destroy=function(){this._removeEventListeners(),function(t){for(var e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()},t.prototype.getState=function(){var t={};return this._mapState.forEach((function(e){t[e.name]=e.getValue()})),t},t.prototype.getRuntimeParams=function(){var t=this,e={};return this._mapState.forEach((function(r){for(var n=0,i=t.runtimeParams;n<i.length;n++){var o=i[n].get(r.name);if(void 0!==o){e[r.name]=r.parse(o);break}}})),e},t.prototype.getContainer=function(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){var t=document.getElementById(this.options.target);if(t)return t}}},t.prototype.setCursor=function(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)},t.prototype.getCursor=function(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();var t=this.getContainer();return t?t.style.cursor:void 0},t.prototype.setCenter=function(t){return this.mapAdapter.setCenter(t),this},t.prototype.getCenter=function(){return this.mapAdapter.getCenter()},t.prototype.getBounds=function(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()},t.prototype.getBoundsPolygon=function(){var t=this.getBounds();if(t)return{type:"Feature",properties:{},geometry:f(t)}},t.prototype.setZoom=function(t){return this.mapAdapter.setZoom(t),this},t.prototype.getZoom=function(){var t=this.mapAdapter.getZoom();if("number"==typeof t)return t},t.prototype.zoomIn=function(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t+1)}},t.prototype.zoomOut=function(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t-1)}},t.prototype.setView=function(t,e){if(Array.isArray(t)){var r=t;this.mapAdapter.setView&&r&&u(e)?this.mapAdapter.setView(r,e):(r&&this.mapAdapter.setCenter(r),u(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}},t.prototype.fitBounds=function(t,e){return t.every((function(t){return u(t)}))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this},t.prototype.getEventStatus=function(t){var e=this._eventsStatus[t];return null!=e&&e},t.prototype.onLoad=function(t){var e=this;return void 0===t&&(t="create"),new Promise((function(r){e.getEventStatus(t)?r(e):e.emitter.once(t,(function(){r(e)}))}))},t.prototype.onMapLoad=function(t){var e=this;return new Promise((function(r){var n,i=function(){var n=e.mapAdapter;t&&t(n),n&&r(n)},o=null===(n=e.mapAdapter.isLoaded)||void 0===n||n;e.mapAdapter.map&&o?i():e.mapAdapter.emitter.once("create",(function(){i()}))}))},t.prototype.getLayerAdapters=function(){return this.mapAdapter.layerAdapters},t.prototype.getLayerAdapter=function(t){return this.mapAdapter.layerAdapters[t]},t.prototype.locate=function(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:function(){return{}}}},t.prototype.stopGetCoordFromMapClick=function(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()},t.prototype.getCoordFromMapClick=function(){var t=this;return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new pt((function(e,r,n){var i=t.getCursor()||"grab";t._removeEventListeners({include:["click"]}),t.setCursor("crosshair");var o=function(){t.setCursor(i),t._addEventsListeners({include:["click"]}),t.mapAdapter.emitter.off("click",a),t._coordFromMapClickPromise=void 0},a=function(t){var r;o(),!(r=t).lngLat&&r.latLng&&(r.lngLat=[r.latLng.lng,r.latLng.lat]),e(t.lngLat)};t.mapAdapter.emitter.once("click",a),n(o)})),this._coordFromMapClickPromise)},t.prototype._emitStatusEvent=function(t,e){var r=t;this._eventsStatus[r]=!0,this.emitter.emit(r,e)},t.prototype._addLayerProviders=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2]}))}))},t.prototype._onLoadSync=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2]}))}))},t.prototype._setupMap=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return[4,this.mapAdapter.create(this.options)];case 1:return t.sent(),this._zoomToInitialExtent(),[4,this._addLayerProviders()];case 2:return t.sent(),[4,this._onLoadSync()];case 3:return t.sent(),this._emitStatusEvent("build-map",this.mapAdapter),[2,this]}}))}))},t.prototype._setTileJsonOptions=function(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),u(t.maxzoom)&&(this.options.zoom=t.maxzoom),u(t.minzoom)&&(this.options.zoom=t.minzoom),u(t.maxzoom)&&u(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)},t.prototype._zoomToInitialExtent=function(){var t,e=(t=this.options).center,r=t.zoom,n=t.bounds;this._extent?this.fitBounds(this._extent):e&&r?this.setView(e,r):n&&this.fitBounds(n)},t.prototype._setInitMapState=function(t){for(var e=0,r=t;e<r.length;e++){var n=new(0,r[e])(this);this._mapState.push(n);for(var i=0,o=this.runtimeParams;i<o.length;i++){var a=o[i].get(n.name);if(void 0!==a){var s=n.parse(a);this._initMapState[n.name]=s,Object.defineProperty(this.options,n.name,{value:s,configurable:!0,enumerable:!0});break}}}},t.prototype._addEventsListeners=function(t){var e=this,r=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(r=r.filter((function(e){return t.include.includes(e)}))),r.forEach((function(t){e._mapEvents[t]=function(r){if(e.runtimeParams.length){var n=e._mapState.find((function(e){return e.event===t}));if(n){var i=n.toString(n.getValue());e.runtimeParams.forEach((function(t){t.set(n.name,i)}))}}e._eventsStatus&&e.emitter.emit(t,r)};var r=e._mapEvents[t];r&&e.mapAdapter.emitter.on(t,r)}))},t.prototype._removeEventListeners=function(t){var e=this,r=Object.entries(this._mapEvents);t&&t.include&&(r=r.filter((function(e){return t.include.includes(e[0])}))),r.forEach((function(t){var r=t[1];r&&e.mapAdapter.emitter.removeListener(t[0],r)}))},t.keys=new dt,t}(),_t=function(t){function e(e){var r=t.call(this,e)||this;r._layersIdCounter=1,r._layersOrderCounter=1,r._baselayers=[],r._layers={},r._selectedLayers=[];var n=r.options.tileJson;return n&&r.emitter.once("build-map",(function(){return r.addTileJsonLayer(n)})),r}return r(e,t),e.prototype.fitLayer=function(t,e){return i(this,void 0,void 0,(function(){var r,n,i;return o(this,(function(o){switch(o.label){case 0:return r=this.getLayer(t),(n=r&&(r.getBounds||r.getExtent))?[4,n.call(r)]:[3,2];case 1:(i=o.sent())&&this.fitBounds(i,e),o.label=2;case 2:return[2]}}))}))},e.prototype.isBaseLayer=function(t){var e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)},e.prototype.getBaseLayers=function(){var t=this,e=[];return this._baselayers.forEach((function(r){var n=t._layers[r];n&&e.push(n)})),e},e.prototype.getBaseLayersIds=function(){return this._baselayers},e.prototype.getLayer=function(t){return"string"==typeof t?this._layers[t]:t},e.prototype.getLayerId=function(t){var e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")},e.prototype.getLayers=function(){return Object.keys(this._layers)},e.prototype.allLayers=function(){return this._layers},e.prototype.orderedLayers=function(){return Object.values(this._layers).sort((function(t,e){return t.order&&e.order?t.order-e.order:0}))},e.prototype.findLayer=function(t){for(var e in this._layers){var r=this._layers[e];if(t(r))return r}},e.prototype.isLayerVisible=function(t){var e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility},e.prototype.addBaseLayer=function(t,e){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.addLayer(t,n(n({},e),{baselayer:!0}),void 0)];case 1:return[2,r.sent()]}}))}))},e.prototype.addLayer=function(t,e,r){var a,s;return void 0===e&&(e={}),i(this,void 0,void 0,(function(){var i,c,f,l,p,h,d,y,v,m,g,b;return o(this,(function(o){switch(o.label){case 0:return i=this._layersIdCounter++,c=u(r)?r:void 0!==e.order?e.order:this.reserveOrder(),"string"!=typeof t?[3,1]:(f=this.getLayerAdapter(t),[3,4]);case 1:return"function"!=typeof t?[3,2]:(f=t,[3,4]);case 2:return"then"in t?[4,t]:[3,4];case 3:f=o.sent(),o.label=4;case 4:return this._updateGeoJsonOptions(l=e),e=n({id:String(i),order:c},e),p=null===(a=e.visibility)||void 0===a||a,e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer&&(h=this.options.onBeforeAddLayer({options:e,adapter:f}))&&(h.options&&(e=h.options),h.adapter&&(f=h.adapter)),void 0===f?[3,12]:((d=new f(this.mapAdapter.map,e)).options=n(n({},e),d.options),d.options.baselayer&&(e.baselayer=!0,e.order=0,d.options.order=0),y=void 0,d.options.id&&(y=String(d.options.id),this._layers[y]=d),this._emitLayerEvent("layer:preadd",y||"",d),[4,this.onMapLoad()]);case 5:return o.sent(),d.map=this.mapAdapter.map,[4,d.addLayer(d.options)];case 6:if(v=o.sent(),d.layer=v,d.id=d.options.id||String(i),d.options.id=d.id,e.baselayer&&(d.options.order=0),d.order=null!==(s=d.options.order)&&void 0!==s?s:c,y&&delete this._layers[y],y=String(d.id),this._layers[y])throw Error("layer with id '".concat(y,"' already exist"));return y?(this._layers[y]=d,l.filter&&this.filterLayer(d,l.filter),e.baselayer&&this._baselayers.push(y),p?[4,this.showLayer(y)]:[3,8]):[3,8];case 7:o.sent(),o.label=8;case 8:return void 0!==(m=e.opacity)&&m<=1&&this.setLayerOpacity(d,m),g=v&&(d.getBounds||d.getExtent),e.fit&&g?[4,g.call(d)]:[3,11];case 9:return(b=o.sent())?[4,this.fitBounds(b)]:[3,11];case 10:o.sent(),o.label=11;case 11:return e.onAdded&&e.onAdded(d),this._emitLayerEvent("layer:add",y,d),[2,d];case 12:return[2,Promise.reject("No adapter")]}}))}))},e.prototype.addLayerFromAsyncAdapter=function(t,e,r){return i(this,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=r||void 0!==e.order?e.order:this.reserveOrder(),[4,t()];case 1:return(i=o.sent())?[2,this.addLayer(i,e,n)]:[2,Promise.reject("No adapter")]}}))}))},e.prototype.removeLayers=function(t){for(var e in this._layers){var r=!0;t&&(r=t(e,this._layers[e])),r&&(this.removeLayer(e),delete this._layers[e])}},e.prototype.reserveOrder=function(){return this._layersOrderCounter++},e.prototype.removeOverlays=function(){this.removeLayers((function(t,e){return!(e&&e.options&&e.options.baselayer)}))},e.prototype.removeLayer=function(t){var e=this.getLayer(t),r=e&&this.getLayerId(e);if(e&&r){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){var n=this._baselayers.indexOf(r);n&&this._baselayers.splice(n,1)}delete this._layers[r],this.emitter.emit("layer:remove",e)}},e.prototype.addGeoJsonLayer=function(t,e){return void 0===t&&(t={}),(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=G(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)},e.prototype.addFeatureLayer=function(t){return void 0===t&&(t={}),this.addGeoJsonLayer(t)},e.prototype.addTileLayer=function(t,e){return void 0===e&&(e={}),this.addLayer("TILE",n(n({},e),{url:t}))},e.prototype.addImageLayer=function(t,e){var r;return"string"==typeof t?r=t:(r=t.url,e=t),this.addLayer("IMAGE",n(n({},e),{url:r}))},e.prototype.showLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!0,e)},e.prototype.hideLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!1,e)},e.prototype.toggleLayer=function(t,e,r){var n=this;void 0===r&&(r={});var a=this.getLayer(t),s=void 0!==e?e:!(a&&a.options.visibility),u=void 0!==r.silent&&r.silent;return a?this.onMapLoad().then((function(){return t=a,i(n,void 0,void 0,(function(){var e,r,n,i,a,c,f,l=this;return o(this,(function(o){switch(o.label){case 0:if(e=String(t.id),r=s?"layer:preshow":"layer:prehide",n=s?"layer:show":"layer:hide",u||(this._emitLayerEvent(r,e,t),this._emitLayerEvent("layer:pretoggle",e,t)),!s||!this.mapAdapter)return[3,9];if(i=t.options.baselayer?0:t.options.order,!t.options.baselayer||!this._baselayers.length)return[3,4];a=this._baselayers.filter((function(e){return e!==t.id&&l.isLayerVisible(e)})),c=0,f=a,o.label=1;case 1:return c<f.length?[4,this.hideLayer(f[c])]:[3,4];case 2:o.sent(),o.label=3;case 3:return c++,[3,1];case 4:return t.showLayer?[4,t.showLayer.call(t,t.layer)]:[3,6];case 5:return o.sent(),[3,8];case 6:return void 0===t.layer?[3,8]:[4,this.mapAdapter.showLayer(t.layer)];case 7:o.sent(),o.label=8;case 8:return void 0!==i&&this.mapAdapter.setLayerOrder(t.layer,i,this._layers),[3,13];case 9:return t.hideLayer?[4,t.hideLayer.call(t,t.layer)]:[3,11];case 10:return o.sent(),[3,13];case 11:return void 0===t.layer?[3,13]:[4,this.mapAdapter.hideLayer(t.layer)];case 12:o.sent(),o.label=13;case 13:return t.options.visibility=s,u||(this._emitLayerEvent(n,e,t),this._emitLayerEvent("layer:toggle",e,t)),[2]}}))}));var t})):Promise.resolve()},e.prototype.updateLayer=function(t){var e=this,r=this.getLayer(t);if(r){if(r.updateLayer)return Promise.resolve(r.updateLayer());if(this.isLayerVisible(r))return this.hideLayer(r,{silent:!0}).then((function(){return e.showLayer(r,{silent:!0})}))}return Promise.resolve()},e.prototype.setLayerOpacity=function(t,e){var r=this.getLayer(t);r&&(r.setOpacity?r.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(r.layer,e))},e.prototype.isLayerLabelVisible=function(t){var e,r=this.getLayer(t);return r.isLabelVisible?r.isLabelVisible():null===(e=r.options.labelVisibility)||void 0===e||e},e.prototype.showLayerLabel=function(t){this.toggleLayerLabel(t,!0)},e.prototype.hideLayerLabel=function(t){this.toggleLayerLabel(t,!1)},e.prototype.toggleLayerLabel=function(t,e){var r=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),r&&(e?r.showLabel&&(r.options.labelVisibility=!0,r.showLabel()):r.hideLabel&&(r.options.labelVisibility=!1,r.hideLabel()),r.id&&this._emitLayerEvent("layer:label:toggle",r.id,r)),e},e.prototype.selectLayer=function(t,e){var r=this.getLayer(t);if(r){r&&r.select&&r.select(e);var n=this.getLayerId(r);n&&this._selectedLayers.push(n)}},e.prototype.unSelectLayer=function(t,e){var r=this.getLayer(t);if(r){var n=r&&r;n.unselect&&n.unselect(e);var i=this.getLayerId(r);if(i){var o=this._selectedLayers.indexOf(i);-1!==o&&this._selectedLayers.splice(o,1)}}},e.prototype.unSelectLayers=function(){for(var t,e=0,r=Object.values(this.allLayers());e<r.length;e++)(t=r[e]).unselect&&t.unselect()},e.prototype.filterLayer=function(t,e){var r=this.getLayer(t);return r.filter?r.filter(e):[]},e.prototype.propertiesFilter=function(t,e,r){var n=this.getLayer(t);if(n){var i=n;if(i.propertiesFilter)return i.propertiesFilter(e,r);i.filter&&this.filterLayer(i,(function(t){return!t.feature||!t.feature.properties||j(t.feature.properties,e)}))}return Promise.resolve()},e.prototype.removeLayerFilter=function(t){var e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((function(){return!0}))},e.prototype.setLayerData=function(t,e){var r=this.getLayer(t);if(r){if(r.setData)return r.setData(e);if(r.clearLayer&&r.addData)return r.clearLayer(),r.addData(e)}return Promise.resolve()},e.prototype.addLayerData=function(t,e){var r=this.getLayer(t);r.addData&&r.addData(e)},e.prototype.clearLayerData=function(t,e){var r=this.getLayer(t);r&&r.clearLayer&&r.clearLayer(e)},e.prototype.setLayerPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.setPaint&&r.setPaint(e)},e.prototype.setLayerSelectedPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.setSelectedPaint&&r.setSelectedPaint(e)},e.prototype.updateLayerPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.updatePaint&&r.updatePaint(e)},e.prototype.updateLayerSelectedPaint=function(t,e){var r=this.getLayer(t);e&&r&&r.updateSelectedPaint&&r.updateSelectedPaint(e)},e.prototype.getAttributions=function(t){var e=[];for(var r in this._layers){var n=this._layers[r],i=!(void 0===t.onlyVisible||t.onlyVisible)||n.options.visibility;if(i&&t.onlyBaselayer&&(i=this._baselayers.includes(r)),i){var o=n.options&&n.options.attribution;o&&e.push(o)}}return e},e.prototype.getActiveBaseLayer=function(){var t=this,e=this.getBaseLayers().find((function(e){return t.isLayerVisible(e)}));if(e)return this.getLayer(e)},e.prototype.addTileJsonLayer=function(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})},e.prototype._emitLayerEvent=function(t,e,r){var n=String(t);if(u(e)&&n.startsWith("layer:")){var i=n.replace("layer:","layer-"+e+":");this.emitter.emit(i,r)}this.emitter.emit(t,r)},e.prototype._onLayerClick=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return this._emitLayerEvent("layer:click",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},e.prototype._onLayerSelect=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return this._emitLayerEvent("layer:select",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},e.prototype._updateGeoJsonOptions=function(t){var e=this,r=t.onSelect,n=t.onLayerSelect,i=t.onMouseOut,o=t.onMouseOver,a=t.onClick||t.onLayerClick;t.onClick=function(t){return a&&a(t),e._onLayerClick(t)},t.onMouseOut=function(t){var r=t.layer.id;i&&i(t),u(r)&&e._emitLayerEvent("layer:mouseout",r,t)},t.onMouseOver=function(t){var r=t.layer.id;o&&o(t),u(r)&&e._emitLayerEvent("layer:mouseover",r,t)};var s=r||n;t.onSelect=function(t){return s&&s(t),e._onLayerSelect(t)},t.nativePaint||(this.options.paint&&(t.paint=V({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=V({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))},e}(Lt);function wt(t,e){var r=document.createElement("div"),n=!1;e.getStatus?n=e.getStatus():e.status&&(n=e.status);var i=e.title||"",o=e.html;function a(){i&&(r.title="string"==typeof i?i:n?i.on:i.off,r.setAttribute("aria-label",r.title))}function s(t){t instanceof HTMLElement?(r.innerHTML="",r.appendChild(t)):"string"==typeof t&&(r.innerHTML=t)}function u(){o&&("string"==typeof o||o instanceof HTMLElement?s(o):s(n?o.on:o.off),r.setAttribute("aria-label",r.title))}function c(t,e){t.split(" ").forEach((function(t){e?r.classList.add(t):r.classList.remove(t)}))}function f(){e.addClassOn&&c(e.addClassOn,n),e.addClassOff&&c(e.addClassOff,!n)}a(),u(),e.addClass&&c(e.addClass,!0),f();var l=function(t){void 0!==t&&(n=t),u(),a(),f()},p=function(t){if(n=void 0!==t?t:!n,e.onClick){var r=e.onClick(n);Promise.resolve(r).then((function(){return l()})).catch((function(){return n=!n}))}else l()},h=t({html:r,onClick:p});return h.onClick=p,h.changeStatus=l,h}var Ct=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},e._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1},e}return r(e,t),e.prototype.addControl=function(t,e,r){return i(this,void 0,void 0,(function(){var n,a=this;return o(this,(function(s){return e=null!=e?e:"top-left",(n="string"==typeof t?this.getControl(t,r):t)?[2,new Promise((function(t){a._setControlQueue(e,(function(){return i(a,void 0,void 0,(function(){var r,i;return o(this,(function(o){switch(o.label){case 0:return[4,n];case 1:return r=o.sent(),i=this.mapAdapter.addControl(r,e),t(i),[2]}}))}))}))}))]:[2]}))}))},e.prototype.createControl=function(t,e){return i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.onLoad("build-map")];case 1:return r.sent(),this.mapAdapter.createControl?[2,this.mapAdapter.createControl(t,e)]:[2]}}))}))},e.prototype.createButtonControl=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createButtonControl?[2,this.mapAdapter.createButtonControl(t)]:[2]}}))}))},e.prototype.createToggleControl=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createToggleControl?[2,this.mapAdapter.createToggleControl(t)]:this.mapAdapter.createButtonControl?[2,wt(this.mapAdapter.createButtonControl,t)]:[2]}}))}))},e.prototype.removeControl=function(t){var e=this;"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((function(t){e.mapAdapter.removeControl(t)}))},e.prototype.getControl=function(t,r){var n=this.mapAdapter.controlAdapters[t];if(n)return new n(r);var i=e.controls[t];return i?i(this,r):void 0},e.prototype.getControlContainer=function(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()},e.prototype._setControlQueue=function(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)},e.prototype._applyControls=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this._loadControlQueue[t].length?(this._isControlLoading[t]=!0,[4,(0,this._loadControlQueue[t][0])()]):[3,2];case 1:return e.sent(),this._loadControlQueue[t].splice(0,1),this._applyControls(t),[3,3];case 2:this._isControlLoading[t]=!1,e.label=3;case 3:return[2]}}))}))},e.controls={CONTROL:function(t,e){return t.createControl(e.control,e.options)},BUTTON:function(t,e){return t.createButtonControl(e)},TOGGLE:function(t,e){return t.createToggleControl(e)}},e}(_t),At={};function Pt(t){return At[t]}var Et=function(t){function e(e){var r=t.call(this,e)||this;return r._addControls(),At[r.id]=r,r}return r(e,t),e.get=function(t){return Pt(t)},e.prototype._addLayerProviders=function(){var t,e,r,n,a,u;return i(this,void 0,void 0,(function(){var i,c,f,l,p,h,d,y,v,m,g,b;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,18,19,24]),i=!0,c=s(this._starterKits),o.label=1;case 1:return[4,c.next()];case 2:return f=o.sent(),(t=f.done)?[3,17]:(i=!1,(l=f.value).getLayerAdapters?[4,l.getLayerAdapters.call(l)]:[3,16]);case 3:if(!(p=o.sent()))return[3,16];o.label=4;case 4:o.trys.push([4,10,11,16]),h=!0,a=void 0,d=s(p),o.label=5;case 5:return[4,d.next()];case 6:return y=o.sent(),(n=y.done)?[3,9]:(h=!1,[4,(v=y.value).createAdapter(this)]);case 7:(m=o.sent())&&(this.mapAdapter.layerAdapters[v.name]=m),o.label=8;case 8:return h=!0,[3,5];case 9:return[3,16];case 10:return g=o.sent(),a={error:g},[3,16];case 11:return o.trys.push([11,,14,15]),h||n||!(u=d.return)?[3,13]:[4,u.call(d)];case 12:o.sent(),o.label=13;case 13:return[3,15];case 14:if(a)throw a.error;return[7];case 15:return[7];case 16:return i=!0,[3,1];case 17:return[3,24];case 18:return b=o.sent(),e={error:b},[3,24];case 19:return o.trys.push([19,,22,23]),i||t||!(r=c.return)?[3,21]:[4,r.call(c)];case 20:o.sent(),o.label=21;case 21:return[3,23];case 22:if(e)throw e.error;return[7];case 23:return[7];case 24:return[2]}}))}))},e.prototype._onLoadSync=function(){var t,e,r;return i(this,void 0,void 0,(function(){var n,i,a,u,c,f;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,8,9,14]),n=!0,i=s(this._starterKits),o.label=1;case 1:return[4,i.next()];case 2:if(a=o.sent(),t=a.done)return[3,7];if(n=!1,!(u=a.value).onLoadSync)return[3,6];o.label=3;case 3:return o.trys.push([3,5,,6]),[4,u.onLoadSync.call(u,this)];case 4:return o.sent(),[3,6];case 5:return c=o.sent(),console.error(c),[3,6];case 6:return n=!0,[3,1];case 7:return[3,14];case 8:return f=o.sent(),e={error:f},[3,14];case 9:return o.trys.push([9,,12,13]),n||t||!(r=i.return)?[3,11]:[4,r.call(i)];case 10:o.sent(),o.label=11;case 11:return[3,13];case 12:if(e)throw e.error;return[7];case 13:return[7];case 14:return[2]}}))}))},e.prototype._addControls=function(){var t=this;this.options.controls&&this.options.controls.forEach((function(e){var r=e,n={};"string"==typeof e&&t.options.controlsOptions&&t.options.controlsOptions[e]&&void 0!==(n=t.options.controlsOptions[e]).control&&(r=n.control);var i=n.position,o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(n,["position"]);t.addControl(r,i||"top-left",o)})),this._emitStatusEvent("controls:create")},e}(Ct);return t.WebMap=Et,t.WebMapControls=Ct,t.WebMapLayers=_t,t.WebMapMain=Lt,t.createToggleControl=wt,t.createWebMap=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return[2,new Et(t).onLoad()]}))}))},t.detectGeometryType=N,t.findMostFrequentGeomType=R,t.getDefaultControls=function(){return["ZOOM","ATTRIBUTION"]},t.getWebMap=Pt,t.updateGeoJsonAdapterOptions=G,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
//# sourceMappingURL=webmap.global.prod.js.map
{
"name": "@nextgis/webmap",
"version": "1.18.6",
"version": "1.18.10",
"_priority": 14,

@@ -13,3 +13,3 @@ "description": "Universal map constructor",

"@nextgis/cancelable-promise": "^1.18.3",
"@nextgis/paint": "^1.18.6",
"@nextgis/paint": "^1.18.10",
"@nextgis/properties-filter": "^1.18.0",

@@ -59,3 +59,3 @@ "@nextgis/utils": "^1.17.0",

},
"gitHead": "0402a2fa8f938e9e9b13b5021d9b7ad3c7e7b14c"
"gitHead": "1a1aa4cda93f1a3dccfc6efa921fbc0397fe44d4"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc