azure-maps-control 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,4 +52,4 @@ Elle s’applique également, même si Microsoft connaissait ou devrait connaît
52
52
  EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
53
53
  */
54
54
 
55
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("azuremaps-maplibre-gl")):"function"==typeof define&&define.amd?define(["exports","azuremaps-maplibre-gl"],e):e((t=t||self).atlas=t.atlas||{},t.maplibregl)}(this,function(u,n){"use strict";var p="default"in n?n.default:n,t="atlas.microsoft.com",e="atlas.microsoft.com",o="styling",r="2022-08-05",i="https://login.microsoftonline.com/",c="api-version",s="Authorization",a="Bearer ",l="jwt-sas ",h="{{azMapsDomain}}",d="{azMapsDomain}",f="{{azMapsView}}",y="view",v="{{azMapsLanguage}}",m="{{azMapsStylingPath}}",g="{{azMapsStylePath}}",_="styling",w="styles",b="2.0",S="Map-Agent",x="x-ms-client-id",O="Ms-Am-Request-Origin",T="MapControl",E="https://atlas.microsoft.com/",C="Session-Id",P=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},k=(A.prototype.merge=function(){for(var e,t,o,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=P(n),s=i.next();!s.done;s=i.next()){var a=s.value;if(a)for(var c in a)a.hasOwnProperty(c)&&this.hasOwnProperty(c)&&(void 0!==a[c]&&null!=a[c]?this[c]instanceof A?this[c].merge(a[c]):this[c]=a[c]:(o=o||new(Object.getPrototypeOf(this).constructor),this[c]=o[c]))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return this},A);function A(){}var I,L,R=window&&window.__extends||(I=function(t,e){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),N=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},M=(R(j,L=k),j);function j(){var t=null!==L&&L.apply(this,arguments)||this;return t.domain=void 0,t.headers={},t.path="",t.protocol="https",t.queryParams={},t.subdomain="",t}var D=(z.prototype.get=function(){return fetch(this.toString(),{method:"GET",mode:"cors",headers:new Headers(this.options.headers)}).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText)})},z.prototype.toString=function(){var t=this,e=Object.entries(t.options.queryParams).map(function(t){t=N(t,2);return t[0]+"="+t[1]}).join("&"),o=[],n=t.options.path||"";return z.protoRegEx.test(n)?o.push(n):(t.options.domain&&(z.protoRegEx.test(t.options.domain)||(o.push(t.options.protocol+"://"),o.push(t.options.subdomain?t.options.subdomain+".":"")),o.push(t.options.domain)),o.push(t.options.path?"/"+n:"")),o.push(e?"?"+e:""),o.join("")},z.protoRegEx=new RegExp(/^(((file|http|https):\/\/)|blob:)/i),z);function z(t){this.options=(new M).merge(t)}var B="2.2.2",F=(U.getFullVersion=function(){return B},U.getEndpointVersion=function(){var t=B.indexOf(".");return-1===(t=B.indexOf(".",t+1))?B:B.substring(0,t)},U);function U(){}function q(t){var e=document.createElement("span");e.innerText=t,e.classList.add("tooltiptext"),window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&e.classList.add("dark");var o=window.matchMedia("(prefers-color-scheme: dark)"),t=function(t){t=t.matches;t&&!e.classList.contains("dark")?e.classList.add("dark"):!t&&e.classList.contains("dark")&&e.classList.remove("dark")};return"function"==typeof o.addEventListener?o.addEventListener("change",t):"function"==typeof o.addListener&&o.addListener(t),-1!=navigator.userAgent.indexOf("Edg")?e.classList.add("edge"):-1!=navigator.userAgent.indexOf("Chrome")?e.classList.add("chrome"):-1!=navigator.userAgent.indexOf("Safari")?e.classList.add("safari"):-1!=navigator.userAgent.indexOf("Firefox")&&e.classList.add("firefox"),-1!=navigator.userAgent.indexOf("Windows")?e.classList.add("win"):-1!=navigator.userAgent.indexOf("Macintosh")&&e.classList.add("mac"),e}function G(r,i,s){function t(t){var e=i.getBoundingClientRect(),o=r.getBoundingClientRect(),n=e.x+o.width>window.innerWidth?window.innerWidth-o.width:e.x,o=e.y+e.height+o.height+4>window.innerHeight?e.y-o.height-4:e.y+e.height+4;s&&i.parentElement&&(e=i.parentElement?i.parentElement.getBoundingClientRect():null,r.style.position="absolute",n-=e.x,o-=e.y),r.style.transform="translate("+n+"px, "+o+"px)"}void 0===s&&(s=!1),i.addEventListener("mouseover",t),i.addEventListener("focusin",t)}var Z,H=window&&window.__extends||(Z=function(t,e){return(Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Z(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});(Lt=u.ControlPosition||(u.ControlPosition={})).TopLeft="top-left",Lt.TopRight="top-right",Lt.BottomLeft="bottom-left",Lt.BottomRight="bottom-right",Lt.NonFixed="non-fixed";var K,W=(H(V,K=k),V);function V(){var t=null!==K&&K.apply(this,arguments)||this;return t.position=u.ControlPosition.NonFixed,t}var Y=(Q.prototype.getLuminosity=function(){for(var t=[this.r,this.g,this.b],e=[],o=0;o<t.length;o++){var n=t[o]/255;e[o]=n<=.03928?n/12.92:Math.pow((.055+n)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},Q.prototype.getRBGA=function(t){var e=document.createElement("canvas").getContext("2d");e.globalAlpha=1,e.fillStyle=t,e.fillRect(0,0,1,1);e=e.getImageData(0,0,1,1).data;return[e[0],e[1],e[2],e[3]]},Q);function Q(t){var e;t&&(e=void 0,3<=(e="string"==typeof t?this.getRBGA(t):t).length&&(this.r=e[0],this.g=e[1],this.b=e[2],3<e.length&&(this.a=e[3])))}(Mt=u.ControlStyle||(u.ControlStyle={})).light="light",Mt.dark="dark",Mt.auto="auto";var J=Map,X=($.prototype._addEventListener=function(t,e,o){this.listeners.has(t)||this.listeners.set(t,new J),this.listeners.get(t).set(e,o)},$.prototype._removeEventListener=function(t,e){this.listeners.has(t)&&this.listeners.get(t).delete(e)},$.prototype._invokeEvent=function(o,n){var r=this;this.listeners.has(o)&&this.listeners.get(o).forEach(function(t,e){t&&r._removeEventListener(o,e);try{e(n)}catch(t){console.error(t)}})},$);function $(){this.listeners=new J}var tt,et,ot=Object.freeze({__proto__:null,EventEmitter:X}),nt=((window&&window.__extends||(tt=function(t,e){return(tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}tt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(rt,et=X),rt.prototype.onRemove=function(){this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.events.remove("stylechanged",this._onStyleChange),delete this._map),this._observer&&(this._observer.disconnect(),delete this._observer),delete this._theme},rt.prototype.buildContainer=function(t,e,o,n){var r=this;return this._map=t,this._container=document.createElement(n||"div"),this._container.classList.add("azure-maps-control-container"),"string"==typeof o&&this._container.setAttribute("aria-label",o),e.toLowerCase()===u.ControlStyle.auto?this._map.styles.definitions().then(function(t){r._map&&r._map.events.add("stylechanged",r._onStyleChange)}):this._container.classList.add(e),this._container},rt.prototype._setTheme=function(t){this._theme!==t&&(this._container.classList.remove(this._theme),this._container.classList.add(t),this._theme=t)},rt.activateClickDelay=100,rt);function rt(){var e=null!==et&&et.apply(this,arguments)||this;return e._onStyleChange=function(){e._map.getStyle().style.toLowerCase().startsWith("blank")?e._observer||(e._onBackgroundChange(),e._observer=new MutationObserver(e._onBackgroundChange),e._observer.observe(e._map.getMapContainer(),{attributes:!0,attributeFilter:["style"]})):(e._observer&&(e._observer.disconnect(),delete e._observer),e._map.styles.getThemeAsync(e._map.getStyle()).then(function(t){e._setTheme(t)}))},e._onBackgroundChange=function(){var t=new Y(e._map.getMapContainer().style.backgroundColor).getLuminosity(),t=isNaN(t)||.5<t?u.ControlStyle.light:u.ControlStyle.dark;e._setTheme(t)},e}var it,st,at=((window&&window.__extends||(it=function(t,e){return(it=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}it(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ct,st=k),ct);function ct(){var t=null!==st&&st.apply(this,arguments)||this;return t.rotationDegreesDelta=15,t.style=u.ControlStyle.light,t.inverted=!1,t}var lt,ut,pt=((window&&window.__extends||(lt=function(t,e){return(lt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}lt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ht,ut=nt),ht.prototype.onAdd=function(t,e){var o=this,n=this.buildContainer(t,this.options.style,"Rotation Control"),r=this.constructRotationButton(t),i=this.constructRotationGrid(t,e),t=q("Reset to Default Rotation");return n.addEventListener("mouseover",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasMouse=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasFocus=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(t){"Escape"!==t.key&&"Esc"!==t.key||(t.stopPropagation(),r.focus(),n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),e&&ht.InvertOrderPositions.includes(e.position)?(n.appendChild(i),n.appendChild(r),n.appendChild(t),G(t,r)):(n.appendChild(r),n.appendChild(t),G(t,r),n.appendChild(i)),n},ht.prototype.constructRotationGrid=function(t,e){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element");var n=this.constructRightRotationButton(t),r=this.constructLeftRotationButton(t),i=q("Rotate Left"),t=q("Rotate Right");return e&&ht.InvertOrderPositions.includes(e.position)?(o.appendChild(n),o.appendChild(t),G(t,n),o.appendChild(r),o.appendChild(i),G(i,r)):(o.appendChild(r),o.appendChild(i),G(i,r),o.appendChild(n),o.appendChild(t),G(t,n)),o},ht.prototype.constructRotationButton=function(e){var o=this,t=document.createElement("button");t.classList.add("azure-maps-control-button"),t.classList.add("rotation"),t.setAttribute("aria-label","Reset to Default Rotation"),t.setAttribute("alt","Reset to Default Rotation"),t.setAttribute("type","button");var n=document.createElement("div");return t.appendChild(n),t.addEventListener("click",function(t){t.timeStamp-o.lastActiveTime>nt.activateClickDelay&&e.setCamera({bearing:ht.DefaultRotation},!0)}),e.events.add("rotate",function(t){n.style.transform="rotate("+-t.map.getCamera().bearing+"deg)"}),t},ht.prototype.constructRightRotationButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("rotation-right"),o.setAttribute("aria-label","Rotate Right"),o.setAttribute("alt","Rotate Right"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({bearing:t.getCamera().bearing-(e.options.inverted?-1:1)*e.options.rotationDegreesDelta,duration:ht.RotationDuration,type:"ease"},!0)}),o},ht.prototype.constructLeftRotationButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("rotation-left"),o.setAttribute("aria-label","Rotate Left"),o.setAttribute("alt","Rotate Left"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({bearing:t.getCamera().bearing+(e.options.inverted?-1:1)*e.options.rotationDegreesDelta,duration:ht.RotationDuration,type:"ease"},!0)}),o},ht.DefaultRotation=0,ht.RotationDuration=100,ht.InvertOrderPositions=[u.ControlPosition.BottomRight,u.ControlPosition.TopRight],ht);function ht(t){var e=ut.call(this)||this;return e.hasMouse=!1,e.hasFocus=!1,e.options=(new at).merge(t),e}var dt,ft,yt=((window&&window.__extends||(dt=function(t,e){return(dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}dt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(mt,ft=k),mt);function mt(){var t=null!==ft&&ft.apply(this,arguments)||this;return t.pitchDegreesDelta=10,t.style=u.ControlStyle.light,t.inverted=!1,t}var gt,vt,_t=((window&&window.__extends||(gt=function(t,e){return(gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}gt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(wt,vt=nt),wt.prototype.onAdd=function(t,e){var o=this,n=this.buildContainer(t,this.options.style,"Pitch Control"),r=this.constructPitchButton(t),i=this.constructPitchGrid(t,e),s=q("Reset to Default Pitch");return n.addEventListener("mouseover",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasMouse=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasFocus=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(t){"Escape"!==t.key&&"Esc"!==t.key||(t.stopPropagation(),r.focus(),n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),e&&wt.INVERT_ORDER_POSITIONS.includes(e.position)?(n.appendChild(i),n.appendChild(r),n.appendChild(s),G(s,n)):(n.appendChild(r),n.appendChild(s),G(s,n),n.appendChild(i)),this.map=t,this.container=n,this.pitchButton=r,t.events.add("pitch",this.pitchChanged),this.updatePitchButtonsState(),n},wt.prototype.onRemove=function(){this.container&&(this.container.remove(),this.container=null,this.pitchButton=null,this.pitchIncrementButton=null,this.pitchDecrementButton=null),this.map&&(this.map.events.remove("pitch",this.pitchChanged),this.map=null)},wt.prototype.constructPitchGrid=function(t,e){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element"),this.pitchIncrementButton=this.constructPitchIncrementButton(t),this.pitchDecrementButton=this.constructPitchDecrementButton(t);var n=q("Increase Pitch"),t=q("Decrease Pitch");return e&&wt.INVERT_ORDER_POSITIONS.includes(e.position)?(o.appendChild(this.pitchDecrementButton),o.appendChild(t),G(t,this.pitchDecrementButton),o.appendChild(this.pitchIncrementButton),o.appendChild(n),G(n,this.pitchIncrementButton)):(o.appendChild(this.pitchIncrementButton),o.appendChild(n),G(n,this.pitchIncrementButton),o.appendChild(this.pitchDecrementButton),o.appendChild(t),G(t,this.pitchDecrementButton)),o},wt.prototype.constructPitchButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch"),o.setAttribute("aria-label","Reset to Default Pitch"),o.setAttribute("alt","Reset to Default Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){event.timeStamp-e.lastActiveTime>nt.activateClickDelay&&t.setCamera({pitch:wt.DEFAULT_PITCH},!0)}),o},wt.prototype.constructPitchDecrementButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch-down"),o.setAttribute("aria-label","Decrease Pitch"),o.setAttribute("alt","Decrease Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({pitch:t.getCamera().pitch-(e.options.inverted?-1:1)*e.options.pitchDegreesDelta,duration:wt.PITCH_DURATION_MS,type:"ease"},!0)}),o},wt.prototype.constructPitchIncrementButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch-up"),o.setAttribute("aria-label","Increase Pitch"),o.setAttribute("alt","Increase Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({pitch:t.getCamera().pitch+(e.options.inverted?-1:1)*e.options.pitchDegreesDelta,duration:wt.PITCH_DURATION_MS,type:"ease"},!0)}),o},wt.PITCH_DURATION_MS=100,wt.DEFAULT_PITCH=0,wt.INVERT_ORDER_POSITIONS=[u.ControlPosition.BottomRight,u.ControlPosition.TopRight],wt);function wt(t){var o=vt.call(this)||this;return o.container=null,o.map=null,o.pitchButton=null,o.pitchIncrementButton=null,o.pitchDecrementButton=null,o.hasMouse=!1,o.hasFocus=!1,o.pitchChanged=function(t){return o.updatePitchButtonsState()},o.updatePitchButtonsState=function(){var t=o.map.getCamera().pitch<=0,e=60<=o.map.getCamera().pitch;o.hasFocus&&o.pitchButton&&(t||e)&&o.pitchButton.focus(),o.options.inverted?(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=t&&(o.pitchIncrementButton.disabled=t),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=e&&(o.pitchDecrementButton.disabled=e)):(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=e&&(o.pitchIncrementButton.disabled=e),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=t&&(o.pitchDecrementButton.disabled=t))},o.options=(new yt).merge(t),o}var bt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var o=t.length;o--;)if(bt(t[o][0],e))return o;return-1},xt=Array.prototype.splice;var Ot=function(t){var e=this.__data__;return!((t=St(e,t))<0)&&(t==e.length-1?e.pop():xt.call(e,t,1),--this.size,!0)};var Tt=function(t){var e=this.__data__;return(t=St(e,t))<0?void 0:e[t][1]};var Et=function(t){return-1<St(this.__data__,t)};var Ct=function(t,e){var o=this.__data__,n=St(o,t);return n<0?(++this.size,o.push([t,e])):o[n][1]=e,this};function Pt(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}Pt.prototype.clear=function(){this.__data__=[],this.size=0},Pt.prototype.delete=Ot,Pt.prototype.get=Tt,Pt.prototype.has=Et,Pt.prototype.set=Ct;var kt=Pt;var At=function(){this.__data__=new kt,this.size=0};var It=function(t){var e=this.__data__,t=e.delete(t);return this.size=e.size,t};R=function(t){return this.__data__.get(t)};var Lt=function(t){return this.__data__.has(t)},H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Rt(t,e){return t(e={exports:{}},e.exports),e.exports}var Nt="object"==typeof H&&H&&H.Object===Object&&H,Mt="object"==typeof self&&self&&self.Object===Object&&self,jt=Nt||Mt||Function("return this")(),Ot=jt.Symbol,Tt=Object.prototype,Dt=Tt.hasOwnProperty,zt=Tt.toString,Bt=Ot?Ot.toStringTag:void 0;var Ft=function(t){var e=Dt.call(t,Bt),o=t[Bt];try{var n=!(t[Bt]=void 0)}catch(t){}var r=zt.call(t);return n&&(e?t[Bt]=o:delete t[Bt]),r},Ut=Object.prototype.toString;var qt=function(t){return Ut.call(t)},Gt=Ot?Ot.toStringTag:void 0;var Zt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(Gt&&Gt in Object(t)?Ft:qt)(t)};var Ht=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var Kt=function(t){return!!Ht(t)&&("[object Function]"==(t=Zt(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)},Et=jt["__core-js_shared__"],Wt=(Ct=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||""))?"Symbol(src)_1."+Ct:"";var Vt=function(t){return!!Wt&&Wt in t},Yt=Function.prototype.toString;var Qt=function(t){if(null!=t){try{return Yt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Jt=/^\[object .+?Constructor\]$/,H=Function.prototype,Mt=Object.prototype,Tt=H.toString,Et=Mt.hasOwnProperty,Xt=RegExp("^"+Tt.call(Et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $t=function(t){return!(!Ht(t)||Vt(t))&&(Kt(t)?Xt:Jt).test(Qt(t))};var te=function(t,e){return null==t?void 0:t[e]};var ee=function(t,e){return e=te(t,e),$t(e)?e:void 0},oe=ee(jt,"Map"),ne=ee(Object,"create");var Ct=function(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t},re=Object.prototype.hasOwnProperty;var H=function(t){var e=this.__data__;if(ne){var o=e[t];return"__lodash_hash_undefined__"===o?void 0:o}return re.call(e,t)?e[t]:void 0},ie=Object.prototype.hasOwnProperty;Mt=function(t){var e=this.__data__;return ne?void 0!==e[t]:ie.call(e,t)};Tt=function(t,e){var o=this.__data__;return this.size+=this.has(t)?0:1,o[t]=ne&&void 0===e?"__lodash_hash_undefined__":e,this};function se(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}se.prototype.clear=function(){this.__data__=ne?ne(null):{},this.size=0},se.prototype.delete=Ct,se.prototype.get=H,se.prototype.has=Mt,se.prototype.set=Tt;var ae=se;Et=function(){this.size=0,this.__data__={hash:new ae,map:new(oe||kt),string:new ae}};var ce=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var le=function(t,e){return t=t.__data__,ce(e)?t["string"==typeof e?"string":"hash"]:t.map};Ct=function(t){return t=le(this,t).delete(t),this.size-=t?1:0,t};H=function(t){return le(this,t).get(t)};Mt=function(t){return le(this,t).has(t)};Tt=function(t,e){var o=le(this,t),n=o.size;return o.set(t,e),this.size+=o.size==n?0:1,this};function ue(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}ue.prototype.clear=Et,ue.prototype.delete=Ct,ue.prototype.get=H,ue.prototype.has=Mt,ue.prototype.set=Tt;var pe=ue;Ct=function(t,e){var o=this.__data__;if(o instanceof kt){var n=o.__data__;if(!oe||n.length<199)return n.push([t,e]),this.size=++o.size,this;o=this.__data__=new pe(n)}return o.set(t,e),this.size=o.size,this};function he(t){t=this.__data__=new kt(t);this.size=t.size}he.prototype.clear=At,he.prototype.delete=It,he.prototype.get=R,he.prototype.has=Lt,he.prototype.set=Ct;var de=he;var fe=function(t,e){for(var o=-1,n=null==t?0:t.length;++o<n&&!1!==e(t[o],o,t););return t},ye=function(){try{var t=ee(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var me=function(t,e,o){"__proto__"==e&&ye?ye(t,e,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[e]=o},ge=Object.prototype.hasOwnProperty;var ve=function(t,e,o){var n=t[e];ge.call(t,e)&&bt(n,o)&&(void 0!==o||e in t)||me(t,e,o)};var _e=function(t,e,o,n){var r=!o;o=o||{};for(var i=-1,s=e.length;++i<s;){var a=e[i],c=n?n(o[a],t[a],a,o,t):void 0;void 0===c&&(c=t[a]),(r?me:ve)(o,a,c)}return o};var we=function(t,e){for(var o=-1,n=Array(t);++o<t;)n[o]=e(o);return n};var be=function(t){return null!=t&&"object"==typeof t};var H=function(t){return be(t)&&"[object Arguments]"==Zt(t)},Mt=Object.prototype,Se=Mt.hasOwnProperty,xe=Mt.propertyIsEnumerable,Oe=H(function(){return arguments}())?H:function(t){return be(t)&&Se.call(t,"callee")&&!xe.call(t,"callee")},Te=Array.isArray;function Ee(){return!1}var Ce=Rt(function(t,e){var o=e&&!e.nodeType&&e,e=o&&t&&!t.nodeType&&t,o=e&&e.exports===o?jt.Buffer:void 0,o=o?o.isBuffer:void 0;t.exports=o||Ee}),Pe=/^(?:0|[1-9]\d*)$/;var ke=function(t,e){var o=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&Pe.test(t))&&-1<t&&t%1==0&&t<e};var Ae=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991},Ie={};Ie["[object Float32Array]"]=Ie["[object Float64Array]"]=Ie["[object Int8Array]"]=Ie["[object Int16Array]"]=Ie["[object Int32Array]"]=Ie["[object Uint8Array]"]=Ie["[object Uint8ClampedArray]"]=Ie["[object Uint16Array]"]=Ie["[object Uint32Array]"]=!0,Ie["[object Arguments]"]=Ie["[object Array]"]=Ie["[object ArrayBuffer]"]=Ie["[object Boolean]"]=Ie["[object DataView]"]=Ie["[object Date]"]=Ie["[object Error]"]=Ie["[object Function]"]=Ie["[object Map]"]=Ie["[object Number]"]=Ie["[object Object]"]=Ie["[object RegExp]"]=Ie["[object Set]"]=Ie["[object String]"]=Ie["[object WeakMap]"]=!1;Tt=function(t){return be(t)&&Ae(t.length)&&!!Ie[Zt(t)]};var At=function(e){return function(t){return e(t)}},It=Rt(function(t,e){var e=e&&!e.nodeType&&e,o=e&&t&&!t.nodeType&&t,n=o&&o.exports===e&&Nt.process,e=function(){try{var t=o&&o.require&&o.require("util").types;return t?t:n&&n.binding&&n.binding("util")}catch(t){}}();t.exports=e}),R=It&&It.isTypedArray,Le=R?At(R):Tt,Re=Object.prototype.hasOwnProperty;var Ne=function(t,e){var o,n=Te(t),r=!n&&Oe(t),i=!n&&!r&&Ce(t),s=!n&&!r&&!i&&Le(t),a=n||r||i||s,c=a?we(t.length,String):[],l=c.length;for(o in t)!e&&!Re.call(t,o)||a&&("length"==o||i&&("offset"==o||"parent"==o)||s&&("buffer"==o||"byteLength"==o||"byteOffset"==o)||ke(o,l))||c.push(o);return c},Me=Object.prototype;var je=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Me)};var Lt=function(e,o){return function(t){return e(o(t))}},De=Lt(Object.keys,Object),ze=Object.prototype.hasOwnProperty;var Be=function(t){if(!je(t))return De(t);var e,o=[];for(e in Object(t))ze.call(t,e)&&"constructor"!=e&&o.push(e);return o};var Fe=function(t){return null!=t&&Ae(t.length)&&!Kt(t)};var Ue=function(t){return(Fe(t)?Ne:Be)(t)};var qe=function(t,e){return t&&_e(e,Ue(e),t)};var Ge=function(t){var e=[];if(null!=t)for(var o in Object(t))e.push(o);return e},Ze=Object.prototype.hasOwnProperty;var He=function(t){if(!Ht(t))return Ge(t);var e,o=je(t),n=[];for(e in t)("constructor"!=e||!o&&Ze.call(t,e))&&n.push(e);return n};var Ke=function(t){return Fe(t)?Ne(t,!0):He(t)};var We=function(t,e){return t&&_e(e,Ke(e),t)},Ve=Rt(function(t,e){var o=e&&!e.nodeType&&e,e=o&&t&&!t.nodeType&&t,o=e&&e.exports===o?jt.Buffer:void 0,n=o?o.allocUnsafe:void 0;t.exports=function(t,e){return e?t.slice():(e=t.length,e=n?n(e):new t.constructor(e),t.copy(e),e)}});var Ye=function(t,e){var o=-1,n=t.length;for(e=e||Array(n);++o<n;)e[o]=t[o];return e};var Qe=function(t,e){for(var o=-1,n=null==t?0:t.length,r=0,i=[];++o<n;){var s=t[o];e(s,o,t)&&(i[r++]=s)}return i};var Ct=function(){return[]},Je=Object.prototype.propertyIsEnumerable,Xe=Object.getOwnPropertySymbols,$e=Xe?function(e){return null==e?[]:(e=Object(e),Qe(Xe(e),function(t){return Je.call(e,t)}))}:Ct;var to=function(t,e){return _e(t,$e(t),e)};var eo=function(t,e){for(var o=-1,n=e.length,r=t.length;++o<n;)t[r+o]=e[o];return t},oo=Lt(Object.getPrototypeOf,Object),no=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)eo(e,$e(t)),t=oo(t);return e}:Ct;var ro=function(t,e){return _e(t,no(t),e)};var io=function(t,e,o){return e=e(t),Te(t)?e:eo(e,o(t))};var so=function(t){return io(t,Ue,$e)};function ao(t){return io(t,Ke,no)}var Mt=ee(jt,"DataView"),H=ee(jt,"Promise"),R=ee(jt,"Set"),Tt=ee(jt,"WeakMap"),co="[object Map]",lo="[object Promise]",uo="[object Set]",po="[object WeakMap]",ho="[object DataView]",fo=Qt(Mt),yo=Qt(oe),mo=Qt(H),go=Qt(R),vo=Qt(Tt),Lt=Zt,_o=Lt=Mt&&Lt(new Mt(new ArrayBuffer(1)))!=ho||oe&&Lt(new oe)!=co||H&&Lt(H.resolve())!=lo||R&&Lt(new R)!=uo||Tt&&Lt(new Tt)!=po?function(t){var e=Zt(t),t="[object Object]"==e?t.constructor:void 0,t=t?Qt(t):"";if(t)switch(t){case fo:return ho;case yo:return co;case mo:return lo;case go:return uo;case vo:return po}return e}:Lt,wo=Object.prototype.hasOwnProperty;var bo=function(t){var e=t.length,o=new t.constructor(e);return e&&"string"==typeof t[0]&&wo.call(t,"index")&&(o.index=t.index,o.input=t.input),o},So=jt.Uint8Array;var xo=function(t){var e=new t.constructor(t.byteLength);return new So(e).set(new So(t)),e};var Oo=function(t,e){return e=e?xo(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength)},To=/\w*$/;var Eo=function(t){var e=new t.constructor(t.source,To.exec(t));return e.lastIndex=t.lastIndex,e},Ct=Ot?Ot.prototype:void 0,Co=Ct?Ct.valueOf:void 0;var Po=function(t){return Co?Object(Co.call(t)):{}};var ko=function(t,e){return e=e?xo(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)};var Ao=function(t,e,o){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return xo(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return Oo(t,o);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ko(t,o);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return Eo(t);case"[object Set]":return new n;case"[object Symbol]":return Po(t)}},Io=Object.create;function Lo(){}var Ro=function(t){if(!Ht(t))return{};if(Io)return Io(t);Lo.prototype=t;t=new Lo;return Lo.prototype=void 0,t};var No=function(t){return"function"!=typeof t.constructor||je(t)?{}:Ro(oo(t))};var Mt=function(t){return be(t)&&"[object Map]"==_o(t)},H=It&&It.isMap,Mo=H?At(H):Mt;var R=function(t){return be(t)&&"[object Set]"==_o(t)},Tt=It&&It.isSet,jo=Tt?At(Tt):R,Do="[object Arguments]",zo="[object Function]",Bo="[object Object]",Fo={};Fo[Do]=Fo["[object Array]"]=Fo["[object ArrayBuffer]"]=Fo["[object DataView]"]=Fo["[object Boolean]"]=Fo["[object Date]"]=Fo["[object Float32Array]"]=Fo["[object Float64Array]"]=Fo["[object Int8Array]"]=Fo["[object Int16Array]"]=Fo["[object Int32Array]"]=Fo["[object Map]"]=Fo["[object Number]"]=Fo[Bo]=Fo["[object RegExp]"]=Fo["[object Set]"]=Fo["[object String]"]=Fo["[object Symbol]"]=Fo["[object Uint8Array]"]=Fo["[object Uint8ClampedArray]"]=Fo["[object Uint16Array]"]=Fo["[object Uint32Array]"]=!0,Fo["[object Error]"]=Fo[zo]=Fo["[object WeakMap]"]=!1;var Uo=function o(n,r,i,t,e,s){var a,c=1&r,l=2&r,u=4&r;if(void 0!==(a=i?e?i(n,t,e,s):i(n):a))return a;if(!Ht(n))return n;var p=Te(n);if(p){if(a=bo(n),!c)return Ye(n,a)}else{var h=_o(n),t=h==zo||"[object GeneratorFunction]"==h;if(Ce(n))return Ve(n,c);if(h==Bo||h==Do||t&&!e){if(a=l||t?{}:No(n),!c)return l?ro(n,We(a,n)):to(n,qe(a,n))}else{if(!Fo[h])return e?n:{};a=Ao(n,h,c)}}c=(s=s||new de).get(n);if(c)return c;s.set(n,a),jo(n)?n.forEach(function(t){a.add(o(t,r,i,t,n,s))}):Mo(n)&&n.forEach(function(t,e){a.set(e,o(t,r,i,e,n,s))});var l=u?l?ao:so:l?keysIn:Ue,d=p?void 0:l(n);return fe(d||n,function(t,e){d&&(t=n[e=t]),ve(a,e,o(t,r,i,e,n,s))}),a};var qo=function(t){return Uo(t,5)};var Go=function(t,e,o){(void 0===o||bt(t[e],o))&&(void 0!==o||e in t)||me(t,e,o)};var Zo=function(c){return function(t,e,o){for(var n=-1,r=Object(t),i=o(t),s=i.length;s--;){var a=i[c?s:++n];if(!1===e(r[a],a,r))break}return t}}();var Ho=function(t){return be(t)&&Fe(t)},Lt=Function.prototype,Ct=Object.prototype,Ko=Lt.toString,Wo=Ct.hasOwnProperty,Vo=Ko.call(Object);var Yo=function(t){return!(!be(t)||"[object Object]"!=Zt(t))&&(null===(t=oo(t))||"function"==typeof(t=Wo.call(t,"constructor")&&t.constructor)&&t instanceof t&&Ko.call(t)==Vo)};var Qo=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var Jo=function(t){return _e(t,Ke(t))};var Xo=function(t,e,o,n,r,i,s){var a,c,l,u=Qo(t,o),p=Qo(e,o),h=s.get(p);h?Go(t,o,h):((a=void 0===(l=i?i(u,p,o+"",t,e,s):void 0))&&(h=!(c=Te(p))&&Ce(p),e=!c&&!h&&Le(p),l=p,c||h||e?l=Te(u)?u:Ho(u)?Ye(u):h?Ve(p,!(a=!1)):e?ko(p,!(a=!1)):[]:Yo(p)||Oe(p)?Oe(l=u)?l=Jo(u):Ht(u)&&!Kt(u)||(l=No(p)):a=!1),a&&(s.set(p,l),r(l,p,n,i,s),s.delete(p)),Go(t,o,l))};var $o=function n(r,i,s,a,c){r!==i&&Zo(i,function(t,e){var o;c=c||new de,Ht(t)?Xo(r,i,e,s,n,a,c):(o=a?a(Qo(r,e),t,e+"",r,i,c):void 0,Go(r,e,o=void 0===o?t:o))},Ke)};function tn(t){return t}var en=function(t,e,o){switch(o.length){case 0:return t.call(e);case 1:return t.call(e,o[0]);case 2:return t.call(e,o[0],o[1]);case 3:return t.call(e,o[0],o[1],o[2])}return t.apply(e,o)},on=Math.max;var nn=function(i,s,a){return s=on(void 0===s?i.length-1:s,0),function(){for(var t=arguments,e=-1,o=on(t.length-s,0),n=Array(o);++e<o;)n[e]=t[s+e];for(var e=-1,r=Array(s+1);++e<s;)r[e]=t[e];return r[s]=a(n),en(i,this,r)}};var rn=function(t){return function(){return t}},sn=Date.now;var an=function(o){var n=0,r=0;return function(){var t=sn(),e=16-(t-r);if(r=t,0<e){if(800<=++n)return arguments[0]}else n=0;return o.apply(void 0,arguments)}}(ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:rn(e),writable:!0})}:tn);var cn=function(t,e){return an(nn(t,e,tn),t+"")};var ln=function(t,e,o){if(!Ht(o))return!1;var n=typeof e;return!!("number"==n?Fe(o)&&ke(e,o.length):"string"==n&&e in o)&&bt(o[e],t)};var un,pn,hn=function(a){return cn(function(t,e){var o=-1,n=e.length,r=1<n?e[n-1]:void 0,i=2<n?e[2]:void 0,r=3<a.length&&"function"==typeof r?(n--,r):void 0;for(i&&ln(e[0],e[1],i)&&(r=n<3?void 0:r,n=1),t=Object(t);++o<n;){var s=e[o];s&&a(t,s,o,r)}return t})}(function(t,e,o){$o(t,e,o)}),dn=((window&&window.__extends||(un=function(t,e){return(un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}un(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(fn,pn=k),fn);function fn(){var t=null!==pn&&pn.apply(this,arguments)||this;return t.layout="icons",t.mapStyles=["road","grayscale_light","grayscale_dark","night","road_shaded_relief"],t.style=u.ControlStyle.light,t.autoSelectionMode=!0,t}var yn,mn,H=window&&window.__extends||(yn=function(t,e){return(yn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}yn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),gn=window&&window.__awaiter||function(t,s,a,c){return new(a=a||Promise)(function(o,e){function n(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((c=c.apply(t,s||[])).next())})},vn=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},_n=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Mt=(H(wn,mn=nt),wn.prototype.onAdd=function(t,e){var o=this;this.map=t;var n=this.buildContainer(t,this.options.style,"Map Style Control"),r=this.buildStyleOpsGrid();this.styleOpsGrid=r;var i=this.buildCurrStyleBtn(),t=q("Select Style");return r.classList.add(e&&e.position||"top-right"),n.addEventListener("mouseover",function(){o.hasMouse=!0,n.classList.add(wn.Css.inUse),r.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(){o.hasFocus=!0,n.classList.add(wn.Css.inUse),r.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element")))}),r.addEventListener("keydown",function(t){27===t.keyCode&&(t.stopPropagation(),i.focus(),n.classList.contains(wn.Css.inUse)&&(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element")))}),i.addEventListener("click",function(t){n.classList.contains(wn.Css.inUse)?(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element")):(n.classList.add(wn.Css.inUse),r.classList.remove("hidden-accessible-element"),r.firstElementChild&&r.firstElementChild.focus())}),e&&wn.InvertOrderPositions.includes(e.position)?(n.appendChild(r),n.appendChild(i),n.appendChild(t),G(t,i)):(n.appendChild(i),n.appendChild(t),G(t,i),n.appendChild(r)),n},wn.prototype.onRemove=function(){mn.prototype.onRemove.call(this),this.styleOpsGrid=null,this.styleButtons.clear(),this.map.events.remove("stylechanged",this.onStyleChange),this.map.events.remove("mapconfigurationchanged",this.onMapConfigurationChange)},wn.prototype.setSelectedStyle=function(o){var e,t,n=this;this.styleIcons.has(o)&&(e=this.currStyleImage,t=this.styleIcons.get(o),e.src!==t&&(e.src=t),Object.entries(this.styleButtons).forEach(function(t){var e=_n(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}),this.map.styles.definitions().then(function(t){t=n.mapToFriendlyStyleName(o,t);e.alt!==t&&(e.alt=t),e.parentElement.lastChild instanceof Text&&(e.parentElement.lastChild.textContent=t)}))},wn.prototype.disableStyle=function(t){t=this.styleButtons[t];t&&t.setAttribute("disabled","true")},wn.prototype.enableStyle=function(t){t=this.styleButtons[t];t&&t.removeAttribute("disabled")},wn.prototype.buildSelectStyleBtn=function(o,t,e){var n=this,r=document.createElement("button"),i=this.mapToFriendlyStyleName(o,t);r.setAttribute("aria-label",i),r.setAttribute("type","button");var s=new Image;e.then(function(t){return t.blob()}).then(function(t){t=URL.createObjectURL(t);s.src=t,o===n.map.getStyle().style&&(n.currStyleImage.src=t,n.currStyleImage.alt=i,n.currStyleImage.parentElement.lastChild.nodeType==Node.TEXT_NODE?n.currStyleImage.parentElement.lastChild.textContent=i:n.currStyleImage.parentElement.appendChild(document.createTextNode(i))),n.styleIcons.set(o,t)}),s.setAttribute("aria-hidden","true"),r.appendChild(s),"icons"===this.options.layout?r.classList.add(wn.Css.button):(r.classList.add(wn.Css.listButton),r.classList.add(wn.Css.expanded),r.appendChild(document.createTextNode(i))),r.addEventListener("click",function(){n.hasMouse=!1,n.hasFocus=!1;var t=n.styleButtons[o];t&&!t.hasAttribute("disabled")&&(n._invokeEvent("styleselected",o),n.options.autoSelectionMode&&n.map.setStyle({style:o}),Object.entries(n.styleButtons).forEach(function(t){var e=_n(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}))});e=document.createElement("div");return e.classList.add("selected-icon"),r.appendChild(e),r},wn.prototype.buildCurrStyleBtn=function(){var t=document.createElement("button");"icons"==this.options.layout?t.classList.add(wn.Css.button):t.classList.add(wn.Css.listButton),t.classList.add(wn.Css.currentStyle),t.setAttribute("aria-label","Select Style"),t.setAttribute("tabindex","-1"),this.currStyleImage=new Image,t.appendChild(this.currStyleImage);var e=document.createElement("div");return e.classList.add("icon"),t.appendChild(e),t},wn.prototype.buildStyleOpsGrid=function(){var t=this,e=document.createElement("div");return e.classList.add(wn.Css.styleOptions),"icons"===this.options.layout?e.classList.add(this.options.layout):e.classList.add(wn.Css.dropdown),e.setAttribute("aria-label","Style Options"),e.classList.add("hidden-accessible-element"),this.map.styles.definitions().then(function(e){return gn(t,void 0,void 0,function(){return vn(this,function(t){return this.onMapConfigurationChange(e),this.map.events.add("stylechanged",this.onStyleChange),[2]})})}),this.map.events.add("mapconfigurationchanged",this.onMapConfigurationChange),e},wn.prototype.populateOpsGridFromDefinitions=function(n){var t,o,r=this;this.styleOpsGrid&&(t=n.configurations,(t=Array.isArray(this.options.mapStyles)?t.filter(function(t){return r.options.mapStyles.includes(t.name.split("_indoor")[0])}):t).forEach(function(t){var e={url:t.thumbnail};t.thumbnail&&r.map.styles._transformStyleRequest(t.thumbnail,e);var o=r.map.getServiceOptions();o.transformRequest&&hn(e,o.transformRequest(e.url,"Thumbnail"));e=fetch(e.url,{headers:e.headers}),e=r.buildSelectStyleBtn(t.name,n,e);r.styleOpsGrid.appendChild(e),r.styleButtons[t.name]=e,"icons"===r.options.layout&&(t=q(r.mapToFriendlyStyleName(t.name,n)),r.styleOpsGrid.appendChild(t),G(t,e))}),o=this.map.getStyle().style,Object.entries(this.styleButtons).forEach(function(t){var e=_n(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}))},wn.InvertOrderPositions=[u.ControlPosition.TopRight,u.ControlPosition.BottomRight],wn.Css={button:"azure-maps-control-button",listButton:"azure-maps-control-list-button",expanded:"expanded",currentStyle:"curr-style",inUse:"in-use",styleOptions:"style-options",dropdown:"azure-maps-control-dropdown"},wn);function wn(t){var e=mn.call(this)||this;return e.styleOpsGrid=null,e.hasMouse=!1,e.hasFocus=!1,e.styleButtons=new J,e.styleIcons=new J,e.onStyleChange=function(){var t;e.options.autoSelectionMode&&(t=e.map.getStyle().style,e.setSelectedStyle(t))},e.onMapConfigurationChange=function(t){e.styleOpsGrid&&(Array.from(e.styleOpsGrid.children).forEach(function(t){return t.remove()}),e.styleButtons.clear(),e.populateOpsGridFromDefinitions(t))},e.mapToFriendlyStyleName=function(e,t){t=t.configurations.find(function(t){return t.name===e});return(null==t?void 0:t.displayName)||e},e.options=(new dn).merge(qo(t)),e}var bn,Sn,xn=((window&&window.__extends||(bn=function(t,e){return(bn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}bn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(On,Sn=k),On);function On(){var t=null!==Sn&&Sn.apply(this,arguments)||this;return t.flow="none",t.incidents=!1,t}var Tn,En,Cn=((window&&window.__extends||(Tn=function(t,e){return(Tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Tn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Pn,En=xn),Pn);function Pn(){var t=null!==En&&En.apply(this,arguments)||this;return t.isActive=!1,t.style=u.ControlStyle.light,t}var kn,An,In=((window&&window.__extends||(kn=function(t,e){return(kn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}kn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ln,An=nt),Object.defineProperty(Ln.prototype,"isActive",{get:function(){if(!this.map)return!1;var t=this.map.getTraffic();return"none"!==t.flow||t.incidents},set:function(t){this.map&&this.map.setTraffic({flow:t?this.options.flow:"none",incidents:!!t&&this.options.incidents})},enumerable:!1,configurable:!0}),Ln.prototype.onAdd=function(t){(this.map=t).getTraffic();void 0!==this.initIsActive&&(this.isActive=this.initIsActive),this.container=this.buildContainer(t,this.style,"Traffic Control"),this.container.style.flexDirection="column";var e=this.constructTrafficButton(t);this.container.appendChild(e);t=q("Toggle Traffic Display");return this.container.appendChild(t),G(t,e),this.container},Ln.prototype.onRemove=function(){An.prototype.onRemove.call(this),this.map=null},Ln.prototype.getOptions=function(){return(new Cn).merge({isActive:this.isActive,flow:this.options.flow,incidents:this.options.incidents,style:this.style})},Ln.prototype.updateButtonState=function(){this.trafficButton&&(this.isActive?this.container.classList.add("in-use"):this.container.classList.remove("in-use"),this.trafficButton.setAttribute("aria-pressed",this.isActive?"true":"false"))},Ln.prototype.constructTrafficButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("traffic"),o.setAttribute("aria-label","Toggle Traffic Display"),o.setAttribute("alt","Toggle Traffic Display"),o.setAttribute("type","button"),this.trafficButton=o,this.updateButtonState(),o.addEventListener("click",function(){e.isActive=!e.isActive}),o},Ln);function Ln(t){var e,o=An.call(this)||this;return o.hasMouse=!1,o.hasFocus=!1,o.options=(new xn).merge({flow:"relative",incidents:!0}),o.style=u.ControlStyle.light,o.container=null,o.trafficButton=null,o.map=null,t&&(o.initIsActive=null!==(e=t.isActive)&&void 0!==e&&e,o.options.flow=t.flow||"relative",o.options.incidents=null===(e=t.incidents)||void 0===e||e,o.style=t.style||u.ControlStyle.light),o}var Rn,Nn,It=window&&window.__extends||(Rn=function(t,e){return(Rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Rn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Mn=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},At=(It(jn,Nn=nt),jn.prototype.onAdd=function(t){this.map=t;var e=this.buildContainer(t,u.ControlStyle.auto,"Traffic Legend"),t=this.buildTrafficLegendDiv(t);return e.setAttribute("role","definition"),e.appendChild(t),e},jn.prototype.onRemove=function(){Nn.prototype.onRemove.call(this),this.syncHiddenState&&(this.map.events.remove("styledata",this.syncHiddenState),this.syncHiddenState=null),this.map=null},jn.prototype.buildTrafficLegendDiv=function(e){var o,t,n,r,i=document.createElement("div");i.classList.add("traffic-legend","hidden"),i.setAttribute("alt","Traffic Legend");var s=document.createElement("table"),a=document.createElement("tr"),c=document.createElement("td");c.setAttribute("alt","Traffic"),c.appendChild(document.createTextNode("Traffic"));var l=q("Traffic");c.classList.add("traffic-legend-title"),c.colSpan=6,a.appendChild(c),a.appendChild(l),G(l,c),s.appendChild(a);var u=document.createElement("tr");try{for(var p=Mn(this.table),h=p.next();!h.done;h=p.next()){var d=h.value,f=document.createElement("td");if("Fast"===d||"Slow"===d)f.setAttribute("alt",d),f.appendChild(document.createTextNode(d)),f.classList.add("traffic-legend-text");else{f.classList.add("traffic-legend-colors"),f.setAttribute("aria-label","Traffic Legend"),f.setAttribute("role","img");try{for(var y=(n=void 0,Mn(d)),m=y.next();!m.done;m=y.next()){var g=m.value,v=document.createElement("div");v.classList.add(g),f.appendChild(v)}}catch(t){n={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}u.appendChild(f);var _=q(d instanceof Array?"Traffic Legend":d);u.appendChild(_),G(_,f)}}catch(t){o={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(o)throw o.error}}return s.appendChild(u),i.appendChild(s),this.syncHiddenState=function(t){"style"===t.dataType&&((t=e.getTraffic()).flow&&"none"!==t.flow?i.classList.remove("hidden"):i.classList.add("hidden"))},this.syncHiddenState({dataType:"style"}),e.events.add("styledata",this.syncHiddenState),i},jn);function jn(){var t=Nn.call(this)||this;return t.table=["Fast",["green","yellow","red","dark-red"],"Slow"],t.map=null,t.syncHiddenState=null,t}Tt=function(t){return this.__data__.has(t)};function Dn(t){var e=-1,o=null==t?0:t.length;for(this.__data__=new pe;++e<o;)this.add(t[e])}Dn.prototype.add=Dn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dn.prototype.has=Tt;var zn=Dn;var Bn=function(t,e){for(var o=-1,n=null==t?0:t.length;++o<n;)if(e(t[o],o,t))return!0;return!1};var Fn=function(t,e){return t.has(e)};var Un=function(t,e,o,n,r,i){var s=1&o,a=t.length,c=e.length;if(a!=c&&!(s&&a<c))return!1;if((c=i.get(t))&&i.get(e))return c==e;var l=-1,u=!0,p=2&o?new zn:void 0;for(i.set(t,e),i.set(e,t);++l<a;){var h,d=t[l],f=e[l];if(void 0!==(h=n?s?n(f,d,l,e,t,i):n(d,f,l,t,e,i):h)){if(h)continue;u=!1;break}if(p){if(!Bn(e,function(t,e){if(!Fn(p,e)&&(d===t||r(d,t,o,n,i)))return p.push(e)})){u=!1;break}}else if(d!==f&&!r(d,f,o,n,i)){u=!1;break}}return i.delete(t),i.delete(e),u};function qn(t){var o=-1,n=Array(t.size);return t.forEach(function(t,e){n[++o]=[e,t]}),n}function Gn(t){var e=-1,o=Array(t.size);return t.forEach(function(t){o[++e]=t}),o}var R=Ot?Ot.prototype:void 0,Zn=R?R.valueOf:void 0;var Hn=function(t,e,o,n,r,i,s){switch(o){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return t.byteLength==e.byteLength&&i(new So(t),new So(e))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return bt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=qn;case"[object Set]":a=a||Gn;if(t.size!=e.size&&!(1&n))return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);a=Un(a(t),a(e),n,r,i,s);return s.delete(t),a;case"[object Symbol]":if(Zn)return Zn.call(t)==Zn.call(e)}return!1},Kn=Object.prototype.hasOwnProperty;var Wn=function(t,e,o,n,r,i){var s=1&o,a=so(t),c=a.length;if(c!=so(e).length&&!s)return!1;for(var l=c;l--;){var u=a[l];if(!(s?u in e:Kn.call(e,u)))return!1}var p=i.get(t);if(p&&i.get(e))return p==e;var h=!0;i.set(t,e),i.set(e,t);for(var d,f=s;++l<c;){var y,m=t[u=a[l]],g=e[u];if(!(void 0===(y=n?s?n(g,m,u,e,t,i):n(m,g,u,t,e,i):y)?m===g||r(m,g,o,n,i):y)){h=!1;break}f=f||"constructor"==u}return!h||f||(d=t.constructor)!=(p=e.constructor)&&"constructor"in t&&"constructor"in e&&!("function"==typeof d&&d instanceof d&&"function"==typeof p&&p instanceof p)&&(h=!1),i.delete(t),i.delete(e),h},Vn="[object Arguments]",Yn="[object Array]",Qn="[object Object]",Jn=Object.prototype.hasOwnProperty;var Xn=function(t,e,o,n,r,i){var s=Te(t),a=Te(e),c=s?Yn:_o(t),l=a?Yn:_o(e),u=(c=c==Vn?Qn:c)==Qn,a=(l=l==Vn?Qn:l)==Qn;if((l=c==l)&&Ce(t)){if(!Ce(e))return!1;u=!(s=!0)}if(l&&!u)return i=i||new de,s||Le(t)?Un(t,e,o,n,r,i):Hn(t,e,c,o,n,r,i);if(!(1&o)){u=u&&Jn.call(t,"__wrapped__"),a=a&&Jn.call(e,"__wrapped__");if(u||a)return r(u?t.value():t,a?e.value():e,o,n,i=i||new de)}return!!l&&(i=i||new de,Wn(t,e,o,n,r,i))};var $n=function t(e,o,n,r,i){return e===o||(null==e||null==o||!be(e)&&!be(o)?e!=e&&o!=o:Xn(e,o,n,r,t,i))};var tr,er=function(t,e){return $n(t,e)},or=(tr=Object.freeze({__proto__:null,default:{}}))&&tr.default||tr,nr=Rt(function(a){!function(){for(var e,o,n=0,r=[],t=0;t<256;t++)r[t]=(t+256).toString(16).substr(1);function i(){var t,t=(t=16,(!e||s.BUFFER_SIZE<n+t)&&(n=0,e=s.randomBytes(s.BUFFER_SIZE)),e.slice(n,n+=t));return t[6]=15&t[6]|64,t[8]=63&t[8]|128,t}function s(){var t=i();return r[t[0]]+r[t[1]]+r[t[2]]+r[t[3]]+"-"+r[t[4]]+r[t[5]]+"-"+r[t[6]]+r[t[7]]+"-"+r[t[8]]+r[t[9]]+"-"+r[t[10]]+r[t[11]]+r[t[12]]+r[t[13]]+r[t[14]]+r[t[15]]}s.BUFFER_SIZE=4096,s.bin=i,s.clearBuffer=function(){e=null,n=0},s.test=function(t){return"string"==typeof t&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)},"undefined"!=typeof crypto?o=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(o=window.msCrypto),o=o||or,(a.exports=s).randomBytes=function(){if(o){if(o.randomBytes)return o.randomBytes;if(o.getRandomValues)return"function"!=typeof Uint8Array.prototype.slice?function(t){t=new Uint8Array(t);return o.getRandomValues(t),Array.from(t)}:function(t){t=new Uint8Array(t);return o.getRandomValues(t),t}}return function(t){for(var e=[],o=0;o<t;o++)e.push(Math.floor(256*Math.random()));return e}}()}()}),rr=(ir.TYPE="Feature",ir);function ir(t,e,o,n){this.type="Feature",this.type=ir.TYPE,this.properties=e||{},this.id=o,this.geometry=t,this.bbox=n}var sr,ar,Lt=window&&window.__extends||(sr=function(t,e){return(sr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}sr(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),cr=(ar=Array,Lt(lr,ar),lr.fromData=function(o){var n=NaN,r=NaN,i=new Set(["y"]),s=new Set(["x"]);return Object.keys(o).forEach(function(t){var e=t.toLowerCase();isNaN(n)&&i.has(e)&&"number"==typeof o[t]?n=o[t]:isNaN(r)&&s.has(e)&&"number"==typeof o[t]&&(r=o[t])}),isNaN(n)||isNaN(r)?null:new lr(n,r)},lr.getX=function(t){return 0<t.length?t[0]:NaN},lr.getY=function(t){return 1<t.length?t[1]:NaN},lr.getDestination=function(t,e,o){return new lr(lr.getX(t)+o*Math.cos((e+270)*Math.PI/180),lr.getY(t)+o*Math.sin((e+270)*Math.PI/180))},lr.getDistance=function(t,e){var o=lr.getX(t)-lr.getX(e),e=lr.getY(t)-lr.getY(e);return Math.sqrt(o*o+e*e)},lr.getHeading=function(t,e){var o=lr.getX(e)-lr.getX(t),e=lr.getY(t)-lr.getY(e);return 180*(2.5*Math.PI-Math.atan2(e,o))/Math.PI%360},lr);function lr(t,e){return ar.call(this,t,e)||this}var ur=(pr.TYPE="Point",pr);function pr(t){this.type="Point",this.type=pr.TYPE,this.coordinates=t}var hr,dr,fr,yr,mr,gr=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},vr=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_r=6378137,wr=Math.PI/180,br=180/Math.PI,Sr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],xr=85.0511;function Or(t){return t*wr}function Tr(t){return t*br}function Er(t,e,o){return Math.min(Math.max(t,e),o)}function Cr(t,e){var o=Or(e[1]-t[1]),n=Or(e[0]-t[0]),n=Math.pow(Math.sin(o/2),2)+Math.cos(Or(t[1]))*Math.cos(Or(e[1]))*Math.pow(Math.sin(n/2),2),n=2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n));return Math.round(_r*n*100)/100}function Pr(t){if(t)switch(t.toLowerCase()){case"feet":case"foot":case"ft":return dr.feet;case"kilometers":case"kilometer":case"kilometres":case"kilometre":case"km":case"kms":return dr.kilometers;case"miles":case"mile":case"mi":return dr.miles;case"nauticalmiles":case"nauticalmile":case"nms":case"nm":return dr.nauticalMiles;case"yards":case"yard":case"yds":case"yrd":case"yrds":return dr.yards;default:return dr.meters}return dr.meters}function kr(t){if(t)switch(t.toLowerCase()){case"milespersecondsquared":case"milepersecondsquared":case"mi/s^2":case"mi/s2":return mr.milesPerSecondSquared;case"kilometerspersecondsquared":case"kilometrespersecondsquared":case"kilometerpersecondsquared":case"kilometrepersecondsquared":case"km/s^2":case"km/s2":return mr.kilometersPerSecondSquared;case"knotspersecond":case"knotpersecond":case"knts/s":case"kn/s":case"kt/s":return mr.knotsPerSecond;case"standardgravity":case"g":return mr.standardGravity;case"feetpersecondsquared":case"footpersecondsquared":case"ft/s^2":case"ft/s2":return mr.feetPerSecondSquared;case"yardspersecondsquared":case"yardpersecondsquared":case"yds/s^2":case"yds/s2":case"yd/s^2":case"yd/s2":return mr.yardsPerSecondSquared;case"milesperhoursecond":case"mileperhoursecond":case"milesperhourseconds":case"mileperhourseconds":case"mi/h/s":return mr.milesPerHourSecond;case"kilometersperhoursecond":case"kilometrespersoursecond":case"kilometerperhoursecond":case"kilometrepersoursecond":case"kilometersperhourssecond":case"kilometrespersourssecond":case"kilometerperhourssecond":case"kilometrepersourssecond":case"kmhs":case"km/h/s":return mr.kilometersPerHourSecond;default:return mr.metersPerSecondSquared}return mr.metersPerSecondSquared}function Ar(t){if(t)switch(t){case"acres":case"ac":return hr.acres;case"hectares":case"ha":return hr.hectares;case"squareFeet":case"ft^2":case"ft2":return hr.squareFeet;case"squareYards":case"squareYard":case"yds^2":case"yds2":case"yd^2":case"yd2":return hr.squareYards;case"squareKilometers":case"squareKilometres":case"squareKilometer":case"squareKilometre":case"km^2":case"km2":return hr.squareKilometers;case"squareMiles":case"squareMile":case"mi^2":case"mi2":return hr.squareMiles;default:return hr.squareMeters}return hr.squareMeters}function Ir(t){if(t)switch(t.toLowerCase()){case"feetpersecond":case"footsecond":case"ftps":case"ft/s":return yr.feetPerSecond;case"milesperhour":case"mileperhour":case"mph":case"mi/hr":case"mi/h":return yr.milesPerHour;case"knots":case"knot":case"knts":case"knt":case"kn":case"kt":return yr.knots;case"mach":case"m":return yr.mach;case"kilometersperhour":case"kilometresperhour":case"kmperhour":case"kmph":case"km/hr":case"km/h":return yr.kilometersPerHour;default:return yr.metersPerSecond}return yr.metersPerSecond}function Lr(t){if(t)switch(t.toLowerCase()){case"milliseconds":case"ms":return fr.ms;case"minutes":case"minute":case"mins":case"min":return fr.minutes;case"hours":case"hour":case"hr":case"h":return fr.hours;case"days":case"day":case"d":return fr.days;default:return fr.seconds}return fr.seconds}function Rr(t){var e=0;if(t&&0<t.length)for(var e=Math.abs(Nr(t[0])),o=1,n=t.length;o<n;o++)e-=Math.abs(Nr(t[o]));return e}function Nr(t){var e=0;if(3<=t.length){for(var o=void 0,n=void 0,r=0,i=t.length;r<i;r++)e+=(Or(t[r===i-2?(o=i-2,n=i-1,0):r===i-1?(o=i-1,n=0,1):(n=(o=r)+1,r+2)][0])-Or(t[o][0]))*Math.sin(Or(t[n][1]));e=e*_r*_r/2}return e}function Mr(t,e,o){return(t[0]-o[0])*(e[1]-o[1])-(t[1]-o[1])*(e[0]-o[0])}function jr(t,e,o){if(2<=o.length){for(var n,r,i=1/0,s=null,a=ei(o,22),c=0,l=a.length-1;c<l;c++)r=function(t,e,o){if(e[0]===o[0]&&e[1]===o[1])return e;var n=t[0]-e[0],r=t[1]-e[1],i=o[0]-e[0],t=o[1]-e[1],r=(i*n+t*r)/(i*i+t*t);return r<0?e:1<r?o:[e[0]+i*r,e[1]+t*r]}(e,a[c],a[c+1]),(n=cr.getDistance(e,r))<i&&(i=n,s=r);if(s){var u=ti([s],22)[0];return new rr(new ur(u),{distance:Fr(t,u)})}}else if(1===o.length)return new rr(new ur(o[0]),{distance:Fr(t,o[0])});return null}function Dr(t,e){var o;return!isNaN(t)&&"number"==typeof e&&0<=e&&(o=void 0,o=e<Sr.length?Sr[e]:Math.pow(10,e),t=Math.round(t*o)/o),t}function zr(t,e,o,n){switch(Pr(e)){case dr.meters:t/=1e3;break;case dr.feet:t/=3280.8399;break;case dr.miles:t/=.62137119;break;case dr.yards:t/=1093.6133;break;case dr.nauticalMiles:t/=.5399568;break;case dr.kilometers:}switch(Pr(o)){case dr.meters:t*=1e3;break;case dr.feet:t*=3280.8399;break;case dr.miles:t*=.62137119;break;case dr.yards:t*=1093.6133;break;case dr.nauticalMiles:t*=.5399568;break;case dr.kilometers:}return"number"==typeof n&&0<=n&&(n=Math.pow(10,n),t=Math.round(t*n)/n),t}function Br(t,e,o,n){n=n||"meters",t=pi(t);var r=Ur(n),n=Or(t[1]),t=Or(t[0]),e=e*wr,o=o/r,r=Math.asin(Math.sin(n)*Math.cos(o)+Math.cos(n)*Math.sin(o)*Math.cos(e)),n=t+Math.atan2(Math.sin(e)*Math.sin(o)*Math.cos(n),Math.cos(o)-Math.sin(n)*Math.sin(r)),r=Er(Jr(r*br),-85,85);return[Xr(n*br),r]}function Fr(t,e,o){e=Cr(t=pi(t),e=pi(e));return"meters"===o?e:zr(e,"meters",o||"meters")}function Ur(t){t=Pr(t);return zr(_r,dr.meters,t)}function qr(t,e,o){for(var n=[],r=Or(t[1]),i=Or(t[0]),s=Or(e[1]),a=Or(e[0]),c=2*Math.asin(Math.sqrt(Math.pow(Math.sin((r-s)/2),2)+Math.cos(r)*Math.cos(s)*Math.pow(Math.sin((i-a)/2),2))),l=0;l<=o;l++){var u=l/o,p=Math.sin((1-u)*c)/Math.sin(c),h=Math.sin(u*c)/Math.sin(c),d=p*Math.cos(r)*Math.cos(i)+h*Math.cos(s)*Math.cos(a),u=p*Math.cos(r)*Math.sin(i)+h*Math.cos(s)*Math.sin(a),h=p*Math.sin(r)+h*Math.sin(s),h=Math.atan2(h,Math.sqrt(Math.pow(d,2)+Math.pow(u,2))),d=Math.atan2(u,d),h=Er(h*br,-85,85);d*=br,n.push([d,h])}return n}function Gr(t){return(Array.isArray(t)?t:t.coordinates).reduce(function(t,e){var o=0<t.length?t[t.length-1]:null;return o&&180<Math.abs(e[0]-o[0])?(o=o[0]<0?e[0]-360:e[0]+360,t.push([o,e[1]])):t.push(e),t},[])}function Zr(t){for(var e,o,n,r,i,s=Array.isArray(t)?t:t.coordinates,a=[],c=[],l=0;l<s.length;l++)a.push(s[l]),l+1>=s.length||(e=(n=gr(s[l],2))[0],o=n[1],i=(r=gr(s[l+1],2))[0],n=r[1],180<Math.abs(i-e)&&(r=0<e?180:-180,i=Math.abs((0<e?i+360:i-360)-e),i=o+(n-o)*(Math.abs(r-e)/i),a.push([r,i]),c.push(a),a=[[-r,i]]));return c.push(a),c}function Hr(t,e){if(t=pi(t),e=pi(e),t&&2<=t.length&&e&&2<=e.length){var o=Or(t[1]),n=Or(e[1]),e=Or(e[0]-t[0]),t=Math.sin(e)*Math.cos(n),e=Math.cos(o)*Math.sin(n)-Math.sin(o)*Math.cos(n)*Math.cos(e);return(Tr(Math.atan2(t,e))+360)%360}return NaN}function Kr(t,e){var o,n=0;Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var r=0,i=o.length-1;r<i;r++)n+=Cr(o[r],o[r+1]);return zr(n,"meters",e||"meters")}function Wr(t,e,o){o=o||"meters";var n,r,i=0;if(Array.isArray(t)?r=t:t.type&&"LineString"===t.type&&(r=t.coordinates),2<=r.length){for(var s=r.length,a=1;a<s;a++){if(e<=i+(n=Fr(r[a-1],r[a],o))){var c=Hr(r[a-1],r[a]);return Br(r[a-1],c,e-i,o)}i+=n}return i<=e?r[s-1]:r[0]}return null}function Vr(t,e,o,n,r){n=n||"meters",r=r||0,t=pi(t);for(var i=[],s=360/o,a=0;a<=o;a++)i.push(Br(t,(a*s+r)%360,e,n));return i}function Yr(t,e,o,n,r){return Gr(Vr(t,e,o,n,r))}function Qr(t,e,o){o=void 0===o?.5:o;var n=Fr(t=pi(t),e=pi(e),"kilometers");return Br(t,Hr(t,e),n*o,"kilometers")}function Jr(t){return 90<t?180<(t=(t+90)%360)?90-(t-180):t-90:t<-90?(t=(t-90)%360)<-180?-90-(t+180):t+90:t}function Xr(t){return 180<t?(t+180)%360-180:t<-180?(t-180)%360+180:t}function $r(t,e,o){if(0===o)return Object.assign({},t);e=pi(e);for(var n,r,i=[],s=0,a=t.length;s<a;s++)n=Fr(e,t[s]),r=Hr(e,t[s]),i.push(Br(e,r+o,n));return i}function ti(t,e){for(var o,n,r=512*Math.pow(2,e),i=[],s=0,a=t.length;s<a;s++)o=t[s][0]/r-.5,n=.5-t[s][1]/r,i.push([360*o,90-360*Math.atan(Math.exp(2*-n*Math.PI))/Math.PI]);return i}function ei(t,e){for(var o,n,r=512*Math.pow(2,e),i=[],s=0,a=t.length;s<a;s++)n=Math.sin(t[s][1]*Math.PI/180),o=(t[s][0]+180)/360,n=.5-Math.log((1+n)/(1-n))/(4*Math.PI),i.push([Math.round(o*r),Math.round(n*r)]);return i}function oi(t,e,o,n){switch(kr(e)){case mr.kilometersPerHourSecond:t/=3.6;break;case mr.milesPerHourSecond:t/=2.236936292054;break;case mr.knotsPerSecond:t/=1.943844492441;break;case mr.standardGravity:t/=.1019716212978;break;case mr.kilometersPerSecondSquared:t/=.001;break;case mr.milesPerSecondSquared:t/=.000621371192;break;case mr.feetPerSecondSquared:t/=3.280839895012;break;case mr.yardsPerSecondSquared:t/=1.093613298338;break;case mr.metersPerSecondSquared:}switch(kr(o)){case mr.kilometersPerHourSecond:t*=3.6;break;case mr.milesPerHourSecond:t*=2.236936292054;break;case mr.knotsPerSecond:t*=1.943844492441;break;case mr.standardGravity:t*=.1019716212978;break;case mr.kilometersPerSecondSquared:t*=.001;break;case mr.milesPerSecondSquared:t*=.000621371192;break;case mr.feetPerSecondSquared:t*=3.280839895012;break;case mr.yardsPerSecondSquared:t*=1.093613298338;break;case mr.metersPerSecondSquared:}return Dr(t,n)}function ni(t,e,o,n){switch(Ar(e)){case hr.acres:t*=4046.8564224;break;case hr.hectares:t*=1e4;break;case hr.squareFeet:t*=.09290304;break;case hr.squareKilometers:t*=1e6;break;case hr.squareMiles:t*=259e4;break;case hr.squareYards:t*=.83612736;break;case hr.squareMeters:}switch(Ar(o)){case hr.acres:t/=4046.8564224;break;case hr.hectares:t/=1e4;break;case hr.squareFeet:t/=.09290304;break;case hr.squareKilometers:t/=1e6;break;case hr.squareMiles:t/=259e4;break;case hr.squareYards:t/=.83612736;break;case hr.squareMeters:}return Dr(t,n)}function ri(t,e,o,n){switch(Ir(e)){case yr.feetPerSecond:t*=1.09728;break;case yr.milesPerHour:t*=1.6093;break;case yr.knots:t*=1.852;break;case yr.metersPerSecond:t*=3.6;break;case yr.mach:t*=1234.8;break;case yr.kilometersPerHour:}switch(Ir(o)){case yr.feetPerSecond:t/=1.09728;break;case yr.milesPerHour:t/=1.6093;break;case yr.knots:t/=1.852;break;case yr.metersPerSecond:t/=3.6;break;case yr.mach:t/=1234.8;break;case yr.kilometersPerHour:}return Dr(t,n)}function ii(t,e,o,n){switch(Lr(e)){case fr.ms:t/=1e3;break;case fr.hours:t*=3600;break;case fr.minutes:t*=60;break;case fr.days:t*=86400;break;case fr.seconds:}switch(Lr(o)){case fr.ms:t*=1e3;break;case fr.hours:t/=3600;break;case fr.minutes:t/=60;break;case fr.days:t/=86400;break;case fr.seconds:}return Dr(t,n)}function si(t,e,o,n,r,i,s,a){r=zr(e,r,dr.meters),i=ii(o,i,fr.seconds);return oi(2*(r-ri(t,n,yr.metersPerSecond)*i)/(i*i),mr.metersPerSecondSquared,s,a)}function ai(t,e,o,n,r,i,s){t=ri(t,n,yr.metersPerSecond);return oi((ri(e,n,yr.metersPerSecond)-t)/ii(o,r,fr.seconds),mr.metersPerSecondSquared,i,s)}function ci(t,e,o,n){t=li(t),e=li(e);return null!=t&&null!=e?ii(e.getTime()-t.getTime(),fr.ms,o,n):NaN}function li(t){if("[object Date]"===Object.prototype.toString.call(t))return t;if("string"==typeof t){var e=Date.parse(t);if(!isNaN(e))return new Date(e);if(0<=t.indexOf("Date(")){e=0,e=0<(t=t.replace("/Date(","").replace(")/","")).indexOf("+")?parseInt(t.substr(0,t.indexOf("+")),10):0<t.indexOf("-")?parseInt(t.substr(0,t.indexOf("-")),10):parseInt(t,10);return new Date(e)}}else if("number"==typeof t)return new Date(t);return null}function ui(t){var e=[],o=null,n=null;if(Array.isArray(t)&&0<t.length)if(Array.isArray(t[0])&&"number"==typeof t[0][0])e=t;else for(var r=t.length,i=0;i<r;i++)e=e.concat(ui(t[i]));else if(t.type)switch(t.type){case"Point":e=[t.coordinates];break;case"LineString":e=t.coordinates;break;case"Polygon":o=t.coordinates;break;case"MultiPoint":e=t.coordinates;break;case"MultiLineString":o=t.coordinates;break;case"MultiPolygon":n=t.coordinates;break;case"Feature":var s=t,e=xi._isCircle(s)?xi._getCirclePositions(s):ui(s.geometry);break;case"FeatureCollection":e=ui(t.features);break;case"GeometryCollection":e=ui(t.geometries)}else if(t instanceof xi)return ui(t.toJson());if(o)for(r=o.length,i=0;i<r;i++)e=e.concat(o[i]);else if(n)for(var a=n.length,i=0;i<a;i++)for(var c=n[i].length,l=0;l<c;l++)e=e.concat(n[i][l]);return e}function pi(t){if(Array.isArray(t)&&"number"==typeof t[0])return t;if(t.type){if("Point"===t.type)return t.coordinates;if("Feature"===t.type&&"Point"===t.geometry.type)return t.geometry.coordinates}else if(t instanceof xi&&"Point"===t.getType())return t.getCoordinates();return null}function hi(t,e,o){o=o||"meters";var n,r,i=0;if(Array.isArray(t)?r=t:t.type&&"LineString"===t.type&&(r=t.coordinates),2<=r.length){for(var s=r.length,a=1;a<s;a++){if(e<=i+(n=Fr(r[a-1],r[a],o))){var c=Hr(r[a-1],r[a]),l=Br(r[a-1],c,e-i,o);return new rr(new ur(l),{heading:c})}i+=n}return i<=e?new rr(new ur(r[s-1]),{heading:Hr(r[s-2],r[s-1])}):new rr(new ur(r[0]),{heading:Hr(r[0],r[1])})}return null}function di(t,e,o,n){var r=pi(t),i=ei([r],22)[0],s=null,a=1/0;switch((e=e instanceof xi?e.toJson():e).type){case"Feature":return di(t,e.geometry,o);case"Point":d=[[e.coordinates]];break;case"MultiPoint":for(var c,l=e.coordinates,u=0,p=l.length;u<p;u++)(c=Fr(r,l[u]))<a&&(a=c,s=new rr(new ur(l[u]),{distance:c}));break;case"LineString":d=[e.coordinates];break;case"Polygon":case"MultiLineString":d=e.coordinates;break;case"MultiPolygon":var h=e.coordinates;if(0<h.length)for(var d=h[0],u=1,p=h.length;u<p;u++)d=d.concat(h[u])}if(d)for(var f,u=0,p=d.length;u<p;u++)(f=jr(r,i,d[u]))&&f.properties.distance<a&&(a=f.properties.distance,s=f);return s&&(s.properties.distance=zr(s.properties.distance,"meters",o,n)),s}(Ct=hr=hr||{}).squareMeters="squareMeters",Ct.acres="acres",Ct.hectares="hectares",Ct.squareFeet="squareFeet",Ct.squareKilometers="squareKilometers",Ct.squareMiles="squareMiles",Ct.squareYards="squareYards",(H=dr=dr||{}).meters="meters",H.kilometers="kilometers",H.feet="feet",H.miles="miles",H.nauticalMiles="nauticalMiles",H.yards="yards",(It=fr=fr||{}).seconds="seconds",It.hours="hours",It.ms="ms",It.minutes="minutes",It.days="days",(Tt=yr=yr||{}).metersPerSecond="metersPerSecond",Tt.kilometersPerHour="kilometersPerHour",Tt.feetPerSecond="feetPerSecond",Tt.milesPerHour="milesPerHour",Tt.knots="knots",Tt.mach="mach",(Ot=mr=mr||{}).milesPerSecondSquared="milesPerSecondSquared",Ot.kilometersPerSecondSquared="kilometersPerSecondSquared",Ot.knotsPerSecond="knotsPerSecond",Ot.standardGravity="standardGravity",Ot.feetPerSecondSquared="feetPerSecondSquared",Ot.yardsPerSecondSquared="yardsPerSecondSquared",Ot.milesPerHourSecond="milesPerHourSecond",Ot.kilometersPerHourSecond="kilometersPerHourSecond",Ot.metersPerSecondSquared="metersPerSecondSquared";var fi,yi,R=window&&window.__extends||(fi=function(t,e){return(fi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}fi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),mi=(yi=Array,R(gi,yi),gi.fromPosition=function(t){return 2===t.length?new gi(t[0],t[1]):2<t.length?new gi(t[0],t[1],t[2]):null},gi.areEqual=function(t,e,o){if(void 0===o&&(o=6),t&&2<=t.length&&e&&2<=e.length){var n=Math.pow(10,o),r=Jr(t[1]),o=Jr(e[1]),t=Xr(t[0]),e=Xr(e[0]);if(0!=Math.round((r-o)*n)/n)return!1;n=Math.round((t-e)*n)/n;return 0!=n&&360!=n?!1:!0}return!1},gi.fromLatLng=function(r,t,e){var i,s,a,c,l,u,o=[];return"number"==typeof r?(o.push(r),"number"==typeof t&&o.push(t),"number"==typeof e&&o.push(e)):Array.isArray(r)?2<=r.length&&"number"==typeof r[0]&&"number"==typeof r[1]&&(3<=r.length&&"number"==typeof r[2]?o.push(r[0],r[1],r[2]):o.push(r[0],r[1])):"object"==typeof r&&(i=["lat","latitude","y"],s=["lng","longitude","lon","x"],a=["elv","elevation","alt","altitude","z"],u=l=c=NaN,Object.keys(r).forEach(function(t,e,o){var n=t.toLowerCase();isNaN(c)&&0<=i.indexOf(n)&&"number"==typeof r[t]?c=r[t]:isNaN(l)&&0<=s.indexOf(n)&&"number"==typeof r[t]?l=r[t]:isNaN(u)&&0<=a.indexOf(n)&&"number"==typeof r[t]&&(u=r[t])}),isNaN(c)||isNaN(l)||(o.push(l,c),isNaN(u)||o.push(u))),2<=o.length?o:null},gi.fromLatLngs=function(t){var e=[];if(Array.isArray(t))for(var o=0,n=t.length;o<n;o++){var r=gi.fromLatLng(t[o]);r&&e.push(r)}return e},gi._getDimensions=function(t){for(var e=0;Array.isArray(t);)t=t[0],e++;return"number"==typeof t&&e--,e},gi);function gi(t,e,o){return o?yi.call(this,t,e,o)||this:yi.call(this,t,e)||this}var vi=(_i.TYPE="Polygon",_i);function _i(t,e){this.type="Polygon",this.type=_i.TYPE,1===mi._getDimensions(t)?this.coordinates=[t]:this.coordinates=t,this.bbox=e}var wi,bi,Lt=window&&window.__extends||(wi=function(t,e){return(wi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}wi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Si=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xi=(Lt(Oi,bi=X),Oi.prototype.addProperty=function(t,e){er(this.data.properties[t],e)||(this.data.properties[t]=qo(e),"subType"!==t&&"radius"!==t||this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Oi.prototype.getBounds=function(){var e,t,o,n,r,i=this.getCoordinates(),s=this.getType();if("Point"===s)r=this.circlePolygon?(a=this.circlePolygon.geometry.coordinates,Pi.fromPositions(a[0])):new Pi(a=i,a);else if("MultiPoint"===s||"LineString"===s){var a=i;r=Pi.fromPositions(a)}else if("Polygon"===s){a=i;r=Pi.fromPositions(a[0])}else if("MultiLineString"===s){a=i;try{for(var c=Si(a),l=c.next();!l.done;l=c.next()){var u=l.value;r=Pi.merge(r,Pi.fromPositions(u))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}}else if("MultiPolygon"===s){a=i;try{for(var p=Si(a),h=p.next();!h.done;h=p.next()){var d=h.value;r=Pi.merge(r,Pi.fromPositions(d[0]))}}catch(t){o={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(o)throw o.error}}}return r},Oi.prototype.getCoordinates=function(){return qo(this.data.geometry.coordinates)},Oi.prototype.getCircleCoordinates=function(){return this.circlePolygon?qo(this.circlePolygon.geometry.coordinates[0]):null},Oi.prototype.getId=function(){return this.data.id},Oi.prototype.getProperties=function(){return qo(this.data.properties)},Oi.prototype.getType=function(){return this.data.geometry.type},Oi.prototype.isCircle=function(){return Oi._isCircle(this.data)},Oi.prototype.isRectangle=function(){return Oi._isRectangle(this.data)},Oi.prototype.setCoordinates=function(t){t="Polygon"===this.getType()&&1===mi._getDimensions(t)?[t]:t;er(this.data.geometry.coordinates,t)||(this.data.geometry.coordinates=qo(t),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Oi.prototype.setProperties=function(t){t[Oi._shapeIdPropName]=this.data.id,er(this.data.properties,t)||(this.data.properties=qo(t),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Oi.prototype.toJson=function(){return JSON.parse(JSON.stringify(this.data))},Oi.prototype._toJson=function(){return this.circlePolygon||this.data},Oi.prototype._setDataSource=function(t){void 0===t||null==t?delete this.dataSource:this.dataSource=t},Oi.prototype._handleCircle=function(){var t;this.isCircle()?(t=Oi._getCirclePositions(this.data),this.circlePolygon=new rr(new vi([t]),this.data.properties,this.data.id),this.data.properties.subType="Circle"):delete this.circlePolygon},Oi._isCircle=function(t){return t&&t.geometry&&"Point"===t.geometry.type&&t.geometry.coordinates&&t.properties&&"string"==typeof t.properties.subType&&"circle"===t.properties.subType.toLowerCase()&&"number"==typeof t.properties.radius},Oi._isRectangle=function(t){if("Polygon"===t.geometry.type&&t.geometry.coordinates&&"string"==typeof t.properties.subType&&"rectangle"===t.properties.subType.toLowerCase()){t=t.geometry.coordinates;if(1===t.length){t=t[0];if(5===t.length)return t[0][0]===t[4][0]&&t[0][1]===t[4][1];if(4===t.length)return!0}}return!1},Oi._getCirclePositions=function(t){return Yr(t.geometry.coordinates,t.properties.radius,72,"meters")},Oi._shapeIdPropName="_azureMapsShapeId",Oi);function Oi(t,e,o){var n,r,i=bi.call(this)||this;return"Feature"===t.type?(r=qo((n=t).geometry),o=n.properties?qo(n.properties):{},e=null==n.id||""===n.id?nr():n.id):(r=qo(t),e=null==e||""===e?nr():e,o=o?qo(o):{}),o[Oi._shapeIdPropName]=e,i.data=new rr(r,o,e),i._handleCircle(),i}var Ti,Ei,Ct=window&&window.__extends||(Ti=function(t,e){return(Ti=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ti(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ci=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Pi=(Ei=Array,Ct(ki,Ei),ki.fromBoundingBox=function(t){var e=ki.getWest(t),o=ki.getSouth(t),n=ki.getEast(t),t=ki.getNorth(t);return new ki([e,o,n,t])},ki.fromDimensions=function(t,e,o){var n=t[0],r=t[1],t=Math.min(Math.max(r+o/2,-85.5),85.5),r=Math.min(Math.max(r-o/2,-85.5),85.5),o=Xr(n+e/2);return new ki([Xr(n-e/2),r,o,t])},ki.fromEdges=function(t,e,o,n){return new ki([t,e,o,n])},ki.containsPosition=function(t,e){var o=ki.getCenter(t),n=Math.abs(o[1]-e[1]),o=Math.abs(o[0]-e[0]);180<o&&(o=360-o);e=ki.getHeight(t),t=ki.getWidth(t);return n<=e/2+1e-8&&o<=t/2+1e-8},ki.containsBoundingBox=function(t,e){var o=t&&4===t.length,n=e&&4===e.length;return!(!o||!n)&&(ki.getWest(t)<ki.getWest(e)&&ki.getWest(e)<ki.getEast(t)&&ki.getWest(t)<ki.getEast(e)&&ki.getEast(e)<ki.getEast(t)&&ki.getSouth(t)<ki.getSouth(e)&&ki.getSouth(e)<ki.getNorth(t)&&ki.getSouth(t)<ki.getNorth(e)&&ki.getNorth(e)<ki.getNorth(t))},ki.crossesAntimeridian=function(t){return Xr(ki.getEast(t))-Xr(ki.getWest(t))<0||ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(t)||ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(t)},ki.getCenter=function(t){var e=Xr(ki.getEast(t)),o=Xr(ki.getWest(t));e<o&&(e+=360);o=Xr((o+e)/2),e=Jr(ki.getSouth(t)),t=Jr(ki.getNorth(t));return[o,Jr((e+t)/2)]},ki.getHeight=function(t){t=Jr(ki.getNorth(t))-Jr(ki.getSouth(t));return isNaN(t)?0:t},ki.getWidth=function(t){t=Xr(ki.getEast(t))-Xr(ki.getWest(t));return isNaN(t)?0:t<0?t+360:t},ki.getSouthWest=function(t){var e=this.getSouth(t),t=this.getWest(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getNorthEast=function(t){var e=this.getNorth(t),t=this.getEast(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getNorthWest=function(t){var e=this.getNorth(t),t=this.getWest(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getSouthEast=function(t){var e=this.getSouth(t),t=this.getEast(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getSouth=function(t){return t&&4<=t.length?Number(t[1]):NaN},ki.getWest=function(t){return t&&4<=t.length?Number(t[0]):NaN},ki.getNorth=function(t){if(t){if(4===t.length)return Number(t[3]);if(6===t.length)return Number(t[4])}return NaN},ki.getEast=function(t){if(t){if(4===t.length)return Number(t[2]);if(6===t.length)return Number(t[3])}return NaN},ki.intersect=function(t,e){var o=ki.getCenter(t),n=ki.getCenter(e),r=Math.abs(o[1]-n[1]),i=Math.abs(o[0]-n[0]);180<i&&(i=360-i);o=ki.getHeight(t),n=ki.getWidth(t),t=ki.getHeight(e),e=ki.getWidth(e);return r<=o/2+t/2&&i<=n/2+e/2},ki.merge=function(t,e){var o=t&&4===t.length,n=e&&4===e.length;if(o&&!n)return t;if(n&&!o)return e;if(!o&&!n)return null;for(var o=Math.max(Jr(ki.getNorth(t)),Jr(ki.getNorth(e))),n=Math.min(Jr(ki.getSouth(t)),Jr(ki.getSouth(e))),r=[t,e],i=[],s=0,s=0;s<r.length;s++){var a=r[s],c=Xr(ki.getWest(a)),l=Xr(ki.getEast(a));ki.crossesAntimeridian(a)?(i.push([c,180]),i.push([-180,l])):i.push([c,l])}i.sort(function(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]});var u=[],p=i[0];for(s=1;s<i.length;){var h=i[s];p[1]>=h[0]?p[1]=Math.max(p[1],h[1]):(u.push(p),p=h),s++}u.push(p);var d=u.length,f=u[0][0]+360-u[d-1][1],y=[u[d-1][1],u[0][0]];for(s=1;s<d;s++){var m=u[s][0]-u[s-1][1];f<m&&(f=m,y=[u[s-1][1],u[s][0]])}return new ki([y[1],n],[y[0],o])},ki.fromPositions=function(t){for(var e,o,n=NaN,r=NaN,i=NaN,s=NaN,a=t.length,c=new Array(a),l=0;a--;)(o=t[a])&&2<=o.length&&(e=Jr(o[1]),n=isNaN(n)?e:Math.max(n,e),r=isNaN(r)?e:Math.min(r,e),c[l++]=Xr(o[0]));if(l){c.length=l,c.sort(function(t,e){return t-e});for(var u=c[0]+360-c[l-1],p=0,a=1;a<l;a++){var h=c[a]-c[a-1];u<h&&(u=h,p=a)}i=c[p],s=c[(p||l)-1]}return isNaN(i)||isNaN(r)||isNaN(s)||isNaN(n)?null:new ki([i,r,s,n])},ki.fromLatLngs=function(t){return ki.fromPositions(mi.fromLatLngs(t))},ki.fromData=function(t){var e,o,n=null;if(Array.isArray(t)&&0<t.length){try{for(var r=Ci(t),i=r.next();!i.done;i=r.next()){var s,a=i.value;null!=(s=ki.fromData(a))&&(n=null===n?s:ki.merge(n,s))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n}if(t instanceof xi)return t.getBounds();if(t&&t.type){var c=t;if(c.bbox&&4===c.bbox.length)return c.bbox;switch(c.type){case"FeatureCollection":return ki.fromData(c.features);case"Feature":return xi._isCircle(c)?ki.fromPositions(xi._getCirclePositions(c)):ki.fromData(c.geometry);case"GeometryCollection":return ki.fromData(c.geometries);case"Point":var l=c.coordinates;if(l&&2<=l.length)return[l[0],l[1],l[0],l[1]];break;case"LineString":case"MultiPoint":return ki.fromPositions(c.coordinates);case"Polygon":case"MultiLineString":var u=c.coordinates;if(u&&0<u.length){for(var p=0,h=u.length;p<h;p++)null!=(s=ki.fromPositions(u[p]))&&(n=null===n?s:ki.merge(n,s));if(null!=n)return n}break;case"MultiPolygon":var d=c.coordinates;if(d&&0<d.length){for(p=0,h=d.length;p<h;p++)for(var f=0,y=d[p].length;f<y;f++)null!=(s=ki.fromPositions(d[p][f]))&&(n=null===n?s:ki.merge(n,s));return n}}}return null},ki.splitOnAntimeridian=function(t){var e,o,n,r,i,s,a=[];return ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(t)?[[-180,t[1],t[2],180,t[4],t[5]]]:ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(t)?[[-180,t[1],180,t[3]]]:(ki.crossesAntimeridian(t)?(s=e=void 0,o=Xr(ki.getWest(t)),n=Xr(ki.getEast(t)),r=Jr(ki.getNorth(t)),i=Jr(ki.getSouth(t)),s=6<=t.length?(e=[o,i,t[2],180,r,t[5]],[-180,i,t[2],n,r,t[5]]):(e=[o,i,180,r],[-180,i,n,r]),a.push(e,s)):a.push(t),a)},ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe=function(t){return 6<=t.length&&360<t[3]-t[0]},ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe=function(t){return t.length<6&&360<t[2]-t[0]},ki);function ki(t,e){var o,n=this;return t&&e?n=(o=t)[2]&&e[2]?Ei.call(this,o[0],o[1],o[2]||0,e[0],e[1],e[2]||0)||this:Ei.call(this,o[0],o[1],e[0],e[1])||this:!t||(t=t)&&(4===t.length?n=Ei.call(this,t[0],t[1],t[2],t[3])||this:6<=t.length&&(n=Ei.call(this,t[0],t[1],t[2],t[3],t[4],t[5])||this)),n}var Ai=(Ii.TYPE="FeatureCollection",Ii);function Ii(t,e){this.type="FeatureCollection",this.type=Ii.TYPE,this.features=t,this.bbox=e}Li.TYPE="GeometryCollection",H=Li;function Li(t){this.type="GeometryCollection",this.type=Li.TYPE,this.geometries=t}Ri.TYPE="LineString",It=Ri;function Ri(t,e){this.type="LineString",this.type=Ri.TYPE,this.coordinates=t,this.bbox=e}Ni.TYPE="MultiLineString",Tt=Ni;function Ni(t,e){this.type="MultiLineString",this.type=Ni.TYPE,this.coordinates=t,this.bbox=e}Mi.TYPE="MultiPoint",Ot=Mi;function Mi(t,e){this.type="MultiPoint",this.type=Mi.TYPE,this.coordinates=t,this.bbox=e}ji.TYPE="MultiPolygon",R=ji;function ji(t,e){this.type="MultiPolygon",this.type=ji.TYPE,this.coordinates=t,this.bbox=e}var Di,zi,Lt=window&&window.__extends||(Di=function(t,e){return(Di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Di(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ct=(zi=Array,Lt(Bi,zi),Bi.fromPosition=function(t){return 2<=t.length?new Bi((180+t[0])/360,Bi._latToMercatorY(t[1]),3<=t.length?Bi._altitudeToMercatorZ(t[2],t[1]):0):[0,0,0]},Bi.fromPositions=function(t){for(var e=[],o=0,n=t.length;o<n;o++)e.push(this.fromPosition(t[o]));return e},Bi.toFloat32Array=function(t){for(var e=new Float32Array(3*t.length),o=0,n=t.length;o<n;o++){var r=3*o,i=t[o];e[r]=(180+i[0])/360,e[1+r]=Bi._latToMercatorY(i[1]),e[2+r]=3<=i.length?Bi._altitudeToMercatorZ(i[2],i[1]):0}return e},Bi.toPosition=function(t){if(2<=t.length){var e=360/Math.PI*Math.atan(Math.exp((180-360*t[1])*Math.PI/180))-90;return new mi(360*t[0]-180,e,3<=t.length?Bi._mercatorZToAltitude(t[2],t[1]):0)}return[0,0,0]},Bi.toPositions=function(t){for(var e=[],o=0,n=t.length;o<n;o++)e.push(this.toPosition(t[o]));return e},Bi.mercatorScale=function(t){return 1/Math.cos(t*Math.PI/180)},Bi.meterInMercatorUnits=function(t){return 1/Bi.earthCircumference*Bi.mercatorScale(Bi._latToMercatorY(t))},Bi._circumferenceAtLatitude=function(t){return Bi.earthCircumference*Math.cos(t*Math.PI/180)},Bi._altitudeToMercatorZ=function(t,e){return t/Bi._circumferenceAtLatitude(e)},Bi._mercatorZToAltitude=function(t,e){return t*Bi._circumferenceAtLatitude(Bi._latToMercatorY(e))},Bi._latToMercatorY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360},Bi.earthCircumference=2*Math.PI*Ur(),Bi);function Bi(t,e,o){return zi.call(this,t,e,o||0)||this}var Fi,Lt=Object.freeze({__proto__:null,Feature:rr,FeatureCollection:Ai,LineString:It,Point:ur,Polygon:vi,Position:mi,BoundingBox:Pi,MercatorPoint:Ct,MultiLineString:Tt,MultiPoint:Ot,MultiPolygon:R,GeometryCollection:H}),Ui=Rt(function(t,e){function y(t,e){return t*t+e*e}function i(t,e){for(var o,n,r,i=t[0],s=[i],a=1,c=t.length;a<c;a++)o=t[a],r=i,y((n=o)[0]-r[0],n[1]-r[1])>e&&(s.push(o),i=o);return i!==o&&s.push(o),s}function m(t,e,o,n,r){for(var i,s,a,c,l,u,p,h=n,d=e+1;d<o;d++){var f=(s=t[d],a=t[e],c=t[o],p=u=f=l=void 0,l=a[0],f=a[1],u=c[0]-l,p=c[1]-f,0==u&&0==p||(1<(a=((s[0]-l)*u+(s[1]-f)*p)/y(u,p))?(l=c[0],f=c[1]):0<a&&(l+=u*a,f+=p*a)),y(s[0]-l,s[1]-f));h<f&&(i=d,h=f)}n<h&&(1<i-e&&m(t,e,i,n,r),r.push(t[i]),1<o-i&&m(t,i,o,n,r))}e.__esModule=!0,e.SimplifyAP=function(t,e,o){if(t.length<=2)return t;var n,r=(e=void 0===e?1:e)*e;return t=(o=void 0===o?!1:o)?t:i(t,r),e=(n=t).length-1,o=[n[0]],m(n,0,e,r,o),o.push(n[e]),t=o}});(Fi=Ui)&&Fi.__esModule&&Object.prototype.hasOwnProperty.call(Fi,"default")&&Fi.default;var qi=Ui.SimplifyAP;var Gi=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zi=(Hi.prototype.toTarget=function(t,e){return this.transformArray(t,this.M,e)},Hi.prototype.toSource=function(t,e){return this.transformArray(t,this.inverseM,e)},Hi.prototype.transformArray=function(t,e,o){var n,r;if(t&&Array.isArray(t)&&Array.isArray(t[0])){var i=[];try{for(var s=Gi(t),a=s.next();!a.done;a=s.next()){var c=a.value;i.push(this.transform(c,e,o))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}return null},Hi.prototype.transform=function(t,e,o){var n=t[0]*e[0][3]+t[1]*e[1][3]+e[2][3],e=t[0]*e[0][4]+t[1]*e[1][4]+e[2][4];return"number"==typeof o&&0<=o?[Dr(n,o),Dr(e,o)]:[Dr(n,6),Dr(e,6)]},Hi._calculateAffineTransform=function(t,e){if(t.length!==e.length||t.length<1)throw new Error("Error: source and target arrays must have the same length.");var o=Math.min(t[0].length,e[0].length),n=o+1;if(t.length<o)throw new Error("Erorr: At least "+o+" reference points required.");for(var r=[],i=[],s=0;s<n;s++){i[s]=[];for(var a=0;a<n;a++){a<o&&(r[a]=0);for(var c=i[s][a]=0;c<t.length;c++)a<o&&(r[a]+=s<o?t[c][s]*e[c][a]:e[c][a]),i[s][a]+=o<=s&&o<=a?1:o<=s?t[c][a]:o<=a?t[c][s]:t[c][s]*t[c][a]}i[s]=i[s].concat(r)}if(!this._gaussJordanElimination(i))throw new Error("Error: Singular matrix. Points are likely coplanar.");return i},Hi._gaussJordanElimination=function(t){for(var e,o=t.length,n=2*o-1,r=0;r<o;r++){for(var i=r,s=r+1;s<o;s++)Math.abs(t[s][r])>Math.abs(t[i][r])&&(i=s);if(e=t[i],t[i]=t[r],t[r]=e,Math.abs(t[r][r])<=1e-12)return!1;for(var a=r+1;a<o;a++)for(var c=t[a][r]/t[r][r],l=r;l<n;l++)t[a][l]-=t[r][l]*c}for(r=o-1;-1<r;r--){c=t[r][r];for(s=0;s<r;s++)for(var u=n-1;r-1<u;u--)t[s][u]-=t[r][u]*t[s][r]/c;t[r][r]/=c;for(var p=o;p<n;p++)t[r][p]/=c}return!0},Hi);function Hi(t,e){this.M=Hi._calculateAffineTransform(t,e),this.inverseM=Hi._calculateAffineTransform(e,t)}var Ki,Wi,It=Object.freeze({__proto__:null,AffineTransform:Zi,WEBMERCATOR_MAXLAT:xr,_precision:Dr,get AreaUnits(){return hr},get DistanceUnits(){return dr},get TimeUnits(){return fr},get SpeedUnits(){return yr},get AccelerationUnits(){return mr},boundingBoxToPolygon:function(t){var e=Xr(Pi.getWest(t)),o=Xr(Pi.getEast(t)),n=Jr(Pi.getNorth(t)),r=Jr(Pi.getSouth(t)),t=Pi.getCenter(t),n=[[e,n],[e,r],[t[0],r],[o,r],[o,n],[t[0],n],[e,n]];return new vi([n])},convertDistance:zr,getCardinalSpline:function(t,e,o,n){if(!t||t.length<=2)return i;"number"!=typeof e&&(e=.5),("number"!=typeof o||o<=0)&&(o=15);var r=t.length,i=t.slice(0);n?(mi.areEqual(i[0],i[r-1])&&(i.pop(),r--),i.unshift(t[r-1]),i.push(t[0]),i.push(t[1]),r++):(i.unshift(t[0]),i.push(t[r-1]));var s,a,c,l=[];l.push([1,0,0,0]);for(var u=1;u<o-1;u++)l.push([2*(c=(s=u/o)*(a=s*s))-3*a+1,-2*c+3*a,c-2*a+s,c-a]);l.push([0,1,0,0]);for(var p,h,d,f,y,m,g=[],u=1;u<r;u++)for(p=e*(i[u+1][0]-i[u-1][0]),h=e*(i[u+1][1]-i[u-1][1]),d=e*(i[u+2][0]-i[u][0]),f=e*(i[u+2][1]-i[u][1]),s=0;s<o;s++)m=(y=l[s])[0]*i[u][0]+y[1]*i[u+1][0]+y[2]*p+y[3]*d,y=Er(y[0]*i[u][1]+y[1]*i[u+1][1]+y[2]*h+y[3]*f,-85,85),g.push([m,y]);return g},getDestination:Br,getDistanceTo:Fr,getEarthRadius:Ur,getPathDenormalizedAtAntimerian:Gr,getPathSplitByAntimeridian:Zr,getGeodesicPath:function(t,e){var o;(!e||e<=0)&&(e=15),Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var n=o.length-1,r=[],i=0;i<n;i++)r=r.concat(qr(o[i],o[i+1],e));return Gr(r)},getGeodesicPaths:function(t,e){var o;(!e||e<=0)&&(e=15),Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var n=o.length-1,r=[],i=[],s=0;s<n;s++)for(var a,c,l,u,p,h=qr(o[s],o[s+1],e),d=0;d<h.length;d++)r.push(h[d]),d+1>=h.length||(a=(l=gr(h[d],2))[0],c=l[1],p=(u=gr(h[d+1],2))[0],l=u[1],180<Math.abs(p-a)&&(u=0<a?180:-180,p=Math.abs((0<a?p+360:p-360)-a),p=c+(l-c)*(Math.abs(u-a)/p),r.push([u,p]),i.push(r),r=[[-u,p]]));return i.push(r),i},getHeading:Hr,getLengthOfPath:Kr,getPositionAlongPath:Wr,getRegularPolygonPath:Yr,getRegularPolygonPaths:function(t,e,o,n,r){return Zr(Vr(t,e,o,n,r))},interpolate:Qr,normalizeLatitude:Jr,normalizeLongitude:Xr,rotatePositions:$r,getPixelHeading:function(t,e){t=pi(t),e=pi(e);var t=(o=gr(ei([t,e],21),2))[0],o=(e=o[1])[0]-t[0],e=t[1]-e[1];return(2.5*Math.PI-Math.atan2(e,o))*br%360},mercatorPixelsToPositions:ti,mercatorPositionsToPixels:ei,convertAcceleration:oi,convertArea:ni,convertSpeed:ri,convertTimespan:ii,getAcceleration:si,getAccelerationFromSpeeds:ai,getAccelerationFromFeatures:function(t,e,o,n,r,i,s){if("string"==typeof o&&"Feature"===t.type&&"Point"===t.geometry.type&&"Feature"===e.type&&"Point"===e.geometry.type){var a=ci(t.properties[o],e.properties[o],fr.seconds);if(!isNaN(a)){var c=0;if(n&&"string"==typeof n){o=t.properties[n],n=e.properties[n];if("number"==typeof o&&(c=o,"number"==typeof n))return ai(o,n,a,r,fr.seconds,i,s)}return si(c,Fr(t.geometry.coordinates,e.geometry.coordinates,dr.meters),a,r,dr.meters,fr.seconds,i,s)}}return NaN},getArea:function t(e,o,n){if(e){var r=0;switch((e=e instanceof xi?e.toJson():e).type){case"Feature":var i=e;if(e.geometry)return t(i.geometry,o,n);break;case"Polygon":(i=e).coordinates&&(r=Rr(i.coordinates));break;case"MultiPolygon":var s=e;if(s.coordinates)for(var a=0,c=s.coordinates.length;a<c;a++)r+=Rr(s.coordinates[a])}return ni(r,hr.squareMeters,o,n)}return 0},getSpeed:function(t,e,o,n,r,i){if(t=pi(t),e=pi(e),t&&e){n=ii(o,n,fr.seconds);return ri(Fr(t,e,dr.meters)/n,yr.metersPerSecond,r,i)}return 0},getSpeedFromFeatures:function(t,e,o,n,r){if("string"==typeof o&&"Feature"===t.type&&"Point"===t.geometry.type&&"Feature"===e.type&&"Point"===e.geometry.type){o=this.getTimespan(t.properties[o],e.properties[o],fr.seconds);if(!isNaN(o)){e=this.getDistanceTo(t.geometry.coordinates,e.geometry.coordinates,dr.meters);return this.convertSpeed(e/o,yr.metersPerSecond,n,r)}}return NaN},getTimespan:ci,getTravelDistance:function(t,e,o,n,r,i,s,a){return e=this.convertTimespan(e,r,fr.seconds),o=(o=this.convertSpeed(o,i,yr.metersPerSecond))*e,"number"==typeof n&&(o+=.5*this.convertAcceleration(n,s,mr.metersPerSecondSquared)*e*e),this.convertDistance(o,dr.meters,t,a)},parseTimestamp:li,getConvexHull:function(t){var e,o,n=ui(t).map(function(t){return[Xr(t[0]),Jr(t[1])]});n.sort(function(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]});var r=[];try{for(var i=vr(n),s=i.next();!s.done;s=i.next()){for(var a=s.value;2<=r.length&&Mr(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(e)throw e.error}}for(var c=[],l=n.length-1;0<=l;l--){for(;2<=c.length&&Mr(c[c.length-2],c[c.length-1],n[l])<=0;)c.pop();c.push(n[l])}return new vi([r.concat(c)])},getPositions:ui,getPosition:pi,getPositionsAlongPath:function(t,e){if(e<2)return[];for(var o=[],n=Kr(t,dr.meters)/(e-1),r=0;r<e;r++){var i=Wr(t,n*r,dr.meters);null!=i&&o.push(i)}return o},getPointWithHeadingAlongPath:hi,getPointsWithHeadingsAlongPath:function(t,e){if(e<=0)return[];for(var o=[],n=Kr(t,dr.meters)/(e-1),r=0;r<e;r++){var i=hi(t,n*r,dr.meters);null!=i&&o.push(i)}return o},getClosestPointOnGeometry:di,simplify:function(t,e){return qi(t,e,!0)}}),Vi=((window&&window.__extends||(Ki=function(t,e){return(Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ki(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Yi,Wi=k),Yi);function Yi(){var t=null!==Wi&&Wi.apply(this,arguments)||this;return t.zoomDelta=1,t.style=u.ControlStyle.light,t}var Qi,Ji,Ct=((window&&window.__extends||(Qi=function(t,e){return(Qi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Qi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Xi,Ji=nt),Xi.prototype.onAdd=function(t){this.container=this.buildContainer(t,this.options.style,"Zoom Control"),this.container.style.flexDirection="column",this.zoomInButton=this.constructZoomInButton(t),this.zoomOutButton=this.constructZoomOutButton(t);var e=q("Zoom In"),o=q("Zoom Out");return this.container.appendChild(this.zoomInButton),this.container.appendChild(e),this.container.appendChild(this.zoomOutButton),this.container.appendChild(o),G(e,this.zoomInButton),G(o,this.zoomOutButton),t.events.add("zoom",this.zoomChanged),t.events.add("minzoomchanged",this.minZoomChanged),t.events.add("maxzoomchanged",this.maxZoomChanged),this.map=t,this.container},Xi.prototype.onRemove=function(){Ji.prototype.onRemove.call(this),this.map&&(this.map.events.remove("zoom",this.zoomChanged),this.map.events.remove("minzoomchanged",this.minZoomChanged),this.map.events.remove("maxzoomchanged",this.maxZoomChanged),this.map=null),this.container&&(this.container.remove(),this.container=null,this.zoomInButton=null,this.zoomOutButton=null)},Xi.prototype.updateZoomButtonsState=function(){var t=this.map.getCamera().zoom>=this.map._getMap().getMaxZoom(),e=Pi.getSouth(this.map.getCamera().bounds)<=-xr&&Pi.getNorth(this.map.getCamera().bounds)>=xr,e=this.map.getCamera().zoom<=this.map._getMap().getMinZoom()||e;this.zoomInButton&&this.zoomInButton.disabled!=t&&(this.zoomInButton.disabled=t,this.zoomInButton.setAttribute("aria-label",t?"Zoom In disabled":"Zoom In")),this.zoomOutButton&&this.zoomOutButton.disabled!=e&&(this.zoomOutButton.disabled=e,this.zoomInButton.setAttribute("aria-label",t?"Zoom Out disabled":"Zoom Out"))},Xi.prototype.constructZoomInButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("zoom-in"),o.setAttribute("aria-label","Zoom In"),o.setAttribute("alt","Zoom In"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({zoom:t.getCamera().zoom+e.options.zoomDelta,duration:Xi.ZOOM_DURATION_MS,type:"ease"},!0)}),o},Xi.prototype.constructZoomOutButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("zoom-out"),o.setAttribute("aria-label","Zoom Out"),o.setAttribute("alt","Zoom Out"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({zoom:t.getCamera().zoom-e.options.zoomDelta,duration:Xi.ZOOM_DURATION_MS,type:"ease"},!0)}),o},Xi.ZOOM_DURATION_MS=200,Xi);function Xi(t){var e=Ji.call(this)||this;return e.container=null,e.zoomInButton=null,e.zoomOutButton=null,e.zoomChanged=function(t){return e.updateZoomButtonsState()},e.minZoomChanged=function(t){return e.updateZoomButtonsState()},e.maxZoomChanged=function(t){return e.updateZoomButtonsState()},e.options=(new Vi).merge(t),e}Tt=Object.freeze({__proto__:null,ControlBase:nt,PitchControl:_t,CompassControl:pt,ZoomControl:Ct,StyleControl:Mt,TrafficControl:In,TrafficLegendControl:At});var $i,ts,es=function(t,e){return Uo(t,5,e="function"==typeof e?e:void 0)},os=((window&&window.__extends||($i=function(t,e){return($i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}$i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ns,ts=k),ns);function ns(){var t=null!==ts&&ts.apply(this,arguments)||this;return t.buffer=128,t.maxZoom=18,t.cluster=!1,t.clusterRadius=50,t.clusterMaxZoom=void 0,t.clusterProperties=void 0,t.lineMetrics=!1,t.tolerance=.375,t}var rs,is,ss=((window&&window.__extends||(rs=function(t,e){return(rs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}rs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(as,is=X),as.prototype.getId=function(){return this.id},as.prototype._setMap=function(t){var e;null==t||void 0===t?(e=this.map,delete this.map,this._invokeEvent("sourceremoved",this),e&&e.events.invoke("sourceremoved",this)):(this.map=t,this._invokeEvent("sourceadded",this),this.map.events.invoke("sourceadded",this))},as);function as(t){var e=is.call(this)||this;return e.id=t||nr(),e}var cs,ls,Ot=window&&window.__extends||(cs=function(t,e){return(cs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}cs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),us=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ps=(Ot(hs,ls=ss),hs.prototype.add=function(t,e){this._addNoUpdate(t,e),this._updateSource()},hs.prototype.clear=function(){this._clearNoUpdate(),this._updateSource()},hs.prototype.dispose=function(){this.options=null,this.shapes=null,this.shapesMap=null,this.map=null},hs.prototype.getClusterExpansionZoom=function(e){var r=this;return new Promise(function(o,n){var t;r.map?(t=r.map._getMap().getSource(r.getId()))&&"geojson"===t.type&&t.getClusterExpansionZoom(e,function(t,e){t?n(t):"number"==typeof e&&o(e)}):n("The DataSource hasn't been added to a map.")})},hs.prototype.getClusterChildren=function(e){var r=this;return new Promise(function(o,n){var t;r.map?(t=r.map._getMap().getSource(r.getId()))&&"geojson"===t.type&&t.getClusterChildren(e,function(t,e){t?n(t):e&&o(r.map.sources._mapFeaturesToShapes(e,!1,r))}):n("The DataSource hasn't been added to a map.")})},hs.prototype.getClusterLeaves=function(e,r,i){var s=this;return new Promise(function(o,n){var t;s.map?(t=s.map._getMap().getSource(s.getId()))&&"geojson"===t.type&&t.getClusterLeaves(e,r,i,function(t,e){t?n(t):e&&o(s.map.sources._mapFeaturesToShapes(e,!1,s))}):n("The DataSource hasn't been added to a map.")})},hs.prototype.getOptions=function(){return qo(this.options)},hs.prototype.getShapes=function(){return Array.from(this.shapes)},hs.prototype.importDataFromUrl=function(t){var e=this;return fetch(t,{method:"GET",mode:"cors"}).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText)}).then(function(t){e.add(t)})},hs.prototype.getShapeById=function(t){return this.shapes[this.shapesMap.get(t)]||null},hs.prototype.remove=function(t){var e,o,t=Array.isArray(t)?t:[t];try{for(var n=us(t),r=n.next();!r.done;r=n.next()){var i=r.value;"number"==typeof i?this._removeByIndex(i):this._removeById(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}this._updateSource()},hs.prototype.removeById=function(t){var e,o,t=Array.isArray(t)?t:[t];try{for(var n=us(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeById(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}this._updateSource()},hs.prototype.setOptions=function(t){t=(new os).merge(this.options,qo(t));er(this.options,t)||(this._invokeEvent("datasourceupdated",this),this.options=t,this.map&&this.map._rebuildStyle())},hs.prototype.setShapes=function(t){this._clearNoUpdate(),this.add(t)},hs.prototype.toJson=function(){return new Ai(this.shapes.map(function(t){return t.toJson()}))},hs.prototype._toJson=function(){return new Ai(this.shapes.map(function(t){return t._toJson()}))},hs.prototype._buildSource=function(){var t={type:"geojson",data:this._toJson(),maxzoom:this.options.maxZoom,cluster:this.options.cluster,clusterRadius:this.options.clusterRadius,tolerance:this.options.tolerance,lineMetrics:this.options.lineMetrics,clusterProperties:this.options.clusterProperties,buffer:this.options.buffer};return"number"==typeof this.options.clusterMaxZoom&&(t.clusterMaxZoom=this.options.clusterMaxZoom),t},hs.prototype._addNoUpdate=function(t,e){var o;t instanceof xi?(this._addToSources(t,e),o=[t]):Array.isArray(t)?(o=t.map(function(t){return t instanceof xi?t:new xi(t)}),this._addToSources(o,e)):"FeatureCollection"===t.type?(o=t.features.map(function(t){return new xi(t)}),this._addToSources(o,e)):"GeometryCollection"===t.type?(o=t.geometries.map(function(t){return new xi(t)}),this._addToSources(o,e)):(t=new xi(t),this._addToSources(t,e),o=[t]),this._invokeEvent("dataadded",o)},hs.prototype._clearNoUpdate=function(){var t=this.shapes;this.shapes=[],this.shapesMap=new J,t&&0<t.length&&this._invokeEvent("dataremoved",t)},hs.prototype._updateSource=function(){var t=this;void 0!==this.requestId||(this.requestId=requestAnimationFrame(function(){t._updateMboxSource(),t.requestId=void 0}))},hs.prototype._addToSources=function(t,e){var o,n,r,i;if(t=Array.isArray(t)?t:[t],"number"!=typeof e)try{for(var s=us(t),a=s.next();!a.done;a=s.next()){var c=a.value;this.shapes.push(c),this.shapesMap.set(c.getId(),this.shapes.length-1)}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}else for(var l=t.length-1;0<=l;l--)this.shapes.splice(e,0,t[l]),this._updateShapesMap(e);try{for(var u=us(t),p=u.next();!p.done;p=u.next())(c=p.value)._setDataSource(this)}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}},hs.prototype._removeById=function(t){var e=t instanceof xi?t.getId():"string"==typeof t||"number"==typeof t?t:t.id,t=this.shapes[this.shapesMap.get(e)];t&&(t._setDataSource(null),this.shapes.splice(this.shapesMap.get(e),1),this._updateShapesMap(this.shapesMap.get(e)),this.shapesMap.delete(e),this._invokeEvent("dataremoved",[t]))},hs.prototype._removeByIndex=function(t){var e;if(t>=this.shapes.length)throw new Error("The specified remove index '"+t+"' is greater than the maximum possible index '"+(this.shapes.length-1)+"'");e=this.shapes[t],this.shapesMap.delete(e.getId()),e._setDataSource(null),this.shapes.splice(t,1),this._updateShapesMap(t),this._invokeEvent("dataremoved",[e])},hs.prototype._updateShapesMap=function(t){for(var e=t;e<this.shapes.length;e++)this.shapesMap.set(this.shapes[e].getId(),e)},hs.prototype._updateMboxSource=function(){var t;this.map&&this.map._getMap()&&((t=this.map._getMap().getSource(this.getId()))&&"geojson"===t.type&&t.setData(this._toJson()))},hs);function hs(t,e){t=ls.call(this,t)||this;return t.requestId=void 0,t.options=(new os).merge(qo(e)),t.shapes=[],t.shapesMap=new J,t}var ds,fs,ys=((window&&window.__extends||(ds=function(t,e){return(ds=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ds(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ms,fs=k),ms);function ms(){var t=null!==fs&&fs.apply(this,arguments)||this;return t.bounds=void 0,t.minZoom=0,t.maxZoom=22,t.isTMS=!1,t.tiles=void 0,t.url=void 0,t}var gs,vs,_s=((window&&window.__extends||(gs=function(t,e){return(gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}gs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ws,vs=ss),ws.prototype.getOptions=function(){return qo(this.options)},ws.prototype.getShape=function(t,e){return this.map._getMap().querySourceFeatures(this.getId(),{sourceLayer:t,filter:e})},ws.prototype._buildSource=function(){var t={type:"vector"};return this.options.bounds&&(t.bounds=this.options.bounds),this.options.tiles?(t.tiles=this.options.tiles,t.minzoom=this.options.minZoom,t.maxzoom=this.options.maxZoom):this.options.url&&(t.url=this.options.url),this.options.isTMS&&(t.scheme="tms"),t},ws);function ws(t,e){t=vs.call(this,t)||this;return t.options=(new ys).merge(qo(e)),t}var bs,Ss,R=Object.freeze({__proto__:null,Source:ss,DataSource:ps,VectorTileSource:_s}),xs=((window&&window.__extends||(bs=function(t,e){return(bs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}bs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Os,Ss=X),Os.prototype.getId=function(){return this.id},Os.prototype.getMap=function(){return this.map||null},Os.prototype.onAdd=function(t){this.map=t,this._invokeEvent("layeradded",this),this.map.events.invoke("layeradded",this)},Os.prototype.onRemove=function(){var t=this.map;delete this.map,this._invokeEvent("layerremoved",this),t&&t.events.invoke("layerremoved",this)},Os._isMBoxEvent=function(t){return!this.LayerEvents.hasOwnProperty(t)},Os.prototype._updateBaseProperties=function(t,e){this._updateFilter(t.filter,e.filter),this._updateZoomRange(t.minZoom,e.minZoom,t.maxZoom,e.maxZoom),this._updateLayoutProperty("visibility",t.visible,e.visible,t.visible?"visible":"none")},Os.prototype._updateFilter=function(t,e){er(t,e)||this.map._getMap().setFilter(this.id,t)},Os.prototype._updatePaintProperty=function(t,e,o,n){er(e,o)||this.map._getMap().setPaintProperty(this.id,t,n||e)},Os.prototype._updateLayoutProperty=function(t,e,o,n){er(e,o)||this.map._getMap().setLayoutProperty(this.id,t,n||e)},Os.prototype._updateZoomRange=function(t,e,o,n){t===e&&n===o||this.map._getMap().setLayerZoomRange(this.id,t,o)},Os.LayerEvents={layeradded:void 0,layerremoved:void 0},Os);function Os(t){var e=Ss.call(this)||this;return e.id=t||nr(),e}var Ts,Es,H=((window&&window.__extends||(Ts=function(t,e){return(Ts=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ts(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Cs,Es=k),Cs._cloneCustomizer=function(t){if(t instanceof ss)return t},Cs);function Cs(){var t=null!==Es&&Es.apply(this,arguments)||this;return t.filter=void 0,t.minZoom=0,t.maxZoom=24,t.visible=!0,t}var Ps,ks,As=((window&&window.__extends||(Ps=function(t,e){return(Ps=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ps(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Is,ks=H),Is);function Is(){var t=null!==ks&&ks.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.color="#1A73AA",t.blur=0,t.opacity=1,t.strokeColor="#FFFFFF",t.strokeOpacity=1,t.strokeWidth=2,t.pitchAlignment="viewport",t.radius=8,t}var Ls,Rs,Ns=((window&&window.__extends||(Ls=function(t,e){return(Ls=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ls(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ms,Rs=xs),Ms.prototype.getOptions=function(){return es(this.options,As._cloneCustomizer)},Ms.prototype.getSource=function(){return this.options.source},Ms.prototype.setOptions=function(t){t=(new As).merge(this.options,es(t,As._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("circle-blur",t.blur,this.options.blur),this._updatePaintProperty("circle-color",t.color,this.options.color),this._updatePaintProperty("circle-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("circle-radius",t.radius,this.options.radius),this._updatePaintProperty("circle-stroke-color",t.strokeColor,this.options.strokeColor),this._updatePaintProperty("circle-stroke-opacity",t.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("circle-stroke-width",t.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("circle-pitch-alignment",t.pitchAlignment,this.options.pitchAlignment)}this.options=t},Ms.prototype._buildLayers=function(){var t={id:this.id,type:"circle",source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"circle-color":this.options.color,"circle-blur":this.options.blur,"circle-opacity":this.options.opacity,"circle-stroke-color":this.options.strokeColor,"circle-stroke-opacity":this.options.strokeOpacity,"circle-stroke-width":this.options.strokeWidth,"circle-pitch-alignment":this.options.pitchAlignment,"circle-radius":this.options.radius},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),[t]},Ms.prototype._getLayerIds=function(){return[this.id]},Ms.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},Ms);function Ms(t,e,o){e=Rs.call(this,e)||this;return e.options=(new As).merge(es(o,As._cloneCustomizer)),e.options.source=t||e.options.source,e}var js,Ds,zs=((window&&window.__extends||(js=function(t,e){return(js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}js(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Bs,Ds=H),Bs._cloneCustomizer=function(t){if(t instanceof ss)return t},Bs);function Bs(){var t=null!==Ds&&Ds.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.color=["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],t.intensity=1,t.opacity=1,t.radius=30,t.weight=1,t}var Fs,Us,_t=((window&&window.__extends||(Fs=function(t,e){return(Fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Fs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(qs,Us=xs),qs.prototype.getOptions=function(){return es(this.options,zs._cloneCustomizer)},qs.prototype.getSource=function(){return this.options.source},qs.prototype.setOptions=function(t){t=(new zs).merge(this.options,es(t,zs._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("heatmap-color",t.color,this.options.color),this._updatePaintProperty("heatmap-intensity",t.intensity,this.options.intensity),this._updatePaintProperty("heatmap-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("heatmap-radius",t.radius,this.options.radius),this._updatePaintProperty("heatmap-weight",t.weight,this.options.weight)}this.options=t},qs.prototype._buildLayers=function(){var t={id:this.id,type:"heatmap",source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"heatmap-color":this.options.color,"heatmap-intensity":this.options.intensity,"heatmap-opacity":this.options.opacity,"heatmap-radius":this.options.radius,"heatmap-weight":this.options.weight},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),[t]},qs.prototype._getLayerIds=function(){return[this.id]},qs.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},qs);function qs(t,e,o){e=Us.call(this,e)||this;return e.options=(new zs).merge(es(o,zs._cloneCustomizer)),e.options.source=t||e.options.source,e}var Gs,Zs,Ct=((window&&window.__extends||(Gs=function(t,e){return(Gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Gs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Hs,Zs=H),Hs);function Hs(){var t=null!==Zs&&Zs.apply(this,arguments)||this;return t.contrast=0,t.fadeDuration=300,t.hueRotation=0,t.maxBrightness=1,t.minBrightness=0,t.opacity=1,t.saturation=0,t}var Ks,Ws,Vs=((window&&window.__extends||(Ks=function(t,e){return(Ks=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ks(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ys,Ws=Ct),Ys._cloneCustomizer=function(t){if(t instanceof ss)return t},Ys);function Ys(){var t=null!==Ws&&Ws.apply(this,arguments)||this;return t.url=void 0,t.coordinates=void 0,t}var Qs,Js,Xs=((window&&window.__extends||(Qs=function(t,e){return(Qs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Qs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))($s,Js=xs),$s.prototype._getSourceIds=function(){var t=new Set;return t.add(this._getSourceId()),t},$s);function $s(){return null!==Js&&Js.apply(this,arguments)||this}var ta,ea,Mt=((window&&window.__extends||(ta=function(t,e){return(ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ta(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(oa,ea=Xs),oa.prototype.getOptions=function(){return es(this.options,Vs._cloneCustomizer)},oa.prototype.setOptions=function(t){var e=(new Vs).merge(this.options,es(t,Vs._cloneCustomizer)),o="string"==typeof t.url&&t.url!==this.getOptions().url,n=void 0!==t.coordinates&&t.coordinates!==this.getOptions().coordinates;this.map&&(this._updateBaseProperties(e,this.options),this._updatePaintProperty("raster-contrast",e.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",e.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",e.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",e.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",e.saturation,this.options.saturation),(t=this.map._getMap().getSource(this._getSourceId()))&&t.updateImage(e)),this.options=e,o?this.reloadImage():n&&this.updateTransform()},oa.prototype.getPositions=function(e){return this.transform.then(function(t){return t.toTarget(e)})},oa.prototype.getPixels=function(e){return this.transform.then(function(t){return t.toSource(e)})},oa.getCoordinatesFromRefPoints=function(t,e,o,n){return new Zi(o,n).toTarget([[0,0],[t,0],[t,e],[0,e]])},oa.getCoordinatesFromEdges=function(t,e,o,n,r){"number"!=typeof r&&(r=0);o=[Math.min(n,o),e,Math.max(n,o),t],t=Pi.getCenter(o);return $r([Pi.getNorthWest(o),Pi.getNorthEast(o),Pi.getSouthEast(o),Pi.getSouthWest(o)],t,r)},oa.prototype._buildLayers=function(){var t={id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-opacity":this.options.opacity,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-min":this.options.minBrightness,"raster-brightness-max":this.options.maxBrightness,"raster-saturation":this.options.saturation,"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),[t]},oa.prototype._getLayerIds=function(){return[this.id]},oa.prototype._buildSource=function(){return{type:"image",url:this.options.url,coordinates:this.options.coordinates}},oa.prototype._getSourceId=function(){return this.getId()+"-ImageSource"},oa.prototype.reloadImage=function(){var o=this;this.options.url&&(this.transform=new Promise(function(e,t){o.img.onload=function(){var t=[[0,0],[o.img.width,0],[o.img.width,o.img.height],[0,o.img.height]];e(new Zi(t,o.options.coordinates)),o.isLoading=!1},o.img.onerror=o.img.onabort=function(){t("Failed to load image")},o.isLoading=!0,o.img.src=o.options.url}))},oa.prototype.updateTransform=function(){var t;this.isLoading||(t=[[0,0],[this.img.width,0],[this.img.width,this.img.height],[0,this.img.height]],this.transform=Promise.resolve(new Zi(t,this.options.coordinates)))},oa);function oa(t,e){e=ea.call(this,e)||this;return e.isLoading=!1,e.options=(new Vs).merge(es(t,Vs._cloneCustomizer)),e.img=new Image,e.reloadImage(),e}var na,ra,ia=((window&&window.__extends||(na=function(t,e){return(na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}na(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(sa,ra=H),sa);function sa(){var t=null!==ra&&ra.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.lineCap="round",t.lineJoin="round",t.blur=0,t.strokeColor="#1E90FF",t.strokeDashArray=void 0,t.strokeGradient=void 0,t.offset=0,t.strokeOpacity=1,t.translate=new cr(0,0),t.translateAnchor="map",t.strokeWidth=2,t}var aa,ca,At=window&&window.__extends||(aa=function(t,e){return(aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}aa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),la=window&&window.__assign||function(){return(la=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ua=(At(pa,ca=xs),pa.prototype.getOptions=function(){return es(this.options,ia._cloneCustomizer)},pa.prototype.getSource=function(){return this.options.source},pa.prototype.setOptions=function(t){t=(new ia).merge(this.options,es(t,ia._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("line-blur",t.blur,this.options.blur),this._updateLayoutProperty("line-cap",t.lineCap,this.options.lineCap),this._updateLayoutProperty("line-join",t.lineJoin,this.options.lineJoin),this._updatePaintProperty("line-offset",t.offset,this.options.offset),this._updatePaintProperty("line-color",t.strokeColor,this.options.strokeColor),this._updatePaintProperty("line-dasharray",t.strokeDashArray,this.options.strokeDashArray),this._updatePaintProperty("line-gradient",t.strokeGradient,this.options.strokeGradient),this._updatePaintProperty("line-opacity",t.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("line-width",t.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("line-translate",t.translate,this.options.translate),this._updatePaintProperty("line-translate-anchor",t.translateAnchor,this.options.translateAnchor)}this.options=t},pa.prototype._buildLayers=function(){return[la(la(la(la({id:this.id,type:"line"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none","line-cap":this.options.lineCap,"line-join":this.options.lineJoin},paint:la(la(la({"line-blur":this.options.blur,"line-color":this.options.strokeColor},this.options.strokeDashArray&&{"line-dasharray":this.options.strokeDashArray}),this.options.strokeGradient&&{"line-gradient":this.options.strokeGradient}),{"line-offset":this.options.offset,"line-opacity":this.options.strokeOpacity,"line-translate":this.options.translate,"line-translate-anchor":this.options.translateAnchor,"line-width":this.options.strokeWidth})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},pa.prototype._getLayerIds=function(){return[this.id]},pa.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},pa);function pa(t,e,o){e=ca.call(this,e)||this;return e.options=(new ia).merge(es(o,ia._cloneCustomizer)),e.options.source=t||e.options.source,e}var ha,da,fa=((window&&window.__extends||(ha=function(t,e){return(ha=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ha(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ya,da=H),ya);function ya(){var t=null!==da&&da.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.base=0,t.fillColor="#1E90FF",t.height=0,t.fillOpacity=1,t.fillPattern=void 0,t.translate=new cr(0,0),t.translateAnchor="map",t.verticalGradient=!0,t}var ma,ga,Ot=window&&window.__extends||(ma=function(t,e){return(ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ma(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),va=window&&window.__assign||function(){return(va=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},At=(Ot(_a,ga=xs),_a.prototype.getOptions=function(){return es(this.options,fa._cloneCustomizer)},_a.prototype.getSource=function(){return this.options.source},_a.prototype.setOptions=function(t){t=(new fa).merge(this.options,es(t,fa._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("fill-extrusion-base",t.base,this.options.base),this._updatePaintProperty("fill-extrusion-color",t.fillColor,this.options.fillColor),this._updatePaintProperty("fill-extrusion-height",t.height,this.options.height),this._updatePaintProperty("fill-extrusion-opacity",t.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-extrusion-pattern",t.fillPattern,this.options.fillPattern),this._updatePaintProperty("fill-extrusion-translate",t.translate,this.options.translate),this._updatePaintProperty("fill-extrusion-translate-anchor",t.translateAnchor,this.options.translateAnchor),this._updatePaintProperty("fill-extrusion-vertical-gradient",t.verticalGradient,this.options.verticalGradient)}this.options=t},_a.prototype._buildLayers=function(){return[va(va(va(va({id:this.id,type:"fill-extrusion"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:va(va({"fill-extrusion-base":this.options.base,"fill-extrusion-height":this.options.height,"fill-extrusion-opacity":this.options.fillOpacity},this.options.fillPattern?{"fill-extrusion-pattern":this.options.fillPattern}:{"fill-extrusion-color":this.options.fillColor}),{"fill-extrusion-translate":this.options.translate,"fill-extrusion-translate-anchor":this.options.translateAnchor,"fill-extrusion-vertical-gradient":this.options.verticalGradient})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},_a.prototype._getLayerIds=function(){return[this.id]},_a.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},_a);function _a(t,e,o){e=ga.call(this,e)||this;return e.options=(new fa).merge(es(o,fa._cloneCustomizer)),e.options.source=t||e.options.source,e}var wa,ba,Ot=window&&window.__extends||(wa=function(t,e){return(wa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}wa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Sa=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xa=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Oa=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Ta=(Ot(Ea,ba=H),Ea.prototype.merge=function(){for(var t,e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var n=!1,r=!1;try{for(var i=Sa(e),s=i.next();!s.done;s=i.next()){var a=s.value;a&&(a.hasOwnProperty("fillColor")?r=!(n=!0):a.hasOwnProperty("fillPattern")&&(n=!(r=!0)))}}catch(t){c={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}var c=ba.prototype.merge.apply(this,Oa([],xa(e)));return n?c.fillPattern=void 0:r&&(c.fillColor=void 0),c},Ea);function Ea(){var t=null!==ba&&ba.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.fillColor="#1E90FF",t.fillOpacity=.5,t.fillPattern=void 0,t}var Ca,Pa,ka=((window&&window.__extends||(Ca=function(t,e){return(Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ca(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Aa,Pa=xs),Aa.prototype.getOptions=function(){return es(this.options,Ta._cloneCustomizer)},Aa.prototype.getSource=function(){return this.options.source},Aa.prototype.setOptions=function(t){t=(new Ta).merge(this.options,es(t,Ta._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("fill-color",t.fillColor,this.options.fillColor),this._updatePaintProperty("fill-opacity",t.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-pattern",t.fillPattern,this.options.fillPattern)}this.options=t},Aa.prototype._buildLayers=function(){var t={id:this.id,type:"fill",source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"fill-opacity":this.options.fillOpacity},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),this.options.fillPattern?t.paint["fill-pattern"]=this.options.fillPattern:t.paint["fill-color"]=this.options.fillColor,[t]},Aa.prototype._getLayerIds=function(){return[this.id]},Aa.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},Aa);function Aa(t,e,o){e=Pa.call(this,e)||this;return e.options=(new Ta).merge(es(o,Ta._cloneCustomizer)),e.options.source=t||e.options.source,e}var Ia,La,Ra=((window&&window.__extends||(Ia=function(t,e){return(Ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ia(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Na,La=k),Na);function Na(){var t=null!==La&&La.apply(this,arguments)||this;return t.allowOverlap=!1,t.anchor="bottom",t.ignorePlacement=!1,t.image="marker-blue",t.offset=new cr(0,0),t.optional=!1,t.padding=2,t.pitchAlignment="auto",t.rotation=0,t.rotationAlignment="auto",t.size=1,t.opacity=1,t}var Ma,ja,Da=((window&&window.__extends||(Ma=function(t,e){return(Ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ma(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(za,ja=k),za);function za(){var t=null!==ja&&ja.apply(this,arguments)||this;return t.allowOverlap=!1,t.anchor="center",t.textField=void 0,t.font=["StandardFont-Regular"],t.ignorePlacement=!1,t.justify="center",t.offset=new cr(0,0),t.optional=!1,t.padding=2,t.pitchAlignment="auto",t.rotation=0,t.rotationAlignment="auto",t.size=16,t.color="#000000",t.haloBlur=0,t.haloColor="rgba(0,0,0,0)",t.haloWidth=0,t.opacity=1,t}var Ba,Fa,Ua=((window&&window.__extends||(Ba=function(t,e){return(Ba=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ba(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(qa,Fa=H),qa);function qa(){var t=null!==Fa&&Fa.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.iconOptions=new Ra,t.textOptions=new Da,t.placement="point",t.zOrder="auto",t.lineSpacing=250,t}var Ga,Za,Ot=window&&window.__extends||(Ga=function(t,e){return(Ga=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ga(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ha=window&&window.__assign||function(){return(Ha=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Ka=(Ot(Wa,Za=xs),Wa.prototype.getOptions=function(){return es(this.options,Ua._cloneCustomizer)},Wa.prototype.getSource=function(){return this.options.source},Wa.prototype.setOptions=function(t){var e=(new Ua).merge(this.options,es(t,Ua._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);var o=this.options,n=e.iconOptions,r=o.iconOptions,i=e.textOptions,t=o.textOptions;this._updateBaseProperties(e,o),this._updateLayoutProperty("symbol-spacing",e.lineSpacing,o.lineSpacing),this._updateLayoutProperty("symbol-placement",e.placement,o.placement),this._updateLayoutProperty("symbol-sort-key",e.sortKey,o.sortKey),this._updateLayoutProperty("symbol-z-order",e.zOrder,o.zOrder),this._updateLayoutProperty("icon-allow-overlap",n.allowOverlap,r.allowOverlap),this._updateLayoutProperty("icon-anchor",n.anchor,r.anchor),this._updateLayoutProperty("icon-ignore-placement",n.ignorePlacement,r.ignorePlacement),this._updateLayoutProperty("icon-image",n.image,r.image),this._updateLayoutProperty("icon-offset",n.offset,r.offset),this._updatePaintProperty("icon-opacity",n.opacity,r.opacity),this._updateLayoutProperty("icon-optional",n.optional,r.optional),this._updateLayoutProperty("icon-padding",n.padding,r.padding),this._updateLayoutProperty("icon-pitch-alignment",n.pitchAlignment,r.pitchAlignment),this._updateLayoutProperty("icon-rotate",n.rotation,r.rotation),this._updateLayoutProperty("icon-rotation-alignment",n.rotationAlignment,r.rotationAlignment),this._updateLayoutProperty("icon-size",n.size,r.size),this._updateLayoutProperty("text-allow-overlap",i.allowOverlap,t.allowOverlap),this._updateLayoutProperty("text-anchor",i.anchor,t.anchor),this._updatePaintProperty("text-color",i.color,t.color),this._updateLayoutProperty("text-font",i.font,t.font),this._updateLayoutProperty("text-ignore-placement",i.ignorePlacement,t.ignorePlacement),this._updateLayoutProperty("text-justify",i.justify,t.justify),this._updatePaintProperty("text-halo-blur",i.haloBlur,t.haloBlur),this._updatePaintProperty("text-halo-color",i.haloColor,t.haloColor),this._updatePaintProperty("text-halo-width",i.haloWidth,t.haloWidth),this._updateLayoutProperty("text-offset",i.offset,t.offset),this._updatePaintProperty("text-opacity",i.opacity,t.opacity),this._updateLayoutProperty("text-optional",i.optional,t.optional),this._updateLayoutProperty("text-padding",i.padding,t.padding),this._updateLayoutProperty("text-pitch-alignment",i.pitchAlignment,t.pitchAlignment),this._updateLayoutProperty("text-radial-offset",i.radialOffset,t.radialOffset),this._updateLayoutProperty("text-rotate",i.rotation,t.rotation),this._updateLayoutProperty("text-rotation-alignment",i.rotationAlignment,t.rotationAlignment),this._updateLayoutProperty("text-size",i.size,t.size),this._updateLayoutProperty("text-variable-anchor",i.variableAnchor,t.variableAnchor),this._updateLayoutProperty("text-field",i.textField,t.textField)}this.options=e},Wa.prototype._buildLayers=function(){var t=Ha(Ha(Ha(Ha({id:this.id,type:"symbol"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:Ha(Ha({visibility:this.options.visible?"visible":"none","symbol-placement":this.options.placement,"symbol-spacing":this.options.lineSpacing,"symbol-z-order":this.options.zOrder,"text-allow-overlap":this.options.textOptions.allowOverlap,"text-anchor":this.options.textOptions.anchor},this.options.textOptions.textField&&{"text-field":this.options.textOptions.textField}),{"text-font":this.options.textOptions.font,"text-ignore-placement":this.options.textOptions.ignorePlacement,"text-justify":this.options.textOptions.justify,"text-offset":this.options.textOptions.offset,"text-optional":this.options.textOptions.optional,"text-padding":this.options.textOptions.padding,"text-pitch-alignment":this.options.textOptions.pitchAlignment,"text-rotate":this.options.textOptions.rotation,"text-rotation-alignment":this.options.textOptions.rotationAlignment,"text-size":this.options.textOptions.size,"icon-allow-overlap":this.options.iconOptions.allowOverlap,"icon-anchor":this.options.iconOptions.anchor,"icon-ignore-placement":this.options.iconOptions.ignorePlacement,"icon-image":this.options.iconOptions.image,"icon-offset":this.options.iconOptions.offset,"icon-optional":this.options.iconOptions.optional,"icon-padding":this.options.iconOptions.padding,"icon-pitch-alignment":this.options.iconOptions.pitchAlignment,"icon-rotate":this.options.iconOptions.rotation,"icon-rotation-alignment":this.options.iconOptions.rotationAlignment,"icon-size":this.options.iconOptions.size}),paint:{"text-color":this.options.textOptions.color,"text-halo-blur":this.options.textOptions.haloBlur,"text-halo-color":this.options.textOptions.haloColor,"text-halo-width":this.options.textOptions.haloWidth,"text-opacity":this.options.textOptions.opacity,"icon-opacity":this.options.iconOptions.opacity}}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom});return void 0!==this.options.sortKey&&(t.layout["symbol-sort-key"]=this.options.sortKey),void 0!==this.options.textOptions.radialOffset&&(t.layout["text-radial-offset"]=this.options.textOptions.radialOffset),void 0!==this.options.textOptions.variableAnchor&&(t.layout["text-variable-anchor"]=this.options.textOptions.variableAnchor),[t]},Wa.prototype._getLayerIds=function(){return[this.id]},Wa.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},Wa);function Wa(t,e,o){e=Za.call(this,e)||this;return e.options=(new Ua).merge(es(o,Ua._cloneCustomizer)),e.options.source=t||e.options.source,e}var Va,Ya,Qa=((window&&window.__extends||(Va=function(t,e){return(Va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Va(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ja,Ya=Ct),Ja);function Ja(){var t=null!==Ya&&Ya.apply(this,arguments)||this;return t.bounds=[-180,-85.0511,180,85.0511],t.minSourceZoom=0,t.maxSourceZoom=22,t.tileSize=512,t.isTMS=!1,t.subdomains=void 0,t.tileUrl=void 0,t}var Xa,$a,Ct=window&&window.__extends||(Xa=function(t,e){return(Xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Xa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),tc=window&&window.__assign||function(){return(tc=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ec=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oc=(Ct(nc,$a=Xs),nc.prototype.getOptions=function(){return es(this.options,Qa._cloneCustomizer)},nc.prototype.setOptions=function(t){t=(new Qa).merge(this.options,es(t,Qa._cloneCustomizer));if(this.map){if(!er(t.bounds,this.options.bounds)||t.isTMS!==this.options.isTMS||t.maxSourceZoom!==this.options.maxSourceZoom||t.minSourceZoom!==this.options.minSourceZoom||!er(t.subdomains,this.options.subdomains)||t.tileSize!==this.options.tileSize||t.tileUrl!==this.options.tileUrl)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("raster-contrast",t.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",t.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",t.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",t.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",t.saturation,this.options.saturation)}this.options=t},nc.prototype._setOptionsNoUpdate=function(t){this.options=(new Qa).merge(this.options,es(t,Qa._cloneCustomizer))},nc.prototype._buildLayers=function(){return[tc(tc({id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-max":this.options.maxBrightness,"raster-brightness-min":this.options.minBrightness,"raster-opacity":this.options.opacity,"raster-saturation":this.options.saturation}},this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},nc.prototype._getLayerIds=function(){return[this.id]},nc.prototype._buildSource=function(){var t,e;if(this.options.tileUrl){if(-1===this.options.tileUrl.indexOf("{"))return{type:"raster",url:this.options.tileUrl};if(-1!==this.options.tileUrl.indexOf("{subdomain}")){if(!(this.options.subdomains&&0<this.options.subdomains.length))throw new Error("The {subdomain} placeholder was included in the tileUrl but no subdomains were specified");var o=[];try{for(var n=ec(this.options.subdomains),r=n.next();!r.done;r=n.next()){var i=r.value;o.push(this.options.tileUrl.replace(/{subdomain}/g,i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}e=o}else e=[this.options.tileUrl]}return tc({type:"raster",bounds:this.options.bounds,maxzoom:this.options.maxSourceZoom,minzoom:this.options.minSourceZoom,scheme:this.options.isTMS?"tms":"xyz",tileSize:this.options.tileSize},e&&{tiles:e})},nc.prototype._getSourceId=function(){return this.getId()+"-RasterSource"},nc);function nc(t,e){e=$a.call(this,e)||this;return t&&e.setOptions(t),e}var rc,ic,sc=((window&&window.__extends||(rc=function(t,e){return(rc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}rc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ac,ic=H),ac);function ac(){var t=null!==ic&&ic.apply(this,arguments)||this;return t.renderer=void 0,t}var cc,lc,uc=((window&&window.__extends||(cc=function(t,e){return(cc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}cc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(pc,lc=xs),pc.prototype.getOptions=function(){return es(this.options,sc._cloneCustomizer)},pc.prototype.setOptions=function(t){t=(new sc).merge(this.options,es(t,sc._cloneCustomizer));this.map&&this.map.triggerRepaint(),this.options=t},pc.prototype.onAdd=function(t){var e,o;lc.prototype.onAdd.call(this,t),this.map.events.add("stylechanged",this._onStyleChange),this.options.renderer&&this.glContext&&null!==(o=(e=this.options.renderer).onAdd)&&void 0!==o&&o.call(e,t,this.glContext)},pc.prototype.onRemove=function(){var t,e;this.options.renderer&&this.glContext&&null!==(e=(t=this.options.renderer).onRemove)&&void 0!==e&&e.call(t,this.map,this.glContext),this.map.events.remove("stylechanged",this._onStyleChange),this.glContext=null,lc.prototype.onRemove.call(this)},pc.prototype._buildLayers=function(){var r=this;if(!this.options.renderer)throw new Error("Cannot build the WebGL layer because renderer was not set.");return[{id:this.id,type:"custom",renderingMode:this.options.renderer.renderingMode,onAdd:function(t,e){r.glContext=e},onRemove:function(t,e){},prerender:function(t,e){var o,n;r._shouldRender()&&null!==(n=(o=r.options.renderer).prerender)&&void 0!==n&&n.call(o,t,e)},render:function(t,e){r._shouldRender()&&r.options.renderer.render(t,e)}}]},pc.prototype._getLayerIds=function(){return[this.id]},pc.prototype._getSourceIds=function(){return(new Set).add(this.source.getId())},pc.prototype._shouldRender=function(){if(this.map){var t=this.map.getCamera().zoom;return this.options.visible&&this.options.minZoom<=t&&this.options.maxZoom>t}return!1},pc);function pc(t,e){var o=lc.call(this,t)||this;return o._onStyleChange=function(){var t,e;o.map._getMap().getLayer(o.id)||(t=o.map,e=null===(e=o.map.layers._getUserLayers().find(function(t){return t.layer.getId()==o.id}))||void 0===e?void 0:e.before,t.layers.remove(o),t.layers.add(o,e))},o.options=(new sc).merge(es(e,sc._cloneCustomizer)),o.source=new ps,o}var At=Object.freeze({__proto__:null,BubbleLayer:Ns,Layer:xs,LineLayer:ua,PolygonExtrusionLayer:At,PolygonLayer:ka,SymbolLayer:Ka,TileLayer:oc,HeatMapLayer:_t,ImageLayer:Mt,WebGLLayer:uc}),hc=(dc.convertHtmlString=function(t){if("string"!=typeof t)return t;var e=document.createElement("div");return e.innerHTML=t,e},dc.parseWithFilter=function(t,e,o,n){var r=this;if(void 0===e&&(e=function(t){return!0}),void 0===o&&(o=function(t){return t}),void 0===n&&(n=function(){return document.createElement("div")}),"string"==typeof t){var i=(new DOMParser).parseFromString(t,"text/html").body;if(0==i.children.length)return o(i.innerHTML);var s,i=1==i.children.length&&1==i.childNodes.length?i.children[0]:(s=n(),Array.from(i.childNodes).map(function(t){return s.append(t)}),s)}else i=t;return Array.from(i.children).forEach(function(t){return r.parseWithFilter(t,e,o)}),e(i)?o(i):(i.parentNode&&i.parentNode.removeChild(i),null)},dc);function dc(){}var fc,yc,mc=function(t){return be(t)&&1===t.nodeType&&!Yo(t)},gc=((window&&window.__extends||(fc=function(t,e){return(fc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}fc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(vc,yc=k),vc._cloneCustomizer=function(t){if(mc(t))return t},vc);function vc(){var t=null!==yc&&yc.apply(this,arguments)||this;return t.anchor="none",t.draggable=!1,t.closeButton=!0,t.content=document.createElement("span"),t.fillColor="#FFFFFF",t.pixelOffset=new cr(0,0),t.position=new mi(0,0),t.showPointer=!0,t}var _c,wc,_t=window&&window.__extends||(_c=function(t,e){return(_c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}_c(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),bc=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Sc=(_t(xc,wc=X),xc.prototype.setPopupOptions=function(t){this.setOptions(t)},xc.prototype.setOptions=function(t){var e=(new gc).merge(this.options,es(t,gc._cloneCustomizer));e.content!==this.options.content?(this.htmlContent.remove(),this.htmlContent=this._createHtmlContent(e),this.contentDiv.prepend(this.htmlContent)):e.draggable!==this.options.draggable&&this._setDraggable(this.htmlContent,e.draggable),e.closeButton&&!this.closeBtn?(this.closeBtn=this._createCloseButton(),this.contentDiv.appendChild(this.closeBtn),t=q("close"),this.contentDiv.appendChild(t),G(t,this.closeBtn,!0)):!e.closeButton&&this.closeBtn&&(this.contentDiv.removeChild(this.closeBtn),delete this.closeBtn),e.showPointer&&!this.arrowDiv?(this.arrowDiv=this._createArrowDiv(),this.containerDiv.appendChild(this.arrowDiv)):!e.showPointer&&this.arrowDiv&&(this.containerDiv.removeChild(this.arrowDiv),delete this.arrowDiv),e.fillColor!==this.options.fillColor&&(this.containerDiv.style.borderColor=e.fillColor,this.contentDiv.style.backgroundColor=e.fillColor),this.marker&&(e.anchor!==this.options.anchor?"none"===this.options.anchor?(this.autoAnchor!==e.anchor&&this._replaceMarker(this.map,e),this.map.events.remove("move",this._onMove),delete this.autoAnchor):(this._replaceMarker(this.map,e),"none"===e.anchor&&this.map.events.add("move",this._onMove)):(er(e.position,this.options.position)||this.marker.setLngLat(e.position),er(e.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(e.pixelOffset))),this.options=e},xc.prototype.getPopupOptions=function(){return this.getOptions()},xc.prototype.getOptions=function(){return es(this.options,gc._cloneCustomizer)},xc.prototype.getPopupContainer=function(){return this.containerDiv},xc.prototype._dragToPixel=function(t){this.dragging||(this.dragging=!0,this.contentDiv.style.pointerEvents="none",this._invokeEvent("dragstart",{type:"dragstart",target:this}));t=[t[0]+this.dragOffset[0],t[1]+this.dragOffset[1]],t=bc(this.map.pixelsToPositions([t]),1)[0];this.options.position=t,this.marker.setLngLat(this.options.position),this._invokeEvent("drag",{type:"drag",target:this})},xc.prototype._onUp=function(){this.dragging&&(this.contentDiv.style.pointerEvents="",this._invokeEvent("dragend",{type:"dragend",target:this}),"none"===this.options.anchor&&this._onMove()),delete this.dragOffset,delete this.dragging},xc.prototype._createContainerDiv=function(t){var e=this,o=document.createElement("div");o.classList.add(xc.Css.container),o.classList.add(xc.Css.hidden),o.style.borderColor=t.fillColor,o.setAttribute("role","dialog"),o.setAttribute("aria-label","Map Information Window");var n=!1;return o.addEventListener("keydown",function(t){"Tab"!==t.key&&"Escape"!==t.key&&"Esc"!==t.key||(n=!0)}),o.addEventListener("keyup",function(t){"Tab"!==t.key&&"Escape"!==t.key&&"Esc"!==t.key||(n=!1)}),o.addEventListener("focusin",function(t){e.map&&!e.isOpen()&&(e.open(e.map),t.target instanceof HTMLElement&&t.target.focus())}),o.addEventListener("focusout",function(t){n&&t.relatedTarget instanceof Node&&!o.contains(t.relatedTarget)&&(n=!1,e.isOpen()&&e.close())}),o},xc.prototype._createContentDiv=function(t){var e=document.createElement("div");return e.classList.add(xc.Css.content),e.style.backgroundColor=t.fillColor,e.setAttribute("tabindex","0"),this.htmlContent=this._createHtmlContent(t),e.appendChild(this.htmlContent),e},xc.prototype._createArrowDiv=function(){var t=document.createElement("div");return t.classList.add(xc.Css.arrow),t},xc.prototype._createCloseButton=function(){var t=document.createElement("button");return t.addEventListener("click",this.close),t.classList.add(xc.Css.close),t.setAttribute("aria-label","close"),t.setAttribute("tabindex","0"),t.innerHTML="&times;",t},xc.prototype._createHtmlContent=function(t){var e=hc.convertHtmlString(t.content);return t.draggable&&this._setDraggable(e,t.draggable),e},xc.prototype._createMarker=function(t,e){var o=this.marker?this.marker.getLngLat():t.position,o="none"===t.anchor?(this.autoAnchor=e||"bottom",this.containerDiv.classList.add(this.autoAnchor),new n.Marker({anchor:this.autoAnchor,element:this.containerDiv,offset:t.pixelOffset}).setLngLat(o)):(this.containerDiv.classList.add(t.anchor),new n.Marker({anchor:t.anchor,element:this.containerDiv,offset:t.pixelOffset}).setLngLat(o));return o},xc.prototype._getAutoAnchor=function(t,e){var o,n,r,i=this.containerDiv.offsetWidth,s=this.containerDiv.offsetHeight,a=[];return(r=this.marker?(n=(o=t._getMap().project(this.marker.getLngLat())).x,o.y):(r=bc(t.positionsToPixels([e.position]),1),n=(r=bc(r[0],2))[0],r[1]))<s?a.push("top"):r>t.getCanvas().offsetHeight-s&&a.push("bottom"),n<i/2?a.push("left"):n>t.getCanvas().offsetWidth-i/2&&a.push("right"),0<a.length?a.join("-"):"bottom"},xc.prototype._replaceMarker=function(t,e,o){var n=this.containerDiv.nextElementSibling;this.marker.remove(),this.containerDiv.classList.remove(this.autoAnchor||this.options.anchor),this.marker=this._createMarker(e,o),this.marker.addTo(t._getMap()),t.popups._getCollectionDiv().insertBefore(this.containerDiv,n||null)},xc.prototype._setDraggable=function(t,e){e?(t.addEventListener("mousedown",this._onDown),t.addEventListener("touchstart",this._onDown),t.addEventListener("dragstart",this._onDragStart)):(t.removeEventListener("mousedown",this._onDown),t.removeEventListener("touchstart",this._onDown),t.removeEventListener("dragstart",this._onDragStart))},xc.Css={arrow:"popup-arrow",close:"popup-close",container:"popup-container",content:"popup-content-container",hidden:"hidden-accessible-element"},xc);function xc(t){var o=wc.call(this)||this;return o.attach=function(t){o.map!==t&&(o.map&&o.remove(),o.map=t,o.marker=o._createMarker(o.options),o.marker.addTo(o.map._getMap()),o.map.popups._getCollectionDiv().appendChild(o.containerDiv),o.map.popups.add(o))},o.open=function(t){if(!t&&!o.map)throw new Error("Must specify a map to open on or attach to a map in advance");o.attach(t||o.map),o.containerDiv.classList.remove(xc.Css.hidden),o.map.events.add("move",o._onMove),o._onMove(),o._invokeEvent("open",{target:o,type:"open"})},o.close=function(){o.map&&o.map.events.remove("move",o._onMove),o.containerDiv.classList.add(xc.Css.hidden),o._invokeEvent("close",{target:o,type:"close"})},o.remove=function(){o.map&&(o.marker.remove(),o.containerDiv.classList.remove(o.autoAnchor||o.options.anchor),o.map.events.remove("move",o._onMove),o.map.popups.remove(o),delete o.map,delete o.marker,delete o.autoAnchor)},o.isOpen=function(){return o.map&&!o.containerDiv.classList.contains(xc.Css.hidden)},o._onMove=function(){var t=o._getAutoAnchor(o.map,o.options);t!==o.autoAnchor&&(o._replaceMarker(o.map,o.options,t),o.map.events.add("move",o._onMove))},o._onDown=function(t){o.map.popups._addDraggedPopup(o);var e=bc(o.map.positionsToPixels([o.options.position]),1)[0];"mousedown"===t.type?o.dragOffset=[e[0]-t.clientX,e[1]-t.clientY]:"touchstart"===t.type&&(o.dragOffset=[e[0]-t.touches[0].clientX,e[1]-t.touches[0].clientY])},o._onDragStart=function(t){t.preventDefault()},o.options=(new gc).merge(es(t,gc._cloneCustomizer)),o.containerDiv=o._createContainerDiv(o.options),o.contentDiv=o._createContentDiv(o.options),o.containerDiv.appendChild(o.contentDiv),o.options.showPointer&&(o.arrowDiv=o._createArrowDiv(),o.containerDiv.appendChild(o.arrowDiv)),o.options.closeButton&&(o.closeBtn=o._createCloseButton(),o.contentDiv.appendChild(o.closeBtn),t=q("close"),o.contentDiv.appendChild(t),G(t,o.closeBtn,!0)),o}var Oc,Tc,Ec=((window&&window.__extends||(Oc=function(t,e){return(Oc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Oc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Cc,Tc=k),Cc._cloneCustomizer=function(t){if(t instanceof Sc||mc(t))return t},Cc);function Cc(){var t=null!==Tc&&Tc.apply(this,arguments)||this;return t.anchor="bottom",t.color="#1A73AA",t.draggable=!1,t.htmlContent='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.5 36.5" id="marker_'+nr()+'" width="24.5" height="36.5" display="block"><path d="M12.25.25a12.2543,12.2543,0,0,0-12,12.4937c0,6.4436,6.4879,12.1093,11.059,22.5641.5493,1.2563,1.3327,1.2563,1.882,0C17.7621,24.8529,24.25,19.1857,24.25,12.7437A12.2543,12.2543,0,0,0,12.25.25Z" fill="{color}" stroke="{secondaryColor}" stroke-width="0.5"/><text style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; fill: white;" text-anchor="middle" x="12" y="18">{text}</text></svg>',t.pixelOffset=new cr(0,0),t.position=new mi(0,0),t.popup=void 0,t.secondaryColor="white",t.text=void 0,t.visible=!0,t}var Pc,kc,Ac=((window&&window.__extends||(Pc=function(t,e){return(Pc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Pc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ic,kc=X),Ic.prototype.getOptions=function(){return es(this.options,Ec._cloneCustomizer)},Ic.prototype.getElement=function(){return this.marker.getElement()},Ic.prototype.setOptions=function(t){t=(new Ec).merge(this.options,es(t,Ec._cloneCustomizer));er(t.htmlContent,this.options.htmlContent)&&t.anchor===this.options.anchor?("string"!=typeof t.htmlContent||t.color===this.options.color&&t.text===this.options.text&&t.secondaryColor===this.options.secondaryColor||(this.element.innerHTML=this._getSubbedHtmlString(t)||""),t.draggable!==this.options.draggable&&(this._setDraggable(t.draggable),this.marker.setDraggable(t.draggable)),er(t.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(t.pixelOffset),er(t.position,this.options.position)||this.marker.setLngLat(t.position),t.visible!==this.options.visible&&(t.visible?this.element.classList.remove(Ic.hiddenClass):this.element.classList.add(Ic.hiddenClass))):(this.marker.remove(),this._buildMarker(t),this.map&&(this.marker.addTo(this.map._getMap()),this._getCollectionContainer().appendChild(this.element))),this.options=t},Ic.prototype.togglePopup=function(){if(this.options.popup)if(this.options.popup.isOpen())this.options.popup.close();else{if(!this.map)throw new Error("The marker must be added to a map before calling togglePopup().");this.options.popup.setOptions({position:this.options.position}),this.options.popup.open(this.map)}},Ic.prototype._addToMap=function(t,e){this.map&&this.map!==t&&this._removeFromMap(),e&&(this.options.position=qo(e),this.marker.setLngLat(this.options.position)),this.map!==t&&(this.map=t,this.marker.addTo(t._getMap()),this._getCollectionContainer().appendChild(this.element))},Ic.prototype._removeFromMap=function(){this.map&&(this.marker.remove(),delete this.map)},Ic.prototype._getId=function(){if(this.element)return("string"==typeof this.options.htmlContent?this.element.firstChild:this.element).id},Ic.prototype._buildMarker=function(t){var e;"string"==typeof t.htmlContent?(e=this._getSubbedHtmlString(t)||"",this.element=hc.convertHtmlString(e)):this.element=t.htmlContent,this.element.classList.add(Ic.containerClass),t.draggable&&this._setDraggable(!0),t.visible||this.element.classList.add(Ic.hiddenClass),this.marker=new n.Marker({element:this.element,offset:t.pixelOffset,draggable:t.draggable,anchor:t.anchor}).setLngLat(t.position),this.marker.on("drag",this._onDrag),this.marker.on("dragstart",this._onDragStart),this.marker.on("dragend",this._onDragEnd),this.element.addEventListener("click",this._bubbleElementEvent),this.element.addEventListener("dblclick",this._bubbleElementEvent),this.element.addEventListener("contextmenu",this._bubbleElementEvent),this.element.addEventListener("keydown",this._bubbleElementEvent),this.element.addEventListener("keypress",this._bubbleElementEvent),this.element.addEventListener("keyup",this._bubbleElementEvent),this.element.addEventListener("mousedown",this._bubbleElementEvent),this.element.addEventListener("mouseenter",this._bubbleElementEvent),this.element.addEventListener("mouseleave",this._bubbleElementEvent),this.element.addEventListener("mousemove",this._bubbleElementEvent),this.element.addEventListener("mouseout",this._bubbleElementEvent),this.element.addEventListener("mouseover",this._bubbleElementEvent),this.element.addEventListener("mouseup",this._bubbleElementEvent)},Ic.prototype._getSubbedHtmlString=function(t){return"string"==typeof t.htmlContent?t.htmlContent.replace(/{color}/gi,t.color||"").replace(/{secondaryColor}/gi,t.secondaryColor||"").replace(/{text}/gi,t.text||""):null},Ic.prototype._getCollectionContainer=function(){var t=this.map.getCanvasContainer().querySelector("."+Ic.collectionContainerClass);return t||((t=document.createElement("div")).classList.add(Ic.collectionContainerClass),this.map.getCanvasContainer().appendChild(t)),t},Ic.prototype._setDraggable=function(t){t?this.element.addEventListener("dragstart",this._onEleDragStart):this.element.removeEventListener("dragstart",this._onEleDragStart)},Ic.collectionContainerClass="marker-collection-container",Ic.hiddenClass="hidden-accessible-element",Ic.containerClass="marker-container",Ic);function Ic(t){var e=kc.call(this)||this;return e._onDrag=function(){var t=e.marker.getLngLat().wrap();e.options.position=new mi(t.lng,t.lat),e._invokeEvent("drag",{type:"drag",target:e})},e._onDragStart=function(){e._invokeEvent("dragstart",{type:"dragstart",target:e})},e._onDragEnd=function(){e._invokeEvent("dragend",{type:"dragend",target:e})},e._bubbleElementEvent=function(t){e._invokeEvent(t.type,{type:t.type,target:e})},e._onEleDragStart=function(t){t.preventDefault()},e.options=(new Ec).merge(es(t,Ec._cloneCustomizer)),e._buildMarker(e.options),e}var Lc=(Rc.parse=function(t){var e=(t=t.toLowerCase()).lastIndexOf("-");return-1!==e?{code:t,language:t.substring(0,e),region:t.substring(e+1)}:{code:t,language:t}},Rc);function Rc(){}var Nc={localizationsPath:"locs/mapcontrol/2019-3-12",sensitiveUserRegions:["il","kr","pk","in","cn","ar","bh","eg","jo","sa","kw","om","qa","ma","ae"],locales:{defaultLanguage:{defaultRegion:{code:"NGT",strings:"en/resource.json"}},ar:{defaultRegion:{code:"ar",strings:"ar-sa/resource.json"}},bg:{defaultRegion:{code:"bg-BG",strings:"bg-bg/resource.json"}},cs:{defaultRegion:{code:"cs-CZ",strings:"cs-cz/resource.json"}},da:{defaultRegion:{code:"da-DK",strings:"da-dk/resource.json"}},de:{defaultRegion:{code:"de-DE",strings:"de-de/resource.json"}},el:{defaultRegion:{code:"el-GR",strings:"el-gr/resource.json"}},en:{defaultRegion:{code:"en",strings:"en/resource.json"},us:{code:"en-US",strings:"en/resource.json"}},es:{defaultRegion:{code:"es-ES",strings:"es-es/resource.json"},mx:{code:"es-MX",strings:"es-mx/resource.json"}},fi:{defaultRegion:{code:"fi-FI",strings:"fi-fi/resource.json"}},fr:{defaultRegion:{code:"fr-FR",strings:"fr-fr/resource.json"}},hu:{defaultRegion:{code:"hu-HU",strings:"hu-hu/resource.json"}},id:{defaultRegion:{code:"id-ID",strings:"id-id/resource.json"}},it:{defaultRegion:{code:"it-IT",strings:"it-it/resource.json"}},ko:{defaultRegion:{code:"ko-KR",strings:"ko-kr/resource.json"}},lt:{defaultRegion:{code:"lt-LT",strings:"lt-lt/resource.json"}},ms:{defaultRegion:{code:"ms-MY",strings:"ms-my/resource.json"}},nb:{defaultRegion:{code:"nb-NO",strings:"nb-no/resource.json"}},nl:{defaultRegion:{code:"nl-NL",strings:"nl-nl/resource.json"}},pl:{defaultRegion:{code:"pl-PL",strings:"pl-pl/resource.json"}},pt:{defaultRegion:{code:"pt-PT",strings:"pt-pt/resource.json"},br:{code:"pt-BR",strings:"pt-br/resource.json"}},ru:{defaultRegion:{code:"ru-RU",strings:"ru-ru/resource.json"}},sk:{defaultRegion:{code:"sk-SK",strings:"sk-sk/resource.json"}},sl:{defaultRegion:{code:"sl-SL",strings:"sl-sl/resource.json"}},sv:{defaultRegion:{code:"sv-SE",strings:"sv-se/resource.json"}},th:{defaultRegion:{code:"th-TH",strings:"th-th/resource.json"}},tr:{defaultRegion:{code:"tr-TR",strings:"tr-tr/resource.json"}},zh:{defaultRegion:{code:"zh-Hant",strings:"zh-tw/resource.json"}},"zh-hant":{defaultRegion:{code:"zh-Hant",strings:"zh-tw/resource.json"}}}},Mc=function(){this.Unknown="Unknown",this.Accident="Accident",this.Fog="Fog",this.Danger="Danger",this.Rain="Rain",this.Ice="Ice",this.Jam="Jam",this.LaneClosed="Lane Closed",this.RoadClosed="Road Closed",this.RoadWorks="Road Works",this.Wind="Wind",this.Flood="Flood",this.Detour="Detour"},jc=(Dc.getCode=function(t){var e=Lc.parse(t);return-1===Nc.sensitiveUserRegions.indexOf(e.region)?this.getLocaleData(e).code:t},Dc.getStrings=function(t){t=this.getLocaleData(t);return Nc.locales.defaultLanguage.defaultRegion.code===t.code?new Promise(function(t){t(new Mc)}):new D({domain:e,path:Nc.localizationsPath+"/"+t.strings}).get().then(function(t){return t},function(){return new Mc})},Dc.getLocaleData=function(t){if("string"==typeof t&&(t=Lc.parse(t)),Nc.locales[t.code])return Nc.locales[t.code].defaultRegion;var e;if(Nc.locales[t.language])e=Nc.locales[t.language];else{if(-1!==t.language.indexOf("-"))return this.getLocaleData(t.language);e=Nc.locales.defaultLanguage}return t.region&&e[t.region]?e[t.region]:e.defaultRegion},Dc);function Dc(){}var zc=(Bc.getEdgeOrIEVersion=function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(0<e)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(0<t.indexOf("Trident/")){var o=t.indexOf("rv:");return parseInt(t.substring(o+3,t.indexOf(".",o)),10)}o=t.indexOf("Edge/");return 0<o?parseInt(t.substring(o+5,t.indexOf(".",o)),10):-1},Bc.isEdgeOrIE=function(){return-1!==this.getEdgeOrIEVersion()},Bc.isIE=function(){var t=this.getEdgeOrIEVersion();return-1!==t&&t<=11},Bc);function Bc(){}var Fc,Mt=window&&window.__extends||(Fc=function(t,e){return(Fc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Fc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Uc=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},qc=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t};(_t=u.AuthenticationType||(u.AuthenticationType={})).subscriptionKey="subscriptionKey",_t.aad="aad",_t.anonymous="anonymous",_t.sas="sas";var Gc,Zc,Hc=(Mt(Kc,Gc=k),Kc.prototype.setSubscriptionKey=function(t){this.authType=u.AuthenticationType.subscriptionKey,this.subscriptionKey=t},Kc.prototype.setAadProperties=function(t,e,o,n,r){this.authType=u.AuthenticationType.aad,this.authContext=r||this.authContext,this.aadInstance=n||this.aadInstance,this.clientId=t,this.aadAppId=e,this.aadTenant=o},Kc.prototype.setTokenCallbackFunction=function(t){this.authType=u.AuthenticationType.anonymous,this.getToken=t},Kc.prototype.setSasCallbackFunction=function(t){this.authType=u.AuthenticationType.sas,this.getToken=t},Kc.prototype.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=Gc.prototype.merge.apply(this,qc([],Uc(t)));return o.authType===u.AuthenticationType.subscriptionKey?o.authContext=o.aadAppId=o.getToken=void 0:o.authType===u.AuthenticationType.aad?o.subscriptionKey=o.getToken=void 0:o.authType===u.AuthenticationType.anonymous?o.subscriptionKey=o.authContext=o.aadAppId=void 0:o.authType===u.AuthenticationType.sas&&(o.authContext=o.subscriptionKey=o.aadAppId=void 0),o},Kc);function Kc(){var t=null!==Gc&&Gc.apply(this,arguments)||this;return t.authType=void 0,t.subscriptionKey=void 0,t.clientId=void 0,t.aadAppId=void 0,t.aadTenant=void 0,t.aadInstance=void 0,t.getToken=void 0,t.sasToken=void 0,t.authContext=void 0,t}var Wc="NGT",Vc=nr(),Yc=t,Qc=e,Jc=o,Xc=r,$c=b,tl=new Hc,el=!1,ol=!1,nl=!1,rl=!1,il=!1,sl=!1,al=!1,cl=!1,ll=!1;function ul(){return Object.assign({},tl)}function pl(){return Qc}function hl(){return Yc}function dl(){return Jc}function fl(){return Xc}function yl(){return $c}function ml(){return p.workerCount}function gl(){return p.maxParallelImageRequests}function vl(){return Wc}function _l(){return Vc}function wl(){return tl.authType===u.AuthenticationType.subscriptionKey?tl.subscriptionKey:void 0}function bl(){return Zc}function Sl(t){return!zc.isIE()&&p.supported({failIfMajorPerformanceCaveat:t})}function xl(t){tl=(new Hc).merge(tl,t),ll=!0}function Ol(t){Yc=t,ol=!0}function Tl(t){Jc=t,nl=!0}function El(t){0<t&&(p.workerCount=t,il=!0)}function Cl(t){0<t&&(p.maxParallelImageRequests=t,sl=!0)}function Pl(t){Wc=jc.getCode(t),al=!0}function kl(t){Vc=t,cl=!0}function Al(t){tl.setSubscriptionKey(t),ll=!0}function Il(t){Zc=t,el=!0}function Ll(t,e){if(e=Math.abs(e||1),"string"==typeof t&&Ul[t.toLowerCase()]){for(var o=Ul[t.toLowerCase()],n=/calc\(([0-9.]+)[px]*\s*\*\s*\{scale\}\)/gi,r=o,i=n.exec(o);i;)r=r.replace(i[0],parseFloat(i[1])*e+""),i=n.exec(o);return r=r.replace("{scale}",e+"")}throw new Error("Invalid templateName.")}function Rl(){return ll}function Nl(){return ol}function Ml(){return nl}function jl(){return il}function Dl(){return sl}function zl(){return al}function Bl(){return cl}function Fl(){return el}var Ul={marker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 26 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><text x="12.5" y="17.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:2"/><text x="12.5" y="18.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-circle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><circle cx="12.5" cy="12.5" r="9" fill="{secondaryColor}"/><text x="12" y="17.5" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(24 * {scale})" height="calc(28 * {scale})" viewBox="0 0 24 28"><path d="m11.988 16.615a5.15 5.15 0 0 1-2.268-.525 4.909 4.909 0 0 1-2.805-4.442 5.019 5.019 0 0 1 5.072-4.936h.012a5.03 5.03 0 0 1 5.085 4.961 4.907 4.907 0 0 1-.549 2.224 5.114 5.114 0 0 1-4.548 2.718zm0-8.06a3.173 3.173 0 0 0-3.226 3.099 3.081 3.081 0 0 0 1.77 2.782 3.299 3.299 0 0 0 4.365-1.386 3.049 3.049 0 0 0 .342-1.381 3.184 3.184 0 0 0-3.239-3.114h-.012z" fill="{secondaryColor}"/><path d="m11.999.922a10.908 10.908 0 0 0-11.076 10.732 10.639 10.639 0 0 0 4.418 8.598l6.658 6.464 6.658-6.463a10.537 10.537 0 0 0 2.198-15.041 11.182 11.182 0 0 0-8.856-4.289zm1.873 14.341a4.221 4.221 0 0 1-5.589-1.789 3.945 3.945 0 0 1-.445-1.8 4.164 4.164 0 0 1 8.323-.037 4.028 4.028 0 0 1-2.289 3.626Z" fill="{color}"/><path d="m11.999 28-7.256-7.044a11.611 11.611 0 0 1-4.743-9.303 11.844 11.844 0 0 1 11.988-11.652.102 .102 0 0 1 .02 0 12.164 12.164 0 0 1 9.577 4.647 11.357 11.357 0 0 1 2.299 8.614 11.521 11.521 0 0 1-4.63 7.695zm-.01-26.157a9.997 9.997 0 0 0-10.143 9.812 9.769 9.769 0 0 0 4.04 7.853l.099.083 6.014 5.838 6.113-5.922a9.7 9.7 0 0 0 3.945-6.505 9.533 9.533 0 0 0-1.933-7.229 10.305 10.305 0 0 0-8.116-3.931h-.021zm.021 14.772a5.11 5.11 0 0 1-4.547-2.718 4.868 4.868 0 0 1 .932-5.743 5.118 5.118 0 0 1 3.58-1.46h.024a5.031 5.031 0 0 1 5.084 4.938 4.92 4.92 0 0 1-2.805 4.457h0a5.152 5.152 0 0 1-2.269.525zm-.011-8.079h-.015a3.277 3.277 0 0 0-2.295.933 3.029 3.029 0 0 0-.587 3.58 3.297 3.297 0 0 0 4.364 1.386h0a3.092 3.092 0 0 0 1.772-2.795 3.185 3.185 0 0 0-3.239-3.105z" fill="{secondaryColor}"/><text x="12" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"pin-round":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25 * {scale})" height="calc(25 * {scale})" viewBox="0 0 25 25"><g transform="translate(0 1)"><circle cx="12.25" cy="11.5833" r="11" fill="{color}"/><path d="m12.25 23.583a12 12 0 1 1 12-12 12 12 0 0 1-12 12zm0-22a10 10 0 1 0 10 10 10 10 0 0 0-10-10z" fill="{secondaryColor}"/><circle cx="12.25" cy="11.5833" r="4.2386" fill="{secondaryColor}"/></g><text x="12.5" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-flat":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(42.8 * {scale})" viewBox="0 0 1600 2570"><g fill="{color}"><path d="M691 2419c-409-575-641-1086-683-1504-10-106-10-136 5-224 31-188 105-330 241-458 129-124 270-190 453-214 69-9 113-10 182-1 373 46 655 326 703 698 40 308-120 801-424 1309-134 224-348 535-369 535-4 0-53-63-108-141z"/></g><g fill="rgba(0,0,0,0.15)" style="transform:scale(-1,1);transform-origin:center"><path d="M691 2419c-407-571-639-1083-682-1498-14-139-3-249 37-371 69-208 254-402 459-481 68-27 217-59 271-59h24v160 180 940 635c0 349-2 635-5 635-2 0-49-63-104-141z"/></g><circle cx="800" cy="800" r="600" fill="{secondaryColor}"/><text x="800" y="1100" style="font-size:800px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-arrow":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25.47 * {scale})" height="calc(35.18 * {scale})" viewBox="0 0 4330 5980"><g fill="{color}"><path d="m2080 5969c-49-20-93-63-115-113-25-55-1928-5486-1953-5573-40-138 67-282 210-283 36 0 246 73 987 345 518 190 947 345 955 345 8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29-33 0-71-5-85-10z"/></g><g fill="{secondaryColor}"><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z"/><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z" style="transform:scale(-1,1);transform-origin:center"/></g><g fill="rgba(0,0,0,0.2)" ><path d="m2165 685c8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29z"/></g><text x="2165" y="3300" style="font-size:2500px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-ball-pin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15.67 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 235 452"><g transform="translate(-135 10)"><path fill="{secondaryColor}" d="m256 442 0 0c-13 0-18-11-18-24l-6-323c0-13 11-24 24-24h0c13 0 24 11 24 24l-6 323c0 13-5 24-18 24z"/><circle style="fill:{color};stroke-width:10;stroke:{secondaryColor}" cx="256" cy="112" r="111"/><ellipse transform="matrix(0.834 0.5518 -0.5518 0.834 65.7916 -97.18)" fill="rgba(255,255,255,0.3)" cx="194.399" cy="60.749" rx="19.076" ry="32.428"/></g><text x="117.5" y="160" style="font-size:160px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.67 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2000 2420"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M845 2152c-22-37-58-95-80-129-22-35-62-99-90-143l-50-80-312 0-313 0 0-900 0-900 900 0 900 0 0 900 0 900-313 0-313 0-34 58c-19 31-38 59-42 60-5 2-8 8-8 12 0 9-69 123-88 145-5 6-11 15-13 21-16 39-77 123-89 124-8 0-33-31-55-68z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(38.8 * {scale})" viewBox="0 0 2500 2910"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m866 2652c-17-31-37-68-46-82-9-14-32-54-51-90-19-36-50-92-70-125l-36-60-332-3-331-2 0-905 0-905 660 0 660 0 0-38c0-71 50-196 102-258 71-85 189-164 244-164 12 0 26-4 29-10 8-13 222-13 230 0 3 6 17 10 30 10 25 0 117 45 154 76 130 107 191 232 191 392 0 155-63 284-190 386-36 29-129 76-150 76-11 0-22 5-25 10-3 6-31 10-61 10l-54 0 0 660 0 660-332 2-332 3-29 50c-17 28-48 84-70 125-22 41-47 86-56 100-9 14-30 51-46 83-17 32-36 57-45 57-8 0-28-25-44-58z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.8 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2010 2410"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M856 2155c-20-30-36-59-36-65 0-5-4-10-10-10-5 0-10-5-10-11 0-5-18-37-40-69-22-32-40-64-40-69 0-6-4-11-10-11-5 0-10-5-10-10 0-6-15-33-32-60l-33-50-127 0c-74 0-129-4-133-10-3-5-17-10-30-10-25 0-116-45-155-76-87-69-142-151-178-265-15-46-17-1075-2-1084 5-3 10-17 10-30 0-13 5-27 10-30 6-3 10-13 10-22 0-22 83-135 122-168 57-46 62-50 112-75l50-25 585 0 586 0 63 34c84 46 169 133 212 218l35 68 0 565 0 565-28 59c-32 69-100 157-139 180-15 9-33 22-40 29-23 22-99 57-123 57-13 0-27 5-30 10-4 6-60 10-135 10l-128 0-128 205c-84 136-133 205-144 205-10 0-33-24-54-55z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(32.13 * {scale})" viewBox="0 0 2500 2900"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m874 2669c-9-18-26-49-37-68-11-20-30-55-43-78-13-24-36-64-51-90-14-27-38-69-52-95l-26-48-142 0c-84 0-144-4-148-10-3-5-17-10-30-10-25 0-118-46-154-76-91-76-136-142-175-254-13-38-16-119-16-554 0-358 3-520 12-545 40-125 106-219 195-278 127-84 116-83 646-83l467 0 0-42c0-46 11-87 45-163 54-121 169-220 306-264 46-14 232-14 278 0 165 53 284 175 340 350 19 61 14 204-10 273-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-3 6-28 10-56 10l-49 0 0 462c0 446-1 464-21 522-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-4 6-65 10-149 10-138 0-143 1-154 23-12 23-62 114-112 202-16 28-44 79-63 115-42 77-67 88-93 39z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(23.5 * {scale})" height="calc(40 * {scale})" viewBox="34 28 198 308"><path style="stroke:{secondaryColor};stroke-width:15;stroke-linecap:round;" d="M42 327l0 -291"/><path style="fill:{color};stroke:{secondaryColor};stroke-width:10;stroke-linejoin:round;" d="M49 50c70 30 104 28 178 2-21 42-21 74 0 116-72 25-101 25-178 0l0-118z"/><text x="130" y="165" style="font-size:100px;fill:#fff;text-anchor:middle">{text}</text></svg>',"flag-triangle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(35.33 * {scale})" viewBox="0 0 40.5 53"><g transform="translate(-31 -20)"><path fill="{secondaryColor}" d="M34.7,73.3V48.4l34.6-10.1c0.7-0.2,1.2-0.8,1.2-1.5s-0.4-1.4-1-1.7L33.7,20.5c-0.5-0.2-1.1-0.2-1.6,0.2 c-0.5,0.3-0.7,0.8-0.7,1.4v51.2H34.7z"/><polygon points="34.7,24.5 66,36.5 34.7,45 34.7,10" fill="{color}"/></g><text x="11" y="21" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(34 * {scale})" height="calc(34 * {scale})" viewBox="0 0 34 34"><g transform="translate(2 2)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17" y="22" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(38 * {scale})" height="calc(38 * {scale})" viewBox="0 0 38 38"><g transform="translate(4 4)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19" y="24" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',triangle:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(36 * {scale})" height="calc(36 * {scale})" viewBox="0 0 36 36"><g transform="translate(2 2)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="30" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><g transform="translate(4 4)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="32" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',hexagon:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(35 * {scale})" height="calc(40 * {scale})" viewBox="0 0 35 40"><g transform="translate(2 2)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="25" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(39 * {scale})" height="calc(44 * {scale})" viewBox="0 0 39 44"><g transform="translate(4 4)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="27" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1100 1100"><g transform="translate(50 50)"><path style="stroke:{secondaryColor};stroke-width:50;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="550" y="700" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1200 1200"><g transform="translate(100 100)"><path style="stroke:{secondaryColor};stroke-width:100;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="600" y="750" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="12,0 0,24 12,17 24,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="17" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="24,12 0,0 7,12 0,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="16.5" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(12.16 * {scale})" height="calc(30.1 * {scale})" viewBox="0 0 902 364"><g fill="{color}" transform="matrix(0,2.4,-2.4,0,897,-930)"><polygon points="902,222 233,222 233,364 0,182 233,0 233,141 902,141 902,222"/></g><text x="450" y="700" style="font-size:900px;fill:#000;text-anchor:middle">{text}</text></svg>',"arrow-up-thin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 12 25"><g transform="translate(-136.91823 -751.91998)"><path fill="{color}" d="m148.271 760.71c-1.641-.547-3.186-1.47-4.633-2.769l0 18.07-1.675 0 0-18.07c-1.447 1.299-2.986 2.222-4.616 2.769l0-1.231c2.325-1.596 4.006-3.812 5.043-6.65l.838 0c1.037 2.838 2.718 5.055 5.043 6.65l0 1.231z"/></g><text x="6" y="20" style="font-size:10px;fill:#000;text-anchor:middle">{text}</text></svg>',car:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(21.93 * {scale})" height="calc(40.9 * {scale})" viewBox="0 0 6580 12270"><g transform="translate(0 12270) rotate(-90)"><path fill="{secondaryColor}" d="M7045 6566c-42-13-105-44-105-51 0-2 23-105 50-228 28-123 50-230 50-236 0-8-241-11-907-11-855 0-1145 6-1513 30-85 6-189 13-230 15-41 3-133 10-205 15-286 21-430 32-705 50-953 63-1459 18-2335-205-304-77-746-209-799-238-131-72-221-408-285-1062-34-345-42-532-48-1130-16-1557 108-2532 336-2649 32-17 469-149 676-205 409-110 819-191 1205-238 116-14 224-18 540-18 395 1 494 5 1140 50 1124 79 1224 82 2496 78l641-3-53-237c-29-131-52-238-51-239 1-1 31-14 66-29 56-23 76-26 142-23 67 3 83 7 120 33 23 17 50 41 61 55 10 14 51 117 91 230l73 205 674 3 675 2 90-39c98-43 198-72 315-93 122-21 829-18 990 5 321 45 626 143 849 270 293 168 516 378 704 662 266 402 416 893 467 1527 15 174 8 882-9 998-6 41-18 127-27 190-69 502-253 969-523 1325-79 105-262 284-381 374-189 142-355 229-574 300-336 110-526 139-952 148-457 9-685-23-887-124l-47-24-678-6-678-6-64 179c-79 224-92 253-121 284-67 70-177 97-274 66zm-2752-5073c-23-2-64-2-90 0-26 2-7 3 42 3 50 0 71-1 48-3zm395 0c-21-2-55-2-75 0-21 2-4 4 37 4 41 0 58-2 38-4z"/><path fill="{color}" d="M7043 6498c-13-6-23-19-23-28 0-9 23-117 50-240 28-123 50-230 50-237 0-22-2126-13-2465 10-132 10-400 28-595 42-661 47-824 55-1160 62-435 7-656-8-1040-73-415-70-865-183-1447-365-168-53-272-556-325-1569-16-319-16-1311 0-1630 45-872 129-1366 257-1518 22-26 51-39 172-77 557-177 1122-310 1563-369 271-36 351-40 690-40 361 1 463 6 1165 54 1122 78 1288 83 2337 79 460-2 840-7 843-11 4-4-17-117-47-252l-55-245 39-16c76-30 180-8 224 47 10 13 54 124 98 246l79 222 709 0 709 0 47-24c74-37 219-83 322-101 122-22 606-32 802-16 374 29 658 102 933 238 124 62 271 155 361 230l61 51 6 100c19 278 103 497 247 643 88 89 173 136 278 152l70 11 41 131c116 369 159 673 168 1170 10 584-38 984-167 1397l-40 126-70 12c-193 33-348 175-441 405-56 139-89 302-89 445 0 43-3 47-58 91-290 235-644 384-1068 450-191 29-796 39-974 16-135-18-263-54-368-102l-75-35-701 0-701 0-79 223c-82 232-102 267-163 293-38 16-138 17-170 2zm-2023-820c332-15 1155-12 1835 6 308 8 563 12 566 8 4-4 10-21 13-38 7-30 6-31-92-77-518-244-1197-396-2112-474-295-25-1282-25-1579 0-231 20-473 46-479 51-6 7 49 110 93 171 160 226 416 335 855 365 142 10 539 5 900-12zm3304-263c525-111 899-887 934-1935 19-557-37-1023-172-1435-186-563-521-900-896-899-81 0-158 14-525 92-426 91-431 92-540 146-195 96-287 207-306 368-12 104-11 2985 1 3078 22 170 135 291 365 389 49 21 191 55 480 115 226 47 419 87 430 89 45 10 164 6 229-8zm-5570-485c112-43 197-156 216-291 12-83 13-2623 1-2706-23-158-125-273-270-304-44-9-100-1-542 75-272 47-514 91-539 98-266 68-487 424-594 958-56 280-70 548-40 800 56 484 207 878 414 1081 115 114 122 116 702 218 277 49 524 90 550 90 26 1 72-8 102-19zm2111-3440c1023-44 1884-213 2462-486l113-53-7-33c-3-18-8-35-10-37-2-3-236 1-521 7-993 24-1271 26-1708 11-541-18-1128-18-1249-1-377 56-588 181-734 437-32 55-41 79-32 84 12 8 246 32 491 51 356 28 815 36 1195 20z"/></g><text x="3250" y="8250" style="font-size:3000px;fill:#fff;text-anchor:middle">{text}</text></svg>',checker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 16 16"><pattern id="p" x="0" y="0" width="16" height="16" patternUnits="userSpaceOnUse"><rect fill="{color}" x="0" width="8" height="8" y="0"/><rect fill="{color}" x="8" width="8" height="8" y="8"/></pattern><rect x="0" y="0" width="16" height="16" fill="{secondaryColor}"/><rect x="0" y="0" width="16" height="16" fill="url(#p)"/></svg>',"checker-rotated":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 60 60"><rect width="60" height="60" fill="{secondaryColor}"/><rect width="42.42" height="42.42" transform="translate(30 0) rotate(45)" fill="{color}"/></svg>',"zig-zag":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120"/></svg>',"zig-zag-vertical":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 0 120 60 90 30 60 0 0 0 0 0 60 60 0 120 60 120 90 90 120 60 120 0"/></svg>',"circles-spaced":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',circles:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(7 * {scale})" height="calc(7 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="6" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',"diagonal-lines-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-lines-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-stripes-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"diagonal-stripes-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(14 * {scale})" height="calc(14 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(45 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}" transform="rotate(-45 3 3)"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-stripes":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"x-fill":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="45.3" height="45.3" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z"/></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(13 * {scale})" height="calc(13 * {scale})" viewBox="0 0 20 20"><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><g fill="{color}"><circle cx="3" cy="3" r="3"/><circle cx="13" cy="13" r="3"/></g></svg>'},ql=(Gl.getHighContrastMode=function(){return matchMedia("(-ms-high-contrast: white-on-black)").matches?"dark":matchMedia("(-ms-high-contrast: black-on-white)").matches?"light":matchMedia("(-ms-high-contrast: active)").matches?"dark":matchMedia("(inverted-colors: inverted)").matches?"invert":null},Gl);function Gl(){}var Zl,Hl,Kl=((window&&window.__extends||(Zl=function(t,e){return(Zl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Zl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Wl,Hl=k),Wl);function Wl(){var t=null!==Hl&&Hl.apply(this,arguments)||this;return t.copyrightMessage=void 0,t.copyrightContent=void 0,t.customAttribution=void 0,t.showFeedbackLink=!0,t.showLogo=!0,t}var Vl,Yl,Ql=((window&&window.__extends||(Vl=function(t,e){return(Vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Vl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Jl,Yl=nt),Jl.prototype.onAdd=function(t){return this.container=this.buildContainer(t,u.ControlStyle.auto),this.container.className="map-copyright",this.copyrightDiv=this.buildCopyrightDiv(),this.copyrightDiv.className="azure-map-copyright",this.container.appendChild(this.copyrightDiv),this.options.showLogo&&this.addRemoveLogo(!0),this.options.showFeedbackLink&&this.addRemoveFeedbackDiv(!0),this.container},Jl.prototype.onRemove=function(){Yl.prototype.onRemove.call(this),delete this.container},Jl.prototype.setOptions=function(t){var e=this,o=(new Kl).merge(this.options,t);o.copyrightMessage===this.options.copyrightMessage&&o.customAttribution===this.options.customAttribution||(this.copyrightDiv.innerText=this.textAttribution(o)),o.copyrightContent!==this.options.copyrightContent&&(this.options.copyrightContent&&(t=Array.from(this.copyrightDiv.children).find(function(t){return t===e.options.copyrightContent}),this.copyrightDiv.removeChild(t)),0<this.copyrightDiv.childNodes.length?this.copyrightDiv.insertBefore(o.copyrightContent,this.copyrightDiv.childNodes[0]):this.copyrightDiv.appendChild(o.copyrightContent),this.options.copyrightContent=o.copyrightContent),!o.showLogo&&this.logoAnchor?this.addRemoveLogo(!1):o.showLogo&&!this.logoAnchor&&this.addRemoveLogo(!0),!o.showFeedbackLink&&this.feedbackAnchor?this.addRemoveFeedbackDiv(!1):o.showFeedbackLink&&!this.feedbackAnchor&&this.addRemoveFeedbackDiv(!0),this.options=o},Jl.prototype.getDefaultAttributions=function(){var t=(new Date).getFullYear(),e=["©"+t+" TomTom"];return this.options.showLogo||e.push("©"+t+" Microsoft"),e},Jl.prototype.buildCopyrightDiv=function(){var t=document.createElement("div");return t.innerText=this.textAttribution(this.options)||"",t},Jl.prototype.buildFeedbackLink=function(){var t=document.createElement("a");return t.setAttribute("alt","Give Feedback"),t.setAttribute("aria-label","Give Feedback"),t.href="https://feedback.azuremaps.com",t.target="_blank",t.rel="noopener",t.className="azure-map-feedback",t},Jl.prototype.addRemoveFeedbackDiv=function(t){t?(this.feedbackAnchor=this.buildFeedbackLink(),this.tooltip=q("Give Feedback"),this.container.appendChild(this.feedbackAnchor),this.container.appendChild(this.tooltip),G(this.tooltip,this.feedbackAnchor)):(this.feedbackAnchor.remove(),this.tooltip.remove(),delete this.tooltip,delete this.feedbackAnchor)},Jl.prototype.addRemoveLogo=function(t){t?(this.logoAnchor=document.createElement("a"),this.logoAnchor.className="azure-map-logo",this.logoAnchor.href="https://microsoft.com",this.logoAnchor.setAttribute("aria-label","Microsoft"),this.container.appendChild(this.logoAnchor),this.logoTooltip=q("Visit microsoft.com"),this.container.appendChild(this.logoTooltip),G(this.logoTooltip,this.logoAnchor)):(this.logoAnchor.remove(),this.logoTooltip.remove(),delete this.logoAnchor)},Jl);function Jl(t){var e=Yl.call(this)||this;return e.textAttribution=function(t){return[e.options.copyrightMessage,e.options.customAttribution].filter(function(t){return t}).join("")},e.options=(new Kl).merge(t),e}var Xl=($l.throwOnError=function(t,e){function o(t){throw n.off("error",o),t.error}var n=t instanceof yd?t._getMap():t;n.on("error",o);e=e();return n.off("error",o),e},$l.tryCatch=function(t,e,o,n){try{return this.throwOnError(t,e)}catch(t){return o(t)}finally{"function"==typeof n&&n()}},$l.tryFinally=function(t,e,o){try{return this.throwOnError(t,e)}finally{o()}},$l);function $l(){}var tu=window&&window.__assign||function(){return(tu=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eu=(ou.prototype.request=function(t){var e={domain:this.map.getServiceOptions().domain,path:"search/address/reverse/json",queryParams:tu({"api-version":"1.0",language:t.style.language,limit:1,query:Jr(t.position[1])+","+Xr(t.position[0])},t.style.view&&{view:t.style.view})};return new D((null===(t=this.map.authentication)||void 0===t?void 0:t.signRequest(e))||e).get()},ou);function ou(t){this.map=t}var nu=(ru.prototype.cache=function(t,e,o,n){n=t+"_"+o[0]+"_"+o[1]+"_"+n;this._labelIdx[e.labelType]||(this._labelIdx[e.labelType]=[],this._labelCache[e.labelType]=[]),-1===this._labelIdx[e.labelType].indexOf(n)&&(this._labelCache[e.labelType].push({name:t,radius:e.radius,minZoom:e.minZoom,maxZoom:e.maxZoom||24,position:o}),this._labelIdx[e.labelType].push(n))},ru.prototype.getNearestLabel=function(t,e,o){var n=null,r=this._labelCache[t];if(r)for(var i,s=1/0,a=0,c=r.length;a<c;a++)o>=r[a].minZoom&&o<=r[a].maxZoom&&((i=Fr(r[a].position,e))<=r[a].radius&&i<=s&&(s=i,n=r[a]));return n},ru.prototype._preloadCache=function(t){if(!this._preloadedCache.has(t)){this._preloadedCache.add(t);var e={source:["Ocean label","Ocean name"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["Ocean","Ocean or sea"]},o=t,n=o.indexOf("-");switch(o=-1!==n?o.substr(0,n):o){case"fr":this.cache("Océan Pacifique",e,[-170,32],t),this.cache("Océan Pacifique",e,[-138,-27],t),this.cache("Océan Atlantique",e,[-40,32],t),this.cache("Océan Atlantique",e,[-17,-29],t);break;case"es":this.cache("Océan Pacifique",e,[-170,32],t),this.cache("Océan Pacifique",e,[-138,-27],t),this.cache("Océano Atlántico",e,[-40,32],t),this.cache("Océano Atlántico",e,[-17,-29],t);break;case"pt":this.cache("Oceano Pacífico",e,[-170,32],t),this.cache("Oceano Pacífico",e,[-138,-27],t),this.cache("Oceano Atlântico",e,[-40,32],t),this.cache("Oceano Atlântico",e,[-17,-29],t);break;case"ja":this.cache("太平洋",e,[-170,32],t),this.cache("太平洋",e,[-138,-27],t);break;case"en":this.cache("Pacific Ocean",e,[-170,32],t),this.cache("Pacific Ocean",e,[-138,-27],t),this.cache("Atlantic Ocean",e,[-40,32],t),this.cache("Atlantic Ocean",e,[-17,-29],t),this.cache("Indian Ocean",e,[77,-26],t)}}},ru);function ru(){this._labelCache={},this._labelIdx={},this._preloadedCache=new Set}var iu=window&&window.__awaiter||function(t,s,a,c){return new(a=a||Promise)(function(o,e){function n(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((c=c.apply(t,s||[])).next())})},su=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},au=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},cu=(lu.prototype.dispose=function(){this._disposed=!0;var t=this._map._getMap();t.off("move",this._onMove),t.off("moveend",this._onMoveEnd),t.off("styledata",this._onStyleData),t.off("rotate",this._onRotate);t=this._map.getCanvas();t.removeEventListener("mousedown",this._onPointerDown),t.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},lu.prototype._getEventPos=function(t){if("touches"in t){var e=t.touches[0],o=t.target.getBoundingClientRect();return[e.pageX-o.left,e.pageY-o.top]}return[t.offsetX,t.offsetY]},lu.prototype._checkThresholds=function(t,e){return this._checkZoomThreshold(t.zoom,e.zoom)||this._checkPitchThreshold(t.pitch,e.pitch)||this._checkLocThreshold(t.center,e.center)||this._checkHeadingThreshold(t.bearing,e.bearing)},lu.prototype._checkZoomThreshold=function(t,e){return this._round(t)!==this._round(e)},lu.prototype._checkPitchThreshold=function(t,e){return Math.abs(t-e)>=this._pitchThreshold},lu.prototype._checkLocThreshold=function(t,e){e=au(this._map.positionsToPixels([e,t]),2),t=e[0],e=e[1];return cr.getDistance(t,e)>=this._moveThreshold},lu.prototype._checkHeadingThreshold=function(t,e){t<0&&(t+=360),e<0&&(e+=360);e=Math.abs(t-e);return(e=180<e?360-e:e)>=this._headingThreshold},lu.prototype._getLocDesc=function(p,h,d){return iu(this,void 0,void 0,function(){var e,o,n,r,i,s,a,c,l,u=this;return su(this,function(t){switch(t.label){case 0:return"blank"===d?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise(function(t){return u._map._getMap().once("idle",t)})];case 1:t.sent(),t.label=2;case 2:for(e={},o=this._map.positionsToPixels([p.center])[0],Xl.tryCatch(this._map,function(){n=u._map._getMap().queryRenderedFeatures(o,{layers:u._polygonStyleLayer,filter:["==",["geometry-type"],"Polygon"]})},function(){}),r=null,n&&0<n.length&&(r=n[0]),i=null,s=0,a=this._lableConfig.length;s<a;s++)c=this._lableConfig[s],p.zoom>=c.minZoom?c.polygonSources?r&&-1!==c.polygonSources.indexOf(r.layer["source-layer"])?(i=c.labelType,this._getClosestLabel(c,p,h,e,!1)):this._getClosestLabel(c,p,h,e,!0):this._getClosestLabel(c,p,h,e,!1):this._getClosestLabel(c,p,h,e,!0);return 8<=p.zoom&&this._processRoads(e,p,h),this._labelCache.forEach(function(t){e[t]||(l=null,(l="water"!==t&&"majorPoi"!==t||t===i?lu._labelCache.getNearestLabel(t,p.center,p.zoom):l)&&(e[t]=l.name))}),[2,this._processLocInfo(p,i,e,!0,this._restFallback)];case 3:return[2,this._processLocInfo(p,null,null,!1,!1)]}})})},lu.prototype._getHeadingDesc=function(t){var e=t.bearing;switch(e<0&&(e+=360),e=this._round(e,this._headingThreshold)){case 0:case 360:return"north";case 45:return"north east";case 90:return"east";case 135:return"south east";case 180:return"south";case 225:return"south west";case 270:return"west";case 315:return"north west";default:return e+" degrees"}},lu.prototype._getClosestLabel=function(t,e,o,n,r){for(var i=t.radius,s=0,a=t.source.length;s<a;s++){var c={sourceLayer:t.source[s]},l=this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId,c),u=null,p=1/0,h=this._labelCache.has(t.labelType);if(!r||h)for(var d=0,f=l.length;d<f;d++){var y,m="Point"===l[d].geometry.type?l[d]:di(e.center,l[d].geometry);r||(y="Point"===l[d].geometry.type?Fr(e.center,m.geometry.coordinates):m.properties.distance)<p&&(p=y,u=l[d]),h&&lu._labelCache.cache(l[d].properties.name,t,m.geometry.coordinates,o)}r||(c=t.labelType+"Dis",u&&p<=i&&("number"!=typeof n[c]||p<=n[c])&&(n[t.labelType]=u.properties.name,n[c]=p))}},lu.prototype._processRoads=function(t,e,o,n){var r=this._map._getMap().queryRenderedFeatures(n,{filter:["==",["geometry-type"],"LineString"]});if(r){for(var i,s=void 0,a=void 0,c=void 0,l=void 0,u=0,p=r.length;u<p;u++)this._roadLayers.has(r[u].layer["source-layer"])&&r[u].properties.name&&""!==r[u].properties.name&&(i=di(e.center,r[u]),(!c||i.properties.distance<c.properties.distance)&&(s&&r[u].properties.name===s.properties.name?c=i:s&&r[u].properties.name===s.properties.name?(!l||i.properties.distance<l.properties.distance)&&(l=i,a=r[u]):(l=c,a=s,c=i,s=r[u])));s&&(t.country||(t.country=s.properties.country_code,t.countryDis=0,lu._labelCache.cache(t.country,{source:["Country name"],labelType:"country",radius:5e3,minZoom:0},c.geometry.coordinates,o)),t.state||(t.state=s.properties.country_subdivision,t.stateDis=0,lu._labelCache.cache(t.state,{source:["State name"],labelType:"state",radius:5e3,minZoom:4},c.geometry.coordinates,o)),15<=e.zoom&&(n=this._map.positionsToPixels([e.center,c.geometry.coordinates]),(cr.getDistance(n[0],n[1])<this._roadPixelRadius||c.properties.distance<this._minRoadDistance)&&(t.road=s.properties.name),a&&(o=this._map.positionsToPixels([l.geometry.coordinates]),(cr.getDistance(n[0],o[0])<this._minIntersectionPixelDistance||l.properties.distance<this._minRoadDistance)&&(t.secondRoad=a.properties.name,t.secondRoadDis=l.properties.distance))))}},lu.prototype._getActionDesc=function(t){if(this._lastCam){var e,o,n=[];return this._checkLocThreshold(t.center,this._lastCam.center)&&(o=["panned"],0===(e=Math.round(Hr(this._lastCam.center,t.center)))||360===e?o.push("north"):e<90?o.push("north east"):90===e?o.push("east"):e<180?o.push("south east"):180===e?o.push("south"):e<270?o.push("south west"):270===e?o.push("west"):e<360&&o.push("north west"),e=Fr(this._lastCam.center,t.center,dr.meters),o.push(1e3<e?Dr(e/1e3,2)+" kilometers":Dr(e,2)+" meters"),n.push(o.join(" "))),this._checkZoomThreshold(t.zoom,this._lastCam.zoom)&&((o=["zoomed"]).push(this._lastCam.zoom<t.zoom?"in":"out"),1<=(e=Math.abs(this._lastCam.zoom-t.zoom))&&(e=Math.ceil(e),o.push(1<e?e+" levels":e+" level")),this._getCanonicalZoom(this._lastCam.zoom)!==this._getCanonicalZoom(t.zoom)&&o.push("to "+this._getCanonicalZoom(t.zoom)+" level"),t.zoom>=t.maxZoom&&o.push("Zoom In button disabled, maximum zoom level reached"),e=Pi.getSouth(t.bounds)<=-xr&&Pi.getNorth(t.bounds)>=xr,(t.zoom<=t.minZoom||e)&&o.push("Zoom Out button disabled, minimum zoom level reached"),n.push(o.join(" "))),this._checkPitchThreshold(t.pitch,this._lastCam.pitch)&&(o=this._round(t.pitch,this._pitchThreshold),n.push("pitched to "+o+" degrees"),60!==t.pitch&&0!==t.pitch||(o=60===t.pitch?"maximum":"minimum",n.push("reached "+o+" of "+t.pitch+" degrees"))),this._checkHeadingThreshold(this._lastCam.bearing,t.bearing)&&n.push("rotated to "+this._getHeadingDesc(t)),n.join(" and ")||null}return null},lu.prototype._getCanonicalZoom=function(t){return(t=this._round(t))<2?"world":t<5?"country":t<11?"state province":t<15?"city":"street"},lu.prototype._processLocInfo=function(r,i,s,a,c){var l=this;return new Promise(function(e,t){var o=[];if(a){var n=[];if(s&&(i&&("water"===i&&s.water?n.push(s.water):"majorPoi"===i&&s.majorPoi&&n.push(s.majorPoi)),0===n.length&&(s.majorPoi&&8<=r.zoom?n.push(s.majorPoi):(s.poi&&14<=r.zoom?n.push(s.poi):s.road&&15<=r.zoom&&(s.secondRoad?n.push(s.road+" & "+s.secondRoad):n.push(s.road)),s.neighbourhood&&12<=r.zoom&&n.push(s.neighbourhood),s.city&&6<=r.zoom&&n.push(s.city)),s.state&&4<=r.zoom&&n.push(s.state),0===n.length?s.water?n.push(s.water):s.country&&n.push(s.country):1===n.length&&s.state&&4<=r.zoom&&s.country&&n.push(s.country))),0<n.length)o.push("<p>Location: ",n.join(", "),".</p>");else if(c&&"water"!==i)return void l._reverseGeocodeDescription(r).then(function(t){e(t)},function(){t("<p>Location: unknown</p>")})}l._returnDetailedDescriptions&&(o.push("<p>Zoom: ",Dr(r.zoom,2),".</p>"),o.push("<p>Latitude: ",Dr(r.center[1],5),".</p>"),o.push("<p>Longitude: ",Dr(r.center[0],5),".</p>")),e(o.join(""))})},lu.prototype._reverseGeocodeDescription=function(r){var i=this;return new Promise(function(o){var n=i._map.getStyle();i._reverseSearch.request({position:r.center,style:n}).then(function(t){var e={};t&&t.addresses&&0<t.addresses.length&&t.addresses[0].address&&((t=t.addresses[0].address).country&&(e.country=t.country,lu._labelCache.cache(e.country,{source:["Country name"],labelType:"country",radius:5e3,minZoom:0},r.center,n.language)),t.countrySubdivision&&(e.state=t.countrySubdivision,lu._labelCache.cache(e.state,{source:["State name"],labelType:"state",radius:5e3,minZoom:4},r.center,n.language)),t.municipality&&(e.city=t.municipality,lu._labelCache.cache(e.state,{source:["Small city"],labelType:"city",radius:1e3,minZoom:10},r.center,n.language)),t.streetNameAndNumber?e.road=t.streetNameAndNumber:t.street&&(e.road=t.street)),i._processLocInfo(r,null,e,!0,!1).then(function(t){o(t)})},function(t){i._processLocInfo(r,null,null,!0,!1).then(function(t){o(t)})}).catch(function(t){i._processLocInfo(r,null,null,!0,!1).then(function(t){o(t)})})})},lu.prototype._round=function(t,e){return void 0===e&&(e=1),Math.round(t/e)*e},lu);function lu(t,e){var i=this;this._disposed=!1,this._lastHeadingTime=0,this._actionQueue=[],this._pointerUpdateDelay=3e3,this._camUpdateDelay=1e3,this._headUpdateLimit=1e3,this._controlEventDelay=500,this._moveThreshold=25,this._headingThreshold=5,this._pitchThreshold=5,this._roadPixelRadius=120,this._minRoadDistance=25,this._minIntersectionPixelDistance=50,this._baseVectorTileSourceId="microsoft.base",this._lableConfig=[{source:["Ocean label","Ocean name"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["Ocean","Ocean or sea"]},{source:["Sea label"],labelType:"water",minZoom:3,radius:1e6,polygonSources:["Sea","Ocean or sea"]},{source:["Country name"],labelType:"country",minZoom:0,maxZoom:5,radius:3e5},{source:["State name","State name short"],labelType:"state",minZoom:4,maxZoom:7,radius:3e5},{source:["Capital city","Large city"],labelType:"city",minZoom:8,radius:4e4},{source:["Medium city"],labelType:"city",minZoom:8,radius:3e4},{source:["Small city"],labelType:"city",minZoom:8,radius:2e4},{source:["Island label"],labelType:"city",minZoom:8,radius:1e4},{source:["Town"],labelType:"city",minZoom:10,radius:1e4},{source:["Village"],labelType:"neighbourhood",minZoom:12,radius:6e3},{source:["Amusement area label"],labelType:"poi",minZoom:14,radius:2e3,polygonSources:["Amusement park"]},{source:["Hospital label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Hospital"]},{source:["Shopping centre label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Shopping"]},{source:["Stadium label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Stadium"]},{source:["University/School label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["University"]},{source:["Zoo label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Zoo"]},{source:["Airport Label","Airport name","Airport POI"],labelType:"majorPoi",minZoom:11,radius:3e3,polygonSources:["Airport","Runway"]},{source:["National park label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["National or state park","National park","Forest"]},{source:["Reservation label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["Reservation"]}],this._polygonStyleLayer=["National or state park","National park","Reservation","Airport","Runway","Stadium","University","Zoo","Shopping","Hospital","Amusement park","Ocean","Sea","Ocean or sea"],this._labelCache=new Set(["city","state","country","water","majorPoi"]),this._roadLayers=new Set(["Connecting road","Connecting road tunnel","International road","International road tunnel","Local road","Local road tunnel","Major local road","Major local road tunnel","Major road","Major road tunnel","Minor local road","Minor local road tunnel","Motorway","Motorway tunnel","Secondary road","Secondary road tunnel","Toll connecting road","Toll connecting road tunnel","Toll international road","Toll international road tunnel","Toll local road","Toll local road tunnel","Toll major local road","Toll major local road tunnel","Toll major road","Toll major road tunnel","Toll minor local road","Toll minor local road tunnel","Toll motorway","Toll motorway tunnel","Toll secondary road","Toll secondary road tunnel"]),this._returnDetailedDescriptions=!1,this._shortcutListener=function(r){return iu(i,void 0,void 0,function(){var e,o,n;return su(this,function(t){switch(t.label){case 0:return r.altKey&&r.ctrlKey&&68===r.keyCode?(this._returnDetailedDescriptions=!this._returnDetailedDescriptions,e=this._map.getCamera(),n=this._map.getStyle(),o=n.language.toLowerCase(),n=n.style.toLowerCase(),[4,this._getLocDesc(e,o,n)]):[3,2];case 1:n=t.sent(),this._descCallback(n),t.label=2;case 2:return[2]}})})},this._onRotate=function(){i._rotateTimeout||(Date.now()-i._lastHeadingTime>=i._headUpdateLimit?i._rotateTimeout=setTimeout(i._updateHeading,pt.RotationDuration+25):i._rotateTimeout=setTimeout(i._updateHeading,i._headUpdateLimit-(Date.now()-i._lastHeadingTime)))},this._onMove=function(){i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._controlTimeout&&(clearTimeout(i._controlTimeout),delete i._controlTimeout)},this._onMoveEnd=function(t){t.fromControl?i._controlTimeout=setTimeout(i._updateCam,i._controlEventDelay):i._updateCam()},this._onStyleData=function(){setTimeout(i._updateStyle)},this._onPointerDown=function(t){i._lastPointerPos=i._getEventPos(t),i._pointerTimeout=setTimeout(function(){return iu(i,void 0,void 0,function(){var e,o,n;return su(this,function(t){switch(t.label){case 0:return o=this._map.getStyle(),e=o.language.toLowerCase(),n=o.style.toLowerCase(),(o=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(o,e,n)];case 1:return n=t.sent(),this._descCallback(n),this._onPointerUp(),[2]}})})},i._pointerUpdateDelay),i._map.getCanvas().addEventListener("mousemove",i._onPointerMove),i._map.getCanvas().addEventListener("touchmove",i._onPointerMove),i._map.getCanvas().addEventListener("mouseup",i._onPointerUp),i._map.getCanvas().addEventListener("touchend",i._onPointerUp)},this._onPointerMove=function(t){var e=i._getEventPos(t),t=i._lastPointerPos[0]-e[0],e=i._lastPointerPos[1]-e[1];Math.sqrt(t*t+e*e)>i._moveThreshold&&i._onPointerUp()},this._onPointerUp=function(){clearTimeout(i._pointerTimeout),delete i._pointerTimeout,i._map.getCanvas().removeEventListener("mousemove",i._onPointerMove),i._map.getCanvas().removeEventListener("touchmove",i._onPointerMove),i._map.getCanvas().removeEventListener("mouseup",i._onPointerUp),i._map.getCanvas().removeEventListener("touchend",i._onPointerUp)},this._updateHeading=function(){var t,e=i._map.getCamera();i._lastHead&&!i._checkHeadingThreshold(e.bearing,i._lastHead)||(t=i._getHeadingDesc(e),i._lastHead=e.bearing,i._descCallback("<p>Map heading "+t+".</p>"),i._lastHeadingTime=Date.now()),delete i._rotateTimeout},this._updateStyle=function(){return iu(i,void 0,void 0,function(){var e,o,n,r;return su(this,function(t){switch(t.label){case 0:return(e=this._map.getCamera(),n=this._map.getStyle(),o=n.language.toLowerCase(),n=n.style.toLowerCase(),this._lastLang===o)?[3,2]:(lu._labelCache._preloadCache(o),[4,this._getLocDesc(e,o,n)]);case 1:return r=t.sent(),[3,4];case 2:return this._lastStyle===n||"blank"!==this._lastStyle?[3,4]:[4,this._getLocDesc(e,o,n)];case 3:r=t.sent(),t.label=4;case 4:return this._lastLang=o,this._lastStyle=n,r&&this._descCallback(r),[2]}})})},this._updateCam=function(t){void 0===t&&(t=!1);var o,n,e,r=i._map.getCamera();(!i._lastCam||0<i._actionQueue.length||i._checkThresholds(r,i._lastCam))&&(e=i._map.getStyle(),o=e.language.toLowerCase(),n=e.style.toLowerCase(),(e=i._getActionDesc(r))&&i._actionQueue.push(e),i._lastCam=r,i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._moveTimeout=setTimeout(function(){return iu(i,void 0,void 0,function(){var e;return su(this,function(t){switch(t.label){case 0:return clearTimeout(this._rotateTimeout),delete this._rotateTimeout,[4,this._getLocDesc(r,o,n)];case 1:return e=t.sent(),0<this._actionQueue.length?(this._descCallback("<p>Map "+this._actionQueue.join(", then ")+".</p>"+e),this._actionQueue=[]):this._descCallback(e),[2]}})})},t?0:i._camUpdateDelay))},this._map=t,this._restFallback=t.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=e,this._reverseSearch=new eu(t),lu._labelCache||(lu._labelCache=new nu),this._lastLang=this._map.getStyle().language.toLowerCase(),lu._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",function(){var t;i._disposed||(i._updateCam(!0),(t=i._map._getMap()).on("move",i._onMove),t.on("moveend",i._onMoveEnd),t.on("styledata",i._onStyleData),t.on("rotate",i._onRotate),(t=i._map.getCanvas()).addEventListener("mousedown",i._onPointerDown),t.addEventListener("touchstart",i._onPointerDown))}),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}var uu,pu,hu,du=function(t){var o=this;this.addToMap=function(){o.initializeMapLiveStateInfo(),o.initializeMapStyleInfo(),o.createMapKeyBindingInfo(),o.map.getMapContainer().setAttribute("role","application"),o.map.getMapContainer().setAttribute("aria-label","Map Application"),o.map.getCanvasContainer().setAttribute("aria-live","polite"),o.map.getCanvasContainer().setAttribute("aria-describedby","atlas-map-state atlas-map-style"),o.map.getCanvas().setAttribute("aria-label","Interactive Map"),o.map.getCanvas().setAttribute("aria-describedby","atlas-map-shortcuts"),o.map.getCanvas().setAttribute("alt","Interactive Map")},this.removeFromMap=function(){null!=o.mapViewDesc&&o.mapViewDesc.dispose(),delete o.mapViewDesc,null!=o.atlasMapKeyBindings&&o.map.getCanvasContainer().removeChild(o.atlasMapKeyBindings),delete o.atlasMapKeyBindings,null!=o.atlasMapLiveStateInfo&&o.map.getCanvasContainer().removeChild(o.atlasMapLiveStateInfo),delete o.atlasMapLiveStateInfo,null!=o.atlasMapStyleInfo&&o.map.getCanvasContainer().removeChild(o.atlasMapStyleInfo),delete o.atlasMapStyleInfo,o.map.getMapContainer().removeAttribute("role"),o.map.getMapContainer().removeAttribute("aria-label"),o.map.getCanvasContainer().removeAttribute("aria-live"),o.map.getCanvasContainer().removeAttribute("aria-describedby"),o.map.getCanvas().removeAttribute("aria-label"),o.map.getCanvas().removeAttribute("aria-describedby"),o.map.getCanvas().removeAttribute("alt"),o.map.events.remove("stylechanged",o.updateMapStyle)},this.createMapKeyBindingInfo=function(){o.atlasMapKeyBindings=document.createElement("div"),o.atlasMapKeyBindings.setAttribute("tabindex","-1"),o.atlasMapKeyBindings.setAttribute("aria-hidden","true"),o.atlasMapKeyBindings.id="atlas-map-shortcuts",o.atlasMapKeyBindings.classList.add("hidden-accessible-element"),o.atlasMapKeyBindings.innerHTML=["Map shortcuts:","Zoom out: hyphen.","Zoom in: plus.","Pan right 100 pixels: right arrow.","Pan left 100 pixels: left arrow.","Pan up 100 pixels: up arrow.","Pan down 100 pixels: down arrow.","Rotate 15 degrees clockwise: shift + right arrow.","Rotate 15 degrees counter clockwise: shift + left arrow.","Increase pitch 10 degrees: shift + up arrow.","Decrease pitch 10 degrees: shift + down arrow.","Jump focus to the map: Escape."].join("\n"),o.map.getCanvasContainer().appendChild(o.atlasMapKeyBindings);var t=[189,187,38,37,39,40],e=o.map._getMap()._canvas;null!=e&&e.addEventListener("keyup",function(e){t.find(function(t){return e.keyCode===t})&&(o.atlasMapKeyBindings.innerHTML="")})},this.initializeMapLiveStateInfo=function(){o.mapViewDesc=new cu(o.map,o.updateMapState),o.atlasMapLiveStateInfo=document.createElement("div"),o.atlasMapLiveStateInfo.setAttribute("tabindex","-1"),o.atlasMapLiveStateInfo.setAttribute("aria-hidden","true"),o.atlasMapLiveStateInfo.id="atlas-map-state",o.atlasMapLiveStateInfo.classList.add("hidden-accessible-element"),o.map.getCanvasContainer().appendChild(o.atlasMapLiveStateInfo)},this.initializeMapStyleInfo=function(){o.atlasMapStyleInfo=document.createElement("div"),o.atlasMapStyleInfo.setAttribute("tabindex","-1"),o.atlasMapStyleInfo.setAttribute("aria-hidden","true"),o.atlasMapStyleInfo.id="atlas-map-style",o.atlasMapStyleInfo.classList.add("hidden-accessible-element"),o.map.events.add("stylechanged",o.updateMapStyle),o.map.getCanvasContainer().appendChild(o.atlasMapStyleInfo)},this.updateMapStyle=function(){o.atlasMapStyleInfo.innerHTML="<p>Map style: "+o.map.getStyle().style+".</p>"},this.updateMapState=function(t){o.atlasMapLiveStateInfo.innerHTML=t},this.map=t},fu=function(t){var o=this;this.listenerEnabled=!1,this.lastFlowMode="none",this.addToMap=function(){if(!o.map._isReady())throw new Error("Traffic flow could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before enabling traffic flow.");o.listenerEnabled||(o.map.events.add("styledata",o.addToMap),o.listenerEnabled=!0);var t,e=o.map.getTraffic();"none"===e.flow||(t=o.map.layers.getLayerById("traffic_"+e.flow))&&(o.lastFlowMode=e.flow,t._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var t;o.map.getTraffic();"none"!=o.lastFlowMode&&((t=o.map.layers.getLayerById("traffic_"+o.lastFlowMode))&&t._updateLayoutProperty("visibility","none","visible"),o.lastFlowMode="none"),o.listenerEnabled&&(o.map.events.remove("styledata",o.addToMap),o.listenerEnabled=!1)},this.map=t},yu=((window&&window.__extends||(uu=function(t,e){return(uu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}uu(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(mu,pu=rr),mu.getIncidentTypeName=function(t,e){switch(t){case 0:return e.Unknown;case 1:return e.Accident;case 2:return e.Fog;case 3:return e.Danger;case 4:return e.Rain;case 5:return e.Ice;case 6:return e.Jam;case 7:return e.LaneClosed;case 8:return e.RoadClosed;case 9:return e.RoadWorks;case 10:return e.Wind;case 11:return e.Flood;case 12:return e.Detour;default:return e.Unknown}},mu.getIncidentTypeIconName=function(t){switch(t){case 0:return"unknown";case 1:return"accident";case 2:return"fog";case 3:return"danger";case 4:return"rain";case 5:return"ice";case 6:return"jam";case 7:return"lane-closed";case 8:return"road-closed";case 9:return"road-work";case 10:return"wind";case 11:return"flood";case 12:return"detour";default:return"unknown"}},mu.getSeverityColorName=function(t){switch(t){case 0:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red";default:return"grey"}},mu.getSeverityColorHexCode=function(t){switch(t){case 0:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E";default:return"#B5B6B7"}},mu);function mu(t,e,o){var n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=t.icon_category_12)&&void 0!==r?r:t.icon_category_11)&&void 0!==n?n:t.icon_category_10)&&void 0!==r?r:t.icon_category_9)&&void 0!==n?n:t.icon_category_8)&&void 0!==r?r:t.icon_category_7)&&void 0!==n?n:t.icon_category_6)&&void 0!==r?r:t.icon_category_5)&&void 0!==n?n:t.icon_category_4)&&void 0!==r?r:t.icon_category_3)&&void 0!==n?n:t.icon_category_2)&&void 0!==r?r:t.icon_category_1)&&void 0!==n?n:t.icon_category_0)&&void 0!==r?r:t.icon_category,r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=t.description_12)&&void 0!==r?r:t.description_11)&&void 0!==r?r:t.description_10)&&void 0!==r?r:t.description_9)&&void 0!==r?r:t.description_8)&&void 0!==r?r:t.description_7)&&void 0!==r?r:t.description_6)&&void 0!==r?r:t.description_5)&&void 0!==r?r:t.description_4)&&void 0!==r?r:t.description_3)&&void 0!==r?r:t.description_2)&&void 0!==r?r:t.description_1)&&void 0!==r?r:t.description_0)&&void 0!==r?r:t.description,t={icon:mu.getSeverityColorName(t.magnitude)+"-"+mu.getIncidentTypeIconName(n),incidentType:mu.getIncidentTypeName(n,o),description:r,delay:t.delay,color:mu.getSeverityColorHexCode(t.magnitude),id:t.id};return pu.call(this,e,t)||this}(b=hu=hu||{}).DELAY="delay",b.LENGTH="length",b.FROM="from",b.TO="to";var gu=(vu.build=function(t,e){void 0===e&&(e="en-US");var o=document.createElement("div");o.classList.add("incident-popup-title"),o.classList.add("font-segoeui-b"),o.innerText=t.properties.incidentType,o.setAttribute("aria-label","Incident Type "+t.properties.incidentType);var n=document.createElement("div");n.classList.add("incident-popup-subtitle"),n.classList.add("font-segoeui-b"),n.setAttribute("aria-label","Incident Description "+t.properties.description),n.innerText=t.properties.description;var r=document.createElement("div");r.classList.add("incident-popup-header"),r.style.backgroundColor=t.properties.color,r.appendChild(o),r.appendChild(n);var i,s,a,n=document.createElement("div");n.classList.add("incident-popup-body"),t.properties.delay&&(i=Math.floor(t.properties.delay/60)+" min",i=this.createInfoSection(i,hu.DELAY),n.appendChild(i)),t.properties.length&&(i=new Intl.NumberFormat([e,"en-US"],{maximumFractionDigits:2}),a=void 0,a="en-US"===e?(s=zr(t.properties.length,"meters","miles"),i.format(s)+" miles"):(s=zr(t.properties.length,"meters","kilometers"),i.format(s)+" km"),a=this.createInfoSection(a,hu.LENGTH),n.appendChild(a)),t.properties.from&&(a=this.createInfoSection(t.properties.from,hu.FROM),n.appendChild(a)),t.properties.to&&(c=this.createInfoSection(t.properties.to,hu.TO),n.appendChild(c));var c=document.createElement("div");return c.classList.add("incident-popup-content"),c.appendChild(r),c.appendChild(n),new Sc({content:c,position:t.geometry.coordinates})},vu.createInfoSection=function(t,e){var o=document.createElement("div");o.classList.add("incident-popup-info");var n=document.createElement("div");n.classList.add("icon"),n.classList.add(e);var r=document.createElement("span");return r.classList.add("message"),r.classList.add("font-segoeui"),r.setAttribute("aria-label","Incident "+e+" "+t),r.innerText=t,o.appendChild(n),o.appendChild(r),o},vu);function vu(){}var _u=window&&window.__awaiter||function(t,s,a,c){return new(a=a||Promise)(function(o,e){function n(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((c=c.apply(t,s||[])).next())})},wu=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},bu=(Su.prototype.getIncidentIconImageExpression=function(){return["concat",["let","magnitude",["get","magnitude"],["case",["==",["var","magnitude"],0],"grey",["==",["var","magnitude"],1],"yellow",["==",["var","magnitude"],2],"orange",["==",["var","magnitude"],3],"red",["==",["var","magnitude"],4],"grey","grey"]],"-",["let","category",["coalesce",["get","icon_category_12"],["get","icon_category_11"],["get","icon_category_10"],["get","icon_category_9"],["get","icon_category_8"],["get","icon_category_7"],["get","icon_category_6"],["get","icon_category_5"],["get","icon_category_4"],["get","icon_category_3"],["get","icon_category_2"],["get","icon_category_0"],["get","icon_category"],0],["case",["==",["var","category"],0],"unknown",["==",["var","category"],1],"accident",["==",["var","category"],2],"fog",["==",["var","category"],3],"danger",["==",["var","category"],4],"rain",["==",["var","category"],5],"ice",["==",["var","category"],6],"jam",["==",["var","category"],7],"lane-closed",["==",["var","category"],8],"road-closed",["==",["var","category"],9],"road-work",["==",["var","category"],10],"wind",["==",["var","category"],11],"flood",["==",["var","category"],12],"detour","unknown"]]]},Su);function Su(t){var r=this;this.incidentLayerName="incidents",this.incidentSourceName="mapcontrol_traffic_incident",this.addToMap=function(){r.map.sources.getById(r.incidentSourceName)||r.map.sources.add(r.vectorTileSource),r.map.layers.getLayerById(r.incidentLayerName)||r.map.layers.add(r.incidentLayer,"labels"),r.clickPopup=new Sc({position:[0,0],pixelOffset:[0,-18]}),r.map.addEventListener("mouseover",r.incidentLayerName,r.cursorToPointer),r.map.addEventListener("mouseleave",r.incidentLayerName,r.cursorToDefault),r.map.addEventListener("click",r.incidentLayerName,r.openIncidentPopup),r.map.events.addOnce("idle",r.setAccessiblePopups),r.map.events.add("moveend",r.setAccessiblePopups)},this.accessiblePopups=[],this.setAccessiblePopups=function(){return _u(r,void 0,void 0,function(){var e,i,s,a,c,l,u=this;return wu(this,function(t){switch(t.label){case 0:return this.accessiblePopups.forEach(function(t){return t.remove()}),this.accessiblePopups=[],e=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this.incidentLayer),[4,this.map._getLocalizedStrings()];case 1:return i=t.sent(),s=function(e,o){var t=e[o],n=t.geometry.coordinates,n=new ur(new mi(n[0],n[1])),n=new yu(t.properties,n,i),r=gu.build(n,u.incidentLanguage),n=r.getPopupContainer();return n.addEventListener("focusin",function(t){u.clickPopup.remove(),u.accessiblePopups.filter(function(t){return t!==r}).forEach(function(t){return t.remove()}),0<=o-1&&a(r,s(e,o-1)),o+1<e.length&&l(s(e,o+1)),2<=o&&o==e.length-1&&c(s(e,0)),0==o&&2<=e.length&&l(s(e,e.length-1))}),o==e.length-1&&n.addEventListener("focusout",function(t){null===t.relatedTarget&&r.close()}),u.accessiblePopups.push(r),r},a=function(t,e){e.open(u.map),e.close();e=e.getPopupContainer(),t=t.getPopupContainer();t.parentElement.insertBefore(e,t)},c=function(t){t.open(u.map),t.close();var e=t.getPopupContainer(),t=e.parentElement;t.insertBefore(e,t.firstElementChild)},l=function(t){t.open(u.map),t.close()},0<e.length&&l(s(e,0)),1<e.length&&l(s(e,e.length-1)),[2]}})})},this.removeFromMap=function(){var t;r.map.removeEventListener("mouseover",r.incidentLayerName,r.cursorToPointer),r.map.removeEventListener("mouseleave",r.incidentLayerName,r.cursorToDefault),r.map.removeEventListener("click",r.incidentLayerName,r.openIncidentPopup),r.map.events.remove("idle",r.setAccessiblePopups),r.map.events.remove("moveend",r.setAccessiblePopups),r.accessiblePopups.forEach(function(t){return t.remove()}),r.accessiblePopups=[],null!==(t=r.clickPopup)&&void 0!==t&&t.remove(),null!=r.map.layers.getLayerById(r.incidentLayerName)&&r.map.layers.remove(r.incidentLayerName),null!=r.map.sources.getById(r.incidentSourceName)&&r.map.sources.remove(r.incidentSourceName)},this.cursorToPointer=function(t){r.map.getCanvas().style.cursor="pointer"},this.cursorToDefault=function(t){r.map.getCanvas().style.cursor=""},this.openIncidentPopup=function(t){r.clickPopup.remove(),r.accessiblePopups.forEach(function(t){return t.close()});var o=t.position,n=t.features[0];r.map._getLocalizedStrings().then(function(t){var e=new ur(new mi(o[0],o[1])),t=new yu(n.properties,e,t);r.clickPopup=gu.build(t,r.incidentLanguage),r.clickPopup.open(r.map),r.clickPopup.getPopupContainer().addEventListener("focusout",function(t){null===t.relatedTarget&&r.clickPopup.close()})})},this.map=t,this.vectorTileSource=new _s(this.incidentSourceName,{maxZoom:22,tiles:["https://"+h+"/traffic/incident/tile/pbf?api-version=1.0&zoom={z}&x={x}&y={y}"]});t=this.getIncidentIconImageExpression();this.incidentLayer=new Ka(this.incidentSourceName,this.incidentLayerName,{sourceLayer:"Traffic incident POI",iconOptions:{ignorePlacement:!0,allowOverlap:!0,image:t,size:.75}})}var xu,Ou,Tu=((window&&window.__extends||(xu=function(t,e){return(xu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}xu(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Eu,Ou=k),Eu);function Eu(){var t=null!==Ou&&Ou.apply(this,arguments)||this;return t.interactive=!0,t.scrollZoomInteraction=!0,t.boxZoomInteraction=!0,t.dragRotateInteraction=!0,t.dragPanInteraction=!0,t.keyboardInteraction=!0,t.dblClickZoomInteraction=!0,t.touchInteraction=!0,t.touchRotate=!0,t.wheelZoomRate=1/450,t}var Cu=(Pu.prototype.enable=function(){this.map.getMapContainer().addEventListener("keydown",this._onKeyDown)},Pu.prototype.disable=function(){this.map.getMapContainer().removeEventListener("keydown",this._onKeyDown)},Pu);function Pu(t){var e=this;this._onKeyDown=function(t){27===t.keyCode&&e.map.getCanvas().focus()},this.map=t}var ku=(Au.prototype.enable=function(){this.map.getCanvasContainer().addEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().addEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().addEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().addEventListener("touchend",this._onTouchEnd)},Au.prototype.disable=function(){this.map.getCanvasContainer().removeEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().removeEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().removeEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().removeEventListener("touchend",this._onTouchEnd)},Au);function Au(t){var e=this;this._onGestureStart=function(t){e.hasTouch||(t.preventDefault(),e.initZoom=e.map.getCamera().zoom)},this._onGestureChange=function(t){e.hasTouch||(t.preventDefault(),e.map.setCamera({zoom:e.initZoom+t.scale-1}))},this._onTouchStart=function(t){e.hasTouch=!0},this._onTouchEnd=function(t){0===t.touches.length&&(e.hasTouch=!1)},this.map=t}var Iu=(Lu.prototype.addToMap=function(){this.added||(this.added=!0,this._setInteractions(this.options))},Lu.prototype.removeFromMap=function(){this.added&&(this.added=!1,this._setInteractions({interactive:!1}))},Lu.prototype.setOptions=function(t){this.options=(new Tu).merge(this.options,t),this.added&&this._setInteractions(this.options)},Lu.prototype.getOptions=function(){return Object.assign({},this.options)},Lu.prototype._setInteractions=function(t){var e;t.interactive?(t.boxZoomInteraction?this.map._getMap().boxZoom.enable():this.map._getMap().boxZoom.disable(),t.dblClickZoomInteraction?this.map._getMap().doubleClickZoom.enable():this.map._getMap().doubleClickZoom.disable(),t.dragPanInteraction?this.map._getMap().dragPan.enable():this.map._getMap().dragPan.disable(),t.dragRotateInteraction?this.map._getMap().dragRotate.enable():this.map._getMap().dragRotate.disable(),t.keyboardInteraction?(this.map._getMap().keyboard.enable(),this.focusShortcut.enable()):(this.map._getMap().keyboard.disable(),this.focusShortcut.disable()),t.scrollZoomInteraction?(this.map._getMap().scrollZoom.enable(),this.map._getMap().scrollZoom.setWheelZoomRate(t.wheelZoomRate)):this.map._getMap().scrollZoom.disable(),e=this.map._getMap().touchZoomRotate,t.touchInteraction?(e.enable(),t.touchRotate?e.enableRotation():e.disableRotation()):e.disable(),this.pinchZoom.enable()):(this.map._getMap().boxZoom.disable(),this.map._getMap().doubleClickZoom.disable(),this.map._getMap().dragPan.disable(),this.map._getMap().dragRotate.disable(),this.map._getMap().keyboard.disable(),this.focusShortcut.disable(),this.map._getMap().scrollZoom.disable(),this.map._getMap().touchZoomRotate.disable(),this.pinchZoom.disable())},Lu);function Lu(t,e){this.added=!1,this.map=t,this.focusShortcut=new Cu(t),this.pinchZoom=new ku(t),this.options=(new Tu).merge(e)}function Ru(t,e,o){var n={type:"Feature"};return 0!==(o=void 0===o?{}:o).id&&!o.id||(n.id=o.id),o.bbox&&(n.bbox=o.bbox),n.properties=e||{},n.geometry=t,n}function Nu(t){return"Feature"===t.type?t.geometry:t}var Mu=Rt(function(t,e){t.exports=function(){function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}function s(t,e,o){if(e)n(t.prototype,e);if(o)n(t,o);return t}var u=function(){function t(t,e){this.next=null;this.key=t;this.data=e;this.left=null;this.right=null}return t}();function e(t,e){return t>e?1:t<e?-1:0}function a(t,e,o){var n=new u(null,null);var r=n;var i=n;while(true){var s=o(t,e.key);if(s<0){if(e.left===null)break;if(o(t,e.left.key)<0){var a=e.left;e.left=a.right;a.right=e;e=a;if(e.left===null)break}i.left=e;i=e;e=e.left}else if(s>0){if(e.right===null)break;if(o(t,e.right.key)>0){var a=e.right;e.right=a.left;a.left=e;e=a;if(e.right===null)break}r.right=e;r=e;e=e.right}else break}r.right=e.left;i.left=e.right;e.left=n.right;e.right=n.left;return e}function c(t,e,o,n){var r=new u(t,e);if(o===null){r.left=r.right=null;return r}o=a(t,o,n);var i=n(t,o.key);if(i<0){r.left=o.left;r.right=o;o.left=null}else if(i>=0){r.right=o.right;r.left=o;o.right=null}return r}function p(t,e,o){var n=null;var r=null;if(e){e=a(t,e,o);var i=o(e.key,t);if(i===0){n=e.left;r=e.right}else if(i<0){r=e.right;e.right=null;n=e}else{n=e.left;e.left=null;r=e}}return{left:n,right:r}}function h(t,e,o){if(e===null)return t;if(t===null)return e;e=a(t.key,e,o);e.left=t;return e}function d(t,e,o,n,r){if(t){n(""+e+(o?"└── ":"├── ")+r(t)+"\n");var i=e+(o?" ":"│ ");if(t.left)d(t.left,i,false,n,r);if(t.right)d(t.right,i,true,n,r)}}var I=function(){function t(t){if(t===void 0)t=e;this._root=null;this._size=0;this._comparator=t}t.prototype.insert=function(t,e){this._size++;return this._root=c(t,e,this._root,this._comparator)};t.prototype.add=function(t,e){var o=new u(t,e);if(this._root===null){o.left=o.right=null;this._size++;this._root=o}var n=this._comparator;var r=a(t,this._root,n);var i=n(t,r.key);if(i===0)this._root=r;else{if(i<0){o.left=r.left;o.right=r;r.left=null}else if(i>0){o.right=r.right;o.left=r;r.right=null}this._size++;this._root=o}return this._root};t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)};t.prototype._remove=function(t,e,o){var n;if(e===null)return null;e=a(t,e,o);var r=o(t,e.key);if(r===0){if(e.left===null)n=e.right;else{n=a(t,e.left,o);n.right=e.right}this._size--;return n}return e};t.prototype.pop=function(){var t=this._root;if(t){while(t.left)t=t.left;this._root=a(t.key,this._root,this._comparator);this._root=this._remove(t.key,this._root,this._comparator);return{key:t.key,data:t.data}}return null};t.prototype.findStatic=function(t){var e=this._root;var o=this._comparator;while(e){var n=o(t,e.key);if(n===0)return e;else if(n<0)e=e.left;else e=e.right}return null};t.prototype.find=function(t){if(this._root){this._root=a(t,this._root,this._comparator);if(this._comparator(t,this._root.key)!==0)return null}return this._root};t.prototype.contains=function(t){var e=this._root;var o=this._comparator;while(e){var n=o(t,e.key);if(n===0)return true;else if(n<0)e=e.left;else e=e.right}return false};t.prototype.forEach=function(t,e){var o=this._root;var n=[];var r=false;while(!r)if(o!==null){n.push(o);o=o.left}else if(n.length!==0){o=n.pop();t.call(e,o);o=o.right}else r=true;return this};t.prototype.range=function(t,e,o,n){var r=[];var i=this._comparator;var s=this._root;var a;while(r.length!==0||s)if(s){r.push(s);s=s.left}else{s=r.pop();a=i(s.key,e);if(a>0)break;else if(i(s.key,t)>=0)if(o.call(n,s))return this;s=s.right}return this};t.prototype.keys=function(){var o=[];this.forEach(function(t){var e=t.key;return o.push(e)});return o};t.prototype.values=function(){var o=[];this.forEach(function(t){var e=t.data;return o.push(e)});return o};t.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};t.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};t.prototype.minNode=function(t){if(t===void 0)t=this._root;if(t)while(t.left)t=t.left;return t};t.prototype.maxNode=function(t){if(t===void 0)t=this._root;if(t)while(t.right)t=t.right;return t};t.prototype.at=function(t){var e=this._root;var o=false;var n=0;var r=[];while(!o)if(e){r.push(e);e=e.left}else if(r.length>0){e=r.pop();if(n===t)return e;n++;e=e.right}else o=true;return null};t.prototype.next=function(t){var e=this._root;var o=null;if(t.right){o=t.right;while(o.left)o=o.left;return o}var n=this._comparator;while(e){var r=n(t.key,e.key);if(r===0)break;else if(r<0){o=e;e=e.left}else e=e.right}return o};t.prototype.prev=function(t){var e=this._root;var o=null;if(t.left!==null){o=t.left;while(o.right)o=o.right;return o}var n=this._comparator;while(e){var r=n(t.key,e.key);if(r===0)break;else if(r<0)e=e.left;else{o=e;e=e.right}}return o};t.prototype.clear=function(){this._root=null;this._size=0;return this};t.prototype.toList=function(){return o(this._root)};t.prototype.load=function(t,e,o){if(e===void 0)e=[];if(o===void 0)o=false;var n=t.length;var r=this._comparator;if(o)v(t,e,0,n-1,r);if(this._root===null){this._root=f(t,e,0,n);this._size=n}else{var i=g(this.toList(),y(t,e),r);n=this._size+n;this._root=m({head:i},0,n)}return this};t.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(t.prototype,"size",{get:function t(){return this._size},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"root",{get:function t(){return this._root},enumerable:true,configurable:true});t.prototype.toString=function(t){if(t===void 0)t=function t(e){return String(e.key)};var e=[];d(this._root,"",true,function(t){return e.push(t)},t);return e.join("")};t.prototype.update=function(t,e,o){var n=this._comparator;var r=p(t,this._root,n),i=r.left,s=r.right;if(n(t,e)<0)s=c(e,o,s,n);else i=c(e,o,i,n);this._root=h(i,s,n)};t.prototype.split=function(t){return p(t,this._root,this._comparator)};return t}();function f(t,e,o,n){var r=n-o;if(r>0){var i=o+Math.floor(r/2);var s=t[i];var a=e[i];var c=new u(s,a);c.left=f(t,e,o,i);c.right=f(t,e,i+1,n);return c}return null}function y(t,e){var o=new u(null,null);var n=o;for(var r=0;r<t.length;r++)n=n.next=new u(t[r],e[r]);n.next=null;return o.next}function o(t){var e=t;var o=[];var n=false;var r=new u(null,null);var i=r;while(!n)if(e){o.push(e);e=e.left}else if(o.length>0){e=i=i.next=o.pop();e=e.right}else n=true;i.next=null;return r.next}function m(t,e,o){var n=o-e;if(n>0){var r=e+Math.floor(n/2);var i=m(t,e,r);var s=t.head;s.left=i;t.head=t.head.next;s.right=m(t,r+1,o);return s}return null}function g(t,e,o){var n=new u(null,null);var r=n;var i=t;var s=e;while(i!==null&&s!==null){if(o(i.key,s.key)<0){r.next=i;i=i.next}else{r.next=s;s=s.next}r=r.next}if(i!==null)r.next=i;else if(s!==null)r.next=s;return n.next}function v(t,e,o,n,r){if(o>=n)return;var i=t[o+n>>1];var s=o-1;var a=n+1;while(true){do{s++}while(r(t[s],i)<0);do{a--}while(r(t[a],i)>0);if(s>=a)break;var c=t[s];t[s]=t[a];t[a]=c;c=e[s];e[s]=e[a];e[a]=c}v(t,e,o,a,r);v(t,e,a+1,n,r)}var _=function t(e,o){return e.ll.x<=o.x&&o.x<=e.ur.x&&e.ll.y<=o.y&&o.y<=e.ur.y},L=function t(e,o){if(o.ur.x<e.ll.x||e.ur.x<o.ll.x||o.ur.y<e.ll.y||e.ur.y<o.ll.y)return null;var n=e.ll.x<o.ll.x?o.ll.x:e.ll.x;var r=e.ur.x<o.ur.x?e.ur.x:o.ur.x;var i=e.ll.y<o.ll.y?o.ll.y:e.ll.y;var s=e.ur.y<o.ur.y?e.ur.y:o.ur.y;return{ll:{x:n,y:i},ur:{x:r,y:s}}},r=Number.EPSILON;if(r===undefined)r=Math.pow(2,-52);var i=r*r,w=function t(e,o){if(-r<e&&e<r)if(-r<o&&o<r)return 0;var n=e-o;if(n*n<i*e*o)return 0;return e<o?-1:1},t=function(){function t(){l(this,t);this.reset()}s(t,[{key:"reset",value:function t(){this.xRounder=new b;this.yRounder=new b}},{key:"round",value:function t(e,o){return{x:this.xRounder.round(e),y:this.yRounder.round(o)}}}]);return t}(),b=function(){function t(){l(this,t);this.tree=new I;this.round(0)}s(t,[{key:"round",value:function t(e){var o=this.tree.add(e);var n=this.tree.prev(o);if(n!==null&&w(o.key,n.key)===0){this.tree.remove(e);return n.key}var r=this.tree.next(o);if(r!==null&&w(o.key,r.key)===0){this.tree.remove(e);return r.key}return e}}]);return t}(),R=new t,S=function t(e,o){return e.x*o.y-e.y*o.x},x=function t(e,o){return e.x*o.x+e.y*o.y},O=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};var s=S(r,i);return w(s,0)},T=function t(e){return Math.sqrt(x(e,e))},E=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};return S(i,r)/T(i)/T(r)},C=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};return x(i,r)/T(i)/T(r)},P=function t(e,o,n){if(o.y===0)return null;return{x:e.x+o.x/o.y*(n-e.y),y:n}},k=function t(e,o,n){if(o.x===0)return null;return{x:n,y:e.y+o.y/o.x*(n-e.x)}},A=function t(e,o,n,r){if(o.x===0)return k(n,r,e.x);if(r.x===0)return k(e,o,n.x);if(o.y===0)return P(n,r,e.y);if(r.y===0)return P(e,o,n.y);var i=S(o,r);if(i==0)return null;var s={x:n.x-e.x,y:n.y-e.y};var a=S(s,o)/i;var c=S(s,r)/i;var l=e.x+c*o.x,u=n.x+a*r.x;var p=e.y+c*o.y,h=n.y+a*r.y;var d=(l+u)/2;var f=(p+h)/2;return{x:d,y:f}},N=function(){s(r,null,[{key:"compare",value:function t(e,o){var n=r.comparePoints(e.point,o.point);if(n!==0)return n;if(e.point!==o.point)e.link(o);if(e.isLeft!==o.isLeft)return e.isLeft?1:-1;return j.compare(e.segment,o.segment)}},{key:"comparePoints",value:function t(e,o){if(e.x<o.x)return-1;if(e.x>o.x)return 1;if(e.y<o.y)return-1;if(e.y>o.y)return 1;return 0}}]);function r(t,e){l(this,r);if(t.events===undefined)t.events=[this];else t.events.push(this);this.point=t;this.isLeft=e}s(r,[{key:"link",value:function t(e){if(e.point===this.point)throw new Error("Tried to link already linked events");var o=e.point.events;for(var n=0,r=o.length;n<r;n++){var i=o[n];this.point.events.push(i);i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function t(){var e=this.point.events.length;for(var o=0;o<e;o++){var n=this.point.events[o];if(n.segment.consumedBy!==undefined)continue;for(var r=o+1;r<e;r++){var i=this.point.events[r];if(i.consumedBy!==undefined)continue;if(n.otherSE.point.events!==i.otherSE.point.events)continue;n.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function t(){var e=[];for(var o=0,n=this.point.events.length;o<n;o++){var r=this.point.events[o];if(r!==this&&!r.segment.ringOut&&r.segment.isInResult())e.push(r)}return e}},{key:"getLeftmostComparator",value:function t(n){var r=this;var c=new Map;var l=function t(e){var o=e.otherSE;c.set(e,{sine:E(r.point,n.point,o.point),cosine:C(r.point,n.point,o.point)})};return function(t,e){if(!c.has(t))l(t);if(!c.has(e))l(e);var o=c.get(t),n=o.sine,r=o.cosine;var i=c.get(e),s=i.sine,a=i.cosine;if(n>=0&&s>=0){if(r<a)return 1;if(r>a)return-1;return 0}if(n<0&&s<0){if(r<a)return-1;if(r>a)return 1;return 0}if(s<n)return-1;if(s>n)return 1;return 0}}}]);return r}(),M=0,j=function(){s(h,null,[{key:"compare",value:function t(e,o){var n=e.leftSE.point.x;var r=o.leftSE.point.x;var i=e.rightSE.point.x;var s=o.rightSE.point.x;if(s<n)return 1;if(i<r)return-1;var a=e.leftSE.point.y;var c=o.leftSE.point.y;var l=e.rightSE.point.y;var u=o.rightSE.point.y;if(n<r){if(c<a&&c<l)return 1;if(c>a&&c>l)return-1;var p=e.comparePoint(o.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=o.comparePoint(e.rightSE.point);if(h!==0)return h;return-1}if(n>r){if(a<c&&a<u)return-1;if(a>c&&a>u)return 1;var d=o.comparePoint(e.leftSE.point);if(d!==0)return d;var f=e.comparePoint(o.rightSE.point);if(f<0)return 1;if(f>0)return-1;return 1}if(a<c)return-1;if(a>c)return 1;if(i<s){var y=o.comparePoint(e.rightSE.point);if(y!==0)return y}if(i>s){var m=e.comparePoint(o.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(i!==s){var g=l-a;var v=i-n;var _=u-c;var w=s-r;if(g>v&&_<w)return 1;if(g<v&&_>w)return-1}if(i>s)return 1;if(i<s)return-1;if(l<u)return-1;if(l>u)return 1;if(e.id<o.id)return-1;if(e.id>o.id)return 1;return 0}}]);function h(t,e,o,n){l(this,h);this.id=++M;this.leftSE=t;t.segment=this;t.otherSE=e;this.rightSE=e;e.segment=this;e.otherSE=t;this.rings=o;this.windings=n}s(h,[{key:"replaceRightSE",value:function t(e){this.rightSE=e;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function t(){var e=this.leftSE.point.y;var o=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<o?e:o},ur:{x:this.rightSE.point.x,y:e>o?e:o}}}},{key:"vector",value:function t(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function t(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function t(e){if(this.isAnEndpoint(e))return 0;var o=this.leftSE.point;var n=this.rightSE.point;var r=this.vector();if(o.x===n.x){if(e.x===o.x)return 0;return e.x<o.x?1:-1}var i=(e.y-o.y)/r.y;var s=o.x+i*r.x;if(e.x===s)return 0;var a=(e.x-o.x)/r.x;var c=o.y+a*r.y;if(e.y===c)return 0;return e.y<c?-1:1}},{key:"getIntersection",value:function t(e){var o=this.bbox();var n=e.bbox();var r=L(o,n);if(r===null)return null;var i=this.leftSE.point;var s=this.rightSE.point;var a=e.leftSE.point;var c=e.rightSE.point;var l=_(o,a)&&this.comparePoint(a)===0;var u=_(n,i)&&e.comparePoint(i)===0;var p=_(o,c)&&this.comparePoint(c)===0;var h=_(n,s)&&e.comparePoint(s)===0;if(u&&l){if(h&&!p)return s;if(!h&&p)return c;return null}if(u){if(p)if(i.x===c.x&&i.y===c.y)return null;return i}if(l){if(h)if(s.x===a.x&&s.y===a.y)return null;return a}if(h&&p)return null;if(h)return s;if(p)return c;var d=A(i,this.vector(),a,e.vector());if(d===null)return null;if(!_(r,d))return null;return R.round(d.x,d.y)}},{key:"split",value:function t(e){var o=[];var n=e.events!==undefined;var r=new N(e,true);var i=new N(e,false);var s=this.rightSE;this.replaceRightSE(i);o.push(i);o.push(r);var a=new h(r,s,this.rings.slice(),this.windings.slice());if(N.comparePoints(a.leftSE.point,a.rightSE.point)>0)a.swapEvents();if(N.comparePoints(this.leftSE.point,this.rightSE.point)>0)this.swapEvents();if(n){r.checkForConsuming();i.checkForConsuming()}return o}},{key:"swapEvents",value:function t(){var e=this.rightSE;this.rightSE=this.leftSE;this.leftSE=e;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var o=0,n=this.windings.length;o<n;o++)this.windings[o]*=-1}},{key:"consume",value:function t(e){var o=this;var n=e;while(o.consumedBy)o=o.consumedBy;while(n.consumedBy)n=n.consumedBy;var r=h.compare(o,n);if(r===0)return;if(r>0){var i=o;o=n;n=i}if(o.prev===n){var s=o;o=n;n=s}for(var a=0,c=n.rings.length;a<c;a++){var l=n.rings[a];var u=n.windings[a];var p=o.rings.indexOf(l);if(p===-1){o.rings.push(l);o.windings.push(u)}else o.windings[p]+=u}n.rings=null;n.windings=null;n.consumedBy=o;n.leftSE.consumedBy=o.leftSE;n.rightSE.consumedBy=o.rightSE}},{key:"prevInResult",value:function t(){if(this._prevInResult!==undefined)return this._prevInResult;if(!this.prev)this._prevInResult=null;else if(this.prev.isInResult())this._prevInResult=this.prev;else this._prevInResult=this.prev.prevInResult();return this._prevInResult}},{key:"beforeState",value:function t(){if(this._beforeState!==undefined)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function t(){if(this._afterState!==undefined)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};var o=this._afterState.rings;var n=this._afterState.windings;var r=this._afterState.multiPolys;for(var i=0,s=this.rings.length;i<s;i++){var a=this.rings[i];var c=this.windings[i];var l=o.indexOf(a);if(l===-1){o.push(a);n.push(c)}else n[l]+=c}var u=[];var p=[];for(var h=0,d=o.length;h<d;h++){if(n[h]===0)continue;var f=o[h];var y=f.poly;if(p.indexOf(y)!==-1)continue;if(f.isExterior)u.push(y);else{if(p.indexOf(y)===-1)p.push(y);var m=u.indexOf(f.poly);if(m!==-1)u.splice(m,1)}}for(var g=0,v=u.length;g<v;g++){var _=u[g].multiPoly;if(r.indexOf(_)===-1)r.push(_)}return this._afterState}},{key:"isInResult",value:function t(){if(this.consumedBy)return false;if(this._isInResult!==undefined)return this._isInResult;var e=this.beforeState().multiPolys;var o=this.afterState().multiPolys;switch(W.type){case"union":{var n=e.length===0;var r=o.length===0;this._isInResult=n!==r;break}case"intersection":{var i;var s;if(e.length<o.length){i=e.length;s=o.length}else{i=o.length;s=e.length}this._isInResult=s===W.numMultiPolys&&i<s;break}case"xor":{var a=Math.abs(e.length-o.length);this._isInResult=a%2===1;break}case"difference":{var c=function t(e){return e.length===1&&e[0].isSubject};this._isInResult=c(e)!==c(o);break}default:throw new Error("Unrecognized operation type found ".concat(W.type))}return this._isInResult}}],[{key:"fromRing",value:function t(e,o,n){var r,i,s;var a=N.comparePoints(e,o);if(a<0){r=e;i=o;s=1}else if(a>0){r=o;i=e;s=-1}else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var c=new N(r,true);var l=new N(i,false);return new h(c,l,[n],[s])}}]);return h}(),D=function(){function c(t,e,o){l(this,c);if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=e;this.isExterior=o;this.segments=[];if(typeof t[0][0]!=="number"||typeof t[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=R.round(t[0][0],t[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};var r=n;for(var i=1,s=t.length;i<s;i++){if(typeof t[i][0]!=="number"||typeof t[i][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var a=R.round(t[i][0],t[i][1]);if(a.x===r.x&&a.y===r.y)continue;this.segments.push(j.fromRing(r,a,this));if(a.x<this.bbox.ll.x)this.bbox.ll.x=a.x;if(a.y<this.bbox.ll.y)this.bbox.ll.y=a.y;if(a.x>this.bbox.ur.x)this.bbox.ur.x=a.x;if(a.y>this.bbox.ur.y)this.bbox.ur.y=a.y;r=a}if(n.x!==r.x||n.y!==r.y)this.segments.push(j.fromRing(r,n,this))}s(c,[{key:"getSweepEvents",value:function t(){var e=[];for(var o=0,n=this.segments.length;o<n;o++){var r=this.segments[o];e.push(r.leftSE);e.push(r.rightSE)}return e}}]);return c}(),z=function(){function i(t,e){l(this,i);if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new D(t[0],this,true);this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}};this.interiorRings=[];for(var o=1,n=t.length;o<n;o++){var r=new D(t[o],this,false);if(r.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=r.bbox.ll.x;if(r.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=r.bbox.ll.y;if(r.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=r.bbox.ur.x;if(r.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=r.bbox.ur.y;this.interiorRings.push(r)}this.multiPoly=e}s(i,[{key:"getSweepEvents",value:function t(){var e=this.exteriorRing.getSweepEvents();for(var o=0,n=this.interiorRings.length;o<n;o++){var r=this.interiorRings[o].getSweepEvents();for(var i=0,s=r.length;i<s;i++)e.push(r[i])}return e}}]);return i}(),B=function(){function i(t,e){l(this,i);if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{if(typeof t[0][0][0]==="number")t=[t]}catch(t){}this.polys=[];this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=t.length;o<n;o++){var r=new z(t[o],this);if(r.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=r.bbox.ll.x;if(r.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=r.bbox.ll.y;if(r.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=r.bbox.ur.x;if(r.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=r.bbox.ur.y;this.polys.push(r)}this.isSubject=e}s(i,[{key:"getSweepEvents",value:function t(){var e=[];for(var o=0,n=this.polys.length;o<n;o++){var r=this.polys[o].getSweepEvents();for(var i=0,s=r.length;i<s;i++)e.push(r[i])}return e}}]);return i}(),F=function(){s(b,null,[{key:"factory",value:function t(e){var o=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(!i.isInResult()||i.ringOut)continue;var s=null;var a=i.leftSE;var c=i.rightSE;var l=[a];var u=a.point;var p=[];while(true){s=a;a=c;l.push(a);if(a.point===u)break;while(true){var h=a.getAvailableLinkedEvents();if(h.length===0){var d=l[0].point;var f=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(h.length===1){c=h[0].otherSE;break}var y=null;for(var m=0,g=p.length;m<g;m++)if(p[m].point===a.point){y=m;break}if(y!==null){var v=p.splice(y)[0];var _=l.splice(v.index);_.unshift(_[0].otherSE);o.push(new b(_.reverse()));continue}p.push({index:l.length,point:a.point});var w=a.getLeftmostComparator(s);c=h.sort(w)[0].otherSE;break}}o.push(new b(l))}return o}}]);function b(t){l(this,b);this.events=t;for(var e=0,o=t.length;e<o;e++)t[e].segment.ringOut=this;this.poly=null}s(b,[{key:"getGeom",value:function t(){var e=this.events[0].point;var o=[e];for(var n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point;var s=this.events[n+1].point;if(O(i,e,s)===0)continue;o.push(i);e=i}if(o.length===1)return null;var a=o[0];var c=o[1];if(O(a,e,c)===0)o.shift();o.push(o[0]);var l=this.isExteriorRing()?1:-1;var u=this.isExteriorRing()?0:o.length-1;var p=this.isExteriorRing()?o.length:-1;var h=[];for(var d=u;d!=p;d+=l)h.push([o[d].x,o[d].y]);return h}},{key:"isExteriorRing",value:function t(){if(this._isExteriorRing===undefined){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():true}return this._isExteriorRing}},{key:"enclosingRing",value:function t(){if(this._enclosingRing===undefined)this._enclosingRing=this._calcEnclosingRing();return this._enclosingRing}},{key:"_calcEnclosingRing",value:function t(){var e=this.events[0];for(var o=1,n=this.events.length;o<n;o++){var r=this.events[o];if(N.compare(e,r)>0)e=r}var i=e.segment.prevInResult();var s=i?i.prevInResult():null;while(true){if(!i)return null;if(!s)return i.ringOut;if(s.ringOut!==i.ringOut)if(s.ringOut.enclosingRing()!==i.ringOut)return i.ringOut;else return i.ringOut.enclosingRing();i=s.prevInResult();s=i?i.prevInResult():null}}}]);return b}(),U=function(){function e(t){l(this,e);this.exteriorRing=t;t.poly=this;this.interiorRings=[]}s(e,[{key:"addInterior",value:function t(e){this.interiorRings.push(e);e.poly=this}},{key:"getGeom",value:function t(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var o=0,n=this.interiorRings.length;o<n;o++){var r=this.interiorRings[o].getGeom();if(r===null)continue;e.push(r)}return e}}]);return e}(),q=function(){function e(t){l(this,e);this.rings=t;this.polys=this._composePolys(t)}s(e,[{key:"getGeom",value:function t(){var e=[];for(var o=0,n=this.polys.length;o<n;o++){var r=this.polys[o].getGeom();if(r===null)continue;e.push(r)}return e}},{key:"_composePolys",value:function t(e){var o=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.poly)continue;if(i.isExteriorRing())o.push(new U(i));else{var s=i.enclosingRing();if(!s.poly)o.push(new U(s));s.poly.addInterior(i)}}return o}}]);return e}(),G=function(){function o(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:j.compare;l(this,o);this.queue=t;this.tree=new I(e);this.segments=[]}s(o,[{key:"process",value:function t(e){var o=e.segment;var n=[];if(e.consumedBy){if(e.isLeft)this.queue.remove(e.otherSE);else this.tree.remove(o);return n}var r=e.isLeft?this.tree.insert(o):this.tree.find(o);if(!r)throw new Error("Unable to find segment #".concat(o.id," ")+"[".concat(o.leftSE.point.x,", ").concat(o.leftSE.point.y,"] -> ")+"[".concat(o.rightSE.point.x,", ").concat(o.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");var i=r;var s=r;var a=undefined;var c=undefined;while(a===undefined){i=this.tree.prev(i);if(i===null)a=null;else if(i.key.consumedBy===undefined)a=i.key}while(c===undefined){s=this.tree.next(s);if(s===null)c=null;else if(s.key.consumedBy===undefined)c=s.key}if(e.isLeft){var l=null;if(a){var u=a.getIntersection(o);if(u!==null){if(!o.isAnEndpoint(u))l=u;if(!a.isAnEndpoint(u)){var p=this._splitSafely(a,u);for(var h=0,d=p.length;h<d;h++)n.push(p[h])}}}var f=null;if(c){var y=c.getIntersection(o);if(y!==null){if(!o.isAnEndpoint(y))f=y;if(!c.isAnEndpoint(y)){var m=this._splitSafely(c,y);for(var g=0,v=m.length;g<v;g++)n.push(m[g])}}}if(l!==null||f!==null){var _=null;if(l===null)_=f;else if(f===null)_=l;else{var w=N.comparePoints(l,f);_=w<=0?l:f}this.queue.remove(o.rightSE);n.push(o.rightSE);var b=o.split(_);for(var S=0,x=b.length;S<x;S++)n.push(b[S])}if(n.length>0){this.tree.remove(o);n.push(e)}else{this.segments.push(o);o.prev=a}}else{if(a&&c){var O=a.getIntersection(c);if(O!==null){if(!a.isAnEndpoint(O)){var T=this._splitSafely(a,O);for(var E=0,C=T.length;E<C;E++)n.push(T[E])}if(!c.isAnEndpoint(O)){var P=this._splitSafely(c,O);for(var k=0,A=P.length;k<A;k++)n.push(P[k])}}}this.tree.remove(o)}return n}},{key:"_splitSafely",value:function t(e,o){this.tree.remove(e);var n=e.rightSE;this.queue.remove(n);var r=e.split(o);r.push(n);if(e.consumedBy===undefined)this.tree.insert(e);return r}}]);return o}(),Z=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,H=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,K,W=new(function(){function t(){l(this,t)}s(t,[{key:"run",value:function t(e,o,n){W.type=e;R.reset();var r=[new B(o,true)];for(var i=0,s=n.length;i<s;i++)r.push(new B(n[i],false));W.numMultiPolys=r.length;if(W.type==="difference"){var a=r[0];var c=1;while(c<r.length)if(L(r[c].bbox,a.bbox)!==null)c++;else r.splice(c,1)}if(W.type==="intersection")for(var l=0,u=r.length;l<u;l++){var p=r[l];for(var h=l+1,d=r.length;h<d;h++)if(L(p.bbox,r[h].bbox)===null)return[]}var f=new I(N.compare);for(var y=0,m=r.length;y<m;y++){var g=r[y].getSweepEvents();for(var v=0,_=g.length;v<_;v++){f.insert(g[v]);if(f.size>Z)throw new Error("Infinite loop when putting segment endpoints in a priority queue "+"(queue size too big). Please file a bug report.")}}var w=new G(f);var b=f.size;var S=f.pop();while(S){var x=S.key;if(f.size===b){var O=x.segment;throw new Error("Unable to pop() ".concat(x.isLeft?"left":"right"," SweepEvent ")+"[".concat(x.point.x,", ").concat(x.point.y,"] from segment #").concat(O.id," ")+"[".concat(O.leftSE.point.x,", ").concat(O.leftSE.point.y,"] -> ")+"[".concat(O.rightSE.point.x,", ").concat(O.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>Z)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(w.segments.length>H)throw new Error("Infinite loop when passing sweep line over endpoints "+"(too many sweep line segments). Please file a bug report.");var T=w.process(x);for(var E=0,C=T.length;E<C;E++){var P=T[E];if(P.consumedBy===undefined)f.insert(P)}b=f.size;S=f.pop()}R.reset();var k=F.factory(w.segments);var A=new q(k);return A.getGeom()}}]);return t}()),V,Y,Q,J,X;return{union:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("union",e,n)},intersection:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("intersection",e,n)},xor:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("xor",e,n)},difference:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("difference",e,n)}}}()});function ju(t,e,o){void 0===o&&(o={});var n,t=Nu(t),e=Nu(e),e=Mu.intersection(t.coordinates,e.coordinates);return 0===e.length?null:1===e.length?function(t,e,o){void 0===o&&(o={});for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}return Ru({type:"Polygon",coordinates:t},e,o)}(e[0],o.properties):(o=o.properties,Ru({type:"MultiPolygon",coordinates:e},o,n=void 0===n?{}:n))}var Du,b=window&&window.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(s=(i<3?r(s):3<i?r(e,o,s):r(e,o))||s);return 3<i&&s&&Object.defineProperty(e,o,s),s},zu=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Bu=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Fu=["DIV","SPAN","A"],Uu=["data-azure-maps-attribution-minzoom","data-azure-maps-attribution-maxzoom","data-azure-maps-attribution-geometry","data-azure-maps-attribution-tileset","data-azure-maps-attribution-order","data-azure-maps-attribution-dynamic"],qu=Bu(["href"],zu(Uu)),Gu=(Zu.prototype.equals=function(t){return this.stringRepresentation===t.stringRepresentation},Object.defineProperty(Zu.prototype,"stringRepresentation",{get:function(){return[void 0!==this.minZoom?"minzoom="+this.minZoom:"",void 0!==this.maxZoom?"maxzoom="+this.maxZoom:"",void 0!==this.geometry?this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry").value:"",void 0!==this.tilesetId?"tilesetId="+this.tilesetId:"",this.dynamic?"dynamic":""].filter(function(t){return 0<t.length}).join(";")},enumerable:!1,configurable:!0}),Zu.applicable=function(t){return Array.from(t.attributes).map(function(t){return Uu.includes(t.name)}).reduce(function(t,e){return t||e},!1)},Object.defineProperty(Zu.prototype,"minZoom",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-minzoom");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Zu.prototype,"maxZoom",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-maxzoom");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Zu.prototype,"geometry",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry");if(t&&t.value)try{return JSON.parse(t.value)}catch(t){return}},enumerable:!1,configurable:!0}),Object.defineProperty(Zu.prototype,"tilesetId",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-tileset");return t&&t.value?t.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Zu.prototype,"order",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-order");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Zu.prototype,"dynamic",{get:function(){return null!==this.element.attributes.getNamedItem("data-azure-maps-attribution-dynamic")},enumerable:!1,configurable:!0}),Object.defineProperty(Zu.prototype,"hidesElement",{get:function(){return"none"==this.element.style.display},enumerable:!1,configurable:!0}),Zu.prototype.forceHide=function(){this.element.style.display="none"},Zu.prototype.satisfied=function(t){var e=!this.minZoom||!t.zoom||t.zoom>=this.minZoom,o=!this.maxZoom||!t.zoom||t.zoom<=this.maxZoom,n=!0;return this.geometry&&t.bounds&&(n=null!==ju({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[Pi.getNorthWest(t.bounds),Pi.getNorthEast(t.bounds),Pi.getSouthEast(t.bounds),Pi.getSouthWest(t.bounds),Pi.getNorthWest(t.bounds)]]},properties:{}})),e&&o&&n},Zu.prototype.apply=function(e,t){var o=this;void 0===t&&(t=null);var n=this.satisfied(e.getCamera()),r=this.dynamic&&this.tilesetId,i=this.hidesElement,t=t&&["dragend","zoomend","pitchend"].includes(t.type);return n||i?n&&(i||r)&&(n&&i&&this.element.style.removeProperty("display"),r&&(t?e.events.addOnce("idle",function(t){return o.fetchAndApplyDynamicAttribution(e)}):this.fetchAndApplyDynamicAttribution(e))):this.element.style.display="none",n===i},Zu.prototype.fetchAndApplyDynamicAttribution=function(n){var e,o,t,r=this,i=n.getCamera();this.lastFetchState&&Pi.containsBoundingBox(this.lastFetchState.bounds,i.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(i.zoom)||(e=Qr(i.center,Pi.getSouthWest(i.bounds),Zu.viewportBufferExpansionRatio),t=((o=Qr(i.center,Pi.getNorthEast(i.bounds),Zu.viewportBufferExpansionRatio))[0]<e[0]?[[e[0],e[1],180,o[1]],[-180,e[1],o[0],o[1]]]:[[e[0],e[1],o[0],o[1]]]).map(function(t){var e=new URLSearchParams({"api-version":"2.1",tilesetId:r.tilesetId,zoom:void 0!==i.zoom?""+Math.floor(i.zoom):void 0,bounds:t.join(",")}),o="https://{{azMapsDomain}}/map/attribution",t={url:o,headers:{}};n._substituteDomainLanguageViewAndSignInRequest(o,t);e=t.url+(t.url.includes("?")?"&":"?")+e.toString();return n._sendRequest(e,"Attribution",t.headers).then(function(t){return t.json()})}),Promise.all(t).then(function(t){r.applyAttributionResponse(t),r.lastFetchState={bounds:new Pi([e[0],e[1],o[0],o[1]]),zoom:i.zoom}}).catch(function(t){return console.error(t)}))},Zu.prototype.applyAttributionResponse=function(t){var e,o,n=this,r=t.map(function(t){return t.copyrights||[]}).reduce(function(t,e){return Bu(Bu([],zu(t)),zu(e))},[]);0!=r.length&&(null!==(t=hc.parseWithFilter(r.join(""),function(t){return!0},function(t){return t},function(){return n.element.innerHTML="",n.element}))?(t="string"==typeof t?((r=document.createElement("span")).innerHTML=t,r):t,o=t===this.element?(e=document.createElement("span"),Array.from(this.element.childNodes).forEach(function(t){return e.appendChild(t)}),e):t,Array.from(this.element.attributes).filter(function(t){return Uu.includes(t.name)}).forEach(function(t){return o.attributes.setNamedItem(t.cloneNode())}),o.style.display=this.element.style.display,t=this.element.parentElement,this.element.remove(),t.append(o),this.element=o,this.attributionChangeCallback(this)):console.warn("Dynamic attribution is empty after filtering"))},Zu.viewportBufferExpansionRatio=2,b([(Du=1e3,function(t,e,o){var n=o.value,r=new Map;return o.value=function(){var t=this,e=arguments;r.get(t)||!1||(n.apply(t,e),r.set(t,!0),setTimeout(function(){return r.delete(t)},Du))},o})],Zu.prototype,"fetchAndApplyDynamicAttribution",null),Zu);function Zu(t,e){var o=this;this.lastFetchState={bounds:null,zoom:null},this.getElement=function(){return o.element},this.element=t,this.attributionChangeCallback=e}var Hu=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Ku=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Wu=[/all rights reserved/gi],Vu=(Yu.prototype.addToMap=function(){this.map.events.add("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.add("dragend",this.applyRules),this.map.events.add("zoomend",this.applyRules),this.map.events.add("pitchend",this.applyRules)},Yu.prototype.removeFromMap=function(){this.map.events.remove("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.remove("dragend",this.applyRules),this.map.events.remove("zoomend",this.applyRules),this.map.events.remove("pitchend",this.applyRules)},Yu.prototype.getDefaultAttribution=function(){return this.copyrightControl.getDefaultAttributions().map(function(t){return e=t,(t=document.createElement("a")).textContent=e,t;var e})},Yu);function Yu(t,e,o){var n,a=this;this.rules=[],this.virtualContext=((n=document.createElement("span")).className="azure-map-copyright-context",n),this.renderContext=this.virtualContext.cloneNode(!1),this.addAttributionFromSource=function(t){},this.removeAttributionFromSource=function(t){},this.getMapStyleVisibleSources=function(){var e=a.map._getMap(),o=e.getStyle();return Object.entries(o.sources).filter(function(t){var e=Hu(t,1)[0];return o.layers.filter(function(t){return t&&t.source==e}).reduce(function(t,e){return!(e.layout&&"none"===e.layout.visibility||e.paint&&0===e.paint["icon-opacity"]&&0===e.paint["text-opacity"])||t},!1)}).map(function(t){t=Hu(t,1)[0];return e.getSource(t)})},this.loadAttributionOnceSourcesLoaded=function(){var t=a.getMapStyleVisibleSources();Promise.all(t.map(function(r){return new Promise(function(o,n){"tiles"in r?o(r):(r.load(),r.on("data",function t(e){"metadata"==e.sourceDataType&&(r.off("data",t),o(r))}),r.on("error",function t(e){r.off("error",t),n(e)}))}).then(function(t){return{status:"fulfilled",value:t}}).catch(function(t){return{status:"rejected",reason:t}})})).then(function(t){a.reloadAttribution()})},this.reloadAttribution=function(){var t=a.getMapStyleVisibleSources(),n=new Set,r={},e=Object.values(t).filter(function(t){return"attribution"in t&&t.attribution&&"tiles"in t&&0<t.tiles.length}).map(function(t){return t}).map(function(t){t=t.attribution;return hc.parseWithFilter(t,function(t){return Fu.includes(t.tagName)&&Array.from(t.attributes).map(function(t){return qu.includes(t.name)}).reduce(function(t,e){return t&&e},!0)},function(t){var e,o=null;return t instanceof HTMLElement&&Gu.applicable(t)&&(o=new Gu(t,function(){return a.renderAttribution()}),n.add(o),void 0!==o.order&&(t.style.order=""+o.order)),o&&t instanceof HTMLElement&&((!((e=o.stringRepresentation)in r)||void 0!==o.order&&void 0!==r[e].order&&o.order<r[e].order||void 0!==o.order&&void 0===r[e].order)&&(r[e]=o)),t},function(){return document.createElement("span")})}),o=new Set(Object.values(r)),t=new Set(Ku([],Hu(n)).filter(function(t){return!o.has(t)})),i=new Set(Ku([],Hu(t)).map(function(t){return t.getElement()}));Ku([],Hu(i)).filter(function(t){return null!==t.parentElement}).forEach(function(t){return t.parentElement.removeChild(t)}),a.rules=Object.values(r);var e=e.filter(function(t){return"string"==typeof t||!i.has(t)}).map(function(t){return"string"==typeof t?new Text(t):t}),s=document.createElement("span");0<e.length?e.forEach(function(t){return s.appendChild(t)}):a.getDefaultAttribution().forEach(function(t){return s.appendChild(t)}),a.virtualContext=s,a.copyrightControl.setOptions({copyrightContent:a.renderContext}),a.applyRules(),a.renderAttribution()},this.applyRules=function(o){void 0===o&&(o=null),a.rules.reduce(function(t,e){e=e.apply(a.map,o);return t||e},!1)&&a.renderAttribution()},this.renderAttribution=function(){var e=function(t){return Array.from("none"!=t.style.display?t.children:[]).map(function(t){return e(t)}).reduce(function(t,e){return Ku(Ku([],Hu(t)),Hu(e))},Array.from("none"!=t.style.display?t.childNodes:[]).filter(function(t){return t.nodeType==t.TEXT_NODE}))},t=a.virtualContext.cloneNode(!0),o=e(t);o.forEach(function(t){return t.textContent=Ku([],Hu(Wu)).reduce(function(t,e){return t.replace(e,"").trim()},t.textContent)}),o.reduce(function(t,e){return t.has(e.textContent)?(e.textContent="",e.parentElement&&e.parentElement.removeChild(e)):t.add(e.textContent),t},new Set),a.renderContext.innerHTML="",Array.from(t.childNodes).forEach(function(t){return a.renderContext.appendChild(t)})},this.map=t,this.copyrightControl=e,this.options=o}var Qu=Rt(function(t){var e=(e=function(t){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},e.prototype._singletonInstance)return e.prototype._singletonInstance;if((e.prototype._singletonInstance=this).instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,t.displayCall&&"function"!=typeof t.displayCall)throw new Error("displayCall is not a function");if(!t.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(t),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(t){}}),e.prototype.login=function(){var t,e;this._loginInProgress?this.info("Login in progress"):(this._loginInProgress=!0,t=this._guid(),this.config.state=t,this._idTokenNonce=this._guid(),(e=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST))&&""!==e?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):e=window.location.href,this.verbose("Expected state: "+t+" startPage:"+e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,t,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),e=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce),this.config.displayCall?this.config.displayCall(e):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(t),this.registerCallback(t,this.config.clientId,this.callback),this._loginPopup(e)):this.promptUser(e))},e.prototype._openPopup=function(t,e,o,n){try{var r=window.screenLeft||window.screenX,i=window.screenTop||window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,c=s/2-o/2+r,l=a/2-n/2+i,u=window.open(t,e,"width="+o+", height="+n+", top="+l+", left="+c);return u.focus&&u.focus(),u}catch(t){return this.warn("Error opening popup, "+t.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},e.prototype._handlePopupError=function(t,e,o,n,r){this.warn(n),this._saveItem(this.CONSTANTS.STORAGE.ERROR,o),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,n),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,r),e&&this._activeRenewals[e]&&(this._activeRenewals[e]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,t&&t(n,null,o)},e.prototype._loginPopup=function(t,n,e){var r,i,s,a=this._openPopup(t,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),c=e||this.callback;null!=a?(this._openedWindows.push(a),r=-1!=this.config.redirectUri.indexOf("#")?this.config.redirectUri.split("#")[0]:this.config.redirectUri,i=this,s=window.setInterval(function(){if(!a||a.closed||void 0===a.closed){var t="Popup Window closed",e="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return i.isAngular&&i._broadcast("adal:popUpClosed",e+i.CONSTANTS.RESOURCE_DELIMETER+t),i._handlePopupError(c,n,t,e,e),void window.clearInterval(s)}try{var o=a.location;if(-1!=encodeURI(o.href).indexOf(encodeURI(r)))return i.isAngular?i._broadcast("adal:popUpHashChanged",o.hash):i.handleWindowCallback(o.hash),window.clearInterval(s),i._loginInProgress=!1,i._acquireTokenInProgress=!1,i.info("Closing popup window"),i._openedWindows=[],void a.close()}catch(t){}},1)):this._handlePopupError(c,n,"Error opening popup",e="Popup Window is null. This can happen if you are using IE",e)},e.prototype._broadcast=function(t,e){function o(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),o}"function"!=typeof window.CustomEvent&&(o.prototype=window.Event.prototype,window.CustomEvent=o);e=new CustomEvent(t,{detail:e});window.dispatchEvent(e)},e.prototype.loginInProgress=function(){return this._loginInProgress},e.prototype._hasResource=function(t){var e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return e&&!this._isEmpty(e)&&-1<e.indexOf(t+this.CONSTANTS.RESOURCE_DELIMETER)},e.prototype.getCachedToken=function(t){if(!this._hasResource(t))return null;var e=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t),o=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t),n=this.config.expireOffsetSeconds||300;return o&&o>this._now()+n?e:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,0),null)},e.prototype.getCachedUser=function(){if(this._user)return this._user;var t=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(t),this._user},e.prototype.registerCallback=function(i,s,t){this._activeRenewals[s]=i,this._callBacksMappedToRenewStates[i]||(this._callBacksMappedToRenewStates[i]=[]);var a=this;this._callBacksMappedToRenewStates[i].push(t),this._callBackMappedToRenewStates[i]||(this._callBackMappedToRenewStates[i]=function(t,e,o,n){a._activeRenewals[s]=null;for(var r=0;r<a._callBacksMappedToRenewStates[i].length;++r)try{a._callBacksMappedToRenewStates[i][r](t,e,o,n)}catch(o){a.warn(o)}a._callBacksMappedToRenewStates[i]=null,a._callBackMappedToRenewStates[i]=null})},e.prototype._renewToken=function(t,e,o){this.info("renewToken is called for resource:"+t);var n=this._addAdalFrame("adalRenewFrame"+t),r=this._guid()+"|"+t;this.config.state=r,this._renewStates.push(r),this.verbose("Renew token Expected state: "+r);var i=this._urlRemoveQueryStringParameter(this._getNavigateUrl(o=o||"token",t),"prompt");o===this.RESPONSE_TYPE.ID_TOKEN_TOKEN&&(this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),i+="&nonce="+encodeURIComponent(this._idTokenNonce)),i=this._addHintParameters(i+="&prompt=none"),this.registerCallback(r,t,e),this.verbosePii("Navigate to:"+i),n.src="about:blank",this._loadFrameTimeout(i,"adalRenewFrame"+t,t)},e.prototype._renewIdToken=function(t,e){this.info("renewIdToken is called");var o=this._addAdalFrame("adalIdTokenFrame"),n=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=n,this._renewStates.push(n),this.verbose("Renew Idtoken Expected state: "+n);var r=null==e?null:this.config.clientId,e=e||"id_token",r=this._urlRemoveQueryStringParameter(this._getNavigateUrl(e,r),"prompt"),r=this._addHintParameters(r+="&prompt=none");r+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(n,this.config.clientId,t),this.verbosePii("Navigate to:"+r),o.src="about:blank",this._loadFrameTimeout(r,"adalIdTokenFrame",this.config.clientId)},e.prototype._urlContainsQueryStringParameter=function(t,e){return new RegExp("[\\?&]"+t+"=").test(e)},e.prototype._urlRemoveQueryStringParameter=function(t,e){var o=new RegExp("(\\&"+e+"=)[^&]+");return t=t.replace(o,""),o=new RegExp("("+e+"=)[^&]+&"),t=t.replace(o,""),o=new RegExp("("+e+"=)[^&]+"),t=t.replace(o,"")},e.prototype._loadFrameTimeout=function(t,e,o){this.verbose("Set loading state to pending for: "+o),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+o,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(t,e);var n=this;setTimeout(function(){var t;n._getItem(n.CONSTANTS.STORAGE.RENEW_STATUS+o)===n.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS&&(n.verbose("Loading frame has timed out after: "+n.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+o),(t=n._activeRenewals[o])&&n._callBackMappedToRenewStates[t]&&n._callBackMappedToRenewStates[t]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),n._saveItem(n.CONSTANTS.STORAGE.RENEW_STATUS+o,n.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED))},n.CONSTANTS.LOADFRAME_TIMEOUT)},e.prototype._loadFrame=function(e,t){var o=this;o.info("LoadFrame: "+t);var n=t;setTimeout(function(){var t=o._addAdalFrame(n);""!==t.src&&"about:blank"!==t.src||(t.src=e,o._loadFrame(e,n))},500)},e.prototype.acquireToken=function(t,e){if(this._isEmpty(t))return this.warn("resource is required"),void e("resource is required",null,"resource is required");var o=this.getCachedToken(t);return o?(this.info("Token is already in cache for resource:"+t),void e(null,o,null)):this._user||this.config.extraQueryParameter&&-1!==this.config.extraQueryParameter.indexOf("login_hint")?void(this._activeRenewals[t]?this.registerCallback(this._activeRenewals[t],t,e):(this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,t===this.config.clientId?this._user?(this.verbose("renewing idtoken"),this._renewIdToken(e)):(this.verbose("renewing idtoken and access_token"),this._renewIdToken(e,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)):this._user?(this.verbose("renewing access_token"),this._renewToken(t,e)):(this.verbose("renewing idtoken and access_token"),this._renewToken(t,e,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)))):(this.warn("User login is required"),void e("User login is required",null,"login required"))},e.prototype.acquireTokenPopup=function(t,e,o,n){if(this._isEmpty(t))return this.warn("resource is required"),void n("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+t;this.config.state=r,this._renewStates.push(r),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+r);var i=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",t),"prompt");if(i+="&prompt=select_account",e&&(i+=e),o&&-1===i.indexOf("&claims"))i+="&claims="+encodeURIComponent(o);else if(o&&-1!==i.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");i=this._addHintParameters(i),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+t),this.registerCallback(r,t,n),this._loginPopup(i,t,n)},e.prototype.acquireTokenRedirect=function(t,e,o){if(this._isEmpty(t))return this.warn("resource is required"),void n("resource is required",null,"resource is required");var n=this.callback;if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+t;this.config.state=r,this.verbose("Renew token Expected state: "+r);n=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",t),"prompt");if(n+="&prompt=select_account",e&&(n+=e),o&&-1===n.indexOf("&claims"))n+="&claims="+encodeURIComponent(o);else if(o&&-1!==n.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");n=this._addHintParameters(n),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,window.location.href),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,r,!0),this.promptUser(n)},e.prototype.promptUser=function(t){t?(this.infoPii("Navigate to:"+t),window.location.replace(t)):this.info("Navigate url is empty")},e.prototype.clearCache=function(){this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._renewStates=[],this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"");var t=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);if(!this._isEmpty(t))for(var t=t.split(this.CONSTANTS.RESOURCE_DELIMETER),e=0;e<t.length&&""!==t[e];e++)this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t[e],""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t[e],0);this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,"")},e.prototype.clearCacheForResource=function(t){this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._hasResource(t)&&(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,0))},e.prototype.logOut=function(){var t,e;this.clearCache(),this._user=null,e=this.config.logOutUri||(t="common",e="",this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(e="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),this.instance+t+"/oauth2/logout?"+e),this.infoPii("Logout navigate to: "+e),this.promptUser(e)},e.prototype._isEmpty=function(t){return void 0===t||!t||0===t.length},e.prototype.getUser=function(t){if("function"!=typeof t)throw new Error("callback is not a function");var e;this._user?t(null,this._user):(e=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN),this._isEmpty(e)?(this.warn("User information is not available"),t("User information is not available",null)):(this.info("User exists in cache: "),this._user=this._createUser(e),t(null,this._user)))},e.prototype._addHintParameters=function(t){var e;return this._user&&this._user.profile&&(this._user.profile.sid&&-1!==t.indexOf("&prompt=none")?this._urlContainsQueryStringParameter("sid",t)||(t+="&sid="+encodeURIComponent(this._user.profile.sid)):this._user.profile.upn&&(this._urlContainsQueryStringParameter("login_hint",t)||(t+="&login_hint="+encodeURIComponent(this._user.profile.upn)),!this._urlContainsQueryStringParameter("domain_hint",t)&&-1<this._user.profile.upn.indexOf("@")&&(e=this._user.profile.upn.split("@"),t+="&domain_hint="+encodeURIComponent(e[e.length-1])))),t},e.prototype._createUser=function(t){var e=null,t=this._extractIdToken(t);return t&&t.hasOwnProperty("aud")&&(t.aud.toLowerCase()===this.config.clientId.toLowerCase()?(e={userName:"",profile:t},t.hasOwnProperty("upn")?e.userName=t.upn:t.hasOwnProperty("email")&&(e.userName=t.email)):this.warn("IdToken has invalid aud field")),e},e.prototype._getHash=function(t){return-1<t.indexOf("#/")?t=t.substring(t.indexOf("#/")+2):-1<t.indexOf("#")&&(t=t.substring(1)),t},e.prototype.isCallback=function(t){t=this._getHash(t);t=this._deserialize(t);return t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},e.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},e.prototype.getRequestInfo=function(t){t=this._getHash(t);var e=this._deserialize(t),o={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(e&&((o.parameters=e).hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||e.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||e.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){o.valid=!0;t="";if(!e.hasOwnProperty("state"))return this.warn("No state returned"),o;if(this.verbose("State: "+e.state),t=e.state,o.stateResponse=t,this._matchState(o))return o;if(!o.stateMatch&&window.parent){o.requestType=this._requestType;for(var n=this._renewStates,r=0;r<n.length;r++)if(n[r]===o.stateResponse){o.stateMatch=!0;break}}}return o},e.prototype._matchNonce=function(t){if(e=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN))for(var e=e.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<e.length;o++)if(e[o]&&e[o]===t.profile.nonce)return!0;return!1},e.prototype._matchState=function(t){if(e=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN))for(var e=e.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<e.length;o++)if(e[o]&&e[o]===t.stateResponse)return t.requestType=this.REQUEST_TYPE.LOGIN,t.stateMatch=!0;if(n=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW))for(var n=n.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<n.length;o++)if(n[o]&&n[o]===t.stateResponse)return t.requestType=this.REQUEST_TYPE.RENEW_TOKEN,t.stateMatch=!0;return!1},e.prototype._getResourceFromState=function(t){if(t){var e=t.indexOf("|");if(-1<e&&e+1<t.length)return t.substring(e+1)}return""},e.prototype.saveTokenFromHash=function(t){this.info("State status:"+t.stateMatch+"; Request type:"+t.requestType),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var e,o=this._getResourceFromState(t.stateResponse);t.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)?(this.infoPii("Error :"+t.parameters.error+"; Error description:"+t.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),this._saveItem(this.CONSTANTS.STORAGE.ERROR,t.parameters.error),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,t.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),t.requestType===this.REQUEST_TYPE.LOGIN&&(this._loginInProgress=!1,this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,t.parameters.error_description))):t.stateMatch?(this.info("State is right"),t.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)&&this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,t.parameters[this.CONSTANTS.SESSION_STATE]),t.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(o)||(e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,e+o+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+o,t.parameters[this.CONSTANTS.ACCESS_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+o,this._expiresIn(t.parameters[this.CONSTANTS.EXPIRES_IN]))),t.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)&&(this.info("Fragment has id token"),this._loginInProgress=!1,this._user=this._createUser(t.parameters[this.CONSTANTS.ID_TOKEN]),this._user&&this._user.profile?this._matchNonce(this._user)?(this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,t.parameters[this.CONSTANTS.ID_TOKEN]),o=this.config.loginResource||this.config.clientId,this._hasResource(o)||(e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,e+o+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+o,t.parameters[this.CONSTANTS.ID_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+o,this._user.profile.exp)):(this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"Nonce received: "+this._user.profile.nonce+" is not same as requested: "+this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN)),this._user=null):(t.parameters.error="invalid id_token",t.parameters.error_description="Invalid id_token. id_token: "+t.parameters[this.CONSTANTS.ID_TOKEN],this._saveItem(this.CONSTANTS.STORAGE.ERROR,"invalid id_token"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid id_token. id_token: "+t.parameters[this.CONSTANTS.ID_TOKEN])))):(t.parameters.error="Invalid_state",t.parameters.error_description="Invalid_state. state: "+t.stateResponse,this._saveItem(this.CONSTANTS.STORAGE.ERROR,"Invalid_state"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid_state. state: "+t.stateResponse)),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+o,this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED)},e.prototype.getResourceForEndpoint=function(t){if(this.config&&this.config.anonymousEndpoints)for(var e=0;e<this.config.anonymousEndpoints.length;e++)if(-1<t.indexOf(this.config.anonymousEndpoints[e]))return null;if(this.config&&this.config.endpoints)for(var o in this.config.endpoints)if(-1<t.indexOf(o))return this.config.endpoints[o];return!(-1<t.indexOf("http://")||-1<t.indexOf("https://"))||this._getHostFromUri(t)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null},e.prototype._getHostFromUri=function(t){return String(t).replace(/^(https?:)\/\//,"").split("/")[0]},e.prototype.handleWindowCallback=function(t){if(null==t&&(t=window.location.hash),this.isCallback(t)){var e=null,o=!1;0<this._openedWindows.length&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(e=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,o=!0):window.parent&&window.parent._adalInstance&&(e=window.parent._adalInstance);var n,r=e.getRequestInfo(t),i=null,s=o||window.parent!==window?e._callBackMappedToRenewStates[r.stateResponse]:e.callback;e.info("Returned from redirect url"),e.saveTokenFromHash(r),r.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?e.verbose("Window is in iframe, acquiring token silently"):e.verbose("acquiring token interactive in progress"),n=r.parameters[e.CONSTANTS.ACCESS_TOKEN]||r.parameters[e.CONSTANTS.ID_TOKEN],i=e.CONSTANTS.ACCESS_TOKEN):r.requestType===this.REQUEST_TYPE.LOGIN&&(n=r.parameters[e.CONSTANTS.ID_TOKEN],i=e.CONSTANTS.ID_TOKEN);t=r.parameters[e.CONSTANTS.ERROR_DESCRIPTION],r=r.parameters[e.CONSTANTS.ERROR];try{s&&s(t,n,r,i)}catch(t){e.error("Error occurred in user defined callback function: "+t)}window.parent!==window||o||(e.config.navigateToLoginRequestUrl?window.location.href=e._getItem(e.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},e.prototype._getNavigateUrl=function(t,e){var o="common";this.config.tenant&&(o=this.config.tenant);e=this.instance+o+"/oauth2/authorize"+this._serialize(t,this.config,e)+this._addLibMetadata();return this.info("Navigate url:"+e),e},e.prototype._extractIdToken=function(t){t=this._decodeJwt(t);if(!t)return null;try{var e=t.JWSPayload,o=this._base64DecodeStringUrlSafe(e);return o?JSON.parse(o):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(t){this.error("The returned id_token could not be decoded",t)}return null},e.prototype._base64DecodeStringUrlSafe=function(t){return t=t.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(t))):decodeURIComponent(escape(this._decode(t)))},e.prototype._decode=function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=(t=String(t).replace(/=+$/,"")).length;if(o%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var n,r,i,s,a,c,l,u="",p=0;p<o;p+=4){if(n=e.indexOf(t.charAt(p)),r=e.indexOf(t.charAt(p+1)),i=e.indexOf(t.charAt(p+2)),s=e.indexOf(t.charAt(p+3)),p+2===o-1){c=(a=n<<18|r<<12|i<<6)>>16&255,l=a>>8&255,u+=String.fromCharCode(c,l);break}if(p+1===o-1){c=(a=n<<18|r<<12)>>16&255,u+=String.fromCharCode(c);break}c=(a=n<<18|r<<12|i<<6|s)>>16&255,l=a>>8&255,u+=String.fromCharCode(c,l,255&a)}return u},e.prototype._decodeJwt=function(t){if(this._isEmpty(t))return null;t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);return!t||t.length<4?(this.warn("The returned id_token is not parseable."),null):{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},e.prototype._convertUrlSafeToRegularBase64EncodedString=function(t){return t.replace("-","+").replace("_","/")},e.prototype._serialize=function(t,e,o){var n=[];return null!==e&&(n.push("?response_type="+t),n.push("client_id="+encodeURIComponent(e.clientId)),o&&n.push("resource="+encodeURIComponent(o)),n.push("redirect_uri="+encodeURIComponent(e.redirectUri)),n.push("state="+encodeURIComponent(e.state)),e.hasOwnProperty("slice")&&n.push("slice="+encodeURIComponent(e.slice)),e.hasOwnProperty("extraQueryParameter")&&n.push(e.extraQueryParameter),e=e.correlationId||this._guid(),n.push("client-request-id="+encodeURIComponent(e))),n.join("&")},e.prototype._deserialize=function(t){for(var e=/\+/g,o=/([^&=]+)=([^&]*)/g,n=function(t){return decodeURIComponent(t.replace(e," "))},r={},i=o.exec(t);i;)r[n(i[1])]=n(i[2]),i=o.exec(t);return r},e.prototype._decimalToHex=function(t){for(var e=t.toString(16);e.length<2;)e="0"+e;return e},e.prototype._guid=function(){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues){var e=new Uint8Array(16);return t.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,this._decimalToHex(e[0])+this._decimalToHex(e[1])+this._decimalToHex(e[2])+this._decimalToHex(e[3])+"-"+this._decimalToHex(e[4])+this._decimalToHex(e[5])+"-"+this._decimalToHex(e[6])+this._decimalToHex(e[7])+"-"+this._decimalToHex(e[8])+this._decimalToHex(e[9])+"-"+this._decimalToHex(e[10])+this._decimalToHex(e[11])+this._decimalToHex(e[12])+this._decimalToHex(e[13])+this._decimalToHex(e[14])+this._decimalToHex(e[15])}for(var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",r=0,i="",s=0;s<36;s++)"-"!==o[s]&&"4"!==o[s]&&(r=16*Math.random()|0),"x"===o[s]?i+=n[r]:"y"===o[s]?(r&=3,i+=n[r|=8]):i+=o[s];return i},e.prototype._expiresIn=function(t){return t=t||3599,this._now()+parseInt(t,10)},e.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},e.prototype._addAdalFrame=function(t){if(void 0!==t){this.info("Add adal frame to document:"+t);var e,o=document.getElementById(t);return o||(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))?((e=document.createElement("iframe")).setAttribute("id",t),e.setAttribute("aria-hidden","true"),e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height=e.borderWidth="0px",o=document.getElementsByTagName("body")[0].appendChild(e)):document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+t+'" id="'+t+'" style="display:none"></iframe>'),window.frames&&window.frames[t]&&(o=window.frames[t])),o}},e.prototype._saveItem=function(t,e,o){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?(o?(o=this._getItem(t)||"",localStorage.setItem(t,o+e+this.CONSTANTS.CACHE_DELIMETER)):localStorage.setItem(t,e),!0):(this.info("Local storage is not supported"),!1):this._supportsSessionStorage()?(sessionStorage.setItem(t,e),!0):(this.info("Session storage is not supported"),!1)},e.prototype._getItem=function(t){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(t):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(t):(this.info("Session storage is not supported"),null)},e.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest"))):!1}catch(t){return!1}},e.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest"))):!1}catch(t){return!1}},e.prototype._cloneConfig=function(t){if(null===t||"object"!=typeof t)return t;var e,o={};for(e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o},e.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},e.prototype.log=function(t,e,o,n){var r;t<=Logging.level&&(!Logging.piiLoggingEnabled&&n||(r=(new Date).toUTCString(),n="",n=this.config.correlationId?r+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[t]+" "+e:r+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[t]+" "+e,o&&(n+="\nstack:\n"+o.stack),Logging.log(n)))},e.prototype.error=function(t,e){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,t,e)},e.prototype.warn=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,t,null)},e.prototype.info=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,t,null)},e.prototype.verbose=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,t,null)},e.prototype.errorPii=function(t,e){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,t,e,!0)},e.prototype.warnPii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,t,null,!0)},e.prototype.infoPii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,t,null,!0)},e.prototype.verbosePii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,t,null,!0)},e.prototype._libVersion=function(){return"1.0.18"},t.exports&&(t.exports=e,t.exports.inject=function(t){return new e(t)}),e)});Qu.inject;function Ju(t){this.message=t}(Ju.prototype=new Error).name="InvalidCharacterError";var Xu="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Ju("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,n,r=0,i=0,s="";n=e.charAt(i++);~n&&(o=r%4?64*o+n:n,r++%4)&&(s+=String.fromCharCode(255&o>>(-2*r&6))))n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return s};function $u(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(Xu(e).replace(/(.)/g,function(t,e){e=e.charCodeAt(0).toString(16).toUpperCase();return"%"+(e=e.length<2?"0"+e:e)}))}catch(t){return Xu(e)}}function tp(t){this.message=t}(tp.prototype=new Error).name="InvalidTokenError";function ep(t,e){if("string"!=typeof t)throw new tp("Invalid token specified");e=!0===(e=e||{}).header?0:1;try{return JSON.parse($u(t.split(".")[e]))}catch(t){throw new tp("Invalid token specified: "+t.message)}}ep.InvalidTokenError=tp;var op=(np.prototype.initialize=function(){var n=this;return this.initPromise||(this.initPromise=new Promise(function(t,e){if(n.options.authType===u.AuthenticationType.subscriptionKey)t();else if(n.options.authType===u.AuthenticationType.aad)n.options.authContext=n.options.authContext||np.getDefaultAuthContext(n.options),n.options.authContext.handleWindowCallback(),n.options.authContext.getLoginError()?e(new Error("Error logging in the AAD users: "+n.options.authContext.getLoginError())):n.options.authContext.isCallback(window.location.hash)?n.map.dispose():setTimeout(function(){return n._loginAndAcquire(t,e)});else if(n.options.authType===u.AuthenticationType.anonymous)t(n._triggerTokenFetch(!0));else if(n.options.authType===u.AuthenticationType.sas){if(n.options.sasToken){var o=-1;try{o=n._getTokenExpiry(n.options.sasToken)}catch(t){return void e(new Error("An invalid sasToken was provided."))}if(o>np.constants.tokenRefreshClockSkew)return n._storeToken(n.options.sasToken),n._setTimeoutTokenFetch(o-np.constants.tokenRefreshClockSkew),void t()}t(n._triggerTokenFetch())}else e(new Error("An invalid authentication type was specified."))})),this.initPromise},np.getDefaultAuthContext=function(t){if(!t.aadAppId)throw new Error("No AAD app ID was specified.");if(!t.aadTenant)throw new Error("No AAD tenant was specified.");return this.defaultAuthContext||(this.defaultAuthContext=new Qu({instance:t.aadInstance||i,tenant:t.aadTenant,clientId:t.aadAppId,cacheLocation:this.constants.preferredCacheLocation})),this.defaultAuthContext},np.prototype._loginAndAcquire=function(e,o){function t(){r.options.authContext.acquireToken(E,function(t){t?o(new Error(t)):(t={map:r.map,type:np.constants.events.tokenAcquired},r.map.events.invoke(np.constants.events.tokenAcquired,t),e())})}var n,r=this,i=this.options.authContext.getCachedToken(this.options.aadAppId),s=this.options.authContext.getCachedUser();i&&s?t():(this.options.authContext.loginInProgress()||this.options.authContext.login(),n=setInterval(function(){r.options.authContext.loginInProgress()||(clearInterval(n),r.options.authContext.getCachedToken(r.options.aadAppId)?t():o(new Error(r.options.authContext.getLoginError()||"The AAD authentication context is not logged-in for the specified app ID: "+r.options.aadAppId)))},25))},np.prototype.getAuthType=function(){return this.options.authType},np.prototype.getClientId=function(){return this.options.clientId},np.prototype.getToken=function(){var o=this;if(this.options.authType===u.AuthenticationType.aad){var n=this.options.authContext.getCachedToken(E);return n||(this.options.authContext.getCachedUser()||this.options.authContext.login(),this.options.authContext.acquireToken(E,function(t,e){t||(n=e,e={map:o.map,type:np.constants.events.tokenAcquired},o.map.events.invoke(np.constants.events.tokenAcquired,e))})),n}if(this.options.authType===u.AuthenticationType.anonymous||this.options.authType===u.AuthenticationType.sas){var t=this._getItem(np.constants.storage.tokenKey);if(t){var e=this._getTokenExpiry(t);if(e<300&&0<e)this._triggerTokenFetch();else if(e<=0)throw this._saveItem(np.constants.storage.tokenKey,""),new Error(np.constants.errors.tokenExpired)}else this._triggerTokenFetch();return t}if(this.options.authType===u.AuthenticationType.subscriptionKey)return this.options.subscriptionKey},np.prototype._getTokenExpiry=function(t){var e=ep(t).exp,t=this._getCurrentTime();return 0<e-t?e-t:-1},np.prototype._storeToken=function(t){this._saveItem(np.constants.storage.tokenKey,t);t={map:this.map,type:np.constants.events.tokenAcquired};this.map.events.invoke(np.constants.events.tokenAcquired,t)},np.prototype._saveItem=function(t,e){return this._supportsLocalStorage()?localStorage.setItem(t,e):this._supportsSessionStorage()?sessionStorage.setItem(t,e):this.fallbackStorage[t]=e,!0},np.prototype._getItem=function(t){return this._supportsLocalStorage()?localStorage.getItem(t):this._supportsSessionStorage()?sessionStorage.getItem(t):t in this.fallbackStorage?this.fallbackStorage[t]:null},np.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem(np.constants.storage.testStorageKey,"A"),"A"===window.localStorage.getItem(np.constants.storage.testStorageKey)&&(window.localStorage.removeItem(np.constants.storage.testStorageKey),!window.localStorage.getItem(np.constants.storage.testStorageKey))):!1}catch(t){return!1}},np.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem(np.constants.storage.testStorageKey,"A"),"A"===window.sessionStorage.getItem(np.constants.storage.testStorageKey)&&(window.sessionStorage.removeItem(np.constants.storage.testStorageKey),!window.sessionStorage.getItem(np.constants.storage.testStorageKey))):!1}catch(t){return!1}},np.prototype._getCurrentTime=function(){return Math.round((new Date).getTime()/1e3)},np.prototype.signRequest=function(t){t.headers=t.headers||{},t.headers[C]=this.sessionId,t.headers[O]=T,t.headers[S]="MapControl/2.2.2 (Web)";var e=this.getToken();switch(this.options.authType){case u.AuthenticationType.aad:case u.AuthenticationType.anonymous:t.headers[x]=this.options.clientId,t.headers[s]=a+e;break;case u.AuthenticationType.sas:t.headers[s]=l+e;break;case u.AuthenticationType.subscriptionKey:t.headers["subscription-key"]=e;break;default:throw new Error("An invalid authentication type was specified")}return t},np.constants={preferredCacheLocation:"localStorage",storage:{tokenKey:"access.token.key",testStorageKey:"testStorage"},events:{tokenAcquired:"tokenacquired"},tokenExpiresIn:3599,tokenRefreshClockSkew:300,errors:{tokenExpired:"Token Expired, Try again"}},np);function np(t){var r=this;this.fallbackStorage={},this._triggerTokenFetch=function(t){return void 0===t&&(t=!1),new Promise(function(o,n){"function"==typeof r.options.getToken?r.options.getToken(function(t){try{var e=r._getTokenExpiry(t)-np.constants.tokenRefreshClockSkew;r._storeToken(t),r._setTimeoutTokenFetch(e),o()}catch(t){n(new Error("Invalid token returned by getToken function"))}},function(t){n(t)},r.map):n(new Error("Token cannot be "+(t?"fetched":"renewed")+" because getToken was not set or is not a function."))})},this._setTimeoutTokenFetch=function(t){clearTimeout(r.tokenTimeOutHandle),r.tokenTimeOutHandle=setTimeout(r._triggerTokenFetch,Math.min(1e3*t,2147483647))};var e=t.getServiceOptions();this.options=e.authOptions,this.sessionId=e.sessionId,this.map=t}var rp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ip=(sp.prototype.add=function(t,e){var o,n;if(Array.isArray(t))try{for(var r=rp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._add(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._add(t,e)},sp.prototype.getControls=function(){return Array.from(this.controls)},sp.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=rp(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._remove(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._remove(t)},sp.prototype._add=function(t,e){this.controls.add(t);var o=(new W).merge(e),t=t.onAdd(this.map,e),e=this.controlContainer.getElementsByClassName(o.position);if(!(0<e.length))throw new Error("Control position "+o.position+" does not exist.");e.item(0).appendChild(t)},sp.prototype._remove=function(t){t.onRemove(),this.controls.delete(t)},sp);function sp(t){for(var e in this.map=t,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),u.ControlPosition){var o;u.ControlPosition.hasOwnProperty(e)&&((o=document.createElement("div")).classList.add(u.ControlPosition[e]),o.classList.add("subcontrol-container"),this.controlContainer.appendChild(o))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}var ap=window&&window.__assign||function(){return(ap=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},cp=(lp.prototype.addCallback=function(s,a,c,t,l){var e,u,p=this;if(t)e=function(t){var e=t.lngLat?new mi(t.lngLat.lng,t.lngLat.lat):void 0,o=t.point?[t.point.x,t.point.y]:void 0,n=t.features?t.features.map(function(t){return new rr(t.geometry,t.properties,t.id)}):[],n={type:t.type,originalEvent:t.originalEvent,position:e,coordinate:o,features:n};c(n)};else switch(s){case"data":case"sourcedata":case"styledata":e=function(t){t=ap(ap({dataType:t.dataType},"source"===t.dataType&&ap(ap(ap({isSourceLoaded:t.isSourceLoaded},t.sourceDataType&&{sourceDataType:t.sourceDataType}),{source:p.map.sources.getById(t.sourceId)}),t.tile&&{tile:{id:{x:t.tile.tileID.canonical.x,y:t.tile.tileID.canonical.y,z:t.tile.tileID.canonical.z},size:t.tile.tileSize,state:t.tile.state}})),{map:p.map,type:t.type});l&&p.map.events._removeListener(s,a,c),c(t)};break;case"error":e=function(t){t={error:t.error,map:p.map,type:t.type};l&&p.map.events._removeListener(s,a,c),c(t)};break;case"touchstart":case"touchend":case"touchmove":case"touchcancel":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e=t.point?new cr(t.point.x,t.point.y):void 0,o=t.points?t.points.map(function(t){return new cr(t.x,t.y)}):[],n=t.lngLat?new mi(t.lngLat.lng,t.lngLat.lat):void 0,r=t.lngLats?t.lngLats.map(function(t){return new mi(t.lng,t.lat)}):[],i=n?p.map.layers.getRenderedShapes(new ur(n),a?[a]:void 0):[],i={map:p.map,originalEvent:t.originalEvent,pixel:e,pixels:o,position:n,positions:r,shapes:i,layerId:a||void 0,preventDefault:function(){return t.preventDefault()},type:t.type};l&&p.map.events._removeListener(s,a,c),c(i)};break;case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"click":case"dblclick":case"mouseout":case"mouseenter":case"mouseleave":case"contextmenu":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e=t.lngLat?new mi(t.lngLat.lng,t.lngLat.lat):void 0,o=t.point?new cr(t.point.x,t.point.y):void 0,n=e?p.map.layers.getRenderedShapes(new ur(e),a?[a]:void 0):[],n={map:p.map,originalEvent:t.originalEvent,position:e,pixel:o,preventDefault:function(){return t.preventDefault()},shapes:n,layerId:a||void 0,type:t.type};l&&p.map.events._removeListener(s,a,c),c(n)};break;case"styleimagemissing":e=function(t){l&&p.map.events._removeListener(s,a,c),c(t.id)};break;case"wheel":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e={map:p.map,originalEvent:t.originalEvent,preventDefault:function(){return t.preventDefault()},type:t.type};l&&p.map.events._removeListener(s,a,c),c(e)};break;case"resize":e=function(t){var e,o={map:p.map,type:t.type};for(e in t)"type"!==e&&"target"!==e&&(o[e]=t[e]);l&&p.map.events._removeListener(s,a,c),c(o)};break;default:e=function(t){var e={map:p.map,type:t.type};t.originalEvent&&(e.originalEvent=t.originalEvent),l&&p.map.events._removeListener(s,a,c),c(e)}}this.callbacks.has(a)||this.callbacks.set(a,new J),this.callbacks.get(a).has(s)||this.callbacks.get(a).set(s,new Map),this.callbacks.get(a).get(s).set(c,[e,l])},lp.prototype.removeCallback=function(t,e,o){this.callbacks.has(e)&&this.callbacks.get(e).has(t)&&this.callbacks.get(e).get(t).has(o)&&this.callbacks.get(e).get(t).delete(o)},lp.prototype.getModifiedCallback=function(t,e,o){if(this.callbacks.has(e)&&this.callbacks.get(e).has(t)&&this.callbacks.get(e).get(t).has(o))return this.callbacks.get(e).get(t).get(o)[0]},lp.prototype.getLayerCallbacks=function(t){if(this.callbacks.has(t))return this.callbacks.get(t)},lp.prototype.getEventCallbacks=function(t,e){if(this.callbacks.has(e)){e=this.callbacks.get(e);if(e.has(t))return e.get(t)}},lp);function lp(t){this.callbacks=new J,this.map=t}var up=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pp=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},hp=["maxzoomchanged","minzoomchanged","mapconfigurationchanged"],dp=(fp.prototype.add=function(t,e,o){var n,r;if("function"==typeof e)this._addGlobalListener(t,e,!1,!1);else{e=Array.isArray(e)?e:[e];try{for(var i=up(e),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof xs&&xs._isMBoxEvent(t)?this._addLayerListener(t,a,o,!1,!1):a._addEventListener(t,o,!1)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}},fp.prototype.addOnce=function(t,e,o){"function"==typeof e?this._addGlobalListener(t,e,!1,!0):e instanceof xs&&xs._isMBoxEvent(t)?this._addLayerListener(t,e,o,!1,!0):e._addEventListener(t,o,!0)},fp.prototype._addLegacy=function(t,e,o){"function"==typeof e?this._addGlobalListener(t,e,!0,!1):this._addLayerListener(t,e,o,!0,!1)},fp.prototype._addLayerListener=function(t,e,o,n,r){var i,s,a,c,l=e instanceof xs?e.getId():e,e=this.map.layers.getLayerById(l),u=this.mapCallbackHandler.getModifiedCallback(t,l,o);if(u&&e)try{for(var p=up(e._getLayerIds()),h=p.next();!h.done;h=p.next()){var d=h.value;this.map._getMap().off(t,d,u)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}if(this.mapCallbackHandler.addCallback(t,l,o,n,r),e){u=this.mapCallbackHandler.getModifiedCallback(t,l,o);try{for(var f=up(e._getLayerIds()),y=f.next();!y.done;y=f.next()){d=y.value;this.map._getMap().on(t,d,u)}}catch(t){a={error:t}}finally{try{y&&!y.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error}}}},fp.prototype._addGlobalListener=function(t,e,o,n){var r,i,s,a;hp.includes(t)?this.map._addEventListener(t,e,n):(r=this.mapCallbackHandler.getModifiedCallback(t,"",e),this.mapCallbackHandler.addCallback(t,"",e,o,n),i=this.mapCallbackHandler.getModifiedCallback(t,"",e),"load"===t&&this.map._isLoaded()?(s={type:"load",map:this.map},setTimeout(function(){return i(s)})):"ready"===t?this.map._isReady()&&(a={type:"ready",map:this.map},setTimeout(function(){return i(a)})):(r&&this.map._getMap().off(t,r),this.map._getMap().on(t,i)))},fp.prototype.invoke=function(t,e,o){if(void 0===o)this._invokeListeners(t,"",e);else if(e instanceof xs&&xs._isMBoxEvent(t))this._invokeListeners(t,e.getId(),o);else{if(!(e instanceof X))throw new Error("The invoke target is invalid.");e._invokeEvent(t,o)}},fp.prototype._invokeListeners=function(o,n,r){var i=this,t=new J(this.mapCallbackHandler.getEventCallbacks(o,n));t?t.forEach(function(t,e){t=pp(t,2),t[0];t[1]&&i._removeListener(o,n,e),e(r)}):"error"===o&&console.error("error"in r?r.error:r)},fp.prototype.remove=function(t,e,o){var n,r;if("function"==typeof e)this._removeListener(t,"",e);else{e=Array.isArray(e)?e:[e];try{for(var i=up(e),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof xs&&xs._isMBoxEvent(t)?this._removeListener(t,a,o):a._removeEventListener(t,o)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}},fp.prototype._removeLegacy=function(t,e,o){"function"==typeof e?this._removeListener(t,"",e):this._removeListener(t,e,o)},fp.prototype._removeListener=function(t,e,o){var n,r;if(hp.includes(t))this.map._removeEventListener(t,o);else{var i=e instanceof xs?e.getId():e,s=this.mapCallbackHandler.getModifiedCallback(t,i,o);if(s)if(i){e=this.map.layers.getLayerById(i);if(e)try{for(var a=up(e._getLayerIds()),c=a.next();!c.done;c=a.next()){var l=c.value;this.map._getMap().off(t,l,s)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}else this.map._getMap().off(t,s);this.mapCallbackHandler.removeCallback(t,i,o)}},fp.prototype._enableLayerEvents=function(c){var l=this,t=this.mapCallbackHandler.getLayerCallbacks(c.getId());t&&t.forEach(function(t,a){t.forEach(function(t){var e,o,n=pp(t,1)[0];try{for(var r=up(c._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;l.map._getMap().on(a,s,n)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},fp.prototype._disableLayerEvents=function(c){var l=this,t=this.mapCallbackHandler.getLayerCallbacks(c.getId());t&&t.forEach(function(t,a){t.forEach(function(t){var e,o,n=pp(t,1)[0];try{for(var r=up(c._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;l.map._getMap().off(a,s,n)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},fp);function fp(t){this.map=t,this.mapCallbackHandler=new cp(this.map)}var yp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},mp=(gp.prototype.add=function(t,e){var o,n;if(Array.isArray(t))try{for(var r=yp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._addMarker(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._addMarker(t,e)},gp.prototype._addMarker=function(t,e){t._addToMap(this.map,e),this.markers.add(t)},gp.prototype.getMarkers=function(){return Array.from(this.markers)},gp.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=yp(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeMarker(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._removeMarker(t)},gp.prototype._removeMarker=function(e){var o=this;e instanceof Ac?(e._removeFromMap(),this.markers.delete(e)):this.markers.forEach(function(t){t._getId()===e&&(t._removeFromMap(),o.markers.delete(t))})},gp.prototype.clear=function(){var e=this;this.markers.forEach(function(t){t._removeFromMap(),e.markers.delete(t)})},gp);function gp(t){this.markers=new Set,this.map=t}var vp=(_p.prototype.add=function(s,e,a){var c=this;return new Promise(function(o,n){var r,t,i;c.userImages.has(s)?o():e instanceof HTMLImageElement||e instanceof ImageData?(c.map._getMap().addImage(s,e,a),c.userImages.set(s,{image:e,meta:a}),o()):"string"==typeof e&&(t=void 0,t=/<svg/i.test(e)&&!/^data:/i.test(e)?"data:image/svg+xml;base64,"+window.btoa(e):e,i=!1,c.map._sendRequest(t,"Image").then(function(t){return i?void 0:t.blob()}).then(function(t){var e;!i&&t&&(clearTimeout(r),(e=new Image).onload=function(){c.map._getMap().addImage(s,e,a),c.userImages.set(s,{image:e,meta:a}),o()},e.onerror=e.onabort=function(){n("Failed to load image into HTML element.")},e.src=URL.createObjectURL(t))}).catch(function(){i||(clearTimeout(r),n("Failed to load image into HTML element."))}),r=setTimeout(function(){i=!0,n("Failed to load image within specified timeout: "+c.imageLoadTimeout+" ms.")},c.imageLoadTimeout))})},_p.prototype.clear=function(){var o=this;this.userImages.forEach(function(t,e){o.map._getMap().removeImage(e)}),this.userImages.clear()},_p.prototype.getImageIds=function(){var o=[];return this.userImages.forEach(function(t,e){o.push(e)}),o},_p.prototype.createFromTemplate=function(t,e,o,n,r){o=o||"#1A73AA",n=n||"#fff";r=(r=Ll(e,r)).replace(/{color}/g,o).replace(/{secondaryColor}/g,n).replace(/{text}/g,"");return this.add(t,r)},_p.prototype.hasImage=function(t){return this.userImages.has(t)},_p.prototype.remove=function(t){this.map._getMap().removeImage(t),this.userImages.delete(t)},_p.prototype._restoreImages=function(){var o=this;this.userImages.forEach(function(t,e){o.map._getMap().hasImage(e)||o.map._getMap().addImage(e,t.image,t.meta)})},_p);function _p(t){this.userImages=new J,this.imageLoadTimeout=5e3,this.map=t}var wp,bp,b=window&&window.__extends||(wp=function(t,e){return(wp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}wp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Sp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xp=(b(Op,bp=xs),Op.prototype._buildLayers=function(){return this.layers},Op.prototype._getLayerIds=function(){return this.layers.map(function(t){return t.id})},Op.prototype._getSourceIds=function(){var e,t,o=new Set;try{for(var n=Sp(this.layers),r=n.next();!r.done;r=n.next()){var i=r.value;"string"==typeof i.source?o.add(i.source):i.source&&o.add(i.id)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o},Op.prototype._updateLayoutProperty=function(e,o,n,r){var i=this;this.layers.forEach(function(t){er(o,n)||i.map._getMap().setLayoutProperty(t.id,e,r||o)})},Op);function Op(t,e){e=bp.call(this,e)||this;return e.layers=t,e}var Tp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ep=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Cp=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Pp=(kp.prototype.add=function(t,e){var o,n,r=e instanceof xs?e.getId():e;if(Array.isArray(t))try{for(var i=Tp(t),s=i.next();!s.done;s=i.next()){var a=s.value;this._addLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}else this._addLayer(t,r)},kp.prototype._addLayer=function(e,o){if(!(this.map._isReady()||e instanceof xp))throw new Error("The layer '"+e.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a layer to it.");var t,n,r,i;o!==e.getId()&&this.layerIndex.find(function(t){return o===t.getId()})?this._getMapboxLayerExists(e)?(n=this.layerIndex.findIndex(function(t){return t.getId()===e.getId()}),r=this.userLayers.findIndex(function(t){return t.layer.getId()===e.getId()}),i=this.layerIndex[n],this._removeMapboxLayers(e),this._addMapboxLayers(e,o),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(e),this.layerIndex.splice(n,1),t=this.layerIndex.findIndex(function(t){return t.getId()===o}),this.layerIndex.splice(t,0,e),e instanceof xp||(this.userLayers[r]={layer:e,before:o}),i.onRemove()):(this._addMapboxLayers(e,o),this.map.events._enableLayerEvents(e),t=this.layerIndex.findIndex(function(t){return t.getId()===o}),this.layerIndex.splice(t,0,e),e instanceof xp||this.userLayers.push({layer:e,before:o})):(n=this.layerIndex.findIndex(function(t){return t.getId()===e.getId()}),r=this.userLayers.findIndex(function(t){return t.layer.getId()===e.getId()}),0<=n&&0<=r?(i=this.layerIndex[n],this._removeMapboxLayers(i),this._addMapboxLayers(e,n+1),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(e),(this.layerIndex[n]=e)instanceof xp||(this.userLayers[r]={layer:e,before:void 0}),i.onRemove()):(this._addMapboxLayers(e),this.map.events._enableLayerEvents(e),this.layerIndex.push(e),e instanceof xp||this.userLayers.push({layer:e,before:o}))),e.onAdd(this.map)},kp.prototype._addMapboxLayers=function(t,e){var o,n;if(!(t instanceof oc)||t.getOptions().tileUrl)if(t instanceof xp)this.map.events._enableLayerEvents(t);else{t instanceof Xs&&this.map._getMap().addSource(t._getSourceId(),t._buildSource());var r=this._getMapboxBefore(e);try{for(var i=Tp(t._buildLayers()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().addLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}this.map.events._enableLayerEvents(t)}},kp.prototype._removeMapboxLayers=function(t,e){var o,n;if(t instanceof xp&&!e)this.map.events._disableLayerEvents(t);else{try{for(var r=Tp(t._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;this.map._getMap().getLayer(s)&&this.map._getMap().removeLayer(s)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}this.map.events._disableLayerEvents(t),t instanceof Xs&&this.map._getMap().getSource(t._getSourceId())&&this.map._getMap().removeSource(t._getSourceId())}},kp.prototype._getMapboxLayerExists=function(e){var o=this,n=!1;return"string"==typeof e?!!(e=this.layerIndex.find(function(t){return t.getId()===e})):(e._getLayerIds().forEach(function(t){o.map._getMap().getLayer(t)&&(n=!0)}),n)},kp.prototype._getMapboxBefore=function(e){var o,t,n,r;if("string"==typeof e){var i=this.layerIndex.find(function(t){return t.getId()===e});if(!i)return;try{for(var s=Tp(i._getLayerIds()),a=s.next();!a.done;a=s.next()){var c=a.value;if(this.map._getMap().getLayer(c))return c}}catch(t){o={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(o)throw o.error}}e=this.layerIndex.findIndex(function(t){return t.getId()===e})+1}for(var l=e;l<this.layerIndex.length;l++)try{for(var u=(n=void 0,Tp(this.layerIndex[l]._getLayerIds())),p=u.next();!p.done;p=u.next()){c=p.value;if(this.map._getMap().getLayer(c))return c}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}},kp.prototype.clear=function(){for(var t=this.layerIndex.length-1;0<=t;t--){var e=this.layerIndex[t];this._removeMapboxLayers(e,!0),this.layerIndex.splice(t,1),e.onRemove()}this.userLayers=[]},kp.prototype.getLayerById=function(e){var t=this.layerIndex.find(function(t){return t.getId()===e});if(t)return t},kp.prototype.getLayers=function(){return this.layerIndex.slice(0)},kp.prototype._getSourceIds=function(){var e,t,o=new Set;try{for(var n=Tp(this.layerIndex),r=n.next();!r.done;r=n.next())r.value._getSourceIds().forEach(function(t){return o.add(t)})}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o},kp.prototype._getUserLayers=function(){return Array.from(this.userLayers)},kp.prototype.move=function(t,e){var o=t instanceof xs?t.getId():t,n=e instanceof xs?e.getId():e;if(!this.layerIndex.find(function(t){return t.getId()===o}))throw new Error("The layer '"+o+"' has not been added to the map and cannot be moved.");e=this.layerIndex.findIndex(function(t){return t.getId()===o});this._moveMapboxLayers(this.layerIndex[e],n),t=this.layerIndex[e],this.layerIndex.splice(e,1);e=this.layerIndex.findIndex(function(t){return t.getId()===n});-1<e?this.layerIndex.splice(e,0,t):this.layerIndex.push(t);t=this.userLayers.find(function(t){return t.layer.getId()===o});t&&(t.before=n)},kp.prototype._moveMapboxLayers=function(t,e){var o,n,r=this._getMapboxBefore(e);try{for(var i=Tp(t._getLayerIds()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().moveLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}},kp.prototype.getRenderedShapes=function(t,e,o){var n,r,i,s=this;if(t=t||[-180,-85.0511,180,85.0511],Array.isArray(t)?4===t.length||6===t.length?i=this.map.positionsToPixels([Pi.getSouthWest(t),Pi.getNorthEast(t)]):2!==t.length&&3!==t.length||(i=this.map.positionsToPixels([t])[0]):i=this.map.positionsToPixels([t.coordinates])[0],e){e=Array.isArray(e)?e:[e];var a=[],c=this;try{for(var l=Tp(e),u=l.next();!u.done;u=l.next())!function(t){var e=t instanceof xs?t.getId():t,t=c.layerIndex.findIndex(function(t){return t.getId()===e});if(!(-1<t))throw new Error("The layer '"+e+"' has not been added to the map and its rendered features cannot be retrieved.");a.push.apply(a,Cp([],Ep(c.layerIndex[t]._getLayerIds().filter(function(t){return!!s.map._getMap().getLayer(t)}))))}(u.value)}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}o=this.map._getMap().queryRenderedFeatures(i,{layers:a,filter:o});return this.map.sources._mapFeaturesToShapes(o)},kp.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=Tp(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeLayer(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._removeLayer(t)},kp.prototype._removeLayer=function(t){var e=t instanceof xs?t.getId():t,o=this.layerIndex.findIndex(function(t){return t.getId()===e});if(-1==o)throw new Error("The layer '"+e+"' has not been added to the map and cannot be removed.");t=this.layerIndex[o];this._removeMapboxLayers(t),this.layerIndex.splice(o,1);o=this.userLayers.findIndex(function(t){return t.layer.getId()===e});-1!=o&&this.userLayers.splice(o,1),t.onRemove()},kp);function kp(t){this.layerIndex=[],this.userLayers=[],this.map=t}var Ap=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ip=(Lp.prototype.add=function(t){var e,o;t=Array.isArray(t)?t:[t];try{for(var n=Ap(t),r=n.next();!r.done;r=n.next()){var i=r.value;this.popups.has(i)||(this.popups.add(i),i.attach(this.map))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},Lp.prototype.clear=function(){var e=this;this.popups.forEach(function(t){e.popups.delete(t),t.remove()})},Lp.prototype.remove=function(t){var e,o;t=Array.isArray(t)?t:[t];try{for(var n=Ap(t),r=n.next();!r.done;r=n.next()){var i=r.value;this.popups.has(i)&&(this.popups.delete(i),i.remove())}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},Lp.prototype.getPopups=function(){return Array.from(this.popups)},Lp.prototype._getCollectionDiv=function(){var t=this.map.getMapContainer().querySelector("."+Lp.Css.collection);return t||((t=document.createElement("div")).classList.add(Lp.Css.collection),t.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(t)),t},Lp.prototype._addDraggedPopup=function(t){0===this.draggedPopups.size&&(this.map.getMapContainer().addEventListener("mousemove",this._onDrag),this.map.getMapContainer().addEventListener("touchmove",this._onDrag),this.map.getMapContainer().addEventListener("mouseup",this._onUp),this.map.getMapContainer().addEventListener("touchend",this._onUp)),this.draggedPopups.add(t)},Lp.Css={collection:"popup-collection-container"},Lp);function Lp(t){var n=this;this._onDrag=function(t){var e,o;"mousemove"===t.type?(e=t.clientX,o=t.clientY):"touchmove"===t.type&&(e=t.touches[0].clientX,o=t.touches[0].clientY),n.draggedPopups.forEach(function(t){t._dragToPixel([e,o])})},this._onUp=function(){n.map.getMapContainer().removeEventListener("mousemove",n._onDrag),n.map.getMapContainer().removeEventListener("touchmove",n._onDrag),n.map.getMapContainer().removeEventListener("mouseup",n._onUp),n.map.getMapContainer().removeEventListener("touchend",n._onUp),n.draggedPopups.forEach(function(t){n.draggedPopups.delete(t),t._onUp()})},this.map=t,this.popups=new Set,this.draggedPopups=new Set}var Rp,Np,b=window&&window.__extends||(Rp=function(t,e){return(Rp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Rp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Mp=window&&window.__assign||function(){return(Mp=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},jp=(b(Dp,Np=ss),Dp.prototype._buildSource=function(){return this.source},Dp.prototype._modifySource=function(t,e){if(t.tiles){var o=t.tiles.map(function(t){return"string"==typeof t?t:new D({domain:h,path:t.path,queryParams:Mp(Mp({},e),t.queryParams)}).toString()});t.tiles=o}else{if(!t.url)throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");t.url="string"==typeof t.url?t.url:new D({domain:h,path:t.url.path,queryParams:Mp(Mp({},e),t.url.queryParams)}).toString()}return t},Dp);function Dp(t,e,o){t=Np.call(this,t)||this;return t.source=t._modifySource(e,o),t}var zp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bp=(Fp.prototype.add=function(t,e){var o,n;if(void 0===e&&(e=!0),Array.isArray(t))try{for(var r=zp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._addSource(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._addSource(t,e)},Fp.prototype.getRenderedShapes=function(t,e,o){t="string"==typeof t?t:t.getId(),e=this.map._getMap().querySourceFeatures(t,{sourceLayer:o,filter:e});return this.map.sources._mapFeaturesToShapes(e,!0,this.sources.get(t))},Fp.prototype._buildSources=function(){var e={};return this.sources.forEach(function(t){e[t.getId()]=t._buildSource()}),e},Fp.prototype.clear=function(){var e=this;this.sources.forEach(function(t){e.remove(t)})},Fp.prototype.getById=function(t){return this.sources.get(t)},Fp.prototype.getSources=function(){return Array.from(this.sources.values())},Fp.prototype.isSourceLoaded=function(t){t=t instanceof ss?t.getId():t;return this.map._getMap().isSourceLoaded(t)},Fp.prototype.remove=function(t,e){var o,n;if(void 0===e&&(e=!0),Array.isArray(t))try{for(var r=zp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._removeSource(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._removeSource(t,e)},Fp.prototype._removeSource=function(t,e){t=t instanceof ss?t.getId():t;if(this.sources.has(t)){if(this.map._getMap().getSource(t)&&e&&this.map._getMap().removeSource(t),this.map._getMap().getSource(t)&&e)throw new Error("One or more layers have a dependency on the source '"+t+"'");return this.sources.get(t)._setMap(null),void this.sources.delete(t)}throw new Error("'"+t+"' is not added to the map")},Fp.prototype._addSource=function(t,e){if(this.sources.has(t.getId())){if(e)throw new Error("'"+t.getId()+"' is already added to the map");this.sources.get(t.getId())._setMap(null),this.sources.delete(t.getId())}if(e){if(!this.map._isReady())throw new Error("The source '"+t.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a source to it.");this.map._getMap().addSource(t.getId(),t._buildSource())}this.sources.set(t.getId(),t),t._setMap(this.map)},Fp.prototype._mapFeaturesToShapes=function(t,e,o){var n,r,i=[];try{for(var s=zp(t),a=s.next();!a.done;a=s.next()){var c=a.value;if((o||"string"==typeof c.source)&&"string"==typeof c.properties[xi._shapeIdPropName]){var l=o||this.sources.get(c.source);if(l instanceof ps){var u=l.getShapeById(c.properties[xi._shapeIdPropName]);if(u instanceof xi){i.push(u);continue}}}e||i.push(c)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},Fp.prototype._syncSources=function(n){var r=this;n&&(Object.keys(n).forEach(function(t){if(!r.sources.has(t)){var e=n[t];if("vector"===e.type){var o=new jp(t,{name:t,tiles:e.tiles,type:"vector",url:e.url});r.sources.set(t,o),o._setMap(r.map)}else{if("raster"!==e.type)throw new Error("Unable to construct source with ID "+t+".");o=new jp(t,{name:t,tiles:e.tiles,type:"raster",url:e.url});r.sources.set(t,o),o._setMap(r.map)}}}),Object.keys(this.sources).forEach(function(t){n.hasOwnProperty(t)||(r.sources.get(t)._setMap(null),r.sources.delete(t))}))},Fp);function Fp(t){this.map=t,this.sources=new J}var Up,qp,Gp=((window&&window.__extends||(Up=function(t,e){return(Up=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Up(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Zp,qp=k),Zp);function Zp(){var t=null!==qp&&qp.apply(this,arguments)||this;return t.duration=1e3,t.type="jump",t}var Hp,Kp,Wp=((window&&window.__extends||(Hp=function(t,e){return(Hp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Hp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Vp,Kp=k),Vp);function Vp(){var t=null!==Kp&&Kp.apply(this,arguments)||this;return t.bottom=0,t.left=0,t.right=0,t.top=0,t}var Yp,Qp,b=window&&window.__extends||(Yp=function(t,e){return(Yp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Yp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Jp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Xp=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},$p=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},th=(b(eh,Qp=k),eh.prototype.merge=function(){for(var e,t,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var r=Jp(o),i=r.next();!i.done;i=r.next()){var s=i.value;s&&"number"==typeof s.padding&&(s.padding={top:s.padding,bottom:s.padding,left:s.padding,right:s.padding})}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return Qp.prototype.merge.apply(this,$p([],Xp(o)))},eh);function eh(){var t=null!==Qp&&Qp.apply(this,arguments)||this;return t.bounds=[-180,-89,180,90],t.maxBounds=void 0,t.maxZoom=20,t.offset=new cr(0,0),t.padding=new Wp,t}var oh,nh,rh=((window&&window.__extends||(oh=function(t,e){return(oh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}oh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ih,nh=k),ih);function ih(){var t=null!==nh&&nh.apply(this,arguments)||this;return t.zoom=1,t.center=new mi(0,0),t.centerOffset=new cr(0,0),t.bearing=0,t.pitch=0,t.minZoom=1,t.maxZoom=20,t.maxBounds=void 0,t}var sh,ah,b=((window&&window.__extends||(sh=function(t,e){return(sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}sh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ch,ah=k),ch);function ch(){var t=null!==ah&&ah.apply(this,arguments)||this;return t.name=void 0,t.before=void 0,t.minZoom=1,t.maxZoom=20,t.overwrite=!1,t.opacity=1,t}var lh,uh,ph=((window&&window.__extends||(lh=function(t,e){return(lh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}lh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(hh,uh=b),hh);function hh(){var t=null!==uh&&uh.apply(this,arguments)||this;return t.color="rgba(0,0,0,.5)",t.outlineColor="#000",t.radius=1,t.outlineWidth=5,t.name="default-circles",t}var dh,fh,yh=((window&&window.__extends||(dh=function(t,e){return(dh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}dh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(mh,fh=b),mh);function mh(){var t=null!==fh&&fh.apply(this,arguments)||this;return t.cap="butt",t.join="miter",t.name="default-linestrings",t.color="#000",t.width=1,t}var gh,vh,_h=((window&&window.__extends||(gh=function(t,e){return(gh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}gh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(wh,vh=b),wh);function wh(){var t=null!==vh&&vh.apply(this,arguments)||this;return t.iconSize=1,t.fontSize=14,t.fontColor="#000",t.textFont="SegoeUi-Regular",t.cluster=!0,t.clusterIcon=void 0,t.textOffset=[0,0],t.name="default-pins",t.icon="pin-darkblue",t.title="",t}var bh,Sh,xh=((window&&window.__extends||(bh=function(t,e){return(bh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}bh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Oh,Sh=b),Oh);function Oh(){var t=null!==Sh&&Sh.apply(this,arguments)||this;return t.color="rgba(0,0,0,.5)",t.outlineColor="#000",t.name="default-polygons",t}var Th,Eh,Ch=((window&&window.__extends||(Th=function(t,e){return(Th=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Th(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ph,Eh=b),Ph);function Ph(){var t=null!==Eh&&Eh.apply(this,arguments)||this;return t.name="default-raster",t}var kh,Ah,Ih=((window&&window.__extends||(kh=function(t,e){return(kh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}kh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Lh,Ah=k),Lh);function Lh(){var t=null!==Ah&&Ah.apply(this,arguments)||this;return t.anchor="map",t.color="#FFFFFF",t.intensity=.5,t.position=[1.15,210,30],t}var Rh,Nh,b=window&&window.__extends||(Rh=function(t,e){return(Rh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Rh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Mh=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jh=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Dh=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},zh=(b(Bh,Nh=k),Bh.prototype.merge=function(){for(var e,t,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var r=Mh(o),i=r.next();!i.done;i=r.next()){var s=i.value;s&&(s.hasOwnProperty("view")?s.userRegion=s.view:s.hasOwnProperty("userRegion")&&(s.view=s.userRegion),"string"==typeof s.language&&(s.language=jc.getCode(s.language)))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return Nh.prototype.merge.apply(this,Dh([],jh(o)))},Bh);function Bh(){var t=null!==Nh&&Nh.apply(this,arguments)||this;return t.antialias=void 0,t.autoResize=!0,t.language=Wc,t.light=new Ih,t.preserveDrawingBuffer=!1,t.progressiveLoading=!1,t.progressiveLoadingInitialLayerGroups=["base"],t.renderWorldCopies=!0,t.showBuildingModels=!1,t.showFeedbackLink=!0,t.showLogo=!0,t.showLabels=!0,t.customAttribution=void 0,t.showTileBoundaries=!1,t.style=void 0,t.view=Zc,t.userRegion=t.view,t}function Fh(t){return 0==t.length?void 0:t.slice(1).reduce(function(o,n){return function(t,e){t=o(t,e);return Gh(Gh({},t),n(t.url,e))}},t[0])}var Uh,qh,b=window&&window.__extends||(Uh=function(t,e){return(Uh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Uh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Gh=window&&window.__assign||function(){return(Gh=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Zh=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Hh=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Kh=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Wh=(b(Vh,qh=k),Vh.prototype.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{for(var o=Zh(t),n=o.next();!n.done;n=o.next()){var r=n.value;r&&(r.authOptions?"string"==typeof r.authOptions.subscriptionKey&&(r.subscriptionKey=r["subscription-key"]=r.authOptions.subscriptionKey):"string"==typeof r.subscriptionKey?(r["subscription-key"]=r.subscriptionKey,r.authOptions={authType:u.AuthenticationType.subscriptionKey,subscriptionKey:r.subscriptionKey}):"string"==typeof r["subscription-key"]&&(r.subscriptionKey=r["subscription-key"],r.authOptions={authType:u.AuthenticationType.subscriptionKey,subscriptionKey:r["subscription-key"]}),"string"==typeof r.sessionId?r["session-id"]=r.sessionId:"string"==typeof r["session-id"]&&(r.sessionId=r["session-id"]),"boolean"==typeof r.disableTelemetry?r["disable-telemetry"]=r.disableTelemetry:"boolean"==typeof r["disable-telemetry"]&&(r.disableTelemetry=r["disable-telemetry"]),"boolean"==typeof r.enableAccessibility?r["enable-accessibility"]=r.enableAccessibility:"boolean"==typeof r["enable-accessibility"]&&(r.enableAccessibility=r["enable-accessibility"]))}}catch(t){a={error:t}}finally{try{n&&!n.done&&(s=o.return)&&s.call(o)}finally{if(a)throw a.error}}var i=this._transformers,s=t?t.filter(function(t){return void 0!==t}).reduce(function(t,e){return Kh(Kh([],Hh(t)),Hh(e._transformers||[]))},[]):[],a=qh.prototype.merge.apply(this,Kh([],Hh(t)));return a.authOptions.authType!==u.AuthenticationType.subscriptionKey&&(a["subscription-key"]=a.subscriptionKey=void 0),void 0!==a.styleSet&&void 0===a.mapConfiguration&&(a.mapConfiguration=a.styleSet),a.mapConfiguration&&"string"!=typeof a.mapConfiguration&&(a.mapConfiguration=Gh(Gh({},a.mapConfiguration),{defaultConfiguration:a.mapConfiguration.defaultConfiguration||a.mapConfiguration.defaultStyle,configurations:a.mapConfiguration.configurations||a.mapConfiguration.styles})),this._transformers=Kh(Kh([],Hh(i||[])),Hh(s.filter(function(t){return!i.includes(t)}))),this.transformRequest&&!this._transformers.includes(this.transformRequest)&&this._transformers.push(this.transformRequest),this.transformRequest=Fh(this._transformers),a},Vh.prototype.addTransformer=function(t){this._transformers||(this._transformers=[]),this._transformers.push(t),this.transformRequest=Fh(this._transformers)},Vh.prototype.removeTransformer=function(e){this._transformers&&(this._transformers=this._transformers.filter(function(t){return e!==t}),this.transformRequest=Fh(this._transformers))},Vh._cloneCustomizer=function(t){if("object"==typeof t)return Object.assign({},t)},Vh);function Vh(){var t=null!==qh&&qh.apply(this,arguments)||this;return t.authOptions=ul(),t.disableTelemetry=!1,t["disable-telemetry"]=t.disableTelemetry,t.domain=Yc,t.staticAssetsDomain=Qc,t.styleDefinitionsPath=Jc,t.styleDefinitionsVersion=Xc,t.styleAPIVersion=$c,t.mapConfiguration=void 0,t.styleSet=void 0,t.enableAccessibility=!0,t["enable-accessibility"]=t.enableAccessibility,t.enableAccessibilityLocationFallback=!0,t.maxParallelImageRequests=gl(),t.refreshExpiredTiles=!0,t.subscriptionKey=wl(),t["subscription-key"]=t.subscriptionKey,t.sessionId=Vc,t["session-id"]=t.sessionId,t._transformers=[],t.transformRequest=void 0,t.workerCount=ml(),t.fadeDuration=300,t.localIdeographFontFamily="sans-serif",t.validateStyle=!0,t}var Yh=(Qh.getLayerGroup=function(t){var e;if(null!=t&&t.metadata&&t.metadata["microsoft.maps:layerGroup"])return t.metadata["microsoft.maps:layerGroup"];t=null!==(e=null==t?void 0:t.id)&&void 0!==e?e:t;if(t.startsWith("microsoft.")){t=t.split(".");return 4<=t.length?t[3]:void 0}},Qh);function Qh(){}var Jh=(Xh.resolve=function(t){return new Xh(Promise.resolve(t))},Xh.reject=function(t){return new Xh(Promise.reject(t))},Xh.prototype.then=function(t,e){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).then(t,e)},Xh.prototype.catch=function(t){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).catch(t)},Xh.prototype.finally=function(t){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).finally(t)},Xh.prototype.hijackAndResolve=function(t){this._hijackedToResolve=t,this._resolve&&this._resolve(t)},Xh.prototype.hijackAndReject=function(t){this._hijackedToReject=t,this._reject&&this._reject(t)},Xh.prototype.switchWith=function(t){this.origin=t,this._toResolve=void 0,this._toReject=void 0},Xh);function Xh(t){var r=this;this.isHijacked=function(){return void 0!==r._hijackedToResolve||void 0!==r._hijackedToReject},this.isResolved=function(){return void 0!==r._hijackedToResolve||void 0!==r._toResolve},this.isRejected=function(){return void 0!==r._hijackedToReject||void 0!==r._toReject},this.resultIfResolved=function(){return r._hijackedToResolve||r._toResolve},this.errorIfRejected=function(){return r._hijackedToReject||r._toReject},this._thenResolver=function(e,o){var n;r._hijackedToResolve?e(r._hijackedToResolve):r._hijackedToReject?o(r._hijackedToReject):(n=r.origin,r.origin.then(function(t){r.isHijacked()||(n!==r.origin?r._thenResolver(e,o):(r._toResolve=t,e(t)))}).catch(function(t){r.isHijacked()||(n!==r.origin?r._thenResolver(e,o):(r._toReject=t,o(t)))}))},this.origin=t,this[Symbol.toStringTag]=this.origin[Symbol.toStringTag]}var $h={road:"Road",satellite:"Satellite",satellite_road_labels:"Hybrid",grayscale_dark:"Grayscale (Dark)",grayscale_light:"Grayscale (Light)",night:"Night",road_shaded_relief:"Terra",blank:"Blank",blank_accessible:"Blank (Accessible)",high_contrast_dark:"High contrast (Dark)",high_contrast_light:"High contrast (Light)"},td=window&&window.__assign||function(){return(td=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ed=window&&window.__awaiter||function(t,s,a,c){return new(a=a||Promise)(function(o,e){function n(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((c=c.apply(t,s||[])).next())})},od=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},nd=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},rd=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},id=(sd.prototype.updateIndoorState=function(t,e){var o,n,r=this,i=this.map.styles.getMapConfiguration();i?(this.preservedPreindoorMapConfiguration=i,o=this.map.getStyle().style?this.map.getStyle().style+"_indoor"+("dark"===t?"_dark":"")+"_tileset_"+e:void 0,this.map.styles.setMapConfiguration("defaultIndoor_"+e,"microsoft-maps:default"===i?o:void 0)):(n=(null===(o=this.indoorState)||void 0===o?void 0:o.tilesetId)!==e,this.indoorState={tilesetId:e,theme:t},this.initStyleset(),this.definitions().then(function(t){var e=(r.map.getStyle().style||t.defaultConfiguration).replace("_indoor_dark","").replace("_indoor","")+"_indoor",t=t.configurations.find(function(t){return t.name.startsWith(e)});t&&r.map.setStyle({style:t.name},!n)}))},sd.prototype.unsetIndoorState=function(){var o=this,t=this.preservedPreindoorMapConfiguration;t?this.map.styles.setMapConfiguration(t):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(t){var e=o.map.getStyle().style;e.includes("_indoor")&&e.split("_indoor")[0]?o.map.setStyle({style:e.split("_indoor")[0]}):o.map.setStyle({style:void 0})}))},sd.prototype.initStyleset=function(){var e=this,t=this.serviceOptions.mapConfiguration?"string"==typeof this.serviceOptions.mapConfiguration?new Jh(this._request(this.serviceOptions.domain,w+"/mapconfigurations/metadata/"+this.serviceOptions.mapConfiguration,"StyleDefinitions").then(function(t){return td(td({},t),{defaultConfiguration:t.defaultConfiguration||t.defaultStyle,configurations:t.configurations||t.styles})})):Jh.resolve(this.serviceOptions.mapConfiguration):new Jh(this._request(this.serviceOptions.staticAssetsDomain,_+"/"+w,"StyleDefinitions",{version:this.serviceOptions.styleDefinitionsVersion}).then(function(t){return{version:isNaN(t.version)?0:parseFloat(t.version),defaultConfiguration:t.defaultStyle,configurations:t.styles.filter(function(t){return e.indoorState?"auto"===e.indoorState.theme?t.name.endsWith("dark"===t.theme?"_indoor_dark":"_indoor"):t.name.endsWith("dark"===e.indoorState.theme?"_indoor_dark":"_indoor"):!t.name.includes("indoor")}).map(function(t){return{copyright:t.copyright.join(" "),name:t.name,displayName:function(t){t=e.indoorState&&t.includes("_indoor")?t.split("_indoor")[0]:t;return t in $h?$h[t]:t}(t.name),theme:t.theme,thumbnail:new D({domain:e.serviceOptions.staticAssetsDomain,path:t.thumbnail,protocol:"https"}).toString(),url:new D({domain:e.serviceOptions.staticAssetsDomain,path:_+"/"+w+"/"+t.name,queryParams:{styleVersion:e.serviceOptions.styleDefinitionsVersion},protocol:"https"}).toString()}})}}));return this.initPromise&&this.initPromise.switchWith(t),this.initPromise=t,this.initPromise.then(function(t){return e.map._invokeEvent("mapconfigurationchanged",t)}),this.initPromise},sd.prototype.getStyle=function(t){t=this._lookUp(t);if(!t)throw Error("Style definition is not available.");if(t.url)return t.url;if(t.style)return t.style;throw Error("Style definition does not contain neither URL nor style object.")},sd.prototype.setStyle=function(t,e){void 0===e&&(e=!0);try{this.map._getMap().setStyle(this.getStyle(t),{diff:e,stylePatch:this._stylePatch.bind(this),validate:this.serviceOptions.validateStyle})}catch(t){throw t}},sd.prototype.getTheme=function(t){t=this._lookUp(t);if(t)return t.theme.toLowerCase()},sd.prototype.getThemeAsync=function(e){return ed(this,void 0,void 0,function(){return od(this,function(t){switch(t.label){case 0:return[4,this._lookUpAsync(e)];case 1:return[2,t.sent().theme]}})})},sd.prototype.setMapConfiguration=function(t,o){var n=this;"string"==typeof(this.serviceOptions.mapConfiguration=t)?this.initStyleset():this.initPromise?this.initPromise.hijackAndResolve(t):this.initPromise=Jh.resolve(t),this.definitions().then(function(t){var e=t.defaultConfiguration;t.configurations.find(function(t){return t.name===o})&&(e=o),n.map.setStyle({style:e})})},sd.prototype.getMapConfiguration=function(){return this.serviceOptions.mapConfiguration},sd.prototype.setStyleSet=function(t){this.updateIndoorState("indoor_dark"===t?"dark":"light",null)},sd.prototype.getStyleSet=function(){return void 0!==this.indoorState?"dark"===this.indoorState.theme?"indoor_dark":"indoor":"base"},sd.prototype.clearStyleSet=function(){this.unsetIndoorState()},sd.prototype._stylePatch=function(t,e,n,o,r,i){var s=this,a=this.map.getStyle(),c=this.map.getTraffic();e.sources=Object.entries(e.sources).reduce(function(t,e){var o=nd(e,2),e=o[0],o=o[1],o=td({},o);return"url"in o&&"string"==typeof o.url&&o.url.includes(v)&&(o.url=o.url.replace(v,a.language)),t[e]=o,t},{});function l(t,e){var o;u||r(t.id,"visibility",e),t.layout=null!==(o=t.layout)&&void 0!==o?o:{},t.layout.visibility=e}var u=a.progressiveLoading&&!this.map._isLoaded(),p={};e.layers.forEach(function(t){var e,o=Yh.getLayerGroup(t);o&&("fill-extrusion"===t.type&&l(t,a.showBuildingModels?"visible":"none"),"none"!==c.flow&&o==="traffic_"+c.flow&&"line"==t.type&&l(t,"visible"),"labels"!==o&&"labels_places"!==o&&"labels_indoor"!==o||"symbol"!==t.type||(e="none"!==(null===(e=t.layout)||void 0===e?void 0:e.visibility),l(t,e&&a.showLabels?"visible":"none")),p[o]?p[o].push(t):p[o]=[t])}),u&&(y=a.progressiveLoadingInitialLayerGroups,Array.isArray(y)&&0<y.length&&this._deferLayerGroupVisibilities(p,y));var h=this.map.layers.getLayers(),d=Object.entries(p).map(function(t){var e=nd(t,2),t=e[0],e=e[1];return s._buildFundamentalLayerFrom(e,t)}),f=this.map.layers._getUserLayers(),y=h.filter(function(e){return d.findIndex(function(t){return e.getId()===t.getId()})<0&&f.findIndex(function(t){return e.getId()===t.layer.getId()})<0}),m=d.filter(function(e){return h.find(function(t){return t.getId()===e.getId()})}).entries(),g=m.next();d.forEach(function(e){var t;g.value&&g.value[1].getId()===e.getId()?(t=h.findIndex(function(t){return t.getId()===e.getId()}),s.map.layers.remove(e.getId()),s.map.layers.add(e,h[t].getId()),g=m.next()):g.value?s.map.layers.add(e,g.value[1]):s.map.layers.add(e)}),y.forEach(function(t){s.map.layers.remove(t)}),f.forEach(function(t){var e,o;t.layer instanceof uc||(o=void 0,s.map.layers.getLayerById(t.before)&&(o=0<(e=s.map.layers.getLayerById(t.before)._buildLayers()).length?e[0]:void 0),n(t.layer.getId(),null==o?void 0:o.id),s.map.layers.move(t.layer,t.before))}),this.map.sources._syncSources(e.sources),this.map.events.remove("styledata",this._onStyleData),this.map.events.addOnce("styledata",this._onStyleData)},sd.prototype._buildFundamentalLayerFrom=function(t,e){if(t&&0<t.length){t=new xp(t,e);return t.onAdd(this.map),t}throw new Error("Unable to construct fundamental map layer for ID: "+e+".")},sd.prototype._transformStyleRequest=function(t,e){t.includes(h)&&(e.url=e.url.replace(h,this.serviceOptions.domain)),t.includes(m)&&(e.url=e.url.replace(m,_)),t.includes(g)&&(e.url=e.url.replace(g,w)),(e.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||e.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&((t=new URL(e.url)).searchParams.get(c)||(t.searchParams.set(c,this.serviceOptions.styleAPIVersion),e.url=t.href),null!==(t=this.map.authentication)&&void 0!==t&&t.signRequest(e))},sd.prototype._request=function(n,r,i,s){var a;return void 0===s&&(s={}),ed(this,void 0,void 0,function(){var e,o;return od(this,function(t){switch(t.label){case 0:return e={url:new D({protocol:"https",domain:n,path:r,queryParams:td(((o={})[c]=this.serviceOptions.styleAPIVersion,o),s)}).toString()},"function"==typeof this.serviceOptions.transformRequest&&i&&(e=this.serviceOptions.transformRequest(e.url,i)),null!==(a=this.map.authentication)&&void 0!==a&&a.signRequest(e),o={method:"GET",mode:"cors"},e.credentials&&(o.credentials=e.credentials),e.headers&&(o.headers=e.headers),[4,fetch(e.url,o).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText+" ")})];case 1:return[2,t.sent()]}})})},sd);function sd(t,e){var s=this;this.definitions=function(){return s.initPromise||s.initStyleset()},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._deferLayerGroupVisibilities=function(e,t){var o,r,n,i=t.filter(function(t){return t in e});0!==i.length&&(o=s.map._getMap(),r=o.getZoom(),(n=Object.entries(e).reduce(function(t,e){var o=nd(e,2),e=o[0],o=o[1],n=i.includes(e);return rd(rd([],nd(t)),nd(o.filter(function(t){if("custom"===t.type)return!1;if(n)if("number"==typeof t.maxzoom&&"number"==typeof t.minzoom){if(r<=t.maxzoom&&r>=t.minzoom)return!1}else if("number"==typeof t.minzoom){if(r>=t.minzoom)return!1}else{if("number"!=typeof t.maxzoom)return!1;if(r<=t.maxzoom)return!1}return"none"!==(null===(t=t.layout)||void 0===t?void 0:t.visibility)})))},[])).forEach(function(t){t.layout=t.layout||{},t.layout.visibility="none"}),s.map.events.addOnce("load",function(){n.forEach(function(t){t.layout.visibility="visible",o.setLayoutProperty(t.id,"visibility","visible")})}))},this._onStyleData=function(){s._lookUpAsync(s.map.getStyle()).then(function(t){s.map.events.invoke("stylechanged",{style:t.name,map:s.map,type:"stylechanged"})})},this._lookUp=function(e){var t=s.definitions().errorIfRejected(),o=s.definitions().resultIfResolved();return t||void 0===o?null:o.configurations.find(function(t){return t.name===(e.style||o.defaultConfiguration)})||o.configurations.find(function(t){return t.name===o.defaultConfiguration})||o.configurations[0]},this._lookUpAsync=function(o){return ed(s,void 0,void 0,function(){var e;return od(this,function(t){switch(t.label){case 0:return[4,this.definitions()];case 1:return e=t.sent(),[2,e.configurations.find(function(t){return t.name===(o.style||e.defaultConfiguration)})||e.configurations.find(function(t){return t.name===e.defaultConfiguration})||e.configurations[0]]}})})},this.map=t,this.serviceOptions=e}var ad,cd,b=window&&window.__extends||(ad=function(t,e){return(ad=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ad(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),ld=window&&window.__assign||function(){return(ld=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ud=window&&window.__awaiter||function(t,s,a,c){return new(a=a||Promise)(function(o,e){function n(t){try{i(c.next(t))}catch(t){e(t)}}function r(t){try{i(c.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((c=c.apply(t,s||[])).next())})},pd=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},hd=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},dd=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},fd=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},yd=(b(md,cd=X),md.prototype.getCanvas=function(){return this.map.getCanvas()},md.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},md.prototype.getMapContainer=function(){return this.map.getContainer()},md.prototype.getServiceOptions=function(){return es(this.serviceOptions,Wh._cloneCustomizer)},md.prototype.setServiceOptions=function(t){this.serviceOptions=(new Wh).merge(this.serviceOptions,t),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap()},md.prototype.addRequestTransformer=function(t){this.serviceOptions.addTransformer(t)},md.prototype.removeRequestTransformer=function(t){this.serviceOptions.removeTransformer(t)},md.prototype.setCamera=function(t,e){if(void 0===e&&(e=!1),"padding"in t||"offset"in t||"bounds"in t){var o,n=(new th).merge({maxZoom:this.getCamera().maxZoom},t),r=this._generateSafeBounds(n.bounds);if(!(o=this.map.cameraForBounds(r,{padding:n.padding,offset:n.offset,maxZoom:n.maxZoom})))throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");this.map.setMaxZoom(n.maxZoom),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),s=this._generateSafeBounds(n.maxBounds)}else{var i=(new rh).merge(this.getCamera(),t);i.centerOffset&&2<=i.centerOffset.length&&(r=i.centerOffset,(n=ei([i.center],i.zoom))[0][0]+=r[0],n[0][1]+=r[1],i.center=ti(n,i.zoom)[0]),o={center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,around:void 0},this.map.setMinZoom(i.minZoom),this.map.setMaxZoom(i.maxZoom),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),s=this._generateSafeBounds(i.maxBounds)}s?this.map.setMaxBounds(s):this.map.setMaxBounds(null);var s=(new Gp).merge(t),t={duration:s.duration,easing:function(t){return t},offset:[0,0],animate:!0},e={fromControl:e};"jump"===s.type?this.map.jumpTo(o,e):"ease"===s.type?this.map.easeTo(ld(ld({},o),t),e):"fly"===s.type&&this.map.flyTo(ld(ld({},o),t),e)},md.prototype.setCameraBounds=function(t){this.setCamera(t)},md.prototype.getCamera=function(){var t=this.map.getBounds().getSouthWest().toArray(),e=this.map.getBounds().getNorthEast().toArray();return{zoom:this.map.getZoom(),center:this.map.getCenter().toArray(),bearing:this.map.getBearing(),pitch:this.map.getPitch(),bounds:new Pi(t,e),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom()}},md.prototype.setStyle=function(t,e){void 0===e&&(e=!0),delete t.preserveDrawingBuffer;t=(new zh).merge(this.styleOptions,t);t.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(t.autoResize),t.language!==this.styleOptions.language&&(this.localizedStringsPromise=jc.getStrings(t.language)),t.renderWorldCopies!==this.styleOptions.renderWorldCopies&&this.map.setRenderWorldCopies(t.renderWorldCopies),t.showFeedbackLink!==this.styleOptions.showFeedbackLink&&this.copyrightControl.setOptions({showFeedbackLink:t.showFeedbackLink}),t.customAttribution!==this.styleOptions.customAttribution&&this.copyrightControl.setOptions({customAttribution:t.customAttribution}),t.showLogo!==this.styleOptions.showLogo&&this.copyrightControl.setOptions({showLogo:t.showLogo}),t.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=t.showTileBoundaries),this.styleOptions=t,this._setStyleComponents(t,e)},md.prototype.getStyle=function(){return qo(this.styleOptions)},md.prototype.addIcon=function(t,e){this.imageSprite.add(t,e)},md.prototype.addPins=function(t,e){var o,n=(new _h).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new Ka(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,iconOptions:{anchor:"center",size:n.iconSize,image:["case",["has","icon"],["get","icon"],n.icon],ignorePlacement:!n.cluster,opacity:n.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],n.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[n.textFont]]],size:["case",["has","point_count"],20,n.fontSize],ignorePlacement:!n.cluster,opacity:n.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[n.textOffset[0]/16,n.textOffset[1]/16]]],color:n.fontColor}})),!(r instanceof Ka))throw new Error("A layer with name '"+n.name+"' already exists but it is not a SymbolLayer.A SymbolLayer should be used for rendering pins.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o,{cluster:n.cluster})),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},md.prototype.addCircles=function(t,e){var o,n=(new ph).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new Ns(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,opacity:n.opacity,radius:["case",["has","radius"],["get","radius"],n.radius],color:["case",["has","color"],["get","color"],n.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],n.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],n.outlineWidth]})),!(r instanceof Ns))throw new Error("A layer with name '"+n.name+"' already exists but it is not a BubbleLayer.A BubbleLayer should be used for rendering circles.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o)),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},md.prototype.addLinestrings=function(t,e){var o,n=(new yh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new ua(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,lineCap:n.cap,lineJoin:n.join,strokeOpacity:n.opacity,strokeColor:["case",["has","color"],["get","color"],n.color],strokeWidth:["case",["has","width"],["get","width"],n.width]})),!(r instanceof ua))throw new Error("A layer with name '"+n.name+"' already exists but it is not a LineLayer.A LineLayer should be used for rendering linestrings.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o)),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},md.prototype.addPolygons=function(t,e){var o,n=(new xh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new ka(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,fillOpacity:n.opacity,fillColor:["case",["has","color"],["get","color"],n.color]})),!(r instanceof ka))throw new Error("A layer with name '"+n.name+"' already exists but it is not a PolygonLayer.A PolygonLayer should be used for rendering linestrings.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o)),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},md.prototype.addRaster=function(t,e){var o=(new Ch).merge(e),n=this.layers.getLayerById(o.name);if(!((n=n||new oc({maxZoom:o.maxZoom,minZoom:o.minZoom,opacity:o.opacity,tileSize:256,tileUrl:"{subdomain}"},o.name))instanceof oc))throw new Error("A layer with name '"+o.name+"' already exists but it is not a TileLayer.A TileLayer should be used for rendering raster images.");if("{subdomain}"!==n.getOptions().tileUrl)throw new Error("A TileLayer with name '"+o.name+"' already exists but was configured for a single tile url [default for new TileLayer(...)].");(e=!o.overwrite&&n.getOptions().subdomains||[]).push.apply(e,dd([],hd(t))),n._setOptionsNoUpdate({subdomains:e}),this.layers.add(n,o.before)},md.prototype.getLayers=function(){return this.layers.getLayers().map(function(t){return t.getId()})},md.prototype.removeLayers=function(t){var e,o;try{for(var n=fd(t),r=n.next();!r.done;r=n.next()){var i,s=r.value;this.layers.getLayerById(s)&&(this.layers.remove(s),i=s+"-source",this.sources.getById(i)&&this.sources.remove(i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},md.prototype.addHtml=function(t,e){t.id||(t.id="marker_"+nr());var o=new Ac({htmlContent:t});return this.markers.add(o,e),t.id},md.prototype.removeHtml=function(t){this.markers.remove(t)},md.prototype.addEventListener=function(t,e,o){this.events._addLegacy(t,e,o)},md.prototype.removeEventListener=function(t,e,o){this.events._removeLegacy(t,e,o)},md.prototype.setUserInteraction=function(t){this.userInteractionDelegate.setOptions(t)},md.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},md.prototype.addControl=function(t,e){this.controls.add(t,e)},md.prototype.removeControl=function(t){this.controls.remove(t)},md.prototype.setTraffic=function(t){var e=this.trafficOptions.incidents,o=this.trafficOptions.flow;if(this.trafficOptions=(new xn).merge(this.trafficOptions,t),this.controls.getControls().filter(function(t){return t instanceof In}).forEach(function(t){return t.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?e||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&"none"!==this.trafficOptions.flow)try{this.trafficOptions.flow!==o&&this.flowDelegate.addToMap()}catch(t){throw this.trafficOptions.flow=o,t}else this.flowDelegate.removeFromMap()},md.prototype.getTraffic=function(){return qo(this.trafficOptions)},md.prototype.remove=function(){this.dispose()},md.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear()},md.prototype.dispose=function(){for(this.clear(),this.map.remove(),this.removed=!0;this.getMapContainer().firstChild;){var t=this.getMapContainer().firstChild;this.getMapContainer().removeChild(t)}},md.prototype.resize=function(t,e,o){"number"!=typeof t&&"string"!=typeof t||"number"!=typeof e&&"string"!=typeof e?o=t:(t=t,this.getMapContainer().style.height="number"==typeof t?t+"px":t,this.getMapContainer().style.width="number"==typeof e?e+"px":e);e=this.getMapContainer().style.overflow;this.getMapContainer().style.overflow="hidden",this.map.resize(o),this.getMapContainer().style.overflow=e},md.prototype.pixelsToPositions=function(t){var e,o,n=[];try{for(var r=fd(t),i=r.next();!i.done;i=r.next()){var s=i.value,a=this.map.unproject(s);n.push(new mi(a.lng,a.lat))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n},md.prototype.positionsToPixels=function(t){var e,o,n=[];try{for(var r=fd(t),i=r.next();!i.done;i=r.next()){var s=i.value,a=this.map.project(s);n.push(new cr(a.x,a.y))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n},md.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},md.prototype.stop=function(){this.map.stop()},md.prototype.triggerRepaint=function(){this.map.triggerRepaint()},md.prototype._getMap=function(){return this.map},md.prototype._rebuildStyle=function(e){return void 0===e&&(e=!0),ud(this,void 0,void 0,function(){return pd(this,function(t){return this.styles.setStyle(this.styleOptions,e),this.imageSprite._restoreImages(),[2]})})},md.prototype._isLoaded=function(){return this.loaded},md.prototype._isReady=function(){return this.ready},md.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},md.prototype._sendRequest=function(t,e,o){var n;return(n="function"==typeof this.serviceOptions.transformRequest?this.serviceOptions.transformRequest(t,e):n)?fetch(n.url||t,{credentials:n.credentials,headers:ld(ld({},o),n.headers),method:"GET",mode:"cors"}):fetch(t,{headers:o,method:"GET",mode:"cors"})},md.prototype._substituteDomainLanguageViewAndSignInRequest=function(t,e){var o,n;(t.includes(d)||t.includes(h))&&(n=new RegExp("[^{]"+d+"[^}]"),t.match(n)&&(e.url=e.url.replace(d,h)),D.protoRegEx.test(this.serviceOptions.domain)?(n=e.url.indexOf(h),e.url=this.serviceOptions.domain+e.url.substring(n+h.length)):e.url=e.url.replace(h,this.serviceOptions.domain)),(e.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||e.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&null!==(o=this.authentication)&&void 0!==o&&o.signRequest(e),t.includes(v)&&(e.url=e.url.replace(v,this.styleOptions.language)),t.includes(f)&&(e.url=this.styleOptions.view?e.url.replace(f,this.styleOptions.view):e.url.replace(f,"").replace("&"+y+"=",""))},md.prototype._setAutoResize=function(t){t?window.addEventListener("resize",this._windowResizeCallback):window.removeEventListener("resize",this._windowResizeCallback)},md.prototype._setStyleComponents=function(e,o){var n=this;void 0===o&&(o=!0),this.removed||this.styles.definitions().then(function(t){n.styleOptions.style&&t.configurations.map(function(t){return t.name}).includes(n.styleOptions.style)||(n.styleOptions.style=t.defaultConfiguration),n.styleOptions=e,n._rebuildStyle(o)})},md.prototype._updateGlobalDefaults=function(t){t&&(t.authOptions&&!ll&&xl(t.authOptions),t.domain&&!ol&&Ol(t.domain),t.styleDefinitionsPath&&!nl&&Tl(t.styleDefinitionsPath),t.workerCount&&!il&&El(t.workerCount),t.maxParallelImageRequests&&!sl&&Cl(t.maxParallelImageRequests),!t.subscriptionKey&&!t["subscription-key"]||ll||Al(t.subscriptionKey||t["subscription-key"]),!t.sessionId&&!t["session-id"]||cl||kl(t.sessionId||t["session-id"]),t.language&&!al&&Pl(t.language),!t.userRegion&&!t.view||el||Il(t.userRegion||t.view))},md.prototype._generateSafeBounds=function(t){if(t){var e=Pi.getSouth(t),o=Pi.getWest(t),n=Pi.getNorth(t),r=Pi.getEast(t);if(!(isFinite(e)&&isFinite(o)&&isFinite(n)&&isFinite(r)))throw new Error("The bounds specified are invalid: ["+t+"]");for(;r<o;)r+=360;return new Pi([o,e,r,n])}return t},md.prototype._detectHighContrast=function(){var t,e;switch(ql.getHighContrastMode()){case"invert":case"light":t=md.Css.hcLight,e="high_contrast_light";break;case"dark":t=md.Css.hcDark,e="high_contrast_dark"}t&&this.map.getContainer().classList.add(t),e&&"road"===this.styleOptions.style&&(this.styleOptions.style=e)},md.Css={canvasContainer:"atlas-map-canvas-container",canvas:"atlas-map-canvas",container:"atlas-map",hcDark:"high-contrast-dark",hcLight:"high-contrast-light"},md);function md(t,e){var n=cd.call(this)||this;n.removed=!1,n.loaded=!1,n.ready=!1,n._windowResizeCallback=function(){return n.resize()};var o,r,i=!0;n._updateGlobalDefaults(e),n.serviceOptions=(new Wh).merge(e),n.styleOptions=(new zh).merge(e),n.trafficOptions=new xn,n.styles=new id(n,n.serviceOptions),n.serviceOptions.authOptions.subscriptionKey&&(n.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(n.serviceOptions.authOptions.subscriptionKey)),o=n.serviceOptions.authOptions.clientId||(n.serviceOptions.authOptions.subscriptionKey?n.serviceOptions.authOptions.subscriptionKey.replace(/.(?=.{3,}$)/g,"*"):"invalid-setting"),n.insights&&n.insights.setAuthenticatedUserContext(n.serviceOptions.sessionId,o),arguments[2]&&"ENVIRONMENT"in window&&window.ENVIRONMENT.hmr?(r=arguments[2],n.ready=!0,n.loaded=!0):(t={antialias:n.styleOptions.antialias,attributionControl:!1,container:t,fadeDuration:n.serviceOptions.fadeDuration,localIdeographFontFamily:n.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:n.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:n.serviceOptions.refreshExpiredTiles,renderWorldCopies:n.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(t,e){var o={url:t};return"Tile"===e||"Source"===e?(t.includes(d)&&n.insights&&n.insights.trackEvent({name:"TileLoad"}),n._substituteDomainLanguageViewAndSignInRequest(t,o)):"Style"!==e&&"SpriteJSON"!==e&&"SpriteImage"!==e&&"Glyphs"!==e||n.styles._transformStyleRequest(t,o),n.serviceOptions.transformRequest&&hn(o,n.serviceOptions.transformRequest(o.url,e)),o}},r=new p.Map(t));try{n.map=r,n.authentication=new op(n),n.controls=new ip(n),n.events=new dp(n),n.imageSprite=new vp(n),n.layers=new Pp(n),n.markers=new mp(n),n.sources=new Bp(n),n.popups=new Ip(n),n.map.getContainer().classList.add(md.Css.container),n.map.getCanvasContainer().classList.add(md.Css.canvasContainer),n.map.getCanvas().classList.add(md.Css.canvas),n._detectHighContrast(),n.copyrightControl=new Ql({showFeedbackLink:n.styleOptions.showFeedbackLink,showLogo:n.styleOptions.showLogo,customAttribution:n.styleOptions.customAttribution}),n.controls.add(n.copyrightControl,{position:u.ControlPosition.NonFixed});var s=n.authentication?n.authentication.initialize():Promise.resolve();if(n.removed)return n;var a=function(){n.loaded=!0,n.map.off("load",a)};n.map.on("load",a);var c=function(){n.ready=!0,n.map.off("styledata",c),n.events.invoke("ready",{map:n,type:"ready"})};n.map.on("styledata",c),n._setAutoResize(n.styleOptions.autoResize),n.map.showTileBoundaries=n.styleOptions.showTileBoundaries,n.localizedStringsPromise=jc.getStrings(n.styleOptions.language);var l=n.styles.initStyleset();Promise.all([s,l]).then(function(t){t=hd(t,2),t[0],t[1];if(!n.removed){if(n.authentication&&!n.authentication.getToken())throw new Error("AuthenticationManager finished initializing, but no token is available");n.serviceOptions["enable-accessibility"]&&n.accessibleMapDelegate.addToMap(),n._setStyleComponents(n.styleOptions),n.copyrightDelegate&&n.copyrightDelegate.addToMap()}}).catch(function(t){t=t instanceof Error?t:new Error(t);n.insights&&n.insights.trackException({error:t}),n.events.invoke("error",{map:n,type:"error",error:t})}),n.setCamera(ld(ld({},e),{type:"jump",duration:0})),n.incidentDelegate=new bu(n),n.flowDelegate=new fu(n),n.accessibleMapDelegate=new du(n),n.userInteractionDelegate=new Iu(n,e),n.userInteractionDelegate.addToMap(),n.copyrightDelegate=new Vu(n,n.copyrightControl,n.styleOptions)}catch(t){throw i=!1,n.insights&&n.insights.trackException({error:t instanceof Error?t:new Error(t)}),t}finally{n.insights&&(n.insights.trackEvent({name:"MapLoad"},{success:i,supported:Sl(!1),supportedWithPerformance:Sl(!0)}),n.insights.flush())}return n}var gd=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},vd=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},k=(_d.applyTemplate=function(e,o){var n,r,t,i=this,s=document.createElement("div");return s.classList.add(_d.Css.template),e&&("boolean"!=typeof(o=o||{}).singleDescription&&(o.singleDescription=!0),o.sandboxContent="boolean"!=typeof o.sandboxContent||o.sandboxContent,o.title&&"string"==typeof o.content&&(o.content.includes("{title}")||o.content.includes("{name}"))||(e.title?o.title="{title}":e.name&&(o.title="{name}")),"boolean"!=typeof o.detectHyperlinks&&(o.detectHyperlinks=!0),"boolean"!=typeof o.parsePropertyPaths&&(o.parsePropertyPaths=!0),o.textColor&&(s.style.color=o.textColor),o.fillColor&&(s.style.backgroundColor=o.fillColor),o.title&&((t=this._applyStringTemplate(e,o.title,o)).innerText=t.textContent||t.innerText||"",this._appendChild(s,t,_d.Css.title)),(n=document.createElement("div")).classList.add(_d.Css.content),Array.isArray(o.content)?0<o.content.length&&o.content[0].propertyPath?this._appendChild(n,this._generateContent(e,o.content,o),_d.Css.item):o.content.forEach(function(t){i._appendChild(n,i._generateContent(e,t,o),_d.Css.item)}):(r=0,e.description&&Object.keys(e).forEach(function(t){i._ignoreProperty(t,e[t])||r++}),t=void 0,1===r||o.singleDescription&&e.description||2===r&&e.Snippet?(t=document.createElement("div")).innerHTML=e.description:t=this._generateContent(e,o.content,o),this._appendChild(n,t,_d.Css.item)),""!==n.innerHTML&&(o.sandboxContent?s.appendChild(_d._createSandboxedIframe(n,o)):s.appendChild(n))),s},_d._createSandboxedIframe=function(t,e){var o=document.createElement("iframe");o.sandbox.add("allow-popups");var n=t.innerHTML,r=!1,i=100,s=550,a=10,c=0;document.body.scrollWidth<=340&&(s=300,i=50);var l=n.split(/<(tr|div|br|li|h[0-9]|p>)/),c=Math.max.apply(Math,vd([],gd(l.map(function(t){return t.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length}))))-1,t=Math.ceil(3.5*c);t<s&&(s=t,i=c),n.includes("<img")||n.includes("<video")?(r=!0,o.width="550px"):(c=-1<n.indexOf(_d.Css.table)?25:20,a+=Math.max(.5*l.length*c,Math.ceil(n.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length/i)*c)),o.width=s+"px",o.height=r||280<a?"280px":a+"px";a=e.textColor?"color:"+e.textColor+";":"",e=e.fillColor?"background-color:"+e.fillColor+";":"",n='<html><head><title></title><meta charset="utf-8" /><meta http-equiv="x-ua-compatible" content="IE=Edge" /><link rel="stylesheet" href="'+_d._cssUrl+'" type="text/css"/><style>html, body{margin:0;padding:0;'+a+e+'}</style></head><body><div class="'+_d.Css.template+'" style="padding:0;width:'+(s-20)+'px">'+n+"</div></body></html>";return void 0===o.srcdoc?o.src="data:text/html;charset=utf-8,"+encodeURI(n):o.srcdoc=n,o},_d._appendChild=function(t,e,o){e&&(o&&(e.className=(e.className?e.className+" ":"")+o),t.appendChild(e))},_d._generateContent=function(t,e,o){if(e)return Array.isArray(e)?this._generatePropertyInfoTable(t,e,o):this._applyStringTemplate(t,e,o);t=this._generateDynamicTableHtml(t,null,o);if(t){o=document.createElement("div");return o.innerHTML=t,o}return null},_d._applyStringTemplate=function(t,e,o){if(e){for(var n,r=e,i=this._placeholderRx.exec(e);i;)2<=i.length&&(n=this._getPropertyValue(t,i[1],o),r=r.replace(i[0],n)),i=this._placeholderRx.exec(e);if(r){(r=r.trim()).includes("<")&&(r=r.replace(/[\r\n]+/g,"<br/>"));var s=document.createElement("div");return s.innerHTML=r,s}}return null},_d._getPropertyValue=function(t,e,o,n){var r=o.parsePropertyPaths?e.split("/"):[e],i=r.length;if(0<i&&t){var s=r[0],a=t[s];if(o.detectHyperlinks&&"link"===e&&(!n||n.hyperlinkFormat)){var c,l=[];if(Array.isArray(a)?a.forEach(function(t){t.href?l.push(t):"string"==typeof t&&l.push({href:t})}):a.href&&l.push(a),0<l.length){n&&n.hyperlinkFormat?c=n.hyperlinkFormat:o&&o.hyperlinkFormat&&(c=o.hyperlinkFormat);var u=c&&c.target?c.target:"_blank",p=[];return l.forEach(function(t){t.title||c&&c.label||!t.rel||p.push(t.rel," - "),p.push('<a href="',t.href,'" target="',u,'">'),t.title?p.push(t.title):c&&c.label?p.push(c.label):p.push(t.href),p.push("</a>","<br/>")}),p.pop(),p.join("")}}if(null!=a){for(var h=void 0,h=1;h<i&&(a=a[r[h]],s=r[h],null!=a);h++);if(h===i&&null!=a){var d=void 0;if((d=void 0!==a.value?a.value:a)instanceof Date)return n&&n.dateFormat?d.toLocaleString(void 0,n.dateFormat):o.dateFormat?d.toLocaleString(void 0,o.dateFormat):d.toISOString();if("object"==typeof d)return(y=this._generateDynamicTableHtml(d,r.slice(1),o))||"";if("number"==typeof d){if(n){if(n.dateFormat)return new Date(d).toLocaleString(void 0,n.dateFormat);if(n.numberFormat)return d.toLocaleString(void 0,n.numberFormat)}else if(/(timestamp|date)/gi.test(s))return new Date(d).toISOString();return d.toLocaleString(void 0,o.numberFormat)}if("string"==typeof d&&""!==d&&!/[\n\r<>\s]/g.test(d)&&(o.detectHyperlinks||n&&n.hyperlinkFormat)){var d=d.trim(),f=this._isUrlRx.test(d)||n&&n.hyperlinkFormat,t=this._isImageUrlRx.test(d)&&(f||d.startsWith("data:image")),e=this._emailRx.test(d);if(f||t||e){f=void 0;n&&n.hyperlinkFormat?f=n.hyperlinkFormat:o&&o.hyperlinkFormat&&(f=o.hyperlinkFormat);var y=void 0;y=f&&f.target?' target="'+f.target+'"':' target="_blank"';o=""+(f&&f.label?f.label:d);f&&f.scheme?d=f.scheme+d:e&&(d="mailto:"+d);e=f&&f.label?' alt="'+f.label+'"':"";return'<a href="'+d+'"'+y+">"+(o=f&&f.isImage||t?'<img src="'+d+'" style="max-width:100%"'+e+'"/>':o)+"</a>"}}return d.toString()}}}return""},_d._generatePropertyInfoTable=function(o,t,n){if(o&&t&&0<t.length){var r=[],i=this;r.push('<table class="'+i.Css.table+'">'),t.forEach(function(t){var e=i._getPropertyValue(o,t.propertyPath,n,t);t.hideLabel?r.push('<tr><td colspan="2">',e,"</td></tr>"):(t=t.label||t.propertyPath.split("/")[0],r.push("<tr><th>",t,"</th><td>",e,"</td></tr>"))}),r.push("</table>");t=document.createElement("div");return t.innerHTML=r.join(""),t}return null},_d._generateDynamicTableHtml=function(e,t,o){var n=this;if(e){var r=[],i=this;r.push('<table class="'+i.Css.table+'">');var s=t&&0<t.length?t.join("/")+"/":"",a=0;return(Object.keys(e).forEach(function(t){n._ignoreProperty(t,e[t])||(r.push("<tr><th>",t,"</th><td>",i._getPropertyValue(e,s+t,o),"</td></tr>"),a++)}),0===a)?null:(r.push("</table>"),r.join(""))}return null},_d._ignoreProperty=function(t,e){switch(t){case"title":case"name":case"base":case"popupTemplate":case"anchor":case"icon":case"image":case"imageUrl":case"rotation":case"color":case"size":case"offset":case"strokeColor":case"strokeWidth":case"strokeOpacity":case"subType":case"fillColor":case"fillOpacity":case"visibility":case"visible":return!0;default:if(0===t.indexOf("_")||null==e||""===e)return!0}return!1},_d._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,_d._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,_d._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,_d._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,_d._cssUrl=new D({domain:e,path:"sdk/javascript/mapcontrol/"+F.getEndpointVersion()+"/atlas.min.css"}).toString(),_d.Css={template:"azure-maps-control-popup-template",title:"azure-maps-control-popup-template-title",content:"azure-maps-control-popup-template-content",item:"azure-maps-control-popup-template-content-item",table:"azure-maps-control-popup-template-table"},_d);function _d(){this.detectHyperlinks=!0,this.parsePropertyPaths=!0}b=new D({domain:e,path:"sdk/javascript/mapcontrol/"+F.getEndpointVersion()+"/mapbox-gl-rtl-text.min.js"});n.setRTLTextPlugin(b.toString(),function(t){t&&console.warn(t)},!0),u.HtmlMarker=Ac,u.Map=yd,u.Pixel=cr,u.Popup=Sc,u.PopupTemplate=k,u.Shape=xi,u._getAssetDomain=function(){return t},u._getDomain=function(){return Yc},u._hasMaxParallelImageRequests=Dl,u._hasSetAuthenticationOptions=Rl,u._hasSetDomain=Nl,u._hasSetLanguage=zl,u._hasSetSessionId=Bl,u._hasSetStyleDefinitionsPath=Ml,u._hasSetStyleDefinitionsVersion=function(){return rl},u._hasSetView=Fl,u._hasWorkerCount=jl,u.addImageTemplate=function(t,e,o){!o&&Ul[t.toLowerCase()]||(Ul[t.toLowerCase()]=e)},u.clearPrewarmedResources=function(){p.clearPrewarmedResources()},u.control=Tt,u.data=Lt,u.getAllImageTemplateNames=function(){return Object.keys(Ul)},u.getAuthenticationOptions=ul,u.getDomain=hl,u.getImageTemplate=Ll,u.getLanguage=vl,u.getMaxParallelImageRequests=gl,u.getSessionId=_l,u.getStaticAssetsDomain=pl,u.getStyleAPIVersion=yl,u.getStyleDefinitionsPath=dl,u.getStyleDefinitionsVersion=fl,u.getSubscriptionKey=wl,u.getUserRegion=function(){return Zc},u.getVersion=function(){return F.getFullVersion()},u.getView=bl,u.getWorkerCount=ml,u.internal=ot,u.isSupported=Sl,u.layer=At,u.math=It,u.prewarm=function(){p.prewarm()},u.setAuthenticationOptions=xl,u.setDomain=Ol,u.setLanguage=Pl,u.setMaxParallelImageRequests=Cl,u.setSessionId=kl,u.setStyleAPIVersion=function(t){$c=t},u.setStyleDefinitionsPath=Tl,u.setStyleDefinitionsVersion=function(t){Xc=t,rl=!0},u.setSubscriptionKey=Al,u.setUserRegion=Il,u.setView=function(t){Zc=t,el=!0},u.setWorkerCount=El,u.source=R,Object.defineProperty(u,"__esModule",{value:!0})});
55
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("azuremaps-maplibre-gl")):"function"==typeof define&&define.amd?define(["exports","azuremaps-maplibre-gl"],e):e((t=t||self).atlas=t.atlas||{},t.maplibregl)}(this,function(u,n){"use strict";var p="default"in n?n.default:n,t="atlas.microsoft.com",e="atlas.microsoft.com",o="styling",r="2022-08-05",i="https://login.microsoftonline.com/",l="api-version",s="Authorization",a="Bearer ",c="jwt-sas ",h="{{azMapsDomain}}",d="{azMapsDomain}",f="{{azMapsView}}",y="view",m="{{azMapsLanguage}}",g="{{azMapsStylingPath}}",v="{{azMapsStylePath}}",_="styling",w="styles",b="2.0",S="Map-Agent",x="x-ms-client-id",O="Ms-Am-Request-Origin",T="MapControl",E="https://atlas.microsoft.com/",C="Session-Id",P=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},k=(A.prototype.merge=function(){for(var e,t,o,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{for(var i=P(n),s=i.next();!s.done;s=i.next()){var a=s.value;if(a)for(var l in a)a.hasOwnProperty(l)&&this.hasOwnProperty(l)&&(void 0!==a[l]&&null!=a[l]?this[l]instanceof A?this[l].merge(a[l]):this[l]=a[l]:(o=o||new(Object.getPrototypeOf(this).constructor),this[l]=o[l]))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return this},A);function A(){}var I,L,R=window&&window.__extends||(I=function(t,e){return(I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),N=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},M=(R(j,L=k),j);function j(){var t=null!==L&&L.apply(this,arguments)||this;return t.domain=void 0,t.headers={},t.path="",t.protocol="https",t.queryParams={},t.subdomain="",t}var D=(z.prototype.get=function(){return fetch(this.toString(),{method:"GET",mode:"cors",headers:new Headers(this.options.headers)}).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText)})},z.prototype.toString=function(){var t=this,e=Object.entries(t.options.queryParams).map(function(t){t=N(t,2);return t[0]+"="+t[1]}).join("&"),o=[],n=t.options.path||"";return z.protoRegEx.test(n)?o.push(n):(t.options.domain&&(z.protoRegEx.test(t.options.domain)||(o.push(t.options.protocol+"://"),o.push(t.options.subdomain?t.options.subdomain+".":"")),o.push(t.options.domain)),o.push(t.options.path?"/"+n:"")),o.push(e?"?"+e:""),o.join("")},z.protoRegEx=new RegExp(/^(((file|http|https):\/\/)|blob:)/i),z);function z(t){this.options=(new M).merge(t)}var B="2.2.4",F=(U.getFullVersion=function(){return B},U.getEndpointVersion=function(){var t=B.indexOf(".");return-1===(t=B.indexOf(".",t+1))?B:B.substring(0,t)},U);function U(){}function q(t){var e=document.createElement("span");return e.innerText=t,e.classList.add("tooltiptext"),-1!=navigator.userAgent.indexOf("Edg")?e.classList.add("edge"):-1!=navigator.userAgent.indexOf("Chrome")?e.classList.add("chrome"):-1!=navigator.userAgent.indexOf("Safari")?e.classList.add("safari"):-1!=navigator.userAgent.indexOf("Firefox")&&e.classList.add("firefox"),-1!=navigator.userAgent.indexOf("Windows")?e.classList.add("win"):-1!=navigator.userAgent.indexOf("Macintosh")&&e.classList.add("mac"),e}function G(r,i,s){function t(t){var e=i.getBoundingClientRect(),o=r.getBoundingClientRect(),n=e.x+o.width>window.innerWidth?window.innerWidth-o.width:e.x,o=e.y+e.height+o.height+4>window.innerHeight?e.y-o.height-4:e.y+e.height+4;s&&i.parentElement&&(e=i.parentElement?i.parentElement.getBoundingClientRect():null,r.style.position="absolute",n-=e.x,o-=e.y),r.style.transform="translate("+n+"px, "+o+"px)"}void 0===s&&(s=!1),i.addEventListener("mouseover",t),i.addEventListener("focusin",t)}var Z,H=window&&window.__extends||(Z=function(t,e){return(Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Z(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});(Lt=u.ControlPosition||(u.ControlPosition={})).TopLeft="top-left",Lt.TopRight="top-right",Lt.BottomLeft="bottom-left",Lt.BottomRight="bottom-right",Lt.NonFixed="non-fixed";var K,W=(H(V,K=k),V);function V(){var t=null!==K&&K.apply(this,arguments)||this;return t.position=u.ControlPosition.NonFixed,t}var Y=(Q.prototype.getLuminosity=function(){for(var t=[this.r,this.g,this.b],e=[],o=0;o<t.length;o++){var n=t[o]/255;e[o]=n<=.03928?n/12.92:Math.pow((.055+n)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},Q.prototype.getRBGA=function(t){var e=document.createElement("canvas").getContext("2d");e.globalAlpha=1,e.fillStyle=t,e.fillRect(0,0,1,1);e=e.getImageData(0,0,1,1).data;return[e[0],e[1],e[2],e[3]]},Q);function Q(t){var e;t&&(e=void 0,3<=(e="string"==typeof t?this.getRBGA(t):t).length&&(this.r=e[0],this.g=e[1],this.b=e[2],3<e.length&&(this.a=e[3])))}(Mt=u.ControlStyle||(u.ControlStyle={})).light="light",Mt.dark="dark",Mt.auto="auto";var J=Map,X=($.prototype._addEventListener=function(t,e,o){this.listeners.has(t)||this.listeners.set(t,new J),this.listeners.get(t).set(e,o)},$.prototype._removeEventListener=function(t,e){this.listeners.has(t)&&this.listeners.get(t).delete(e)},$.prototype._invokeEvent=function(o,n){var r=this;this.listeners.has(o)&&this.listeners.get(o).forEach(function(t,e){t&&r._removeEventListener(o,e);try{e(n)}catch(t){console.error(t)}})},$);function $(){this.listeners=new J}var tt,et,ot=Object.freeze({__proto__:null,EventEmitter:X}),nt=((window&&window.__extends||(tt=function(t,e){return(tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}tt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(rt,et=X),rt.prototype.onRemove=function(){this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.events.remove("stylechanged",this._onStyleChange),delete this._map),this._observer&&(this._observer.disconnect(),delete this._observer),delete this._theme},rt.prototype.buildContainer=function(t,e,o,n){var r=this;return this._map=t,this._container=document.createElement(n||"div"),this._container.classList.add("azure-maps-control-container"),"string"==typeof o&&this._container.setAttribute("aria-label",o),e.toLowerCase()===u.ControlStyle.auto?this._map.styles.definitions().then(function(t){r._map&&r._map.events.add("stylechanged",r._onStyleChange)}):this._container.classList.add(e),this._container},rt.prototype._setTheme=function(t){this._theme!==t&&(this._container.classList.remove(this._theme),this._container.classList.add(t),this._theme=t)},rt.activateClickDelay=100,rt);function rt(){var e=null!==et&&et.apply(this,arguments)||this;return e._onStyleChange=function(){e._map.getStyle().style.toLowerCase().startsWith("blank")?e._observer||(e._onBackgroundChange(),e._observer=new MutationObserver(e._onBackgroundChange),e._observer.observe(e._map.getMapContainer(),{attributes:!0,attributeFilter:["style"]})):(e._observer&&(e._observer.disconnect(),delete e._observer),e._map.styles.getThemeAsync(e._map.getStyle()).then(function(t){e._setTheme(t)}))},e._onBackgroundChange=function(){var t=new Y(e._map.getMapContainer().style.backgroundColor).getLuminosity(),t=isNaN(t)||.5<t?u.ControlStyle.light:u.ControlStyle.dark;e._setTheme(t)},e}var it,st,at=((window&&window.__extends||(it=function(t,e){return(it=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}it(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(lt,st=k),lt);function lt(){var t=null!==st&&st.apply(this,arguments)||this;return t.rotationDegreesDelta=15,t.style=u.ControlStyle.light,t.inverted=!1,t}var ct,ut,pt=((window&&window.__extends||(ct=function(t,e){return(ct=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ct(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ht,ut=nt),ht.prototype.onAdd=function(t,e){var o=this,n=this.buildContainer(t,this.options.style,"Rotation Control"),r=this.constructRotationButton(t),i=this.constructRotationGrid(t,e),t=q("Reset to Default Rotation");return n.addEventListener("mouseover",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasMouse=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasFocus=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(t){"Escape"!==t.key&&"Esc"!==t.key||(t.stopPropagation(),r.focus(),n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),e&&ht.InvertOrderPositions.includes(e.position)?(n.appendChild(i),n.appendChild(r),n.appendChild(t),G(t,r)):(n.appendChild(r),n.appendChild(t),G(t,r),n.appendChild(i)),n},ht.prototype.constructRotationGrid=function(t,e){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element");var n=this.constructRightRotationButton(t),r=this.constructLeftRotationButton(t),i=q("Rotate Left"),t=q("Rotate Right");return e&&ht.InvertOrderPositions.includes(e.position)?(o.appendChild(n),o.appendChild(t),G(t,n),o.appendChild(r),o.appendChild(i),G(i,r)):(o.appendChild(r),o.appendChild(i),G(i,r),o.appendChild(n),o.appendChild(t),G(t,n)),o},ht.prototype.constructRotationButton=function(e){var o=this,t=document.createElement("button");t.classList.add("azure-maps-control-button"),t.classList.add("rotation"),t.setAttribute("aria-label","Reset to Default Rotation"),t.setAttribute("alt","Reset to Default Rotation"),t.setAttribute("type","button");var n=document.createElement("div");return t.appendChild(n),t.addEventListener("click",function(t){t.timeStamp-o.lastActiveTime>nt.activateClickDelay&&e.setCamera({bearing:ht.DefaultRotation},!0)}),e.events.add("rotate",function(t){n.style.transform="rotate("+-t.map.getCamera().bearing+"deg)"}),t},ht.prototype.constructRightRotationButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("rotation-right"),o.setAttribute("aria-label","Rotate Right"),o.setAttribute("alt","Rotate Right"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({bearing:t.getCamera().bearing-(e.options.inverted?-1:1)*e.options.rotationDegreesDelta,duration:ht.RotationDuration,type:"ease"},!0)}),o},ht.prototype.constructLeftRotationButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("rotation-left"),o.setAttribute("aria-label","Rotate Left"),o.setAttribute("alt","Rotate Left"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({bearing:t.getCamera().bearing+(e.options.inverted?-1:1)*e.options.rotationDegreesDelta,duration:ht.RotationDuration,type:"ease"},!0)}),o},ht.DefaultRotation=0,ht.RotationDuration=100,ht.InvertOrderPositions=[u.ControlPosition.BottomRight,u.ControlPosition.TopRight],ht);function ht(t){var e=ut.call(this)||this;return e.hasMouse=!1,e.hasFocus=!1,e.options=(new at).merge(t),e}var dt,ft,yt=((window&&window.__extends||(dt=function(t,e){return(dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}dt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(mt,ft=k),mt);function mt(){var t=null!==ft&&ft.apply(this,arguments)||this;return t.pitchDegreesDelta=10,t.style=u.ControlStyle.light,t.inverted=!1,t}var gt,vt,_t=((window&&window.__extends||(gt=function(t,e){return(gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}gt(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(wt,vt=nt),wt.prototype.onAdd=function(t,e){var o=this,n=this.buildContainer(t,this.options.style,"Pitch Control"),r=this.constructPitchButton(t),i=this.constructPitchGrid(t,e),s=q("Reset to Default Pitch");return n.addEventListener("mouseover",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasMouse=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(t){o.lastActiveTime=o.lastActiveTime||t.timeStamp,o.hasFocus=!0,n.classList.add("in-use"),i.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(delete o.lastActiveTime,n.classList.remove("in-use"),i.classList.add("hidden-accessible-element")))}),i.addEventListener("keydown",function(t){"Escape"!==t.key&&"Esc"!==t.key||(t.stopPropagation(),r.focus(),n.classList.remove("in-use"),i.classList.add("hidden-accessible-element"))}),e&&wt.INVERT_ORDER_POSITIONS.includes(e.position)?(n.appendChild(i),n.appendChild(r),n.appendChild(s),G(s,n)):(n.appendChild(r),n.appendChild(s),G(s,n),n.appendChild(i)),this.map=t,this.container=n,this.pitchButton=r,t.events.add("pitch",this.pitchChanged),this.updatePitchButtonsState(),n},wt.prototype.onRemove=function(){this.container&&(this.container.remove(),this.container=null,this.pitchButton=null,this.pitchIncrementButton=null,this.pitchDecrementButton=null),this.map&&(this.map.events.remove("pitch",this.pitchChanged),this.map=null)},wt.prototype.constructPitchGrid=function(t,e){var o=document.createElement("div");o.classList.add("sub-container"),o.classList.add("hidden-accessible-element"),this.pitchIncrementButton=this.constructPitchIncrementButton(t),this.pitchDecrementButton=this.constructPitchDecrementButton(t);var n=q("Increase Pitch"),t=q("Decrease Pitch");return e&&wt.INVERT_ORDER_POSITIONS.includes(e.position)?(o.appendChild(this.pitchDecrementButton),o.appendChild(t),G(t,this.pitchDecrementButton),o.appendChild(this.pitchIncrementButton),o.appendChild(n),G(n,this.pitchIncrementButton)):(o.appendChild(this.pitchIncrementButton),o.appendChild(n),G(n,this.pitchIncrementButton),o.appendChild(this.pitchDecrementButton),o.appendChild(t),G(t,this.pitchDecrementButton)),o},wt.prototype.constructPitchButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch"),o.setAttribute("aria-label","Reset to Default Pitch"),o.setAttribute("alt","Reset to Default Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){event.timeStamp-e.lastActiveTime>nt.activateClickDelay&&t.setCamera({pitch:wt.DEFAULT_PITCH},!0)}),o},wt.prototype.constructPitchDecrementButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch-down"),o.setAttribute("aria-label","Decrease Pitch"),o.setAttribute("alt","Decrease Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({pitch:t.getCamera().pitch-(e.options.inverted?-1:1)*e.options.pitchDegreesDelta,duration:wt.PITCH_DURATION_MS,type:"ease"},!0)}),o},wt.prototype.constructPitchIncrementButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("pitch-up"),o.setAttribute("aria-label","Increase Pitch"),o.setAttribute("alt","Increase Pitch"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({pitch:t.getCamera().pitch+(e.options.inverted?-1:1)*e.options.pitchDegreesDelta,duration:wt.PITCH_DURATION_MS,type:"ease"},!0)}),o},wt.PITCH_DURATION_MS=100,wt.DEFAULT_PITCH=0,wt.INVERT_ORDER_POSITIONS=[u.ControlPosition.BottomRight,u.ControlPosition.TopRight],wt);function wt(t){var o=vt.call(this)||this;return o.container=null,o.map=null,o.pitchButton=null,o.pitchIncrementButton=null,o.pitchDecrementButton=null,o.hasMouse=!1,o.hasFocus=!1,o.pitchChanged=function(t){return o.updatePitchButtonsState()},o.updatePitchButtonsState=function(){var t=o.map.getCamera().pitch<=0,e=60<=o.map.getCamera().pitch;o.hasFocus&&o.pitchButton&&(t||e)&&o.pitchButton.focus(),o.options.inverted?(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=t&&(o.pitchIncrementButton.disabled=t),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=e&&(o.pitchDecrementButton.disabled=e)):(o.pitchIncrementButton&&o.pitchIncrementButton.disabled!=e&&(o.pitchIncrementButton.disabled=e),o.pitchDecrementButton&&o.pitchDecrementButton.disabled!=t&&(o.pitchDecrementButton.disabled=t))},o.options=(new yt).merge(t),o}var bt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var o=t.length;o--;)if(bt(t[o][0],e))return o;return-1},xt=Array.prototype.splice;var Ot=function(t){var e=this.__data__;return!((t=St(e,t))<0)&&(t==e.length-1?e.pop():xt.call(e,t,1),--this.size,!0)};var Tt=function(t){var e=this.__data__;return(t=St(e,t))<0?void 0:e[t][1]};var Et=function(t){return-1<St(this.__data__,t)};var Ct=function(t,e){var o=this.__data__,n=St(o,t);return n<0?(++this.size,o.push([t,e])):o[n][1]=e,this};function Pt(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}Pt.prototype.clear=function(){this.__data__=[],this.size=0},Pt.prototype.delete=Ot,Pt.prototype.get=Tt,Pt.prototype.has=Et,Pt.prototype.set=Ct;var kt=Pt;var At=function(){this.__data__=new kt,this.size=0};var It=function(t){var e=this.__data__,t=e.delete(t);return this.size=e.size,t};R=function(t){return this.__data__.get(t)};var Lt=function(t){return this.__data__.has(t)},H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Rt(t,e){return t(e={exports:{}},e.exports),e.exports}var Nt="object"==typeof H&&H&&H.Object===Object&&H,Mt="object"==typeof self&&self&&self.Object===Object&&self,jt=Nt||Mt||Function("return this")(),Ot=jt.Symbol,Tt=Object.prototype,Dt=Tt.hasOwnProperty,zt=Tt.toString,Bt=Ot?Ot.toStringTag:void 0;var Ft=function(t){var e=Dt.call(t,Bt),o=t[Bt];try{var n=!(t[Bt]=void 0)}catch(t){}var r=zt.call(t);return n&&(e?t[Bt]=o:delete t[Bt]),r},Ut=Object.prototype.toString;var qt=function(t){return Ut.call(t)},Gt=Ot?Ot.toStringTag:void 0;var Zt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":(Gt&&Gt in Object(t)?Ft:qt)(t)};var Ht=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var Kt=function(t){return!!Ht(t)&&("[object Function]"==(t=Zt(t))||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t)},Et=jt["__core-js_shared__"],Wt=(Ct=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||""))?"Symbol(src)_1."+Ct:"";var Vt=function(t){return!!Wt&&Wt in t},Yt=Function.prototype.toString;var Qt=function(t){if(null!=t){try{return Yt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Jt=/^\[object .+?Constructor\]$/,H=Function.prototype,Mt=Object.prototype,Tt=H.toString,Et=Mt.hasOwnProperty,Xt=RegExp("^"+Tt.call(Et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $t=function(t){return!(!Ht(t)||Vt(t))&&(Kt(t)?Xt:Jt).test(Qt(t))};var te=function(t,e){return null==t?void 0:t[e]};var ee=function(t,e){return e=te(t,e),$t(e)?e:void 0},oe=ee(jt,"Map"),ne=ee(Object,"create");var Ct=function(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t},re=Object.prototype.hasOwnProperty;var H=function(t){var e=this.__data__;if(ne){var o=e[t];return"__lodash_hash_undefined__"===o?void 0:o}return re.call(e,t)?e[t]:void 0},ie=Object.prototype.hasOwnProperty;Mt=function(t){var e=this.__data__;return ne?void 0!==e[t]:ie.call(e,t)};Tt=function(t,e){var o=this.__data__;return this.size+=this.has(t)?0:1,o[t]=ne&&void 0===e?"__lodash_hash_undefined__":e,this};function se(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}se.prototype.clear=function(){this.__data__=ne?ne(null):{},this.size=0},se.prototype.delete=Ct,se.prototype.get=H,se.prototype.has=Mt,se.prototype.set=Tt;var ae=se;Et=function(){this.size=0,this.__data__={hash:new ae,map:new(oe||kt),string:new ae}};var le=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ce=function(t,e){return t=t.__data__,le(e)?t["string"==typeof e?"string":"hash"]:t.map};Ct=function(t){return t=ce(this,t).delete(t),this.size-=t?1:0,t};H=function(t){return ce(this,t).get(t)};Mt=function(t){return ce(this,t).has(t)};Tt=function(t,e){var o=ce(this,t),n=o.size;return o.set(t,e),this.size+=o.size==n?0:1,this};function ue(t){var e=-1,o=null==t?0:t.length;for(this.clear();++e<o;){var n=t[e];this.set(n[0],n[1])}}ue.prototype.clear=Et,ue.prototype.delete=Ct,ue.prototype.get=H,ue.prototype.has=Mt,ue.prototype.set=Tt;var pe=ue;Ct=function(t,e){var o=this.__data__;if(o instanceof kt){var n=o.__data__;if(!oe||n.length<199)return n.push([t,e]),this.size=++o.size,this;o=this.__data__=new pe(n)}return o.set(t,e),this.size=o.size,this};function he(t){t=this.__data__=new kt(t);this.size=t.size}he.prototype.clear=At,he.prototype.delete=It,he.prototype.get=R,he.prototype.has=Lt,he.prototype.set=Ct;var de=he;var fe=function(t,e){for(var o=-1,n=null==t?0:t.length;++o<n&&!1!==e(t[o],o,t););return t},ye=function(){try{var t=ee(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var me=function(t,e,o){"__proto__"==e&&ye?ye(t,e,{configurable:!0,enumerable:!0,value:o,writable:!0}):t[e]=o},ge=Object.prototype.hasOwnProperty;var ve=function(t,e,o){var n=t[e];ge.call(t,e)&&bt(n,o)&&(void 0!==o||e in t)||me(t,e,o)};var _e=function(t,e,o,n){var r=!o;o=o||{};for(var i=-1,s=e.length;++i<s;){var a=e[i],l=n?n(o[a],t[a],a,o,t):void 0;void 0===l&&(l=t[a]),(r?me:ve)(o,a,l)}return o};var we=function(t,e){for(var o=-1,n=Array(t);++o<t;)n[o]=e(o);return n};var be=function(t){return null!=t&&"object"==typeof t};var H=function(t){return be(t)&&"[object Arguments]"==Zt(t)},Mt=Object.prototype,Se=Mt.hasOwnProperty,xe=Mt.propertyIsEnumerable,Oe=H(function(){return arguments}())?H:function(t){return be(t)&&Se.call(t,"callee")&&!xe.call(t,"callee")},Te=Array.isArray;function Ee(){return!1}var Ce=Rt(function(t,e){var o=e&&!e.nodeType&&e,e=o&&t&&!t.nodeType&&t,o=e&&e.exports===o?jt.Buffer:void 0,o=o?o.isBuffer:void 0;t.exports=o||Ee}),Pe=/^(?:0|[1-9]\d*)$/;var ke=function(t,e){var o=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==o||"symbol"!=o&&Pe.test(t))&&-1<t&&t%1==0&&t<e};var Ae=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991},Ie={};Ie["[object Float32Array]"]=Ie["[object Float64Array]"]=Ie["[object Int8Array]"]=Ie["[object Int16Array]"]=Ie["[object Int32Array]"]=Ie["[object Uint8Array]"]=Ie["[object Uint8ClampedArray]"]=Ie["[object Uint16Array]"]=Ie["[object Uint32Array]"]=!0,Ie["[object Arguments]"]=Ie["[object Array]"]=Ie["[object ArrayBuffer]"]=Ie["[object Boolean]"]=Ie["[object DataView]"]=Ie["[object Date]"]=Ie["[object Error]"]=Ie["[object Function]"]=Ie["[object Map]"]=Ie["[object Number]"]=Ie["[object Object]"]=Ie["[object RegExp]"]=Ie["[object Set]"]=Ie["[object String]"]=Ie["[object WeakMap]"]=!1;Tt=function(t){return be(t)&&Ae(t.length)&&!!Ie[Zt(t)]};var At=function(e){return function(t){return e(t)}},It=Rt(function(t,e){var e=e&&!e.nodeType&&e,o=e&&t&&!t.nodeType&&t,n=o&&o.exports===e&&Nt.process,e=function(){try{var t=o&&o.require&&o.require("util").types;return t?t:n&&n.binding&&n.binding("util")}catch(t){}}();t.exports=e}),R=It&&It.isTypedArray,Le=R?At(R):Tt,Re=Object.prototype.hasOwnProperty;var Ne=function(t,e){var o,n=Te(t),r=!n&&Oe(t),i=!n&&!r&&Ce(t),s=!n&&!r&&!i&&Le(t),a=n||r||i||s,l=a?we(t.length,String):[],c=l.length;for(o in t)!e&&!Re.call(t,o)||a&&("length"==o||i&&("offset"==o||"parent"==o)||s&&("buffer"==o||"byteLength"==o||"byteOffset"==o)||ke(o,c))||l.push(o);return l},Me=Object.prototype;var je=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Me)};var Lt=function(e,o){return function(t){return e(o(t))}},De=Lt(Object.keys,Object),ze=Object.prototype.hasOwnProperty;var Be=function(t){if(!je(t))return De(t);var e,o=[];for(e in Object(t))ze.call(t,e)&&"constructor"!=e&&o.push(e);return o};var Fe=function(t){return null!=t&&Ae(t.length)&&!Kt(t)};var Ue=function(t){return(Fe(t)?Ne:Be)(t)};var qe=function(t,e){return t&&_e(e,Ue(e),t)};var Ge=function(t){var e=[];if(null!=t)for(var o in Object(t))e.push(o);return e},Ze=Object.prototype.hasOwnProperty;var He=function(t){if(!Ht(t))return Ge(t);var e,o=je(t),n=[];for(e in t)("constructor"!=e||!o&&Ze.call(t,e))&&n.push(e);return n};var Ke=function(t){return Fe(t)?Ne(t,!0):He(t)};var We=function(t,e){return t&&_e(e,Ke(e),t)},Ve=Rt(function(t,e){var o=e&&!e.nodeType&&e,e=o&&t&&!t.nodeType&&t,o=e&&e.exports===o?jt.Buffer:void 0,n=o?o.allocUnsafe:void 0;t.exports=function(t,e){return e?t.slice():(e=t.length,e=n?n(e):new t.constructor(e),t.copy(e),e)}});var Ye=function(t,e){var o=-1,n=t.length;for(e=e||Array(n);++o<n;)e[o]=t[o];return e};var Qe=function(t,e){for(var o=-1,n=null==t?0:t.length,r=0,i=[];++o<n;){var s=t[o];e(s,o,t)&&(i[r++]=s)}return i};var Ct=function(){return[]},Je=Object.prototype.propertyIsEnumerable,Xe=Object.getOwnPropertySymbols,$e=Xe?function(e){return null==e?[]:(e=Object(e),Qe(Xe(e),function(t){return Je.call(e,t)}))}:Ct;var to=function(t,e){return _e(t,$e(t),e)};var eo=function(t,e){for(var o=-1,n=e.length,r=t.length;++o<n;)t[r+o]=e[o];return t},oo=Lt(Object.getPrototypeOf,Object),no=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)eo(e,$e(t)),t=oo(t);return e}:Ct;var ro=function(t,e){return _e(t,no(t),e)};var io=function(t,e,o){return e=e(t),Te(t)?e:eo(e,o(t))};var so=function(t){return io(t,Ue,$e)};function ao(t){return io(t,Ke,no)}var Mt=ee(jt,"DataView"),H=ee(jt,"Promise"),R=ee(jt,"Set"),Tt=ee(jt,"WeakMap"),lo="[object Map]",co="[object Promise]",uo="[object Set]",po="[object WeakMap]",ho="[object DataView]",fo=Qt(Mt),yo=Qt(oe),mo=Qt(H),go=Qt(R),vo=Qt(Tt),Lt=Zt,_o=Lt=Mt&&Lt(new Mt(new ArrayBuffer(1)))!=ho||oe&&Lt(new oe)!=lo||H&&Lt(H.resolve())!=co||R&&Lt(new R)!=uo||Tt&&Lt(new Tt)!=po?function(t){var e=Zt(t),t="[object Object]"==e?t.constructor:void 0,t=t?Qt(t):"";if(t)switch(t){case fo:return ho;case yo:return lo;case mo:return co;case go:return uo;case vo:return po}return e}:Lt,wo=Object.prototype.hasOwnProperty;var bo=function(t){var e=t.length,o=new t.constructor(e);return e&&"string"==typeof t[0]&&wo.call(t,"index")&&(o.index=t.index,o.input=t.input),o},So=jt.Uint8Array;var xo=function(t){var e=new t.constructor(t.byteLength);return new So(e).set(new So(t)),e};var Oo=function(t,e){return e=e?xo(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength)},To=/\w*$/;var Eo=function(t){var e=new t.constructor(t.source,To.exec(t));return e.lastIndex=t.lastIndex,e},Ct=Ot?Ot.prototype:void 0,Co=Ct?Ct.valueOf:void 0;var Po=function(t){return Co?Object(Co.call(t)):{}};var ko=function(t,e){return e=e?xo(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length)};var Ao=function(t,e,o){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return xo(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return Oo(t,o);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ko(t,o);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return Eo(t);case"[object Set]":return new n;case"[object Symbol]":return Po(t)}},Io=Object.create;function Lo(){}var Ro=function(t){if(!Ht(t))return{};if(Io)return Io(t);Lo.prototype=t;t=new Lo;return Lo.prototype=void 0,t};var No=function(t){return"function"!=typeof t.constructor||je(t)?{}:Ro(oo(t))};var Mt=function(t){return be(t)&&"[object Map]"==_o(t)},H=It&&It.isMap,Mo=H?At(H):Mt;var R=function(t){return be(t)&&"[object Set]"==_o(t)},Tt=It&&It.isSet,jo=Tt?At(Tt):R,Do="[object Arguments]",zo="[object Function]",Bo="[object Object]",Fo={};Fo[Do]=Fo["[object Array]"]=Fo["[object ArrayBuffer]"]=Fo["[object DataView]"]=Fo["[object Boolean]"]=Fo["[object Date]"]=Fo["[object Float32Array]"]=Fo["[object Float64Array]"]=Fo["[object Int8Array]"]=Fo["[object Int16Array]"]=Fo["[object Int32Array]"]=Fo["[object Map]"]=Fo["[object Number]"]=Fo[Bo]=Fo["[object RegExp]"]=Fo["[object Set]"]=Fo["[object String]"]=Fo["[object Symbol]"]=Fo["[object Uint8Array]"]=Fo["[object Uint8ClampedArray]"]=Fo["[object Uint16Array]"]=Fo["[object Uint32Array]"]=!0,Fo["[object Error]"]=Fo[zo]=Fo["[object WeakMap]"]=!1;var Uo=function o(n,r,i,t,e,s){var a,l=1&r,c=2&r,u=4&r;if(void 0!==(a=i?e?i(n,t,e,s):i(n):a))return a;if(!Ht(n))return n;var p=Te(n);if(p){if(a=bo(n),!l)return Ye(n,a)}else{var h=_o(n),t=h==zo||"[object GeneratorFunction]"==h;if(Ce(n))return Ve(n,l);if(h==Bo||h==Do||t&&!e){if(a=c||t?{}:No(n),!l)return c?ro(n,We(a,n)):to(n,qe(a,n))}else{if(!Fo[h])return e?n:{};a=Ao(n,h,l)}}l=(s=s||new de).get(n);if(l)return l;s.set(n,a),jo(n)?n.forEach(function(t){a.add(o(t,r,i,t,n,s))}):Mo(n)&&n.forEach(function(t,e){a.set(e,o(t,r,i,e,n,s))});var c=u?c?ao:so:c?keysIn:Ue,d=p?void 0:c(n);return fe(d||n,function(t,e){d&&(t=n[e=t]),ve(a,e,o(t,r,i,e,n,s))}),a};var qo=function(t){return Uo(t,5)};var Go=function(t,e,o){(void 0===o||bt(t[e],o))&&(void 0!==o||e in t)||me(t,e,o)};var Zo=function(l){return function(t,e,o){for(var n=-1,r=Object(t),i=o(t),s=i.length;s--;){var a=i[l?s:++n];if(!1===e(r[a],a,r))break}return t}}();var Ho=function(t){return be(t)&&Fe(t)},Lt=Function.prototype,Ct=Object.prototype,Ko=Lt.toString,Wo=Ct.hasOwnProperty,Vo=Ko.call(Object);var Yo=function(t){return!(!be(t)||"[object Object]"!=Zt(t))&&(null===(t=oo(t))||"function"==typeof(t=Wo.call(t,"constructor")&&t.constructor)&&t instanceof t&&Ko.call(t)==Vo)};var Qo=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var Jo=function(t){return _e(t,Ke(t))};var Xo=function(t,e,o,n,r,i,s){var a,l,c,u=Qo(t,o),p=Qo(e,o),h=s.get(p);h?Go(t,o,h):((a=void 0===(c=i?i(u,p,o+"",t,e,s):void 0))&&(h=!(l=Te(p))&&Ce(p),e=!l&&!h&&Le(p),c=p,l||h||e?c=Te(u)?u:Ho(u)?Ye(u):h?Ve(p,!(a=!1)):e?ko(p,!(a=!1)):[]:Yo(p)||Oe(p)?Oe(c=u)?c=Jo(u):Ht(u)&&!Kt(u)||(c=No(p)):a=!1),a&&(s.set(p,c),r(c,p,n,i,s),s.delete(p)),Go(t,o,c))};var $o=function n(r,i,s,a,l){r!==i&&Zo(i,function(t,e){var o;l=l||new de,Ht(t)?Xo(r,i,e,s,n,a,l):(o=a?a(Qo(r,e),t,e+"",r,i,l):void 0,Go(r,e,o=void 0===o?t:o))},Ke)};function tn(t){return t}var en=function(t,e,o){switch(o.length){case 0:return t.call(e);case 1:return t.call(e,o[0]);case 2:return t.call(e,o[0],o[1]);case 3:return t.call(e,o[0],o[1],o[2])}return t.apply(e,o)},on=Math.max;var nn=function(i,s,a){return s=on(void 0===s?i.length-1:s,0),function(){for(var t=arguments,e=-1,o=on(t.length-s,0),n=Array(o);++e<o;)n[e]=t[s+e];for(var e=-1,r=Array(s+1);++e<s;)r[e]=t[e];return r[s]=a(n),en(i,this,r)}};var rn=function(t){return function(){return t}},sn=Date.now;var an=function(o){var n=0,r=0;return function(){var t=sn(),e=16-(t-r);if(r=t,0<e){if(800<=++n)return arguments[0]}else n=0;return o.apply(void 0,arguments)}}(ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:rn(e),writable:!0})}:tn);var ln=function(t,e){return an(nn(t,e,tn),t+"")};var cn=function(t,e,o){if(!Ht(o))return!1;var n=typeof e;return!!("number"==n?Fe(o)&&ke(e,o.length):"string"==n&&e in o)&&bt(o[e],t)};var un,pn,hn=function(a){return ln(function(t,e){var o=-1,n=e.length,r=1<n?e[n-1]:void 0,i=2<n?e[2]:void 0,r=3<a.length&&"function"==typeof r?(n--,r):void 0;for(i&&cn(e[0],e[1],i)&&(r=n<3?void 0:r,n=1),t=Object(t);++o<n;){var s=e[o];s&&a(t,s,o,r)}return t})}(function(t,e,o){$o(t,e,o)}),dn=((window&&window.__extends||(un=function(t,e){return(un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}un(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(fn,pn=k),fn);function fn(){var t=null!==pn&&pn.apply(this,arguments)||this;return t.layout="icons",t.mapStyles=["road","grayscale_light","grayscale_dark","night","road_shaded_relief"],t.style=u.ControlStyle.light,t.autoSelectionMode=!0,t}var yn,mn,H=window&&window.__extends||(yn=function(t,e){return(yn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}yn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),gn=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},vn=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},_n=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Mt=(H(wn,mn=nt),wn.prototype.onAdd=function(t,e){var o=this;this.map=t;var n=this.buildContainer(t,this.options.style,"Map Style Control"),r=this.buildStyleOpsGrid();this.styleOpsGrid=r;var i=this.buildCurrStyleBtn(),t=q("Select Style");return r.classList.add(e&&e.position||"top-right"),n.addEventListener("mouseover",function(){o.hasMouse=!0,n.classList.add(wn.Css.inUse),r.classList.remove("hidden-accessible-element")}),n.addEventListener("focusin",function(){o.hasFocus=!0,n.classList.add(wn.Css.inUse),r.classList.remove("hidden-accessible-element")}),n.addEventListener("mouseleave",function(){o.hasMouse=!1,o.hasFocus||(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element"))}),n.addEventListener("focusout",function(t){t.target===i&&Array.from(r.children).forEach(function(t){return t.removeAttribute("tabIndex")}),t.relatedTarget instanceof Node&&n.contains(t.relatedTarget)||(o.hasFocus=!1,o.hasMouse||(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element")))}),r.addEventListener("keydown",function(t){27===t.keyCode&&(t.stopPropagation(),i.focus(),Array.from(r.children).forEach(function(t){return t.setAttribute("tabIndex","-1")}),n.classList.contains(wn.Css.inUse)&&(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element")))}),i.addEventListener("click",function(t){n.classList.contains(wn.Css.inUse)?(n.classList.remove(wn.Css.inUse),r.classList.add("hidden-accessible-element")):(n.classList.add(wn.Css.inUse),r.classList.remove("hidden-accessible-element"),r.firstElementChild&&r.firstElementChild.focus())}),e&&wn.InvertOrderPositions.includes(e.position)?(n.appendChild(r),n.appendChild(i),n.appendChild(t),G(t,i)):(n.appendChild(i),n.appendChild(t),G(t,i),n.appendChild(r)),n},wn.prototype.onRemove=function(){mn.prototype.onRemove.call(this),this.styleOpsGrid=null,this.styleButtons.clear(),this.map.events.remove("stylechanged",this.onStyleChange),this.map.events.remove("mapconfigurationchanged",this.onMapConfigurationChange)},wn.prototype.setSelectedStyle=function(o){var e,t,n=this;this.styleIcons.has(o)&&(e=this.currStyleImage,t=this.styleIcons.get(o),e.src!==t&&(e.src=t),Object.entries(this.styleButtons).forEach(function(t){var e=_n(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}),this.map.styles.definitions().then(function(t){t=n.mapToFriendlyStyleName(o,t);e.alt!==t&&(e.alt=t),e.parentElement.lastChild instanceof Text&&(e.parentElement.lastChild.textContent=t)}))},wn.prototype.disableStyle=function(t){t=this.styleButtons[t];t&&t.setAttribute("disabled","true")},wn.prototype.enableStyle=function(t){t=this.styleButtons[t];t&&t.removeAttribute("disabled")},wn.prototype.buildSelectStyleBtn=function(o,t,e){var n=this,r=document.createElement("button"),i=this.mapToFriendlyStyleName(o,t);r.setAttribute("aria-label",i),r.setAttribute("type","button");var s=new Image;e.then(function(t){return t.blob()}).then(function(t){t=URL.createObjectURL(t);s.src=t,o===n.map.getStyle().style&&(n.currStyleImage.src=t,n.currStyleImage.alt=i,n.currStyleImage.parentElement.lastChild.nodeType==Node.TEXT_NODE?n.currStyleImage.parentElement.lastChild.textContent=i:n.currStyleImage.parentElement.appendChild(document.createTextNode(i))),n.styleIcons.set(o,t)}),s.setAttribute("aria-hidden","true"),r.appendChild(s),"icons"===this.options.layout?r.classList.add(wn.Css.button):(r.classList.add(wn.Css.listButton),r.classList.add(wn.Css.expanded),r.appendChild(document.createTextNode(i))),r.addEventListener("click",function(){n.hasMouse=!1,n.hasFocus=!1;var t=n.styleButtons[o];t&&!t.hasAttribute("disabled")&&(n._invokeEvent("styleselected",o),n.options.autoSelectionMode&&n.map.setStyle({style:o}),Object.entries(n.styleButtons).forEach(function(t){var e=_n(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}))});e=document.createElement("div");return e.classList.add("selected-icon"),r.appendChild(e),r},wn.prototype.buildCurrStyleBtn=function(){var t=document.createElement("button");"icons"==this.options.layout?t.classList.add(wn.Css.button):t.classList.add(wn.Css.listButton),t.classList.add(wn.Css.currentStyle),t.setAttribute("aria-label","Select Style"),t.setAttribute("tabindex","-1"),this.currStyleImage=new Image,t.appendChild(this.currStyleImage);var e=document.createElement("div");return e.classList.add("icon"),t.appendChild(e),t},wn.prototype.buildStyleOpsGrid=function(){var t=this,e=document.createElement("div");return e.classList.add(wn.Css.styleOptions),"icons"===this.options.layout?e.classList.add(this.options.layout):e.classList.add(wn.Css.dropdown),e.setAttribute("aria-label","Style Options"),e.classList.add("hidden-accessible-element"),this.map.styles.definitions().then(function(e){return gn(t,void 0,void 0,function(){return vn(this,function(t){return this.onMapConfigurationChange(e),this.map.events.add("stylechanged",this.onStyleChange),[2]})})}),this.map.events.add("mapconfigurationchanged",this.onMapConfigurationChange),e},wn.prototype.populateOpsGridFromDefinitions=function(n){var t,o,r=this;this.styleOpsGrid&&(t=n.configurations,(t=Array.isArray(this.options.mapStyles)?t.filter(function(t){return r.options.mapStyles.includes(t.name.split("_indoor")[0])}):t).forEach(function(t){var e={url:t.thumbnail};t.thumbnail&&r.map.styles._transformStyleRequest(t.thumbnail,e);var o=r.map.getServiceOptions();o.transformRequest&&hn(e,o.transformRequest(e.url,"Thumbnail"));e=fetch(e.url,{headers:e.headers}),e=r.buildSelectStyleBtn(t.name,n,e);r.styleOpsGrid.appendChild(e),r.styleButtons[t.name]=e,"icons"===r.options.layout&&(t=q(r.mapToFriendlyStyleName(t.name,n)),r.styleOpsGrid.appendChild(t),G(t,e))}),o=this.map.getStyle().style,Object.entries(this.styleButtons).forEach(function(t){var e=_n(t,2),t=e[0];return e[1].setAttribute("aria-current",t===o?"true":"false")}))},wn.InvertOrderPositions=[u.ControlPosition.TopRight,u.ControlPosition.BottomRight],wn.Css={button:"azure-maps-control-button",listButton:"azure-maps-control-list-button",expanded:"expanded",currentStyle:"curr-style",inUse:"in-use",styleOptions:"style-options",dropdown:"azure-maps-control-dropdown"},wn);function wn(t){var e=mn.call(this)||this;return e.styleOpsGrid=null,e.hasMouse=!1,e.hasFocus=!1,e.styleButtons=new J,e.styleIcons=new J,e.onStyleChange=function(){var t;e.options.autoSelectionMode&&(t=e.map.getStyle().style,e.setSelectedStyle(t))},e.onMapConfigurationChange=function(t){e.styleOpsGrid&&(Array.from(e.styleOpsGrid.children).forEach(function(t){return t.remove()}),e.styleButtons.clear(),e.populateOpsGridFromDefinitions(t))},e.mapToFriendlyStyleName=function(e,t){t=t.configurations.find(function(t){return t.name===e});return(null==t?void 0:t.displayName)||e},e.options=(new dn).merge(qo(t)),e}var bn,Sn,xn=((window&&window.__extends||(bn=function(t,e){return(bn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}bn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(On,Sn=k),On);function On(){var t=null!==Sn&&Sn.apply(this,arguments)||this;return t.flow="none",t.incidents=!1,t}var Tn,En,Cn=((window&&window.__extends||(Tn=function(t,e){return(Tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Tn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Pn,En=xn),Pn);function Pn(){var t=null!==En&&En.apply(this,arguments)||this;return t.isActive=!1,t.style=u.ControlStyle.light,t}var kn,An,In=((window&&window.__extends||(kn=function(t,e){return(kn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}kn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ln,An=nt),Object.defineProperty(Ln.prototype,"isActive",{get:function(){if(!this.map)return!1;var t=this.map.getTraffic();return"none"!==t.flow||t.incidents},set:function(t){this.map&&this.map.setTraffic({flow:t?this.options.flow:"none",incidents:!!t&&this.options.incidents})},enumerable:!1,configurable:!0}),Ln.prototype.onAdd=function(t){(this.map=t).getTraffic();void 0!==this.initIsActive&&(this.isActive=this.initIsActive),this.container=this.buildContainer(t,this.style,"Traffic Control"),this.container.style.flexDirection="column";var e=this.constructTrafficButton(t);this.container.appendChild(e);t=q("Toggle Traffic Display");return this.container.appendChild(t),G(t,e),this.container},Ln.prototype.onRemove=function(){An.prototype.onRemove.call(this),this.map=null},Ln.prototype.getOptions=function(){return(new Cn).merge({isActive:this.isActive,flow:this.options.flow,incidents:this.options.incidents,style:this.style})},Ln.prototype.updateButtonState=function(){this.trafficButton&&(this.isActive?this.container.classList.add("in-use"):this.container.classList.remove("in-use"),this.trafficButton.setAttribute("aria-pressed",this.isActive?"true":"false"))},Ln.prototype.constructTrafficButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("traffic"),o.setAttribute("aria-label","Toggle Traffic Display"),o.setAttribute("alt","Toggle Traffic Display"),o.setAttribute("type","button"),this.trafficButton=o,this.updateButtonState(),o.addEventListener("click",function(){e.isActive=!e.isActive}),o},Ln);function Ln(t){var e,o=An.call(this)||this;return o.hasMouse=!1,o.hasFocus=!1,o.options=(new xn).merge({flow:"relative",incidents:!0}),o.style=u.ControlStyle.light,o.container=null,o.trafficButton=null,o.map=null,t&&(o.initIsActive=null!==(e=t.isActive)&&void 0!==e&&e,o.options.flow=t.flow||"relative",o.options.incidents=null===(e=t.incidents)||void 0===e||e,o.style=t.style||u.ControlStyle.light),o}var Rn,Nn,It=window&&window.__extends||(Rn=function(t,e){return(Rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Rn(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Mn=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},At=(It(jn,Nn=nt),jn.prototype.onAdd=function(t){this.map=t;var e=this.buildContainer(t,u.ControlStyle.auto,"Traffic Legend"),t=this.buildTrafficLegendDiv(t);return e.setAttribute("role","definition"),e.appendChild(t),e},jn.prototype.onRemove=function(){Nn.prototype.onRemove.call(this),this.syncHiddenState&&(this.map.events.remove("styledata",this.syncHiddenState),this.syncHiddenState=null),this.map=null},jn.prototype.buildTrafficLegendDiv=function(e){var o,t,n,r,i=document.createElement("div");i.classList.add("traffic-legend","hidden"),i.setAttribute("alt","Traffic Legend");var s=document.createElement("table"),a=document.createElement("tr"),l=document.createElement("td");l.setAttribute("alt","Traffic"),l.appendChild(document.createTextNode("Traffic"));var c=q("Traffic");l.classList.add("traffic-legend-title"),l.colSpan=6,a.appendChild(l),a.appendChild(c),G(c,l),s.appendChild(a);var u=document.createElement("tr");try{for(var p=Mn(this.table),h=p.next();!h.done;h=p.next()){var d=h.value,f=document.createElement("td");if("Fast"===d||"Slow"===d)f.setAttribute("alt",d),f.appendChild(document.createTextNode(d)),f.classList.add("traffic-legend-text");else{f.classList.add("traffic-legend-colors"),f.setAttribute("aria-label","Traffic Legend"),f.setAttribute("role","img");try{for(var y=(n=void 0,Mn(d)),m=y.next();!m.done;m=y.next()){var g=m.value,v=document.createElement("div");v.classList.add(g),f.appendChild(v)}}catch(t){n={error:t}}finally{try{m&&!m.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}}u.appendChild(f);var _=q(d instanceof Array?"Traffic Legend":d);u.appendChild(_),G(_,f)}}catch(t){o={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(o)throw o.error}}return s.appendChild(u),i.appendChild(s),this.syncHiddenState=function(t){"style"===t.dataType&&((t=e.getTraffic()).flow&&"none"!==t.flow?i.classList.remove("hidden"):i.classList.add("hidden"))},this.syncHiddenState({dataType:"style"}),e.events.add("styledata",this.syncHiddenState),i},jn);function jn(){var t=Nn.call(this)||this;return t.table=["Fast",["green","yellow","red","dark-red"],"Slow"],t.map=null,t.syncHiddenState=null,t}Tt=function(t){return this.__data__.has(t)};function Dn(t){var e=-1,o=null==t?0:t.length;for(this.__data__=new pe;++e<o;)this.add(t[e])}Dn.prototype.add=Dn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dn.prototype.has=Tt;var zn=Dn;var Bn=function(t,e){for(var o=-1,n=null==t?0:t.length;++o<n;)if(e(t[o],o,t))return!0;return!1};var Fn=function(t,e){return t.has(e)};var Un=function(t,e,o,n,r,i){var s=1&o,a=t.length,l=e.length;if(a!=l&&!(s&&a<l))return!1;if((l=i.get(t))&&i.get(e))return l==e;var c=-1,u=!0,p=2&o?new zn:void 0;for(i.set(t,e),i.set(e,t);++c<a;){var h,d=t[c],f=e[c];if(void 0!==(h=n?s?n(f,d,c,e,t,i):n(d,f,c,t,e,i):h)){if(h)continue;u=!1;break}if(p){if(!Bn(e,function(t,e){if(!Fn(p,e)&&(d===t||r(d,t,o,n,i)))return p.push(e)})){u=!1;break}}else if(d!==f&&!r(d,f,o,n,i)){u=!1;break}}return i.delete(t),i.delete(e),u};function qn(t){var o=-1,n=Array(t.size);return t.forEach(function(t,e){n[++o]=[e,t]}),n}function Gn(t){var e=-1,o=Array(t.size);return t.forEach(function(t){o[++e]=t}),o}var R=Ot?Ot.prototype:void 0,Zn=R?R.valueOf:void 0;var Hn=function(t,e,o,n,r,i,s){switch(o){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return t.byteLength==e.byteLength&&i(new So(t),new So(e))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return bt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=qn;case"[object Set]":a=a||Gn;if(t.size!=e.size&&!(1&n))return!1;var l=s.get(t);if(l)return l==e;n|=2,s.set(t,e);a=Un(a(t),a(e),n,r,i,s);return s.delete(t),a;case"[object Symbol]":if(Zn)return Zn.call(t)==Zn.call(e)}return!1},Kn=Object.prototype.hasOwnProperty;var Wn=function(t,e,o,n,r,i){var s=1&o,a=so(t),l=a.length;if(l!=so(e).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in e:Kn.call(e,u)))return!1}var p=i.get(t);if(p&&i.get(e))return p==e;var h=!0;i.set(t,e),i.set(e,t);for(var d,f=s;++c<l;){var y,m=t[u=a[c]],g=e[u];if(!(void 0===(y=n?s?n(g,m,u,e,t,i):n(m,g,u,t,e,i):y)?m===g||r(m,g,o,n,i):y)){h=!1;break}f=f||"constructor"==u}return!h||f||(d=t.constructor)!=(p=e.constructor)&&"constructor"in t&&"constructor"in e&&!("function"==typeof d&&d instanceof d&&"function"==typeof p&&p instanceof p)&&(h=!1),i.delete(t),i.delete(e),h},Vn="[object Arguments]",Yn="[object Array]",Qn="[object Object]",Jn=Object.prototype.hasOwnProperty;var Xn=function(t,e,o,n,r,i){var s=Te(t),a=Te(e),l=s?Yn:_o(t),c=a?Yn:_o(e),u=(l=l==Vn?Qn:l)==Qn,a=(c=c==Vn?Qn:c)==Qn;if((c=l==c)&&Ce(t)){if(!Ce(e))return!1;u=!(s=!0)}if(c&&!u)return i=i||new de,s||Le(t)?Un(t,e,o,n,r,i):Hn(t,e,l,o,n,r,i);if(!(1&o)){u=u&&Jn.call(t,"__wrapped__"),a=a&&Jn.call(e,"__wrapped__");if(u||a)return r(u?t.value():t,a?e.value():e,o,n,i=i||new de)}return!!c&&(i=i||new de,Wn(t,e,o,n,r,i))};var $n=function t(e,o,n,r,i){return e===o||(null==e||null==o||!be(e)&&!be(o)?e!=e&&o!=o:Xn(e,o,n,r,t,i))};var tr,er=function(t,e){return $n(t,e)},or=(tr=Object.freeze({__proto__:null,default:{}}))&&tr.default||tr,nr=Rt(function(a){!function(){for(var e,o,n=0,r=[],t=0;t<256;t++)r[t]=(t+256).toString(16).substr(1);function i(){var t,t=(t=16,(!e||s.BUFFER_SIZE<n+t)&&(n=0,e=s.randomBytes(s.BUFFER_SIZE)),e.slice(n,n+=t));return t[6]=15&t[6]|64,t[8]=63&t[8]|128,t}function s(){var t=i();return r[t[0]]+r[t[1]]+r[t[2]]+r[t[3]]+"-"+r[t[4]]+r[t[5]]+"-"+r[t[6]]+r[t[7]]+"-"+r[t[8]]+r[t[9]]+"-"+r[t[10]]+r[t[11]]+r[t[12]]+r[t[13]]+r[t[14]]+r[t[15]]}s.BUFFER_SIZE=4096,s.bin=i,s.clearBuffer=function(){e=null,n=0},s.test=function(t){return"string"==typeof t&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)},"undefined"!=typeof crypto?o=crypto:"undefined"!=typeof window&&void 0!==window.msCrypto&&(o=window.msCrypto),o=o||or,(a.exports=s).randomBytes=function(){if(o){if(o.randomBytes)return o.randomBytes;if(o.getRandomValues)return"function"!=typeof Uint8Array.prototype.slice?function(t){t=new Uint8Array(t);return o.getRandomValues(t),Array.from(t)}:function(t){t=new Uint8Array(t);return o.getRandomValues(t),t}}return function(t){for(var e=[],o=0;o<t;o++)e.push(Math.floor(256*Math.random()));return e}}()}()}),rr=(ir.TYPE="Feature",ir);function ir(t,e,o,n){this.type="Feature",this.type=ir.TYPE,this.properties=e||{},this.id=o,this.geometry=t,this.bbox=n}var sr,ar,Lt=window&&window.__extends||(sr=function(t,e){return(sr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}sr(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),lr=(ar=Array,Lt(cr,ar),cr.fromData=function(o){var n=NaN,r=NaN,i=new Set(["y"]),s=new Set(["x"]);return Object.keys(o).forEach(function(t){var e=t.toLowerCase();isNaN(n)&&i.has(e)&&"number"==typeof o[t]?n=o[t]:isNaN(r)&&s.has(e)&&"number"==typeof o[t]&&(r=o[t])}),isNaN(n)||isNaN(r)?null:new cr(n,r)},cr.getX=function(t){return 0<t.length?t[0]:NaN},cr.getY=function(t){return 1<t.length?t[1]:NaN},cr.getDestination=function(t,e,o){return new cr(cr.getX(t)+o*Math.cos((e+270)*Math.PI/180),cr.getY(t)+o*Math.sin((e+270)*Math.PI/180))},cr.getDistance=function(t,e){var o=cr.getX(t)-cr.getX(e),e=cr.getY(t)-cr.getY(e);return Math.sqrt(o*o+e*e)},cr.getHeading=function(t,e){var o=cr.getX(e)-cr.getX(t),e=cr.getY(t)-cr.getY(e);return 180*(2.5*Math.PI-Math.atan2(e,o))/Math.PI%360},cr);function cr(t,e){return ar.call(this,t,e)||this}var ur=(pr.TYPE="Point",pr);function pr(t){this.type="Point",this.type=pr.TYPE,this.coordinates=t}var hr,dr,fr,yr,mr,gr=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},vr=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_r=6378137,wr=Math.PI/180,br=180/Math.PI,Sr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],xr=85.0511;function Or(t){return t*wr}function Tr(t){return t*br}function Er(t,e,o){return Math.min(Math.max(t,e),o)}function Cr(t,e){var o=Or(e[1]-t[1]),n=Or(e[0]-t[0]),n=Math.pow(Math.sin(o/2),2)+Math.cos(Or(t[1]))*Math.cos(Or(e[1]))*Math.pow(Math.sin(n/2),2),n=2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n));return Math.round(_r*n*100)/100}function Pr(t){if(t)switch(t.toLowerCase()){case"feet":case"foot":case"ft":return dr.feet;case"kilometers":case"kilometer":case"kilometres":case"kilometre":case"km":case"kms":return dr.kilometers;case"miles":case"mile":case"mi":return dr.miles;case"nauticalmiles":case"nauticalmile":case"nms":case"nm":return dr.nauticalMiles;case"yards":case"yard":case"yds":case"yrd":case"yrds":return dr.yards;default:return dr.meters}return dr.meters}function kr(t){if(t)switch(t.toLowerCase()){case"milespersecondsquared":case"milepersecondsquared":case"mi/s^2":case"mi/s2":return mr.milesPerSecondSquared;case"kilometerspersecondsquared":case"kilometrespersecondsquared":case"kilometerpersecondsquared":case"kilometrepersecondsquared":case"km/s^2":case"km/s2":return mr.kilometersPerSecondSquared;case"knotspersecond":case"knotpersecond":case"knts/s":case"kn/s":case"kt/s":return mr.knotsPerSecond;case"standardgravity":case"g":return mr.standardGravity;case"feetpersecondsquared":case"footpersecondsquared":case"ft/s^2":case"ft/s2":return mr.feetPerSecondSquared;case"yardspersecondsquared":case"yardpersecondsquared":case"yds/s^2":case"yds/s2":case"yd/s^2":case"yd/s2":return mr.yardsPerSecondSquared;case"milesperhoursecond":case"mileperhoursecond":case"milesperhourseconds":case"mileperhourseconds":case"mi/h/s":return mr.milesPerHourSecond;case"kilometersperhoursecond":case"kilometrespersoursecond":case"kilometerperhoursecond":case"kilometrepersoursecond":case"kilometersperhourssecond":case"kilometrespersourssecond":case"kilometerperhourssecond":case"kilometrepersourssecond":case"kmhs":case"km/h/s":return mr.kilometersPerHourSecond;default:return mr.metersPerSecondSquared}return mr.metersPerSecondSquared}function Ar(t){if(t)switch(t){case"acres":case"ac":return hr.acres;case"hectares":case"ha":return hr.hectares;case"squareFeet":case"ft^2":case"ft2":return hr.squareFeet;case"squareYards":case"squareYard":case"yds^2":case"yds2":case"yd^2":case"yd2":return hr.squareYards;case"squareKilometers":case"squareKilometres":case"squareKilometer":case"squareKilometre":case"km^2":case"km2":return hr.squareKilometers;case"squareMiles":case"squareMile":case"mi^2":case"mi2":return hr.squareMiles;default:return hr.squareMeters}return hr.squareMeters}function Ir(t){if(t)switch(t.toLowerCase()){case"feetpersecond":case"footsecond":case"ftps":case"ft/s":return yr.feetPerSecond;case"milesperhour":case"mileperhour":case"mph":case"mi/hr":case"mi/h":return yr.milesPerHour;case"knots":case"knot":case"knts":case"knt":case"kn":case"kt":return yr.knots;case"mach":case"m":return yr.mach;case"kilometersperhour":case"kilometresperhour":case"kmperhour":case"kmph":case"km/hr":case"km/h":return yr.kilometersPerHour;default:return yr.metersPerSecond}return yr.metersPerSecond}function Lr(t){if(t)switch(t.toLowerCase()){case"milliseconds":case"ms":return fr.ms;case"minutes":case"minute":case"mins":case"min":return fr.minutes;case"hours":case"hour":case"hr":case"h":return fr.hours;case"days":case"day":case"d":return fr.days;default:return fr.seconds}return fr.seconds}function Rr(t){var e=0;if(t&&0<t.length)for(var e=Math.abs(Nr(t[0])),o=1,n=t.length;o<n;o++)e-=Math.abs(Nr(t[o]));return e}function Nr(t){var e=0;if(3<=t.length){for(var o=void 0,n=void 0,r=0,i=t.length;r<i;r++)e+=(Or(t[r===i-2?(o=i-2,n=i-1,0):r===i-1?(o=i-1,n=0,1):(n=(o=r)+1,r+2)][0])-Or(t[o][0]))*Math.sin(Or(t[n][1]));e=e*_r*_r/2}return e}function Mr(t,e,o){return(t[0]-o[0])*(e[1]-o[1])-(t[1]-o[1])*(e[0]-o[0])}function jr(t,e,o){if(2<=o.length){for(var n,r,i=1/0,s=null,a=ei(o,22),l=0,c=a.length-1;l<c;l++)r=function(t,e,o){if(e[0]===o[0]&&e[1]===o[1])return e;var n=t[0]-e[0],r=t[1]-e[1],i=o[0]-e[0],t=o[1]-e[1],r=(i*n+t*r)/(i*i+t*t);return r<0?e:1<r?o:[e[0]+i*r,e[1]+t*r]}(e,a[l],a[l+1]),(n=lr.getDistance(e,r))<i&&(i=n,s=r);if(s){var u=ti([s],22)[0];return new rr(new ur(u),{distance:Fr(t,u)})}}else if(1===o.length)return new rr(new ur(o[0]),{distance:Fr(t,o[0])});return null}function Dr(t,e){var o;return!isNaN(t)&&"number"==typeof e&&0<=e&&(o=void 0,o=e<Sr.length?Sr[e]:Math.pow(10,e),t=Math.round(t*o)/o),t}function zr(t,e,o,n){switch(Pr(e)){case dr.meters:t/=1e3;break;case dr.feet:t/=3280.8399;break;case dr.miles:t/=.62137119;break;case dr.yards:t/=1093.6133;break;case dr.nauticalMiles:t/=.5399568;break;case dr.kilometers:}switch(Pr(o)){case dr.meters:t*=1e3;break;case dr.feet:t*=3280.8399;break;case dr.miles:t*=.62137119;break;case dr.yards:t*=1093.6133;break;case dr.nauticalMiles:t*=.5399568;break;case dr.kilometers:}return"number"==typeof n&&0<=n&&(n=Math.pow(10,n),t=Math.round(t*n)/n),t}function Br(t,e,o,n){n=n||"meters",t=pi(t);var r=Ur(n),n=Or(t[1]),t=Or(t[0]),e=e*wr,o=o/r,r=Math.asin(Math.sin(n)*Math.cos(o)+Math.cos(n)*Math.sin(o)*Math.cos(e)),n=t+Math.atan2(Math.sin(e)*Math.sin(o)*Math.cos(n),Math.cos(o)-Math.sin(n)*Math.sin(r)),r=Er(Jr(r*br),-85,85);return[Xr(n*br),r]}function Fr(t,e,o){e=Cr(t=pi(t),e=pi(e));return"meters"===o?e:zr(e,"meters",o||"meters")}function Ur(t){t=Pr(t);return zr(_r,dr.meters,t)}function qr(t,e,o){for(var n=[],r=Or(t[1]),i=Or(t[0]),s=Or(e[1]),a=Or(e[0]),l=2*Math.asin(Math.sqrt(Math.pow(Math.sin((r-s)/2),2)+Math.cos(r)*Math.cos(s)*Math.pow(Math.sin((i-a)/2),2))),c=0;c<=o;c++){var u=c/o,p=Math.sin((1-u)*l)/Math.sin(l),h=Math.sin(u*l)/Math.sin(l),d=p*Math.cos(r)*Math.cos(i)+h*Math.cos(s)*Math.cos(a),u=p*Math.cos(r)*Math.sin(i)+h*Math.cos(s)*Math.sin(a),h=p*Math.sin(r)+h*Math.sin(s),h=Math.atan2(h,Math.sqrt(Math.pow(d,2)+Math.pow(u,2))),d=Math.atan2(u,d),h=Er(h*br,-85,85);d*=br,n.push([d,h])}return n}function Gr(t){return(Array.isArray(t)?t:t.coordinates).reduce(function(t,e){var o=0<t.length?t[t.length-1]:null;return o&&180<Math.abs(e[0]-o[0])?(o=o[0]<0?e[0]-360:e[0]+360,t.push([o,e[1]])):t.push(e),t},[])}function Zr(t){for(var e,o,n,r,i,s=Array.isArray(t)?t:t.coordinates,a=[],l=[],c=0;c<s.length;c++)a.push(s[c]),c+1>=s.length||(e=(n=gr(s[c],2))[0],o=n[1],i=(r=gr(s[c+1],2))[0],n=r[1],180<Math.abs(i-e)&&(r=0<e?180:-180,i=Math.abs((0<e?i+360:i-360)-e),i=o+(n-o)*(Math.abs(r-e)/i),a.push([r,i]),l.push(a),a=[[-r,i]]));return l.push(a),l}function Hr(t,e){if(t=pi(t),e=pi(e),t&&2<=t.length&&e&&2<=e.length){var o=Or(t[1]),n=Or(e[1]),e=Or(e[0]-t[0]),t=Math.sin(e)*Math.cos(n),e=Math.cos(o)*Math.sin(n)-Math.sin(o)*Math.cos(n)*Math.cos(e);return(Tr(Math.atan2(t,e))+360)%360}return NaN}function Kr(t,e){var o,n=0;Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var r=0,i=o.length-1;r<i;r++)n+=Cr(o[r],o[r+1]);return zr(n,"meters",e||"meters")}function Wr(t,e,o){o=o||"meters";var n,r,i=0;if(Array.isArray(t)?r=t:t.type&&"LineString"===t.type&&(r=t.coordinates),2<=r.length){for(var s=r.length,a=1;a<s;a++){if(e<=i+(n=Fr(r[a-1],r[a],o))){var l=Hr(r[a-1],r[a]);return Br(r[a-1],l,e-i,o)}i+=n}return i<=e?r[s-1]:r[0]}return null}function Vr(t,e,o,n,r){n=n||"meters",r=r||0,t=pi(t);for(var i=[],s=360/o,a=0;a<=o;a++)i.push(Br(t,(a*s+r)%360,e,n));return i}function Yr(t,e,o,n,r){return Gr(Vr(t,e,o,n,r))}function Qr(t,e,o){o=void 0===o?.5:o;var n=Fr(t=pi(t),e=pi(e),"kilometers");return Br(t,Hr(t,e),n*o,"kilometers")}function Jr(t){return 90<t?180<(t=(t+90)%360)?90-(t-180):t-90:t<-90?(t=(t-90)%360)<-180?-90-(t+180):t+90:t}function Xr(t){return 180<t?(t+180)%360-180:t<-180?(t-180)%360+180:t}function $r(t,e,o){if(0===o)return Object.assign({},t);e=pi(e);for(var n,r,i=[],s=0,a=t.length;s<a;s++)n=Fr(e,t[s]),r=Hr(e,t[s]),i.push(Br(e,r+o,n));return i}function ti(t,e){for(var o,n,r=512*Math.pow(2,e),i=[],s=0,a=t.length;s<a;s++)o=t[s][0]/r-.5,n=.5-t[s][1]/r,i.push([360*o,90-360*Math.atan(Math.exp(2*-n*Math.PI))/Math.PI]);return i}function ei(t,e){for(var o,n,r=512*Math.pow(2,e),i=[],s=0,a=t.length;s<a;s++)n=Math.sin(t[s][1]*Math.PI/180),o=(t[s][0]+180)/360,n=.5-Math.log((1+n)/(1-n))/(4*Math.PI),i.push([Math.round(o*r),Math.round(n*r)]);return i}function oi(t,e,o,n){switch(kr(e)){case mr.kilometersPerHourSecond:t/=3.6;break;case mr.milesPerHourSecond:t/=2.236936292054;break;case mr.knotsPerSecond:t/=1.943844492441;break;case mr.standardGravity:t/=.1019716212978;break;case mr.kilometersPerSecondSquared:t/=.001;break;case mr.milesPerSecondSquared:t/=.000621371192;break;case mr.feetPerSecondSquared:t/=3.280839895012;break;case mr.yardsPerSecondSquared:t/=1.093613298338;break;case mr.metersPerSecondSquared:}switch(kr(o)){case mr.kilometersPerHourSecond:t*=3.6;break;case mr.milesPerHourSecond:t*=2.236936292054;break;case mr.knotsPerSecond:t*=1.943844492441;break;case mr.standardGravity:t*=.1019716212978;break;case mr.kilometersPerSecondSquared:t*=.001;break;case mr.milesPerSecondSquared:t*=.000621371192;break;case mr.feetPerSecondSquared:t*=3.280839895012;break;case mr.yardsPerSecondSquared:t*=1.093613298338;break;case mr.metersPerSecondSquared:}return Dr(t,n)}function ni(t,e,o,n){switch(Ar(e)){case hr.acres:t*=4046.8564224;break;case hr.hectares:t*=1e4;break;case hr.squareFeet:t*=.09290304;break;case hr.squareKilometers:t*=1e6;break;case hr.squareMiles:t*=259e4;break;case hr.squareYards:t*=.83612736;break;case hr.squareMeters:}switch(Ar(o)){case hr.acres:t/=4046.8564224;break;case hr.hectares:t/=1e4;break;case hr.squareFeet:t/=.09290304;break;case hr.squareKilometers:t/=1e6;break;case hr.squareMiles:t/=259e4;break;case hr.squareYards:t/=.83612736;break;case hr.squareMeters:}return Dr(t,n)}function ri(t,e,o,n){switch(Ir(e)){case yr.feetPerSecond:t*=1.09728;break;case yr.milesPerHour:t*=1.6093;break;case yr.knots:t*=1.852;break;case yr.metersPerSecond:t*=3.6;break;case yr.mach:t*=1234.8;break;case yr.kilometersPerHour:}switch(Ir(o)){case yr.feetPerSecond:t/=1.09728;break;case yr.milesPerHour:t/=1.6093;break;case yr.knots:t/=1.852;break;case yr.metersPerSecond:t/=3.6;break;case yr.mach:t/=1234.8;break;case yr.kilometersPerHour:}return Dr(t,n)}function ii(t,e,o,n){switch(Lr(e)){case fr.ms:t/=1e3;break;case fr.hours:t*=3600;break;case fr.minutes:t*=60;break;case fr.days:t*=86400;break;case fr.seconds:}switch(Lr(o)){case fr.ms:t*=1e3;break;case fr.hours:t/=3600;break;case fr.minutes:t/=60;break;case fr.days:t/=86400;break;case fr.seconds:}return Dr(t,n)}function si(t,e,o,n,r,i,s,a){r=zr(e,r,dr.meters),i=ii(o,i,fr.seconds);return oi(2*(r-ri(t,n,yr.metersPerSecond)*i)/(i*i),mr.metersPerSecondSquared,s,a)}function ai(t,e,o,n,r,i,s){t=ri(t,n,yr.metersPerSecond);return oi((ri(e,n,yr.metersPerSecond)-t)/ii(o,r,fr.seconds),mr.metersPerSecondSquared,i,s)}function li(t,e,o,n){t=ci(t),e=ci(e);return null!=t&&null!=e?ii(e.getTime()-t.getTime(),fr.ms,o,n):NaN}function ci(t){if("[object Date]"===Object.prototype.toString.call(t))return t;if("string"==typeof t){var e=Date.parse(t);if(!isNaN(e))return new Date(e);if(0<=t.indexOf("Date(")){e=0,e=0<(t=t.replace("/Date(","").replace(")/","")).indexOf("+")?parseInt(t.substr(0,t.indexOf("+")),10):0<t.indexOf("-")?parseInt(t.substr(0,t.indexOf("-")),10):parseInt(t,10);return new Date(e)}}else if("number"==typeof t)return new Date(t);return null}function ui(t){var e=[],o=null,n=null;if(Array.isArray(t)&&0<t.length)if(Array.isArray(t[0])&&"number"==typeof t[0][0])e=t;else for(var r=t.length,i=0;i<r;i++)e=e.concat(ui(t[i]));else if(t.type)switch(t.type){case"Point":e=[t.coordinates];break;case"LineString":e=t.coordinates;break;case"Polygon":o=t.coordinates;break;case"MultiPoint":e=t.coordinates;break;case"MultiLineString":o=t.coordinates;break;case"MultiPolygon":n=t.coordinates;break;case"Feature":var s=t,e=xi._isCircle(s)?xi._getCirclePositions(s):ui(s.geometry);break;case"FeatureCollection":e=ui(t.features);break;case"GeometryCollection":e=ui(t.geometries)}else if(t instanceof xi)return ui(t.toJson());if(o)for(r=o.length,i=0;i<r;i++)e=e.concat(o[i]);else if(n)for(var a=n.length,i=0;i<a;i++)for(var l=n[i].length,c=0;c<l;c++)e=e.concat(n[i][c]);return e}function pi(t){if(Array.isArray(t)&&"number"==typeof t[0])return t;if(t.type){if("Point"===t.type)return t.coordinates;if("Feature"===t.type&&"Point"===t.geometry.type)return t.geometry.coordinates}else if(t instanceof xi&&"Point"===t.getType())return t.getCoordinates();return null}function hi(t,e,o){o=o||"meters";var n,r,i=0;if(Array.isArray(t)?r=t:t.type&&"LineString"===t.type&&(r=t.coordinates),2<=r.length){for(var s=r.length,a=1;a<s;a++){if(e<=i+(n=Fr(r[a-1],r[a],o))){var l=Hr(r[a-1],r[a]),c=Br(r[a-1],l,e-i,o);return new rr(new ur(c),{heading:l})}i+=n}return i<=e?new rr(new ur(r[s-1]),{heading:Hr(r[s-2],r[s-1])}):new rr(new ur(r[0]),{heading:Hr(r[0],r[1])})}return null}function di(t,e,o,n){var r=pi(t),i=ei([r],22)[0],s=null,a=1/0;switch((e=e instanceof xi?e.toJson():e).type){case"Feature":return di(t,e.geometry,o);case"Point":d=[[e.coordinates]];break;case"MultiPoint":for(var l,c=e.coordinates,u=0,p=c.length;u<p;u++)(l=Fr(r,c[u]))<a&&(a=l,s=new rr(new ur(c[u]),{distance:l}));break;case"LineString":d=[e.coordinates];break;case"Polygon":case"MultiLineString":d=e.coordinates;break;case"MultiPolygon":var h=e.coordinates;if(0<h.length)for(var d=h[0],u=1,p=h.length;u<p;u++)d=d.concat(h[u])}if(d)for(var f,u=0,p=d.length;u<p;u++)(f=jr(r,i,d[u]))&&f.properties.distance<a&&(a=f.properties.distance,s=f);return s&&(s.properties.distance=zr(s.properties.distance,"meters",o,n)),s}(Ct=hr=hr||{}).squareMeters="squareMeters",Ct.acres="acres",Ct.hectares="hectares",Ct.squareFeet="squareFeet",Ct.squareKilometers="squareKilometers",Ct.squareMiles="squareMiles",Ct.squareYards="squareYards",(H=dr=dr||{}).meters="meters",H.kilometers="kilometers",H.feet="feet",H.miles="miles",H.nauticalMiles="nauticalMiles",H.yards="yards",(It=fr=fr||{}).seconds="seconds",It.hours="hours",It.ms="ms",It.minutes="minutes",It.days="days",(Tt=yr=yr||{}).metersPerSecond="metersPerSecond",Tt.kilometersPerHour="kilometersPerHour",Tt.feetPerSecond="feetPerSecond",Tt.milesPerHour="milesPerHour",Tt.knots="knots",Tt.mach="mach",(Ot=mr=mr||{}).milesPerSecondSquared="milesPerSecondSquared",Ot.kilometersPerSecondSquared="kilometersPerSecondSquared",Ot.knotsPerSecond="knotsPerSecond",Ot.standardGravity="standardGravity",Ot.feetPerSecondSquared="feetPerSecondSquared",Ot.yardsPerSecondSquared="yardsPerSecondSquared",Ot.milesPerHourSecond="milesPerHourSecond",Ot.kilometersPerHourSecond="kilometersPerHourSecond",Ot.metersPerSecondSquared="metersPerSecondSquared";var fi,yi,R=window&&window.__extends||(fi=function(t,e){return(fi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}fi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),mi=(yi=Array,R(gi,yi),gi.fromPosition=function(t){return 2===t.length?new gi(t[0],t[1]):2<t.length?new gi(t[0],t[1],t[2]):null},gi.areEqual=function(t,e,o){if(void 0===o&&(o=6),t&&2<=t.length&&e&&2<=e.length){var n=Math.pow(10,o),r=Jr(t[1]),o=Jr(e[1]),t=Xr(t[0]),e=Xr(e[0]);if(0!=Math.round((r-o)*n)/n)return!1;n=Math.round((t-e)*n)/n;return 0!=n&&360!=n?!1:!0}return!1},gi.fromLatLng=function(r,t,e){var i,s,a,l,c,u,o=[];return"number"==typeof r?(o.push(r),"number"==typeof t&&o.push(t),"number"==typeof e&&o.push(e)):Array.isArray(r)?2<=r.length&&"number"==typeof r[0]&&"number"==typeof r[1]&&(3<=r.length&&"number"==typeof r[2]?o.push(r[0],r[1],r[2]):o.push(r[0],r[1])):"object"==typeof r&&(i=["lat","latitude","y"],s=["lng","longitude","lon","x"],a=["elv","elevation","alt","altitude","z"],u=c=l=NaN,Object.keys(r).forEach(function(t,e,o){var n=t.toLowerCase();isNaN(l)&&0<=i.indexOf(n)&&"number"==typeof r[t]?l=r[t]:isNaN(c)&&0<=s.indexOf(n)&&"number"==typeof r[t]?c=r[t]:isNaN(u)&&0<=a.indexOf(n)&&"number"==typeof r[t]&&(u=r[t])}),isNaN(l)||isNaN(c)||(o.push(c,l),isNaN(u)||o.push(u))),2<=o.length?o:null},gi.fromLatLngs=function(t){var e=[];if(Array.isArray(t))for(var o=0,n=t.length;o<n;o++){var r=gi.fromLatLng(t[o]);r&&e.push(r)}return e},gi._getDimensions=function(t){for(var e=0;Array.isArray(t);)t=t[0],e++;return"number"==typeof t&&e--,e},gi);function gi(t,e,o){return o?yi.call(this,t,e,o)||this:yi.call(this,t,e)||this}var vi=(_i.TYPE="Polygon",_i);function _i(t,e){this.type="Polygon",this.type=_i.TYPE,1===mi._getDimensions(t)?this.coordinates=[t]:this.coordinates=t,this.bbox=e}var wi,bi,Lt=window&&window.__extends||(wi=function(t,e){return(wi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}wi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Si=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xi=(Lt(Oi,bi=X),Oi.prototype.addProperty=function(t,e){er(this.data.properties[t],e)||(this.data.properties[t]=qo(e),"subType"!==t&&"radius"!==t||this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Oi.prototype.getBounds=function(){var e,t,o,n,r,i=this.getCoordinates(),s=this.getType();if("Point"===s)r=this.circlePolygon?(a=this.circlePolygon.geometry.coordinates,Pi.fromPositions(a[0])):new Pi(a=i,a);else if("MultiPoint"===s||"LineString"===s){var a=i;r=Pi.fromPositions(a)}else if("Polygon"===s){a=i;r=Pi.fromPositions(a[0])}else if("MultiLineString"===s){a=i;try{for(var l=Si(a),c=l.next();!c.done;c=l.next()){var u=c.value;r=Pi.merge(r,Pi.fromPositions(u))}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}}else if("MultiPolygon"===s){a=i;try{for(var p=Si(a),h=p.next();!h.done;h=p.next()){var d=h.value;r=Pi.merge(r,Pi.fromPositions(d[0]))}}catch(t){o={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(o)throw o.error}}}return r},Oi.prototype.getCoordinates=function(){return qo(this.data.geometry.coordinates)},Oi.prototype.getCircleCoordinates=function(){return this.circlePolygon?qo(this.circlePolygon.geometry.coordinates[0]):null},Oi.prototype.getId=function(){return this.data.id},Oi.prototype.getProperties=function(){return qo(this.data.properties)},Oi.prototype.getType=function(){return this.data.geometry.type},Oi.prototype.isCircle=function(){return Oi._isCircle(this.data)},Oi.prototype.isRectangle=function(){return Oi._isRectangle(this.data)},Oi.prototype.setCoordinates=function(t){t="Polygon"===this.getType()&&1===mi._getDimensions(t)?[t]:t;er(this.data.geometry.coordinates,t)||(this.data.geometry.coordinates=qo(t),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Oi.prototype.setProperties=function(t){t[Oi._shapeIdPropName]=this.data.id,er(this.data.properties,t)||(this.data.properties=qo(t),this._handleCircle(),this.dataSource&&this.dataSource._updateSource(),this._invokeEvent("shapechanged",this))},Oi.prototype.toJson=function(){return JSON.parse(JSON.stringify(this.data))},Oi.prototype._toJson=function(){return this.circlePolygon||this.data},Oi.prototype._setDataSource=function(t){void 0===t||null==t?delete this.dataSource:this.dataSource=t},Oi.prototype._handleCircle=function(){var t;this.isCircle()?(t=Oi._getCirclePositions(this.data),this.circlePolygon=new rr(new vi([t]),this.data.properties,this.data.id),this.data.properties.subType="Circle"):delete this.circlePolygon},Oi._isCircle=function(t){return t&&t.geometry&&"Point"===t.geometry.type&&t.geometry.coordinates&&t.properties&&"string"==typeof t.properties.subType&&"circle"===t.properties.subType.toLowerCase()&&"number"==typeof t.properties.radius},Oi._isRectangle=function(t){if("Polygon"===t.geometry.type&&t.geometry.coordinates&&"string"==typeof t.properties.subType&&"rectangle"===t.properties.subType.toLowerCase()){t=t.geometry.coordinates;if(1===t.length){t=t[0];if(5===t.length)return t[0][0]===t[4][0]&&t[0][1]===t[4][1];if(4===t.length)return!0}}return!1},Oi._getCirclePositions=function(t){return Yr(t.geometry.coordinates,t.properties.radius,72,"meters")},Oi._shapeIdPropName="_azureMapsShapeId",Oi);function Oi(t,e,o){var n,r,i=bi.call(this)||this;return"Feature"===t.type?(r=qo((n=t).geometry),o=n.properties?qo(n.properties):{},e=null==n.id||""===n.id?nr():n.id):(r=qo(t),e=null==e||""===e?nr():e,o=o?qo(o):{}),o[Oi._shapeIdPropName]=e,i.data=new rr(r,o,e),i._handleCircle(),i}var Ti,Ei,Ct=window&&window.__extends||(Ti=function(t,e){return(Ti=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ti(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ci=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Pi=(Ei=Array,Ct(ki,Ei),ki.fromBoundingBox=function(t){var e=ki.getWest(t),o=ki.getSouth(t),n=ki.getEast(t),t=ki.getNorth(t);return new ki([e,o,n,t])},ki.fromDimensions=function(t,e,o){var n=t[0],r=t[1],t=Math.min(Math.max(r+o/2,-85.5),85.5),r=Math.min(Math.max(r-o/2,-85.5),85.5),o=Xr(n+e/2);return new ki([Xr(n-e/2),r,o,t])},ki.fromEdges=function(t,e,o,n){return new ki([t,e,o,n])},ki.containsPosition=function(t,e){var o=ki.getCenter(t),n=Math.abs(o[1]-e[1]),o=Math.abs(o[0]-e[0]);180<o&&(o=360-o);e=ki.getHeight(t),t=ki.getWidth(t);return n<=e/2+1e-8&&o<=t/2+1e-8},ki.containsBoundingBox=function(t,e){var o=t&&4===t.length,n=e&&4===e.length;return!(!o||!n)&&(ki.getWest(t)<ki.getWest(e)&&ki.getWest(e)<ki.getEast(t)&&ki.getWest(t)<ki.getEast(e)&&ki.getEast(e)<ki.getEast(t)&&ki.getSouth(t)<ki.getSouth(e)&&ki.getSouth(e)<ki.getNorth(t)&&ki.getSouth(t)<ki.getNorth(e)&&ki.getNorth(e)<ki.getNorth(t))},ki.crossesAntimeridian=function(t){return Xr(ki.getEast(t))-Xr(ki.getWest(t))<0||ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(t)||ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(t)},ki.getCenter=function(t){var e=Xr(ki.getEast(t)),o=Xr(ki.getWest(t));e<o&&(e+=360);o=Xr((o+e)/2),e=Jr(ki.getSouth(t)),t=Jr(ki.getNorth(t));return[o,Jr((e+t)/2)]},ki.getHeight=function(t){t=Jr(ki.getNorth(t))-Jr(ki.getSouth(t));return isNaN(t)?0:t},ki.getWidth=function(t){t=Xr(ki.getEast(t))-Xr(ki.getWest(t));return isNaN(t)?0:t<0?t+360:t},ki.getSouthWest=function(t){var e=this.getSouth(t),t=this.getWest(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getNorthEast=function(t){var e=this.getNorth(t),t=this.getEast(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getNorthWest=function(t){var e=this.getNorth(t),t=this.getWest(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getSouthEast=function(t){var e=this.getSouth(t),t=this.getEast(t);return isNaN(e)||isNaN(t)?null:[t,e]},ki.getSouth=function(t){return t&&4<=t.length?Number(t[1]):NaN},ki.getWest=function(t){return t&&4<=t.length?Number(t[0]):NaN},ki.getNorth=function(t){if(t){if(4===t.length)return Number(t[3]);if(6===t.length)return Number(t[4])}return NaN},ki.getEast=function(t){if(t){if(4===t.length)return Number(t[2]);if(6===t.length)return Number(t[3])}return NaN},ki.intersect=function(t,e){var o=ki.getCenter(t),n=ki.getCenter(e),r=Math.abs(o[1]-n[1]),i=Math.abs(o[0]-n[0]);180<i&&(i=360-i);o=ki.getHeight(t),n=ki.getWidth(t),t=ki.getHeight(e),e=ki.getWidth(e);return r<=o/2+t/2&&i<=n/2+e/2},ki.merge=function(t,e){var o=t&&4===t.length,n=e&&4===e.length;if(o&&!n)return t;if(n&&!o)return e;if(!o&&!n)return null;for(var o=Math.max(Jr(ki.getNorth(t)),Jr(ki.getNorth(e))),n=Math.min(Jr(ki.getSouth(t)),Jr(ki.getSouth(e))),r=[t,e],i=[],s=0,s=0;s<r.length;s++){var a=r[s],l=Xr(ki.getWest(a)),c=Xr(ki.getEast(a));ki.crossesAntimeridian(a)?(i.push([l,180]),i.push([-180,c])):i.push([l,c])}i.sort(function(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]});var u=[],p=i[0];for(s=1;s<i.length;){var h=i[s];p[1]>=h[0]?p[1]=Math.max(p[1],h[1]):(u.push(p),p=h),s++}u.push(p);var d=u.length,f=u[0][0]+360-u[d-1][1],y=[u[d-1][1],u[0][0]];for(s=1;s<d;s++){var m=u[s][0]-u[s-1][1];f<m&&(f=m,y=[u[s-1][1],u[s][0]])}return new ki([y[1],n],[y[0],o])},ki.fromPositions=function(t){for(var e,o,n=NaN,r=NaN,i=NaN,s=NaN,a=t.length,l=new Array(a),c=0;a--;)(o=t[a])&&2<=o.length&&(e=Jr(o[1]),n=isNaN(n)?e:Math.max(n,e),r=isNaN(r)?e:Math.min(r,e),l[c++]=Xr(o[0]));if(c){l.length=c,l.sort(function(t,e){return t-e});for(var u=l[0]+360-l[c-1],p=0,a=1;a<c;a++){var h=l[a]-l[a-1];u<h&&(u=h,p=a)}i=l[p],s=l[(p||c)-1]}return isNaN(i)||isNaN(r)||isNaN(s)||isNaN(n)?null:new ki([i,r,s,n])},ki.fromLatLngs=function(t){return ki.fromPositions(mi.fromLatLngs(t))},ki.fromData=function(t){var e,o,n=null;if(Array.isArray(t)&&0<t.length){try{for(var r=Ci(t),i=r.next();!i.done;i=r.next()){var s,a=i.value;null!=(s=ki.fromData(a))&&(n=null===n?s:ki.merge(n,s))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n}if(t instanceof xi)return t.getBounds();if(t&&t.type){var l=t;if(l.bbox&&4===l.bbox.length)return l.bbox;switch(l.type){case"FeatureCollection":return ki.fromData(l.features);case"Feature":return xi._isCircle(l)?ki.fromPositions(xi._getCirclePositions(l)):ki.fromData(l.geometry);case"GeometryCollection":return ki.fromData(l.geometries);case"Point":var c=l.coordinates;if(c&&2<=c.length)return[c[0],c[1],c[0],c[1]];break;case"LineString":case"MultiPoint":return ki.fromPositions(l.coordinates);case"Polygon":case"MultiLineString":var u=l.coordinates;if(u&&0<u.length){for(var p=0,h=u.length;p<h;p++)null!=(s=ki.fromPositions(u[p]))&&(n=null===n?s:ki.merge(n,s));if(null!=n)return n}break;case"MultiPolygon":var d=l.coordinates;if(d&&0<d.length){for(p=0,h=d.length;p<h;p++)for(var f=0,y=d[p].length;f<y;f++)null!=(s=ki.fromPositions(d[p][f]))&&(n=null===n?s:ki.merge(n,s));return n}}}return null},ki.splitOnAntimeridian=function(t){var e,o,n,r,i,s,a=[];return ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe(t)?[[-180,t[1],t[2],180,t[4],t[5]]]:ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe(t)?[[-180,t[1],180,t[3]]]:(ki.crossesAntimeridian(t)?(s=e=void 0,o=Xr(ki.getWest(t)),n=Xr(ki.getEast(t)),r=Jr(ki.getNorth(t)),i=Jr(ki.getSouth(t)),s=6<=t.length?(e=[o,i,t[2],180,r,t[5]],[-180,i,t[2],n,r,t[5]]):(e=[o,i,180,r],[-180,i,n,r]),a.push(e,s)):a.push(t),a)},ki.isBoundingBoxWithSixOrMoreElementsLargerThanGlobe=function(t){return 6<=t.length&&360<t[3]-t[0]},ki.isBoundingBoxWithLessThanSixElementsLargerThanGlobe=function(t){return t.length<6&&360<t[2]-t[0]},ki);function ki(t,e){var o,n=this;return t&&e?n=(o=t)[2]&&e[2]?Ei.call(this,o[0],o[1],o[2]||0,e[0],e[1],e[2]||0)||this:Ei.call(this,o[0],o[1],e[0],e[1])||this:!t||(t=t)&&(4===t.length?n=Ei.call(this,t[0],t[1],t[2],t[3])||this:6<=t.length&&(n=Ei.call(this,t[0],t[1],t[2],t[3],t[4],t[5])||this)),n}var Ai=(Ii.TYPE="FeatureCollection",Ii);function Ii(t,e){this.type="FeatureCollection",this.type=Ii.TYPE,this.features=t,this.bbox=e}Li.TYPE="GeometryCollection",H=Li;function Li(t){this.type="GeometryCollection",this.type=Li.TYPE,this.geometries=t}Ri.TYPE="LineString",It=Ri;function Ri(t,e){this.type="LineString",this.type=Ri.TYPE,this.coordinates=t,this.bbox=e}Ni.TYPE="MultiLineString",Tt=Ni;function Ni(t,e){this.type="MultiLineString",this.type=Ni.TYPE,this.coordinates=t,this.bbox=e}Mi.TYPE="MultiPoint",Ot=Mi;function Mi(t,e){this.type="MultiPoint",this.type=Mi.TYPE,this.coordinates=t,this.bbox=e}ji.TYPE="MultiPolygon",R=ji;function ji(t,e){this.type="MultiPolygon",this.type=ji.TYPE,this.coordinates=t,this.bbox=e}var Di,zi,Lt=window&&window.__extends||(Di=function(t,e){return(Di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Di(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ct=(zi=Array,Lt(Bi,zi),Bi.fromPosition=function(t){return 2<=t.length?new Bi((180+t[0])/360,Bi._latToMercatorY(t[1]),3<=t.length?Bi._altitudeToMercatorZ(t[2],t[1]):0):[0,0,0]},Bi.fromPositions=function(t){for(var e=[],o=0,n=t.length;o<n;o++)e.push(this.fromPosition(t[o]));return e},Bi.toFloat32Array=function(t){for(var e=new Float32Array(3*t.length),o=0,n=t.length;o<n;o++){var r=3*o,i=t[o];e[r]=(180+i[0])/360,e[1+r]=Bi._latToMercatorY(i[1]),e[2+r]=3<=i.length?Bi._altitudeToMercatorZ(i[2],i[1]):0}return e},Bi.toPosition=function(t){if(2<=t.length){var e=360/Math.PI*Math.atan(Math.exp((180-360*t[1])*Math.PI/180))-90;return new mi(360*t[0]-180,e,3<=t.length?Bi._mercatorZToAltitude(t[2],t[1]):0)}return[0,0,0]},Bi.toPositions=function(t){for(var e=[],o=0,n=t.length;o<n;o++)e.push(this.toPosition(t[o]));return e},Bi.mercatorScale=function(t){return 1/Math.cos(t*Math.PI/180)},Bi.meterInMercatorUnits=function(t){return 1/Bi.earthCircumference*Bi.mercatorScale(Bi._latToMercatorY(t))},Bi._circumferenceAtLatitude=function(t){return Bi.earthCircumference*Math.cos(t*Math.PI/180)},Bi._altitudeToMercatorZ=function(t,e){return t/Bi._circumferenceAtLatitude(e)},Bi._mercatorZToAltitude=function(t,e){return t*Bi._circumferenceAtLatitude(Bi._latToMercatorY(e))},Bi._latToMercatorY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360},Bi.earthCircumference=2*Math.PI*Ur(),Bi);function Bi(t,e,o){return zi.call(this,t,e,o||0)||this}var Fi,Lt=Object.freeze({__proto__:null,Feature:rr,FeatureCollection:Ai,LineString:It,Point:ur,Polygon:vi,Position:mi,BoundingBox:Pi,MercatorPoint:Ct,MultiLineString:Tt,MultiPoint:Ot,MultiPolygon:R,GeometryCollection:H}),Ui=Rt(function(t,e){function y(t,e){return t*t+e*e}function i(t,e){for(var o,n,r,i=t[0],s=[i],a=1,l=t.length;a<l;a++)o=t[a],r=i,y((n=o)[0]-r[0],n[1]-r[1])>e&&(s.push(o),i=o);return i!==o&&s.push(o),s}function m(t,e,o,n,r){for(var i,s,a,l,c,u,p,h=n,d=e+1;d<o;d++){var f=(s=t[d],a=t[e],l=t[o],p=u=f=c=void 0,c=a[0],f=a[1],u=l[0]-c,p=l[1]-f,0==u&&0==p||(1<(a=((s[0]-c)*u+(s[1]-f)*p)/y(u,p))?(c=l[0],f=l[1]):0<a&&(c+=u*a,f+=p*a)),y(s[0]-c,s[1]-f));h<f&&(i=d,h=f)}n<h&&(1<i-e&&m(t,e,i,n,r),r.push(t[i]),1<o-i&&m(t,i,o,n,r))}e.__esModule=!0,e.SimplifyAP=function(t,e,o){if(t.length<=2)return t;var n,r=(e=void 0===e?1:e)*e;return t=(o=void 0===o?!1:o)?t:i(t,r),e=(n=t).length-1,o=[n[0]],m(n,0,e,r,o),o.push(n[e]),t=o}});(Fi=Ui)&&Fi.__esModule&&Object.prototype.hasOwnProperty.call(Fi,"default")&&Fi.default;var qi=Ui.SimplifyAP;var Gi=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zi=(Hi.prototype.toTarget=function(t,e){return this.transformArray(t,this.M,e)},Hi.prototype.toSource=function(t,e){return this.transformArray(t,this.inverseM,e)},Hi.prototype.transformArray=function(t,e,o){var n,r;if(t&&Array.isArray(t)&&Array.isArray(t[0])){var i=[];try{for(var s=Gi(t),a=s.next();!a.done;a=s.next()){var l=a.value;i.push(this.transform(l,e,o))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i}return null},Hi.prototype.transform=function(t,e,o){var n=t[0]*e[0][3]+t[1]*e[1][3]+e[2][3],e=t[0]*e[0][4]+t[1]*e[1][4]+e[2][4];return"number"==typeof o&&0<=o?[Dr(n,o),Dr(e,o)]:[Dr(n,6),Dr(e,6)]},Hi._calculateAffineTransform=function(t,e){if(t.length!==e.length||t.length<1)throw new Error("Error: source and target arrays must have the same length.");var o=Math.min(t[0].length,e[0].length),n=o+1;if(t.length<o)throw new Error("Erorr: At least "+o+" reference points required.");for(var r=[],i=[],s=0;s<n;s++){i[s]=[];for(var a=0;a<n;a++){a<o&&(r[a]=0);for(var l=i[s][a]=0;l<t.length;l++)a<o&&(r[a]+=s<o?t[l][s]*e[l][a]:e[l][a]),i[s][a]+=o<=s&&o<=a?1:o<=s?t[l][a]:o<=a?t[l][s]:t[l][s]*t[l][a]}i[s]=i[s].concat(r)}if(!this._gaussJordanElimination(i))throw new Error("Error: Singular matrix. Points are likely coplanar.");return i},Hi._gaussJordanElimination=function(t){for(var e,o=t.length,n=2*o-1,r=0;r<o;r++){for(var i=r,s=r+1;s<o;s++)Math.abs(t[s][r])>Math.abs(t[i][r])&&(i=s);if(e=t[i],t[i]=t[r],t[r]=e,Math.abs(t[r][r])<=1e-12)return!1;for(var a=r+1;a<o;a++)for(var l=t[a][r]/t[r][r],c=r;c<n;c++)t[a][c]-=t[r][c]*l}for(r=o-1;-1<r;r--){l=t[r][r];for(s=0;s<r;s++)for(var u=n-1;r-1<u;u--)t[s][u]-=t[r][u]*t[s][r]/l;t[r][r]/=l;for(var p=o;p<n;p++)t[r][p]/=l}return!0},Hi);function Hi(t,e){this.M=Hi._calculateAffineTransform(t,e),this.inverseM=Hi._calculateAffineTransform(e,t)}var Ki,Wi,It=Object.freeze({__proto__:null,AffineTransform:Zi,WEBMERCATOR_MAXLAT:xr,_precision:Dr,get AreaUnits(){return hr},get DistanceUnits(){return dr},get TimeUnits(){return fr},get SpeedUnits(){return yr},get AccelerationUnits(){return mr},boundingBoxToPolygon:function(t){var e=Xr(Pi.getWest(t)),o=Xr(Pi.getEast(t)),n=Jr(Pi.getNorth(t)),r=Jr(Pi.getSouth(t)),t=Pi.getCenter(t),n=[[e,n],[e,r],[t[0],r],[o,r],[o,n],[t[0],n],[e,n]];return new vi([n])},convertDistance:zr,getCardinalSpline:function(t,e,o,n){if(!t||t.length<=2)return i;"number"!=typeof e&&(e=.5),("number"!=typeof o||o<=0)&&(o=15);var r=t.length,i=t.slice(0);n?(mi.areEqual(i[0],i[r-1])&&(i.pop(),r--),i.unshift(t[r-1]),i.push(t[0]),i.push(t[1]),r++):(i.unshift(t[0]),i.push(t[r-1]));var s,a,l,c=[];c.push([1,0,0,0]);for(var u=1;u<o-1;u++)c.push([2*(l=(s=u/o)*(a=s*s))-3*a+1,-2*l+3*a,l-2*a+s,l-a]);c.push([0,1,0,0]);for(var p,h,d,f,y,m,g=[],u=1;u<r;u++)for(p=e*(i[u+1][0]-i[u-1][0]),h=e*(i[u+1][1]-i[u-1][1]),d=e*(i[u+2][0]-i[u][0]),f=e*(i[u+2][1]-i[u][1]),s=0;s<o;s++)m=(y=c[s])[0]*i[u][0]+y[1]*i[u+1][0]+y[2]*p+y[3]*d,y=Er(y[0]*i[u][1]+y[1]*i[u+1][1]+y[2]*h+y[3]*f,-85,85),g.push([m,y]);return g},getDestination:Br,getDistanceTo:Fr,getEarthRadius:Ur,getPathDenormalizedAtAntimerian:Gr,getPathSplitByAntimeridian:Zr,getGeodesicPath:function(t,e){var o;(!e||e<=0)&&(e=15),Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var n=o.length-1,r=[],i=0;i<n;i++)r=r.concat(qr(o[i],o[i+1],e));return Gr(r)},getGeodesicPaths:function(t,e){var o;(!e||e<=0)&&(e=15),Array.isArray(t)?o=t:t.type&&"LineString"===t.type&&(o=t.coordinates);for(var n=o.length-1,r=[],i=[],s=0;s<n;s++)for(var a,l,c,u,p,h=qr(o[s],o[s+1],e),d=0;d<h.length;d++)r.push(h[d]),d+1>=h.length||(a=(c=gr(h[d],2))[0],l=c[1],p=(u=gr(h[d+1],2))[0],c=u[1],180<Math.abs(p-a)&&(u=0<a?180:-180,p=Math.abs((0<a?p+360:p-360)-a),p=l+(c-l)*(Math.abs(u-a)/p),r.push([u,p]),i.push(r),r=[[-u,p]]));return i.push(r),i},getHeading:Hr,getLengthOfPath:Kr,getPositionAlongPath:Wr,getRegularPolygonPath:Yr,getRegularPolygonPaths:function(t,e,o,n,r){return Zr(Vr(t,e,o,n,r))},interpolate:Qr,normalizeLatitude:Jr,normalizeLongitude:Xr,rotatePositions:$r,getPixelHeading:function(t,e){t=pi(t),e=pi(e);var t=(o=gr(ei([t,e],21),2))[0],o=(e=o[1])[0]-t[0],e=t[1]-e[1];return(2.5*Math.PI-Math.atan2(e,o))*br%360},mercatorPixelsToPositions:ti,mercatorPositionsToPixels:ei,convertAcceleration:oi,convertArea:ni,convertSpeed:ri,convertTimespan:ii,getAcceleration:si,getAccelerationFromSpeeds:ai,getAccelerationFromFeatures:function(t,e,o,n,r,i,s){if("string"==typeof o&&"Feature"===t.type&&"Point"===t.geometry.type&&"Feature"===e.type&&"Point"===e.geometry.type){var a=li(t.properties[o],e.properties[o],fr.seconds);if(!isNaN(a)){var l=0;if(n&&"string"==typeof n){o=t.properties[n],n=e.properties[n];if("number"==typeof o&&(l=o,"number"==typeof n))return ai(o,n,a,r,fr.seconds,i,s)}return si(l,Fr(t.geometry.coordinates,e.geometry.coordinates,dr.meters),a,r,dr.meters,fr.seconds,i,s)}}return NaN},getArea:function t(e,o,n){if(e){var r=0;switch((e=e instanceof xi?e.toJson():e).type){case"Feature":var i=e;if(e.geometry)return t(i.geometry,o,n);break;case"Polygon":(i=e).coordinates&&(r=Rr(i.coordinates));break;case"MultiPolygon":var s=e;if(s.coordinates)for(var a=0,l=s.coordinates.length;a<l;a++)r+=Rr(s.coordinates[a])}return ni(r,hr.squareMeters,o,n)}return 0},getSpeed:function(t,e,o,n,r,i){if(t=pi(t),e=pi(e),t&&e){n=ii(o,n,fr.seconds);return ri(Fr(t,e,dr.meters)/n,yr.metersPerSecond,r,i)}return 0},getSpeedFromFeatures:function(t,e,o,n,r){if("string"==typeof o&&"Feature"===t.type&&"Point"===t.geometry.type&&"Feature"===e.type&&"Point"===e.geometry.type){o=this.getTimespan(t.properties[o],e.properties[o],fr.seconds);if(!isNaN(o)){e=this.getDistanceTo(t.geometry.coordinates,e.geometry.coordinates,dr.meters);return this.convertSpeed(e/o,yr.metersPerSecond,n,r)}}return NaN},getTimespan:li,getTravelDistance:function(t,e,o,n,r,i,s,a){return e=this.convertTimespan(e,r,fr.seconds),o=(o=this.convertSpeed(o,i,yr.metersPerSecond))*e,"number"==typeof n&&(o+=.5*this.convertAcceleration(n,s,mr.metersPerSecondSquared)*e*e),this.convertDistance(o,dr.meters,t,a)},parseTimestamp:ci,getConvexHull:function(t){var e,o,n=ui(t).map(function(t){return[Xr(t[0]),Jr(t[1])]});n.sort(function(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]});var r=[];try{for(var i=vr(n),s=i.next();!s.done;s=i.next()){for(var a=s.value;2<=r.length&&Mr(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(e)throw e.error}}for(var l=[],c=n.length-1;0<=c;c--){for(;2<=l.length&&Mr(l[l.length-2],l[l.length-1],n[c])<=0;)l.pop();l.push(n[c])}return new vi([r.concat(l)])},getPositions:ui,getPosition:pi,getPositionsAlongPath:function(t,e){if(e<2)return[];for(var o=[],n=Kr(t,dr.meters)/(e-1),r=0;r<e;r++){var i=Wr(t,n*r,dr.meters);null!=i&&o.push(i)}return o},getPointWithHeadingAlongPath:hi,getPointsWithHeadingsAlongPath:function(t,e){if(e<=0)return[];for(var o=[],n=Kr(t,dr.meters)/(e-1),r=0;r<e;r++){var i=hi(t,n*r,dr.meters);null!=i&&o.push(i)}return o},getClosestPointOnGeometry:di,simplify:function(t,e){return qi(t,e,!0)}}),Vi=((window&&window.__extends||(Ki=function(t,e){return(Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ki(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Yi,Wi=k),Yi);function Yi(){var t=null!==Wi&&Wi.apply(this,arguments)||this;return t.zoomDelta=1,t.style=u.ControlStyle.light,t}var Qi,Ji,Ct=((window&&window.__extends||(Qi=function(t,e){return(Qi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Qi(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Xi,Ji=nt),Xi.prototype.onAdd=function(t){this.container=this.buildContainer(t,this.options.style,"Zoom Control"),this.container.style.flexDirection="column",this.zoomInButton=this.constructZoomInButton(t),this.zoomOutButton=this.constructZoomOutButton(t);var e=q("Zoom In"),o=q("Zoom Out");return this.container.appendChild(this.zoomInButton),this.container.appendChild(e),this.container.appendChild(this.zoomOutButton),this.container.appendChild(o),G(e,this.zoomInButton),G(o,this.zoomOutButton),t.events.add("zoom",this.zoomChanged),t.events.add("minzoomchanged",this.minZoomChanged),t.events.add("maxzoomchanged",this.maxZoomChanged),this.map=t,this.container},Xi.prototype.onRemove=function(){Ji.prototype.onRemove.call(this),this.map&&(this.map.events.remove("zoom",this.zoomChanged),this.map.events.remove("minzoomchanged",this.minZoomChanged),this.map.events.remove("maxzoomchanged",this.maxZoomChanged),this.map=null),this.container&&(this.container.remove(),this.container=null,this.zoomInButton=null,this.zoomOutButton=null)},Xi.prototype.updateZoomButtonsState=function(){var t=this.map.getCamera().zoom>=this.map._getMap().getMaxZoom(),e=Pi.getSouth(this.map.getCamera().bounds)<=-xr&&Pi.getNorth(this.map.getCamera().bounds)>=xr,e=this.map.getCamera().zoom<=this.map._getMap().getMinZoom()||e;this.zoomInButton&&this.zoomInButton.disabled!=t&&(this.zoomInButton.disabled=t,this.zoomInButton.setAttribute("aria-label",t?"Zoom In disabled":"Zoom In")),this.zoomOutButton&&this.zoomOutButton.disabled!=e&&(this.zoomOutButton.disabled=e,this.zoomInButton.setAttribute("aria-label",t?"Zoom Out disabled":"Zoom Out"))},Xi.prototype.constructZoomInButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("zoom-in"),o.setAttribute("aria-label","Zoom In"),o.setAttribute("alt","Zoom In"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({zoom:t.getCamera().zoom+e.options.zoomDelta,duration:Xi.ZOOM_DURATION_MS,type:"ease"},!0)}),o},Xi.prototype.constructZoomOutButton=function(t){var e=this,o=document.createElement("button");return o.classList.add("azure-maps-control-button"),o.classList.add("zoom-out"),o.setAttribute("aria-label","Zoom Out"),o.setAttribute("alt","Zoom Out"),o.setAttribute("type","button"),o.addEventListener("click",function(){t.setCamera({zoom:t.getCamera().zoom-e.options.zoomDelta,duration:Xi.ZOOM_DURATION_MS,type:"ease"},!0)}),o},Xi.ZOOM_DURATION_MS=200,Xi);function Xi(t){var e=Ji.call(this)||this;return e.container=null,e.zoomInButton=null,e.zoomOutButton=null,e.zoomChanged=function(t){return e.updateZoomButtonsState()},e.minZoomChanged=function(t){return e.updateZoomButtonsState()},e.maxZoomChanged=function(t){return e.updateZoomButtonsState()},e.options=(new Vi).merge(t),e}Tt=Object.freeze({__proto__:null,ControlBase:nt,PitchControl:_t,CompassControl:pt,ZoomControl:Ct,StyleControl:Mt,TrafficControl:In,TrafficLegendControl:At});var $i,ts,es=function(t,e){return Uo(t,5,e="function"==typeof e?e:void 0)},os=((window&&window.__extends||($i=function(t,e){return($i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}$i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ns,ts=k),ns);function ns(){var t=null!==ts&&ts.apply(this,arguments)||this;return t.buffer=128,t.maxZoom=18,t.cluster=!1,t.clusterRadius=50,t.clusterMaxZoom=void 0,t.clusterProperties=void 0,t.lineMetrics=!1,t.tolerance=.375,t}var rs,is,ss=((window&&window.__extends||(rs=function(t,e){return(rs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}rs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(as,is=X),as.prototype.getId=function(){return this.id},as.prototype._setMap=function(t){var e;null==t||void 0===t?(e=this.map,delete this.map,this._invokeEvent("sourceremoved",this),e&&e.events.invoke("sourceremoved",this)):(this.map=t,this._invokeEvent("sourceadded",this),this.map.events.invoke("sourceadded",this))},as);function as(t){var e=is.call(this)||this;return e.id=t||nr(),e}var ls,cs,Ot=window&&window.__extends||(ls=function(t,e){return(ls=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ls(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),us=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ps=(Ot(hs,cs=ss),hs.prototype.add=function(t,e){this._addNoUpdate(t,e),this._updateSource()},hs.prototype.clear=function(){this._clearNoUpdate(),this._updateSource()},hs.prototype.dispose=function(){this.options=null,this.shapes=null,this.shapesMap=null,this.map=null},hs.prototype.getClusterExpansionZoom=function(e){var r=this;return new Promise(function(o,n){var t;r.map?(t=r.map._getMap().getSource(r.getId()))&&"geojson"===t.type&&t.getClusterExpansionZoom(e,function(t,e){t?n(t):"number"==typeof e&&o(e)}):n("The DataSource hasn't been added to a map.")})},hs.prototype.getClusterChildren=function(e){var r=this;return new Promise(function(o,n){var t;r.map?(t=r.map._getMap().getSource(r.getId()))&&"geojson"===t.type&&t.getClusterChildren(e,function(t,e){t?n(t):e&&o(r.map.sources._mapFeaturesToShapes(e,!1,r))}):n("The DataSource hasn't been added to a map.")})},hs.prototype.getClusterLeaves=function(e,r,i){var s=this;return new Promise(function(o,n){var t;s.map?(t=s.map._getMap().getSource(s.getId()))&&"geojson"===t.type&&t.getClusterLeaves(e,r,i,function(t,e){t?n(t):e&&o(s.map.sources._mapFeaturesToShapes(e,!1,s))}):n("The DataSource hasn't been added to a map.")})},hs.prototype.getOptions=function(){return qo(this.options)},hs.prototype.getShapes=function(){return Array.from(this.shapes)},hs.prototype.importDataFromUrl=function(t){var e=this;return fetch(t,{method:"GET",mode:"cors"}).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText)}).then(function(t){e.add(t)})},hs.prototype.getShapeById=function(t){return this.shapes[this.shapesMap.get(t)]||null},hs.prototype.remove=function(t){var e,o,t=Array.isArray(t)?t:[t];try{for(var n=us(t),r=n.next();!r.done;r=n.next()){var i=r.value;"number"==typeof i?this._removeByIndex(i):this._removeById(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}this._updateSource()},hs.prototype.removeById=function(t){var e,o,t=Array.isArray(t)?t:[t];try{for(var n=us(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeById(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}this._updateSource()},hs.prototype.setOptions=function(t){t=(new os).merge(this.options,qo(t));er(this.options,t)||(this._invokeEvent("datasourceupdated",this),this.options=t,this.map&&this.map._rebuildStyle())},hs.prototype.setShapes=function(t){this._clearNoUpdate(),this.add(t)},hs.prototype.toJson=function(){return new Ai(this.shapes.map(function(t){return t.toJson()}))},hs.prototype._toJson=function(){return new Ai(this.shapes.map(function(t){return t._toJson()}))},hs.prototype._buildSource=function(){var t={type:"geojson",data:this._toJson(),maxzoom:this.options.maxZoom,cluster:this.options.cluster,clusterRadius:this.options.clusterRadius,tolerance:this.options.tolerance,lineMetrics:this.options.lineMetrics,clusterProperties:this.options.clusterProperties,buffer:this.options.buffer};return"number"==typeof this.options.clusterMaxZoom&&(t.clusterMaxZoom=this.options.clusterMaxZoom),t},hs.prototype._addNoUpdate=function(t,e){var o;t instanceof xi?(this._addToSources(t,e),o=[t]):Array.isArray(t)?(o=t.map(function(t){return t instanceof xi?t:new xi(t)}),this._addToSources(o,e)):"FeatureCollection"===t.type?(o=t.features.map(function(t){return new xi(t)}),this._addToSources(o,e)):"GeometryCollection"===t.type?(o=t.geometries.map(function(t){return new xi(t)}),this._addToSources(o,e)):(t=new xi(t),this._addToSources(t,e),o=[t]),this._invokeEvent("dataadded",o)},hs.prototype._clearNoUpdate=function(){var t=this.shapes;this.shapes=[],this.shapesMap=new J,t&&0<t.length&&this._invokeEvent("dataremoved",t)},hs.prototype._updateSource=function(){var t=this;void 0!==this.requestId||(this.requestId=requestAnimationFrame(function(){t._updateMboxSource(),t.requestId=void 0}))},hs.prototype._addToSources=function(t,e){var o,n,r,i;if(t=Array.isArray(t)?t:[t],"number"!=typeof e)try{for(var s=us(t),a=s.next();!a.done;a=s.next()){var l=a.value;this.shapes.push(l),this.shapesMap.set(l.getId(),this.shapes.length-1)}}catch(t){o={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}else for(var c=t.length-1;0<=c;c--)this.shapes.splice(e,0,t[c]),this._updateShapesMap(e);try{for(var u=us(t),p=u.next();!p.done;p=u.next())(l=p.value)._setDataSource(this)}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}},hs.prototype._removeById=function(t){var e=t instanceof xi?t.getId():"string"==typeof t||"number"==typeof t?t:t.id,t=this.shapes[this.shapesMap.get(e)];t&&(t._setDataSource(null),this.shapes.splice(this.shapesMap.get(e),1),this._updateShapesMap(this.shapesMap.get(e)),this.shapesMap.delete(e),this._invokeEvent("dataremoved",[t]))},hs.prototype._removeByIndex=function(t){var e;if(t>=this.shapes.length)throw new Error("The specified remove index '"+t+"' is greater than the maximum possible index '"+(this.shapes.length-1)+"'");e=this.shapes[t],this.shapesMap.delete(e.getId()),e._setDataSource(null),this.shapes.splice(t,1),this._updateShapesMap(t),this._invokeEvent("dataremoved",[e])},hs.prototype._updateShapesMap=function(t){for(var e=t;e<this.shapes.length;e++)this.shapesMap.set(this.shapes[e].getId(),e)},hs.prototype._updateMboxSource=function(){var t;this.map&&this.map._getMap()&&((t=this.map._getMap().getSource(this.getId()))&&"geojson"===t.type&&t.setData(this._toJson()))},hs);function hs(t,e){t=cs.call(this,t)||this;return t.requestId=void 0,t.options=(new os).merge(qo(e)),t.shapes=[],t.shapesMap=new J,t}var ds,fs,ys=((window&&window.__extends||(ds=function(t,e){return(ds=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ds(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ms,fs=k),ms);function ms(){var t=null!==fs&&fs.apply(this,arguments)||this;return t.bounds=void 0,t.minZoom=0,t.maxZoom=22,t.isTMS=!1,t.tiles=void 0,t.url=void 0,t}var gs,vs,_s=((window&&window.__extends||(gs=function(t,e){return(gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}gs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ws,vs=ss),ws.prototype.getOptions=function(){return qo(this.options)},ws.prototype.getShape=function(t,e){return this.map._getMap().querySourceFeatures(this.getId(),{sourceLayer:t,filter:e})},ws.prototype._buildSource=function(){var t={type:"vector"};return this.options.bounds&&(t.bounds=this.options.bounds),this.options.tiles?(t.tiles=this.options.tiles,t.minzoom=this.options.minZoom,t.maxzoom=this.options.maxZoom):this.options.url&&(t.url=this.options.url),this.options.isTMS&&(t.scheme="tms"),t},ws);function ws(t,e){t=vs.call(this,t)||this;return t.options=(new ys).merge(qo(e)),t}var bs,Ss,R=Object.freeze({__proto__:null,Source:ss,DataSource:ps,VectorTileSource:_s}),xs=((window&&window.__extends||(bs=function(t,e){return(bs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}bs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Os,Ss=X),Os.prototype.getId=function(){return this.id},Os.prototype.getMap=function(){return this.map||null},Os.prototype.onAdd=function(t){this.map=t,this._invokeEvent("layeradded",this),this.map.events.invoke("layeradded",this)},Os.prototype.onRemove=function(){var t=this.map;delete this.map,this._invokeEvent("layerremoved",this),t&&t.events.invoke("layerremoved",this)},Os._isMBoxEvent=function(t){return!this.LayerEvents.hasOwnProperty(t)},Os.prototype._updateBaseProperties=function(t,e){this._updateFilter(t.filter,e.filter),this._updateZoomRange(t.minZoom,e.minZoom,t.maxZoom,e.maxZoom),this._updateLayoutProperty("visibility",t.visible,e.visible,t.visible?"visible":"none")},Os.prototype._updateFilter=function(t,e){er(t,e)||this.map._getMap().setFilter(this.id,t)},Os.prototype._updatePaintProperty=function(t,e,o,n){er(e,o)||this.map._getMap().setPaintProperty(this.id,t,n||e)},Os.prototype._updateLayoutProperty=function(t,e,o,n){er(e,o)||this.map._getMap().setLayoutProperty(this.id,t,n||e)},Os.prototype._updateZoomRange=function(t,e,o,n){t===e&&n===o||this.map._getMap().setLayerZoomRange(this.id,t,o)},Os.LayerEvents={layeradded:void 0,layerremoved:void 0},Os);function Os(t){var e=Ss.call(this)||this;return e.id=t||nr(),e}var Ts,Es,H=((window&&window.__extends||(Ts=function(t,e){return(Ts=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ts(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Cs,Es=k),Cs._cloneCustomizer=function(t){if(t instanceof ss)return t},Cs);function Cs(){var t=null!==Es&&Es.apply(this,arguments)||this;return t.filter=void 0,t.minZoom=0,t.maxZoom=24,t.visible=!0,t}var Ps,ks,As=((window&&window.__extends||(Ps=function(t,e){return(Ps=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ps(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Is,ks=H),Is);function Is(){var t=null!==ks&&ks.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.color="#1A73AA",t.blur=0,t.opacity=1,t.strokeColor="#FFFFFF",t.strokeOpacity=1,t.strokeWidth=2,t.pitchAlignment="viewport",t.radius=8,t}var Ls,Rs,Ns=((window&&window.__extends||(Ls=function(t,e){return(Ls=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ls(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ms,Rs=xs),Ms.prototype.getOptions=function(){return es(this.options,As._cloneCustomizer)},Ms.prototype.getSource=function(){return this.options.source},Ms.prototype.setOptions=function(t){t=(new As).merge(this.options,es(t,As._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("circle-blur",t.blur,this.options.blur),this._updatePaintProperty("circle-color",t.color,this.options.color),this._updatePaintProperty("circle-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("circle-radius",t.radius,this.options.radius),this._updatePaintProperty("circle-stroke-color",t.strokeColor,this.options.strokeColor),this._updatePaintProperty("circle-stroke-opacity",t.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("circle-stroke-width",t.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("circle-pitch-alignment",t.pitchAlignment,this.options.pitchAlignment)}this.options=t},Ms.prototype._buildLayers=function(){var t={id:this.id,type:"circle",source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"circle-color":this.options.color,"circle-blur":this.options.blur,"circle-opacity":this.options.opacity,"circle-stroke-color":this.options.strokeColor,"circle-stroke-opacity":this.options.strokeOpacity,"circle-stroke-width":this.options.strokeWidth,"circle-pitch-alignment":this.options.pitchAlignment,"circle-radius":this.options.radius},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),[t]},Ms.prototype._getLayerIds=function(){return[this.id]},Ms.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},Ms);function Ms(t,e,o){e=Rs.call(this,e)||this;return e.options=(new As).merge(es(o,As._cloneCustomizer)),e.options.source=t||e.options.source,e}var js,Ds,zs=((window&&window.__extends||(js=function(t,e){return(js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}js(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Bs,Ds=H),Bs._cloneCustomizer=function(t){if(t instanceof ss)return t},Bs);function Bs(){var t=null!==Ds&&Ds.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.color=["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],t.intensity=1,t.opacity=1,t.radius=30,t.weight=1,t}var Fs,Us,_t=((window&&window.__extends||(Fs=function(t,e){return(Fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Fs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(qs,Us=xs),qs.prototype.getOptions=function(){return es(this.options,zs._cloneCustomizer)},qs.prototype.getSource=function(){return this.options.source},qs.prototype.setOptions=function(t){t=(new zs).merge(this.options,es(t,zs._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("heatmap-color",t.color,this.options.color),this._updatePaintProperty("heatmap-intensity",t.intensity,this.options.intensity),this._updatePaintProperty("heatmap-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("heatmap-radius",t.radius,this.options.radius),this._updatePaintProperty("heatmap-weight",t.weight,this.options.weight)}this.options=t},qs.prototype._buildLayers=function(){var t={id:this.id,type:"heatmap",source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"heatmap-color":this.options.color,"heatmap-intensity":this.options.intensity,"heatmap-opacity":this.options.opacity,"heatmap-radius":this.options.radius,"heatmap-weight":this.options.weight},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),[t]},qs.prototype._getLayerIds=function(){return[this.id]},qs.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},qs);function qs(t,e,o){e=Us.call(this,e)||this;return e.options=(new zs).merge(es(o,zs._cloneCustomizer)),e.options.source=t||e.options.source,e}var Gs,Zs,Ct=((window&&window.__extends||(Gs=function(t,e){return(Gs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Gs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Hs,Zs=H),Hs);function Hs(){var t=null!==Zs&&Zs.apply(this,arguments)||this;return t.contrast=0,t.fadeDuration=300,t.hueRotation=0,t.maxBrightness=1,t.minBrightness=0,t.opacity=1,t.saturation=0,t}var Ks,Ws,Vs=((window&&window.__extends||(Ks=function(t,e){return(Ks=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ks(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ys,Ws=Ct),Ys._cloneCustomizer=function(t){if(t instanceof ss)return t},Ys);function Ys(){var t=null!==Ws&&Ws.apply(this,arguments)||this;return t.url=void 0,t.coordinates=void 0,t}var Qs,Js,Xs=((window&&window.__extends||(Qs=function(t,e){return(Qs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Qs(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))($s,Js=xs),$s.prototype._getSourceIds=function(){var t=new Set;return t.add(this._getSourceId()),t},$s);function $s(){return null!==Js&&Js.apply(this,arguments)||this}var ta,ea,Mt=((window&&window.__extends||(ta=function(t,e){return(ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ta(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(oa,ea=Xs),oa.prototype.getOptions=function(){return es(this.options,Vs._cloneCustomizer)},oa.prototype.setOptions=function(t){var e=(new Vs).merge(this.options,es(t,Vs._cloneCustomizer)),o="string"==typeof t.url&&t.url!==this.getOptions().url,n=void 0!==t.coordinates&&t.coordinates!==this.getOptions().coordinates;this.map&&(this._updateBaseProperties(e,this.options),this._updatePaintProperty("raster-contrast",e.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",e.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",e.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",e.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",e.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",e.saturation,this.options.saturation),(t=this.map._getMap().getSource(this._getSourceId()))&&t.updateImage(e)),this.options=e,o?this.reloadImage():n&&this.updateTransform()},oa.prototype.getPositions=function(e){return this.transform.then(function(t){return t.toTarget(e)})},oa.prototype.getPixels=function(e){return this.transform.then(function(t){return t.toSource(e)})},oa.getCoordinatesFromRefPoints=function(t,e,o,n){return new Zi(o,n).toTarget([[0,0],[t,0],[t,e],[0,e]])},oa.getCoordinatesFromEdges=function(t,e,o,n,r){"number"!=typeof r&&(r=0);o=[Math.min(n,o),e,Math.max(n,o),t],t=Pi.getCenter(o);return $r([Pi.getNorthWest(o),Pi.getNorthEast(o),Pi.getSouthEast(o),Pi.getSouthWest(o)],t,r)},oa.prototype._buildLayers=function(){var t={id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-opacity":this.options.opacity,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-min":this.options.minBrightness,"raster-brightness-max":this.options.maxBrightness,"raster-saturation":this.options.saturation,"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),[t]},oa.prototype._getLayerIds=function(){return[this.id]},oa.prototype._buildSource=function(){return{type:"image",url:this.options.url,coordinates:this.options.coordinates}},oa.prototype._getSourceId=function(){return this.getId()+"-ImageSource"},oa.prototype.reloadImage=function(){var o=this;this.options.url&&(this.transform=new Promise(function(e,t){o.img.onload=function(){var t=[[0,0],[o.img.width,0],[o.img.width,o.img.height],[0,o.img.height]];e(new Zi(t,o.options.coordinates)),o.isLoading=!1},o.img.onerror=o.img.onabort=function(){t("Failed to load image")},o.isLoading=!0,o.img.src=o.options.url}))},oa.prototype.updateTransform=function(){var t;this.isLoading||(t=[[0,0],[this.img.width,0],[this.img.width,this.img.height],[0,this.img.height]],this.transform=Promise.resolve(new Zi(t,this.options.coordinates)))},oa);function oa(t,e){e=ea.call(this,e)||this;return e.isLoading=!1,e.options=(new Vs).merge(es(t,Vs._cloneCustomizer)),e.img=new Image,e.reloadImage(),e}var na,ra,ia=((window&&window.__extends||(na=function(t,e){return(na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}na(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(sa,ra=H),sa);function sa(){var t=null!==ra&&ra.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.lineCap="round",t.lineJoin="round",t.blur=0,t.strokeColor="#1E90FF",t.strokeDashArray=void 0,t.strokeGradient=void 0,t.offset=0,t.strokeOpacity=1,t.translate=new lr(0,0),t.translateAnchor="map",t.strokeWidth=2,t}var aa,la,At=window&&window.__extends||(aa=function(t,e){return(aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}aa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),ca=window&&window.__assign||function(){return(ca=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ua=(At(pa,la=xs),pa.prototype.getOptions=function(){return es(this.options,ia._cloneCustomizer)},pa.prototype.getSource=function(){return this.options.source},pa.prototype.setOptions=function(t){t=(new ia).merge(this.options,es(t,ia._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("line-blur",t.blur,this.options.blur),this._updateLayoutProperty("line-cap",t.lineCap,this.options.lineCap),this._updateLayoutProperty("line-join",t.lineJoin,this.options.lineJoin),this._updatePaintProperty("line-offset",t.offset,this.options.offset),this._updatePaintProperty("line-color",t.strokeColor,this.options.strokeColor),this._updatePaintProperty("line-dasharray",t.strokeDashArray,this.options.strokeDashArray),this._updatePaintProperty("line-gradient",t.strokeGradient,this.options.strokeGradient),this._updatePaintProperty("line-opacity",t.strokeOpacity,this.options.strokeOpacity),this._updatePaintProperty("line-width",t.strokeWidth,this.options.strokeWidth),this._updatePaintProperty("line-translate",t.translate,this.options.translate),this._updatePaintProperty("line-translate-anchor",t.translateAnchor,this.options.translateAnchor)}this.options=t},pa.prototype._buildLayers=function(){return[ca(ca(ca(ca({id:this.id,type:"line"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none","line-cap":this.options.lineCap,"line-join":this.options.lineJoin},paint:ca(ca(ca({"line-blur":this.options.blur,"line-color":this.options.strokeColor},this.options.strokeDashArray&&{"line-dasharray":this.options.strokeDashArray}),this.options.strokeGradient&&{"line-gradient":this.options.strokeGradient}),{"line-offset":this.options.offset,"line-opacity":this.options.strokeOpacity,"line-translate":this.options.translate,"line-translate-anchor":this.options.translateAnchor,"line-width":this.options.strokeWidth})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},pa.prototype._getLayerIds=function(){return[this.id]},pa.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},pa);function pa(t,e,o){e=la.call(this,e)||this;return e.options=(new ia).merge(es(o,ia._cloneCustomizer)),e.options.source=t||e.options.source,e}var ha,da,fa=((window&&window.__extends||(ha=function(t,e){return(ha=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ha(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ya,da=H),ya);function ya(){var t=null!==da&&da.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.base=0,t.fillColor="#1E90FF",t.height=0,t.fillOpacity=1,t.fillPattern=void 0,t.translate=new lr(0,0),t.translateAnchor="map",t.verticalGradient=!0,t}var ma,ga,Ot=window&&window.__extends||(ma=function(t,e){return(ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ma(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),va=window&&window.__assign||function(){return(va=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},At=(Ot(_a,ga=xs),_a.prototype.getOptions=function(){return es(this.options,fa._cloneCustomizer)},_a.prototype.getSource=function(){return this.options.source},_a.prototype.setOptions=function(t){t=(new fa).merge(this.options,es(t,fa._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("fill-extrusion-base",t.base,this.options.base),this._updatePaintProperty("fill-extrusion-color",t.fillColor,this.options.fillColor),this._updatePaintProperty("fill-extrusion-height",t.height,this.options.height),this._updatePaintProperty("fill-extrusion-opacity",t.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-extrusion-pattern",t.fillPattern,this.options.fillPattern),this._updatePaintProperty("fill-extrusion-translate",t.translate,this.options.translate),this._updatePaintProperty("fill-extrusion-translate-anchor",t.translateAnchor,this.options.translateAnchor),this._updatePaintProperty("fill-extrusion-vertical-gradient",t.verticalGradient,this.options.verticalGradient)}this.options=t},_a.prototype._buildLayers=function(){return[va(va(va(va({id:this.id,type:"fill-extrusion"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:va(va({"fill-extrusion-base":this.options.base,"fill-extrusion-height":this.options.height,"fill-extrusion-opacity":this.options.fillOpacity},this.options.fillPattern?{"fill-extrusion-pattern":this.options.fillPattern}:{"fill-extrusion-color":this.options.fillColor}),{"fill-extrusion-translate":this.options.translate,"fill-extrusion-translate-anchor":this.options.translateAnchor,"fill-extrusion-vertical-gradient":this.options.verticalGradient})}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},_a.prototype._getLayerIds=function(){return[this.id]},_a.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},_a);function _a(t,e,o){e=ga.call(this,e)||this;return e.options=(new fa).merge(es(o,fa._cloneCustomizer)),e.options.source=t||e.options.source,e}var wa,ba,Ot=window&&window.__extends||(wa=function(t,e){return(wa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}wa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Sa=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xa=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Oa=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Ta=(Ot(Ea,ba=H),Ea.prototype.merge=function(){for(var t,e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var n=!1,r=!1;try{for(var i=Sa(e),s=i.next();!s.done;s=i.next()){var a=s.value;a&&(a.hasOwnProperty("fillColor")?r=!(n=!0):a.hasOwnProperty("fillPattern")&&(n=!(r=!0)))}}catch(t){l={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(l)throw l.error}}var l=ba.prototype.merge.apply(this,Oa([],xa(e)));return n?l.fillPattern=void 0:r&&(l.fillColor=void 0),l},Ea);function Ea(){var t=null!==ba&&ba.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.fillColor="#1E90FF",t.fillOpacity=.5,t.fillPattern=void 0,t}var Ca,Pa,ka=((window&&window.__extends||(Ca=function(t,e){return(Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ca(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Aa,Pa=xs),Aa.prototype.getOptions=function(){return es(this.options,Ta._cloneCustomizer)},Aa.prototype.getSource=function(){return this.options.source},Aa.prototype.setOptions=function(t){t=(new Ta).merge(this.options,es(t,Ta._cloneCustomizer));if(this.map){if(t.source!==this.options.source||t.sourceLayer!==this.options.sourceLayer)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("fill-color",t.fillColor,this.options.fillColor),this._updatePaintProperty("fill-opacity",t.fillOpacity,this.options.fillOpacity),this._updatePaintProperty("fill-pattern",t.fillPattern,this.options.fillPattern)}this.options=t},Aa.prototype._buildLayers=function(){var t={id:this.id,type:"fill",source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:{visibility:this.options.visible?"visible":"none"},paint:{"fill-opacity":this.options.fillOpacity},minzoom:this.options.minZoom,maxzoom:this.options.maxZoom};return this.options.filter&&(t.filter=this.options.filter),this.options.sourceLayer&&(t["source-layer"]=this.options.sourceLayer),this.options.fillPattern?t.paint["fill-pattern"]=this.options.fillPattern:t.paint["fill-color"]=this.options.fillColor,[t]},Aa.prototype._getLayerIds=function(){return[this.id]},Aa.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},Aa);function Aa(t,e,o){e=Pa.call(this,e)||this;return e.options=(new Ta).merge(es(o,Ta._cloneCustomizer)),e.options.source=t||e.options.source,e}var Ia,La,Ra=((window&&window.__extends||(Ia=function(t,e){return(Ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ia(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Na,La=k),Na);function Na(){var t=null!==La&&La.apply(this,arguments)||this;return t.allowOverlap=!1,t.anchor="bottom",t.ignorePlacement=!1,t.image="marker-blue",t.offset=new lr(0,0),t.optional=!1,t.padding=2,t.pitchAlignment="auto",t.rotation=0,t.rotationAlignment="auto",t.size=1,t.opacity=1,t}var Ma,ja,Da=((window&&window.__extends||(Ma=function(t,e){return(Ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ma(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(za,ja=k),za);function za(){var t=null!==ja&&ja.apply(this,arguments)||this;return t.allowOverlap=!1,t.anchor="center",t.textField=void 0,t.font=["StandardFont-Regular"],t.ignorePlacement=!1,t.justify="center",t.offset=new lr(0,0),t.optional=!1,t.padding=2,t.pitchAlignment="auto",t.rotation=0,t.rotationAlignment="auto",t.size=16,t.color="#000000",t.haloBlur=0,t.haloColor="rgba(0,0,0,0)",t.haloWidth=0,t.opacity=1,t}var Ba,Fa,Ua=((window&&window.__extends||(Ba=function(t,e){return(Ba=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ba(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(qa,Fa=H),qa);function qa(){var t=null!==Fa&&Fa.apply(this,arguments)||this;return t.source=void 0,t.sourceLayer=void 0,t.iconOptions=new Ra,t.textOptions=new Da,t.placement="point",t.zOrder="auto",t.lineSpacing=250,t}var Ga,Za,Ot=window&&window.__extends||(Ga=function(t,e){return(Ga=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ga(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ha=window&&window.__assign||function(){return(Ha=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Ka=(Ot(Wa,Za=xs),Wa.prototype.getOptions=function(){return es(this.options,Ua._cloneCustomizer)},Wa.prototype.getSource=function(){return this.options.source},Wa.prototype.setOptions=function(t){var e=(new Ua).merge(this.options,es(t,Ua._cloneCustomizer));if(this.map){if(e.source!==this.options.source||e.sourceLayer!==this.options.sourceLayer)return this.options=e,void this.map.layers.add(this);var o=this.options,n=e.iconOptions,r=o.iconOptions,i=e.textOptions,t=o.textOptions;this._updateBaseProperties(e,o),this._updateLayoutProperty("symbol-spacing",e.lineSpacing,o.lineSpacing),this._updateLayoutProperty("symbol-placement",e.placement,o.placement),this._updateLayoutProperty("symbol-sort-key",e.sortKey,o.sortKey),this._updateLayoutProperty("symbol-z-order",e.zOrder,o.zOrder),this._updateLayoutProperty("icon-allow-overlap",n.allowOverlap,r.allowOverlap),this._updateLayoutProperty("icon-anchor",n.anchor,r.anchor),this._updateLayoutProperty("icon-ignore-placement",n.ignorePlacement,r.ignorePlacement),this._updateLayoutProperty("icon-image",n.image,r.image),this._updateLayoutProperty("icon-offset",n.offset,r.offset),this._updatePaintProperty("icon-opacity",n.opacity,r.opacity),this._updateLayoutProperty("icon-optional",n.optional,r.optional),this._updateLayoutProperty("icon-padding",n.padding,r.padding),this._updateLayoutProperty("icon-pitch-alignment",n.pitchAlignment,r.pitchAlignment),this._updateLayoutProperty("icon-rotate",n.rotation,r.rotation),this._updateLayoutProperty("icon-rotation-alignment",n.rotationAlignment,r.rotationAlignment),this._updateLayoutProperty("icon-size",n.size,r.size),this._updateLayoutProperty("text-allow-overlap",i.allowOverlap,t.allowOverlap),this._updateLayoutProperty("text-anchor",i.anchor,t.anchor),this._updatePaintProperty("text-color",i.color,t.color),this._updateLayoutProperty("text-font",i.font,t.font),this._updateLayoutProperty("text-ignore-placement",i.ignorePlacement,t.ignorePlacement),this._updateLayoutProperty("text-justify",i.justify,t.justify),this._updatePaintProperty("text-halo-blur",i.haloBlur,t.haloBlur),this._updatePaintProperty("text-halo-color",i.haloColor,t.haloColor),this._updatePaintProperty("text-halo-width",i.haloWidth,t.haloWidth),this._updateLayoutProperty("text-offset",i.offset,t.offset),this._updatePaintProperty("text-opacity",i.opacity,t.opacity),this._updateLayoutProperty("text-optional",i.optional,t.optional),this._updateLayoutProperty("text-padding",i.padding,t.padding),this._updateLayoutProperty("text-pitch-alignment",i.pitchAlignment,t.pitchAlignment),this._updateLayoutProperty("text-radial-offset",i.radialOffset,t.radialOffset),this._updateLayoutProperty("text-rotate",i.rotation,t.rotation),this._updateLayoutProperty("text-rotation-alignment",i.rotationAlignment,t.rotationAlignment),this._updateLayoutProperty("text-size",i.size,t.size),this._updateLayoutProperty("text-variable-anchor",i.variableAnchor,t.variableAnchor),this._updateLayoutProperty("text-field",i.textField,t.textField)}this.options=e},Wa.prototype._buildLayers=function(){var t=Ha(Ha(Ha(Ha({id:this.id,type:"symbol"},this.options.sourceLayer&&{"source-layer":this.options.sourceLayer}),{source:this.options.source instanceof ss?this.options.source.getId():this.options.source,layout:Ha(Ha({visibility:this.options.visible?"visible":"none","symbol-placement":this.options.placement,"symbol-spacing":this.options.lineSpacing,"symbol-z-order":this.options.zOrder,"text-allow-overlap":this.options.textOptions.allowOverlap,"text-anchor":this.options.textOptions.anchor},this.options.textOptions.textField&&{"text-field":this.options.textOptions.textField}),{"text-font":this.options.textOptions.font,"text-ignore-placement":this.options.textOptions.ignorePlacement,"text-justify":this.options.textOptions.justify,"text-offset":this.options.textOptions.offset,"text-optional":this.options.textOptions.optional,"text-padding":this.options.textOptions.padding,"text-pitch-alignment":this.options.textOptions.pitchAlignment,"text-rotate":this.options.textOptions.rotation,"text-rotation-alignment":this.options.textOptions.rotationAlignment,"text-size":this.options.textOptions.size,"icon-allow-overlap":this.options.iconOptions.allowOverlap,"icon-anchor":this.options.iconOptions.anchor,"icon-ignore-placement":this.options.iconOptions.ignorePlacement,"icon-image":this.options.iconOptions.image,"icon-offset":this.options.iconOptions.offset,"icon-optional":this.options.iconOptions.optional,"icon-padding":this.options.iconOptions.padding,"icon-pitch-alignment":this.options.iconOptions.pitchAlignment,"icon-rotate":this.options.iconOptions.rotation,"icon-rotation-alignment":this.options.iconOptions.rotationAlignment,"icon-size":this.options.iconOptions.size}),paint:{"text-color":this.options.textOptions.color,"text-halo-blur":this.options.textOptions.haloBlur,"text-halo-color":this.options.textOptions.haloColor,"text-halo-width":this.options.textOptions.haloWidth,"text-opacity":this.options.textOptions.opacity,"icon-opacity":this.options.iconOptions.opacity}}),this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom});return void 0!==this.options.sortKey&&(t.layout["symbol-sort-key"]=this.options.sortKey),void 0!==this.options.textOptions.radialOffset&&(t.layout["text-radial-offset"]=this.options.textOptions.radialOffset),void 0!==this.options.textOptions.variableAnchor&&(t.layout["text-variable-anchor"]=this.options.textOptions.variableAnchor),[t]},Wa.prototype._getLayerIds=function(){return[this.id]},Wa.prototype._getSourceIds=function(){var t=new Set;return this.options.source instanceof ss?t.add(this.options.source.getId()):t.add(this.options.source),t},Wa);function Wa(t,e,o){e=Za.call(this,e)||this;return e.options=(new Ua).merge(es(o,Ua._cloneCustomizer)),e.options.source=t||e.options.source,e}var Va,Ya,Qa=((window&&window.__extends||(Va=function(t,e){return(Va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Va(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Ja,Ya=Ct),Ja);function Ja(){var t=null!==Ya&&Ya.apply(this,arguments)||this;return t.bounds=[-180,-85.0511,180,85.0511],t.minSourceZoom=0,t.maxSourceZoom=22,t.tileSize=512,t.isTMS=!1,t.subdomains=void 0,t.tileUrl=void 0,t}var Xa,$a,Ct=window&&window.__extends||(Xa=function(t,e){return(Xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Xa(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),tl=window&&window.__assign||function(){return(tl=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},el=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ol=(Ct(nl,$a=Xs),nl.prototype.getOptions=function(){return es(this.options,Qa._cloneCustomizer)},nl.prototype.setOptions=function(t){t=(new Qa).merge(this.options,es(t,Qa._cloneCustomizer));if(this.map){if(!er(t.bounds,this.options.bounds)||t.isTMS!==this.options.isTMS||t.maxSourceZoom!==this.options.maxSourceZoom||t.minSourceZoom!==this.options.minSourceZoom||!er(t.subdomains,this.options.subdomains)||t.tileSize!==this.options.tileSize||t.tileUrl!==this.options.tileUrl)return this.options=t,void this.map.layers.add(this);this._updateBaseProperties(t,this.options),this._updatePaintProperty("raster-contrast",t.contrast,this.options.contrast),this._updatePaintProperty("raster-fade-duration",t.fadeDuration,this.options.fadeDuration),this._updatePaintProperty("raster-hue-rotate",t.hueRotation,this.options.hueRotation),this._updatePaintProperty("raster-brightness-max",t.maxBrightness,this.options.maxBrightness),this._updatePaintProperty("raster-opacity",t.opacity,this.options.opacity),this._updatePaintProperty("raster-saturation",t.saturation,this.options.saturation)}this.options=t},nl.prototype._setOptionsNoUpdate=function(t){this.options=(new Qa).merge(this.options,es(t,Qa._cloneCustomizer))},nl.prototype._buildLayers=function(){return[tl(tl({id:this.id,type:"raster",source:this._getSourceId(),layout:{visibility:this.options.visible?"visible":"none"},paint:{"raster-contrast":this.options.contrast,"raster-fade-duration":this.options.fadeDuration,"raster-hue-rotate":this.options.hueRotation,"raster-brightness-max":this.options.maxBrightness,"raster-brightness-min":this.options.minBrightness,"raster-opacity":this.options.opacity,"raster-saturation":this.options.saturation}},this.options.filter&&{filter:this.options.filter}),{minzoom:this.options.minZoom,maxzoom:this.options.maxZoom})]},nl.prototype._getLayerIds=function(){return[this.id]},nl.prototype._buildSource=function(){var t,e;if(this.options.tileUrl){if(-1===this.options.tileUrl.indexOf("{"))return{type:"raster",url:this.options.tileUrl};if(-1!==this.options.tileUrl.indexOf("{subdomain}")){if(!(this.options.subdomains&&0<this.options.subdomains.length))throw new Error("The {subdomain} placeholder was included in the tileUrl but no subdomains were specified");var o=[];try{for(var n=el(this.options.subdomains),r=n.next();!r.done;r=n.next()){var i=r.value;o.push(this.options.tileUrl.replace(/{subdomain}/g,i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}e=o}else e=[this.options.tileUrl]}return tl({type:"raster",bounds:this.options.bounds,maxzoom:this.options.maxSourceZoom,minzoom:this.options.minSourceZoom,scheme:this.options.isTMS?"tms":"xyz",tileSize:this.options.tileSize},e&&{tiles:e})},nl.prototype._getSourceId=function(){return this.getId()+"-RasterSource"},nl);function nl(t,e){e=$a.call(this,e)||this;return t&&e.setOptions(t),e}var rl,il,sl=((window&&window.__extends||(rl=function(t,e){return(rl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}rl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(al,il=H),al);function al(){var t=null!==il&&il.apply(this,arguments)||this;return t.renderer=void 0,t}var ll,cl,ul=((window&&window.__extends||(ll=function(t,e){return(ll=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ll(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(pl,cl=xs),pl.prototype.getOptions=function(){return es(this.options,sl._cloneCustomizer)},pl.prototype.setOptions=function(t){t=(new sl).merge(this.options,es(t,sl._cloneCustomizer));this.map&&this.map.triggerRepaint(),this.options=t},pl.prototype.onAdd=function(t){var e,o;cl.prototype.onAdd.call(this,t),this.map.events.add("stylechanged",this._onStyleChange),this.options.renderer&&this.glContext&&null!==(o=(e=this.options.renderer).onAdd)&&void 0!==o&&o.call(e,t,this.glContext)},pl.prototype.onRemove=function(){var t,e;this.options.renderer&&this.glContext&&null!==(e=(t=this.options.renderer).onRemove)&&void 0!==e&&e.call(t,this.map,this.glContext),this.map.events.remove("stylechanged",this._onStyleChange),this.glContext=null,cl.prototype.onRemove.call(this)},pl.prototype._buildLayers=function(){var r=this;if(!this.options.renderer)throw new Error("Cannot build the WebGL layer because renderer was not set.");return[{id:this.id,type:"custom",renderingMode:this.options.renderer.renderingMode,onAdd:function(t,e){r.glContext=e},onRemove:function(t,e){},prerender:function(t,e){var o,n;r._shouldRender()&&null!==(n=(o=r.options.renderer).prerender)&&void 0!==n&&n.call(o,t,e)},render:function(t,e){r._shouldRender()&&r.options.renderer.render(t,e)}}]},pl.prototype._getLayerIds=function(){return[this.id]},pl.prototype._getSourceIds=function(){return(new Set).add(this.source.getId())},pl.prototype._shouldRender=function(){if(this.map){var t=this.map.getCamera().zoom;return this.options.visible&&this.options.minZoom<=t&&this.options.maxZoom>t}return!1},pl);function pl(t,e){var o=cl.call(this,t)||this;return o._onStyleChange=function(){var t,e;o.map._getMap().getLayer(o.id)||(t=o.map,e=null===(e=o.map.layers._getUserLayers().find(function(t){return t.layer.getId()==o.id}))||void 0===e?void 0:e.before,t.layers.remove(o),t.layers.add(o,e))},o.options=(new sl).merge(es(e,sl._cloneCustomizer)),o.source=new ps,o}var At=Object.freeze({__proto__:null,BubbleLayer:Ns,Layer:xs,LineLayer:ua,PolygonExtrusionLayer:At,PolygonLayer:ka,SymbolLayer:Ka,TileLayer:ol,HeatMapLayer:_t,ImageLayer:Mt,WebGLLayer:ul}),hl=(dl.convertHtmlString=function(t){if("string"!=typeof t)return t;var e=document.createElement("div");return e.innerHTML=t,e},dl.parseWithFilter=function(t,e,o,n){var r=this;if(void 0===e&&(e=function(t){return!0}),void 0===o&&(o=function(t){return t}),void 0===n&&(n=function(){return document.createElement("div")}),"string"==typeof t){var i=(new DOMParser).parseFromString(t,"text/html").body;if(0==i.children.length)return o(i.innerHTML);var s,i=1==i.children.length&&1==i.childNodes.length?i.children[0]:(s=n(),Array.from(i.childNodes).map(function(t){return s.append(t)}),s)}else i=t;return Array.from(i.children).forEach(function(t){return r.parseWithFilter(t,e,o)}),e(i)?o(i):(i.parentNode&&i.parentNode.removeChild(i),null)},dl);function dl(){}var fl,yl,ml=function(t){return be(t)&&1===t.nodeType&&!Yo(t)},gl=((window&&window.__extends||(fl=function(t,e){return(fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}fl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(vl,yl=k),vl._cloneCustomizer=function(t){if(ml(t))return t},vl);function vl(){var t=null!==yl&&yl.apply(this,arguments)||this;return t.anchor="none",t.draggable=!1,t.closeButton=!0,t.content=document.createElement("span"),t.fillColor="#FFFFFF",t.pixelOffset=new lr(0,0),t.position=new mi(0,0),t.showPointer=!0,t}var _l,wl,_t=window&&window.__extends||(_l=function(t,e){return(_l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}_l(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),bl=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Sl=(_t(xl,wl=X),xl.prototype.setPopupOptions=function(t){this.setOptions(t)},xl.prototype.setOptions=function(t){var e=(new gl).merge(this.options,es(t,gl._cloneCustomizer));e.content!==this.options.content?(this.htmlContent.remove(),this.htmlContent=this._createHtmlContent(e),this.contentDiv.prepend(this.htmlContent)):e.draggable!==this.options.draggable&&this._setDraggable(this.htmlContent,e.draggable),e.closeButton&&!this.closeBtn?(this.closeBtn=this._createCloseButton(),this.contentDiv.appendChild(this.closeBtn),t=q("close"),this.contentDiv.appendChild(t),G(t,this.closeBtn,!0)):!e.closeButton&&this.closeBtn&&(this.contentDiv.removeChild(this.closeBtn),delete this.closeBtn),e.showPointer&&!this.arrowDiv?(this.arrowDiv=this._createArrowDiv(),this.containerDiv.appendChild(this.arrowDiv)):!e.showPointer&&this.arrowDiv&&(this.containerDiv.removeChild(this.arrowDiv),delete this.arrowDiv),e.fillColor!==this.options.fillColor&&(this.containerDiv.style.borderColor=e.fillColor,this.contentDiv.style.backgroundColor=e.fillColor),this.marker&&(e.anchor!==this.options.anchor?"none"===this.options.anchor?(this.autoAnchor!==e.anchor&&this._replaceMarker(this.map,e),this.map.events.remove("move",this._onMove),delete this.autoAnchor):(this._replaceMarker(this.map,e),"none"===e.anchor&&this.map.events.add("move",this._onMove)):(er(e.position,this.options.position)||this.marker.setLngLat(e.position),er(e.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(e.pixelOffset))),this.options=e},xl.prototype.getPopupOptions=function(){return this.getOptions()},xl.prototype.getOptions=function(){return es(this.options,gl._cloneCustomizer)},xl.prototype.getPopupContainer=function(){return this.containerDiv},xl.prototype._dragToPixel=function(t){this.dragging||(this.dragging=!0,this.contentDiv.style.pointerEvents="none",this._invokeEvent("dragstart",{type:"dragstart",target:this}));t=[t[0]+this.dragOffset[0],t[1]+this.dragOffset[1]],t=bl(this.map.pixelsToPositions([t]),1)[0];this.options.position=t,this.marker.setLngLat(this.options.position),this._invokeEvent("drag",{type:"drag",target:this})},xl.prototype._onUp=function(){this.dragging&&(this.contentDiv.style.pointerEvents="",this._invokeEvent("dragend",{type:"dragend",target:this}),"none"===this.options.anchor&&this._onMove()),delete this.dragOffset,delete this.dragging},xl.prototype._createContainerDiv=function(t){var e=this,o=document.createElement("div");o.classList.add(xl.Css.container),o.classList.add(xl.Css.hidden),o.style.borderColor=t.fillColor,o.setAttribute("role","dialog"),o.setAttribute("aria-label","Map Information Window");var n=!1;return o.addEventListener("keydown",function(t){"Tab"!==t.key&&"Escape"!==t.key&&"Esc"!==t.key||(n=!0)}),o.addEventListener("keyup",function(t){"Tab"!==t.key&&"Escape"!==t.key&&"Esc"!==t.key||(n=!1)}),o.addEventListener("focusin",function(t){e.map&&!e.isOpen()&&(e.open(e.map),t.target instanceof HTMLElement&&t.target.focus())}),o.addEventListener("focusout",function(t){n&&t.relatedTarget instanceof Node&&!o.contains(t.relatedTarget)&&(n=!1,e.isOpen()&&e.close())}),o},xl.prototype._createContentDiv=function(t){var e=document.createElement("div");return e.classList.add(xl.Css.content),e.style.backgroundColor=t.fillColor,e.setAttribute("tabindex","0"),this.htmlContent=this._createHtmlContent(t),e.appendChild(this.htmlContent),e},xl.prototype._createArrowDiv=function(){var t=document.createElement("div");return t.classList.add(xl.Css.arrow),t},xl.prototype._createCloseButton=function(){var t=document.createElement("button");return t.addEventListener("click",this.close),t.classList.add(xl.Css.close),t.setAttribute("aria-label","close"),t.setAttribute("tabindex","0"),t.innerHTML="&times;",t},xl.prototype._createHtmlContent=function(t){var e=hl.convertHtmlString(t.content);return t.draggable&&this._setDraggable(e,t.draggable),e},xl.prototype._createMarker=function(t,e){var o=this.marker?this.marker.getLngLat():t.position,o="none"===t.anchor?(this.autoAnchor=e||"bottom",this.containerDiv.classList.add(this.autoAnchor),new n.Marker({anchor:this.autoAnchor,element:this.containerDiv,offset:t.pixelOffset}).setLngLat(o)):(this.containerDiv.classList.add(t.anchor),new n.Marker({anchor:t.anchor,element:this.containerDiv,offset:t.pixelOffset}).setLngLat(o));return o},xl.prototype._getAutoAnchor=function(t,e){var o,n,r,i=this.containerDiv.offsetWidth,s=this.containerDiv.offsetHeight,a=[];return(r=this.marker?(n=(o=t._getMap().project(this.marker.getLngLat())).x,o.y):(r=bl(t.positionsToPixels([e.position]),1),n=(r=bl(r[0],2))[0],r[1]))<s?a.push("top"):r>t.getCanvas().offsetHeight-s&&a.push("bottom"),n<i/2?a.push("left"):n>t.getCanvas().offsetWidth-i/2&&a.push("right"),0<a.length?a.join("-"):"bottom"},xl.prototype._replaceMarker=function(t,e,o){var n=this.containerDiv.nextElementSibling;this.marker.remove(),this.containerDiv.classList.remove(this.autoAnchor||this.options.anchor),this.marker=this._createMarker(e,o),this.marker.addTo(t._getMap()),t.popups._getCollectionDiv().insertBefore(this.containerDiv,n||null)},xl.prototype._setDraggable=function(t,e){e?(t.addEventListener("mousedown",this._onDown),t.addEventListener("touchstart",this._onDown),t.addEventListener("dragstart",this._onDragStart)):(t.removeEventListener("mousedown",this._onDown),t.removeEventListener("touchstart",this._onDown),t.removeEventListener("dragstart",this._onDragStart))},xl.Css={arrow:"popup-arrow",close:"popup-close",container:"popup-container",content:"popup-content-container",hidden:"hidden-accessible-element"},xl);function xl(t){var o=wl.call(this)||this;return o.attach=function(t){o.map!==t&&(o.map&&o.remove(),o.map=t,o.marker=o._createMarker(o.options),o.marker.addTo(o.map._getMap()),o.map.popups._getCollectionDiv().appendChild(o.containerDiv),o.map.popups.add(o))},o.open=function(t){if(!t&&!o.map)throw new Error("Must specify a map to open on or attach to a map in advance");o.attach(t||o.map),o.containerDiv.classList.remove(xl.Css.hidden),o.map.events.add("move",o._onMove),o._onMove(),o._invokeEvent("open",{target:o,type:"open"})},o.close=function(){o.map&&o.map.events.remove("move",o._onMove),o.containerDiv.classList.add(xl.Css.hidden),o._invokeEvent("close",{target:o,type:"close"})},o.remove=function(){o.map&&(o.marker.remove(),o.containerDiv.classList.remove(o.autoAnchor||o.options.anchor),o.map.events.remove("move",o._onMove),o.map.popups.remove(o),delete o.map,delete o.marker,delete o.autoAnchor)},o.isOpen=function(){return o.map&&!o.containerDiv.classList.contains(xl.Css.hidden)},o._onMove=function(){var t=o._getAutoAnchor(o.map,o.options);t!==o.autoAnchor&&(o._replaceMarker(o.map,o.options,t),o.map.events.add("move",o._onMove))},o._onDown=function(t){o.map.popups._addDraggedPopup(o);var e=bl(o.map.positionsToPixels([o.options.position]),1)[0];"mousedown"===t.type?o.dragOffset=[e[0]-t.clientX,e[1]-t.clientY]:"touchstart"===t.type&&(o.dragOffset=[e[0]-t.touches[0].clientX,e[1]-t.touches[0].clientY])},o._onDragStart=function(t){t.preventDefault()},o.options=(new gl).merge(es(t,gl._cloneCustomizer)),o.containerDiv=o._createContainerDiv(o.options),o.contentDiv=o._createContentDiv(o.options),o.containerDiv.appendChild(o.contentDiv),o.options.showPointer&&(o.arrowDiv=o._createArrowDiv(),o.containerDiv.appendChild(o.arrowDiv)),o.options.closeButton&&(o.closeBtn=o._createCloseButton(),o.contentDiv.appendChild(o.closeBtn),t=q("close"),o.contentDiv.appendChild(t),G(t,o.closeBtn,!0)),o}var Ol,Tl,El=((window&&window.__extends||(Ol=function(t,e){return(Ol=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ol(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Cl,Tl=k),Cl._cloneCustomizer=function(t){if(t instanceof Sl||ml(t))return t},Cl);function Cl(){var t=null!==Tl&&Tl.apply(this,arguments)||this;return t.anchor="bottom",t.color="#1A73AA",t.draggable=!1,t.htmlContent='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24.5 36.5" id="marker_'+nr()+'" width="24.5" height="36.5" display="block"><path d="M12.25.25a12.2543,12.2543,0,0,0-12,12.4937c0,6.4436,6.4879,12.1093,11.059,22.5641.5493,1.2563,1.3327,1.2563,1.882,0C17.7621,24.8529,24.25,19.1857,24.25,12.7437A12.2543,12.2543,0,0,0,12.25.25Z" fill="{color}" stroke="{secondaryColor}" stroke-width="0.5"/><text style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; fill: white;" text-anchor="middle" x="12" y="18">{text}</text></svg>',t.pixelOffset=new lr(0,0),t.position=new mi(0,0),t.popup=void 0,t.secondaryColor="white",t.text=void 0,t.visible=!0,t}var Pl,kl,Al=((window&&window.__extends||(Pl=function(t,e){return(Pl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Pl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Il,kl=X),Il.prototype.getOptions=function(){return es(this.options,El._cloneCustomizer)},Il.prototype.getElement=function(){return this.marker.getElement()},Il.prototype.setOptions=function(t){t=(new El).merge(this.options,es(t,El._cloneCustomizer));er(t.htmlContent,this.options.htmlContent)&&t.anchor===this.options.anchor?("string"!=typeof t.htmlContent||t.color===this.options.color&&t.text===this.options.text&&t.secondaryColor===this.options.secondaryColor||(this.element.innerHTML=this._getSubbedHtmlString(t)||""),t.draggable!==this.options.draggable&&(this._setDraggable(t.draggable),this.marker.setDraggable(t.draggable)),er(t.pixelOffset,this.options.pixelOffset)||this.marker.setOffset(t.pixelOffset),er(t.position,this.options.position)||this.marker.setLngLat(t.position),t.visible!==this.options.visible&&(t.visible?this.element.classList.remove(Il.hiddenClass):this.element.classList.add(Il.hiddenClass))):(this.marker.remove(),this._buildMarker(t),this.map&&(this.marker.addTo(this.map._getMap()),this._getCollectionContainer().appendChild(this.element))),this.options=t},Il.prototype.togglePopup=function(){if(this.options.popup)if(this.options.popup.isOpen())this.options.popup.close();else{if(!this.map)throw new Error("The marker must be added to a map before calling togglePopup().");this.options.popup.setOptions({position:this.options.position}),this.options.popup.open(this.map)}},Il.prototype._addToMap=function(t,e){this.map&&this.map!==t&&this._removeFromMap(),e&&(this.options.position=qo(e),this.marker.setLngLat(this.options.position)),this.map!==t&&(this.map=t,this.marker.addTo(t._getMap()),this._getCollectionContainer().appendChild(this.element))},Il.prototype._removeFromMap=function(){this.map&&(this.marker.remove(),delete this.map)},Il.prototype._getId=function(){if(this.element)return("string"==typeof this.options.htmlContent?this.element.firstChild:this.element).id},Il.prototype._buildMarker=function(t){var e;"string"==typeof t.htmlContent?(e=this._getSubbedHtmlString(t)||"",this.element=hl.convertHtmlString(e)):this.element=t.htmlContent,this.element.classList.add(Il.containerClass),t.draggable&&this._setDraggable(!0),t.visible||this.element.classList.add(Il.hiddenClass),this.marker=new n.Marker({element:this.element,offset:t.pixelOffset,draggable:t.draggable,anchor:t.anchor}).setLngLat(t.position),this.marker.on("drag",this._onDrag),this.marker.on("dragstart",this._onDragStart),this.marker.on("dragend",this._onDragEnd),this.element.addEventListener("click",this._bubbleElementEvent),this.element.addEventListener("dblclick",this._bubbleElementEvent),this.element.addEventListener("contextmenu",this._bubbleElementEvent),this.element.addEventListener("keydown",this._bubbleElementEvent),this.element.addEventListener("keypress",this._bubbleElementEvent),this.element.addEventListener("keyup",this._bubbleElementEvent),this.element.addEventListener("mousedown",this._bubbleElementEvent),this.element.addEventListener("mouseenter",this._bubbleElementEvent),this.element.addEventListener("mouseleave",this._bubbleElementEvent),this.element.addEventListener("mousemove",this._bubbleElementEvent),this.element.addEventListener("mouseout",this._bubbleElementEvent),this.element.addEventListener("mouseover",this._bubbleElementEvent),this.element.addEventListener("mouseup",this._bubbleElementEvent)},Il.prototype._getSubbedHtmlString=function(t){return"string"==typeof t.htmlContent?t.htmlContent.replace(/{color}/gi,t.color||"").replace(/{secondaryColor}/gi,t.secondaryColor||"").replace(/{text}/gi,t.text||""):null},Il.prototype._getCollectionContainer=function(){var t=this.map.getCanvasContainer().querySelector("."+Il.collectionContainerClass);return t||((t=document.createElement("div")).classList.add(Il.collectionContainerClass),this.map.getCanvasContainer().appendChild(t)),t},Il.prototype._setDraggable=function(t){t?this.element.addEventListener("dragstart",this._onEleDragStart):this.element.removeEventListener("dragstart",this._onEleDragStart)},Il.collectionContainerClass="marker-collection-container",Il.hiddenClass="hidden-accessible-element",Il.containerClass="marker-container",Il);function Il(t){var e=kl.call(this)||this;return e._onDrag=function(){var t=e.marker.getLngLat().wrap();e.options.position=new mi(t.lng,t.lat),e._invokeEvent("drag",{type:"drag",target:e})},e._onDragStart=function(){e._invokeEvent("dragstart",{type:"dragstart",target:e})},e._onDragEnd=function(){e._invokeEvent("dragend",{type:"dragend",target:e})},e._bubbleElementEvent=function(t){e._invokeEvent(t.type,{type:t.type,target:e})},e._onEleDragStart=function(t){t.preventDefault()},e.options=(new El).merge(es(t,El._cloneCustomizer)),e._buildMarker(e.options),e}var Ll=(Rl.parse=function(t){var e=(t=t.toLowerCase()).lastIndexOf("-");return-1!==e?{code:t,language:t.substring(0,e),region:t.substring(e+1)}:{code:t,language:t}},Rl);function Rl(){}var Nl={localizationsPath:"locs/mapcontrol/2019-3-12",sensitiveUserRegions:["il","kr","pk","in","cn","ar","bh","eg","jo","sa","kw","om","qa","ma","ae"],locales:{defaultLanguage:{defaultRegion:{code:"NGT",strings:"en/resource.json"},latn:{code:"NGT-Latn",strings:"en/resource.json"}},ar:{defaultRegion:{code:"ar",strings:"ar-sa/resource.json"}},bg:{defaultRegion:{code:"bg-BG",strings:"bg-bg/resource.json"}},cs:{defaultRegion:{code:"cs-CZ",strings:"cs-cz/resource.json"}},da:{defaultRegion:{code:"da-DK",strings:"da-dk/resource.json"}},de:{defaultRegion:{code:"de-DE",strings:"de-de/resource.json"}},el:{defaultRegion:{code:"el-GR",strings:"el-gr/resource.json"}},en:{defaultRegion:{code:"en",strings:"en/resource.json"},us:{code:"en-US",strings:"en/resource.json"},au:{code:"en-AU",strings:"en/resource.json"},gb:{code:"en-GB",strings:"en/resource.json"},nz:{code:"en-NZ",strings:"en/resource.json"}},es:{defaultRegion:{code:"es-ES",strings:"es-es/resource.json"},mx:{code:"es-MX",strings:"es-mx/resource.json"}},fi:{defaultRegion:{code:"fi-FI",strings:"fi-fi/resource.json"}},fr:{defaultRegion:{code:"fr-FR",strings:"fr-fr/resource.json"}},hu:{defaultRegion:{code:"hu-HU",strings:"hu-hu/resource.json"}},id:{defaultRegion:{code:"id-ID",strings:"id-id/resource.json"}},it:{defaultRegion:{code:"it-IT",strings:"it-it/resource.json"}},ko:{defaultRegion:{code:"ko-KR",strings:"ko-kr/resource.json"}},lt:{defaultRegion:{code:"lt-LT",strings:"lt-lt/resource.json"}},ms:{defaultRegion:{code:"ms-MY",strings:"ms-my/resource.json"}},nb:{defaultRegion:{code:"nb-NO",strings:"nb-no/resource.json"}},nl:{defaultRegion:{code:"nl-NL",strings:"nl-nl/resource.json"}},pl:{defaultRegion:{code:"pl-PL",strings:"pl-pl/resource.json"}},pt:{defaultRegion:{code:"pt-PT",strings:"pt-pt/resource.json"},br:{code:"pt-BR",strings:"pt-br/resource.json"}},ru:{defaultRegion:{code:"ru-RU",strings:"ru-ru/resource.json"}},sk:{defaultRegion:{code:"sk-SK",strings:"sk-sk/resource.json"}},sl:{defaultRegion:{code:"sl-SL",strings:"sl-sl/resource.json"}},sv:{defaultRegion:{code:"sv-SE",strings:"sv-se/resource.json"}},th:{defaultRegion:{code:"th-TH",strings:"th-th/resource.json"}},tr:{defaultRegion:{code:"tr-TR",strings:"tr-tr/resource.json"}},zh:{defaultRegion:{code:"zh",strings:"en/resource.json"}},"zh-hans":{defaultRegion:{code:"zh-Hans",strings:"zh-cn/resource.json"},cn:{code:"zh-Hans-CN",strings:"zh-cn/resource.json"}},"zh-hant":{defaultRegion:{code:"zh-Hant",strings:"en/resource.json"},tw:{code:"zh-Hant-TW",strings:"zh-tw/resource.json"}}}},Ml=function(){this.Unknown="Unknown",this.Accident="Accident",this.Fog="Fog",this.Danger="Danger",this.Rain="Rain",this.Ice="Ice",this.Jam="Jam",this.LaneClosed="Lane Closed",this.RoadClosed="Road Closed",this.RoadWorks="Road Works",this.Wind="Wind",this.Flood="Flood",this.Detour="Detour"},jl=(Dl.getCode=function(t){var e=Ll.parse(t);return-1===Nl.sensitiveUserRegions.indexOf(e.region)?this.getLocaleData(e).code:t},Dl.getStrings=function(t){t=this.getLocaleData(t);return Nl.locales.defaultLanguage.defaultRegion.code===t.code?new Promise(function(t){t(new Ml)}):new D({domain:e,path:Nl.localizationsPath+"/"+t.strings}).get().then(function(t){return t},function(){return new Ml})},Dl.getLocaleData=function(t){if("string"==typeof t&&(t=Ll.parse(t)),Nl.locales[t.code])return Nl.locales[t.code].defaultRegion;var e;if(Nl.locales[t.language])e=Nl.locales[t.language];else{if(-1!==t.language.indexOf("-"))return this.getLocaleData(t.language);e=Nl.locales.defaultLanguage}return t.region&&e[t.region]?e[t.region]:e.defaultRegion},Dl);function Dl(){}var zl=(Bl.getEdgeOrIEVersion=function(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(0<e)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(0<t.indexOf("Trident/")){var o=t.indexOf("rv:");return parseInt(t.substring(o+3,t.indexOf(".",o)),10)}o=t.indexOf("Edge/");return 0<o?parseInt(t.substring(o+5,t.indexOf(".",o)),10):-1},Bl.isEdgeOrIE=function(){return-1!==this.getEdgeOrIEVersion()},Bl.isIE=function(){var t=this.getEdgeOrIEVersion();return-1!==t&&t<=11},Bl);function Bl(){}var Fl,Mt=window&&window.__extends||(Fl=function(t,e){return(Fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Fl(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Ul=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},ql=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t};(_t=u.AuthenticationType||(u.AuthenticationType={})).subscriptionKey="subscriptionKey",_t.aad="aad",_t.anonymous="anonymous",_t.sas="sas";var Gl,Zl,Hl=(Mt(Kl,Gl=k),Kl.prototype.setSubscriptionKey=function(t){this.authType=u.AuthenticationType.subscriptionKey,this.subscriptionKey=t},Kl.prototype.setAadProperties=function(t,e,o,n,r){this.authType=u.AuthenticationType.aad,this.authContext=r||this.authContext,this.aadInstance=n||this.aadInstance,this.clientId=t,this.aadAppId=e,this.aadTenant=o},Kl.prototype.setTokenCallbackFunction=function(t){this.authType=u.AuthenticationType.anonymous,this.getToken=t},Kl.prototype.setSasCallbackFunction=function(t){this.authType=u.AuthenticationType.sas,this.getToken=t},Kl.prototype.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=Gl.prototype.merge.apply(this,ql([],Ul(t)));return o.authType===u.AuthenticationType.subscriptionKey?o.authContext=o.aadAppId=o.getToken=void 0:o.authType===u.AuthenticationType.aad?o.subscriptionKey=o.getToken=void 0:o.authType===u.AuthenticationType.anonymous?o.subscriptionKey=o.authContext=o.aadAppId=void 0:o.authType===u.AuthenticationType.sas&&(o.authContext=o.subscriptionKey=o.aadAppId=void 0),o},Kl);function Kl(){var t=null!==Gl&&Gl.apply(this,arguments)||this;return t.authType=void 0,t.subscriptionKey=void 0,t.clientId=void 0,t.aadAppId=void 0,t.aadTenant=void 0,t.aadInstance=void 0,t.getToken=void 0,t.sasToken=void 0,t.authContext=void 0,t}var Wl="NGT",Vl=nr(),Yl=t,Ql=e,Jl=o,Xl=r,$l=b,tc=new Hl,ec=!1,oc=!1,nc=!1,rc=!1,ic=!1,sc=!1,ac=!1,lc=!1,cc=!1;function uc(){return Object.assign({},tc)}function pc(){return Ql}function hc(){return Yl}function dc(){return Jl}function fc(){return Xl}function yc(){return $l}function mc(){return p.workerCount}function gc(){return p.maxParallelImageRequests}function vc(){return Wl}function _c(){return Vl}function wc(){return tc.authType===u.AuthenticationType.subscriptionKey?tc.subscriptionKey:void 0}function bc(){return Zl}function Sc(t){return!zl.isIE()&&p.supported({failIfMajorPerformanceCaveat:t})}function xc(t){tc=(new Hl).merge(tc,t),cc=!0}function Oc(t){Yl=t,oc=!0}function Tc(t){Jl=t,nc=!0}function Ec(t){0<t&&(p.workerCount=t,ic=!0)}function Cc(t){0<t&&(p.maxParallelImageRequests=t,sc=!0)}function Pc(t){Wl=jl.getCode(t),ac=!0}function kc(t){Vl=t,lc=!0}function Ac(t){tc.setSubscriptionKey(t),cc=!0}function Ic(t){Zl=t,ec=!0}function Lc(t,e){if(e=Math.abs(e||1),"string"==typeof t&&Uc[t.toLowerCase()]){for(var o=Uc[t.toLowerCase()],n=/calc\(([0-9.]+)[px]*\s*\*\s*\{scale\}\)/gi,r=o,i=n.exec(o);i;)r=r.replace(i[0],parseFloat(i[1])*e+""),i=n.exec(o);return r=r.replace("{scale}",e+"")}throw new Error("Invalid templateName.")}function Rc(){return cc}function Nc(){return oc}function Mc(){return nc}function jc(){return ic}function Dc(){return sc}function zc(){return ac}function Bc(){return lc}function Fc(){return ec}var Uc={marker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 26 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><text x="12.5" y="17.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:2"/><text x="12.5" y="18.5" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-circle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(39 * {scale})" viewBox="-1 -1 27 38"><path d="M12.25.25a12.254 12.254 0 0 0-12 12.494c0 6.444 6.488 12.109 11.059 22.564.549 1.256 1.333 1.256 1.882 0C17.762 24.853 24.25 19.186 24.25 12.744A12.254 12.254 0 0 0 12.25.25Z" style="fill:{color};stroke:{secondaryColor};stroke-width:1"/><circle cx="12.5" cy="12.5" r="9" fill="{secondaryColor}"/><text x="12" y="17.5" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(24 * {scale})" height="calc(28 * {scale})" viewBox="0 0 24 28"><path d="m11.988 16.615a5.15 5.15 0 0 1-2.268-.525 4.909 4.909 0 0 1-2.805-4.442 5.019 5.019 0 0 1 5.072-4.936h.012a5.03 5.03 0 0 1 5.085 4.961 4.907 4.907 0 0 1-.549 2.224 5.114 5.114 0 0 1-4.548 2.718zm0-8.06a3.173 3.173 0 0 0-3.226 3.099 3.081 3.081 0 0 0 1.77 2.782 3.299 3.299 0 0 0 4.365-1.386 3.049 3.049 0 0 0 .342-1.381 3.184 3.184 0 0 0-3.239-3.114h-.012z" fill="{secondaryColor}"/><path d="m11.999.922a10.908 10.908 0 0 0-11.076 10.732 10.639 10.639 0 0 0 4.418 8.598l6.658 6.464 6.658-6.463a10.537 10.537 0 0 0 2.198-15.041 11.182 11.182 0 0 0-8.856-4.289zm1.873 14.341a4.221 4.221 0 0 1-5.589-1.789 3.945 3.945 0 0 1-.445-1.8 4.164 4.164 0 0 1 8.323-.037 4.028 4.028 0 0 1-2.289 3.626Z" fill="{color}"/><path d="m11.999 28-7.256-7.044a11.611 11.611 0 0 1-4.743-9.303 11.844 11.844 0 0 1 11.988-11.652.102 .102 0 0 1 .02 0 12.164 12.164 0 0 1 9.577 4.647 11.357 11.357 0 0 1 2.299 8.614 11.521 11.521 0 0 1-4.63 7.695zm-.01-26.157a9.997 9.997 0 0 0-10.143 9.812 9.769 9.769 0 0 0 4.04 7.853l.099.083 6.014 5.838 6.113-5.922a9.7 9.7 0 0 0 3.945-6.505 9.533 9.533 0 0 0-1.933-7.229 10.305 10.305 0 0 0-8.116-3.931h-.021zm.021 14.772a5.11 5.11 0 0 1-4.547-2.718 4.868 4.868 0 0 1 .932-5.743 5.118 5.118 0 0 1 3.58-1.46h.024a5.031 5.031 0 0 1 5.084 4.938 4.92 4.92 0 0 1-2.805 4.457h0a5.152 5.152 0 0 1-2.269.525zm-.011-8.079h-.015a3.277 3.277 0 0 0-2.295.933 3.029 3.029 0 0 0-.587 3.58 3.297 3.297 0 0 0 4.364 1.386h0a3.092 3.092 0 0 0 1.772-2.795 3.185 3.185 0 0 0-3.239-3.105z" fill="{secondaryColor}"/><text x="12" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"pin-round":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25 * {scale})" height="calc(25 * {scale})" viewBox="0 0 25 25"><g transform="translate(0 1)"><circle cx="12.25" cy="11.5833" r="11" fill="{color}"/><path d="m12.25 23.583a12 12 0 1 1 12-12 12 12 0 0 1-12 12zm0-22a10 10 0 1 0 10 10 10 10 0 0 0-10-10z" fill="{secondaryColor}"/><circle cx="12.25" cy="11.5833" r="4.2386" fill="{secondaryColor}"/></g><text x="12.5" y="17" style="font-size:14px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-flat":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(42.8 * {scale})" viewBox="0 0 1600 2570"><g fill="{color}"><path d="M691 2419c-409-575-641-1086-683-1504-10-106-10-136 5-224 31-188 105-330 241-458 129-124 270-190 453-214 69-9 113-10 182-1 373 46 655 326 703 698 40 308-120 801-424 1309-134 224-348 535-369 535-4 0-53-63-108-141z"/></g><g fill="rgba(0,0,0,0.15)" style="transform:scale(-1,1);transform-origin:center"><path d="M691 2419c-407-571-639-1083-682-1498-14-139-3-249 37-371 69-208 254-402 459-481 68-27 217-59 271-59h24v160 180 940 635c0 349-2 635-5 635-2 0-49-63-104-141z"/></g><circle cx="800" cy="800" r="600" fill="{secondaryColor}"/><text x="800" y="1100" style="font-size:800px;fill:#000;text-anchor:middle">{text}</text></svg>',"marker-arrow":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(25.47 * {scale})" height="calc(35.18 * {scale})" viewBox="0 0 4330 5980"><g fill="{color}"><path d="m2080 5969c-49-20-93-63-115-113-25-55-1928-5486-1953-5573-40-138 67-282 210-283 36 0 246 73 987 345 518 190 947 345 955 345 8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29-33 0-71-5-85-10z"/></g><g fill="{secondaryColor}"><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z"/><path d="m2200 1600c-36 10-83 2-484-84-243-53-451-94-461-91-11 4-22 18-25 31-5 19 114 371 436 1292 244 697 448 1273 454 1281 19 24 50 30 71 12z" style="transform:scale(-1,1);transform-origin:center"/></g><g fill="rgba(0,0,0,0.2)" ><path d="m2165 685c8 0 438-155 955-345 615-226 954-345 979-345 87 0 165 47 204 123 46 91 107-95-957 2942-537 1535-986 2805-997 2823-11 18-43 46-72 62-41 24-62 30-111 29z"/></g><text x="2165" y="3300" style="font-size:2500px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-ball-pin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15.67 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 235 452"><g transform="translate(-135 10)"><path fill="{secondaryColor}" d="m256 442 0 0c-13 0-18-11-18-24l-6-323c0-13 11-24 24-24h0c13 0 24 11 24 24l-6 323c0 13-5 24-18 24z"/><circle style="fill:{color};stroke-width:10;stroke:{secondaryColor}" cx="256" cy="112" r="111"/><ellipse transform="matrix(0.834 0.5518 -0.5518 0.834 65.7916 -97.18)" fill="rgba(255,255,255,0.3)" cx="194.399" cy="60.749" rx="19.076" ry="32.428"/></g><text x="117.5" y="160" style="font-size:160px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.67 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2000 2420"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M845 2152c-22-37-58-95-80-129-22-35-62-99-90-143l-50-80-312 0-313 0 0-900 0-900 900 0 900 0 0 900 0 900-313 0-313 0-34 58c-19 31-38 59-42 60-5 2-8 8-8 12 0 9-69 123-88 145-5 6-11 15-13 21-16 39-77 123-89 124-8 0-33-31-55-68z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(38.8 * {scale})" viewBox="0 0 2500 2910"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m866 2652c-17-31-37-68-46-82-9-14-32-54-51-90-19-36-50-92-70-125l-36-60-332-3-331-2 0-905 0-905 660 0 660 0 0-38c0-71 50-196 102-258 71-85 189-164 244-164 12 0 26-4 29-10 8-13 222-13 230 0 3 6 17 10 30 10 25 0 117 45 154 76 130 107 191 232 191 392 0 155-63 284-190 386-36 29-129 76-150 76-11 0-22 5-25 10-3 6-31 10-61 10l-54 0 0 660 0 660-332 2-332 3-29 50c-17 28-48 84-70 125-22 41-47 86-56 100-9 14-30 51-46 83-17 32-36 57-45 57-8 0-28-25-44-58z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(26.8 * {scale})" height="calc(32.27 * {scale})" viewBox="0 0 2010 2410"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="M856 2155c-20-30-36-59-36-65 0-5-4-10-10-10-5 0-10-5-10-11 0-5-18-37-40-69-22-32-40-64-40-69 0-6-4-11-10-11-5 0-10-5-10-10 0-6-15-33-32-60l-33-50-127 0c-74 0-129-4-133-10-3-5-17-10-30-10-25 0-116-45-155-76-87-69-142-151-178-265-15-46-17-1075-2-1084 5-3 10-17 10-30 0-13 5-27 10-30 6-3 10-13 10-22 0-22 83-135 122-168 57-46 62-50 112-75l50-25 585 0 586 0 63 34c84 46 169 133 212 218l35 68 0 565 0 565-28 59c-32 69-100 157-139 180-15 9-33 22-40 29-23 22-99 57-123 57-13 0-27 5-30 10-4 6-60 10-135 10l-128 0-128 205c-84 136-133 205-144 205-10 0-33-24-54-55z"/></g><text x="1000" y="1300" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',"marker-square-rounded-cluster":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(33.33 * {scale})" height="calc(32.13 * {scale})" viewBox="0 0 2500 2900"><g transform="translate(100 100)" style="stroke:{secondaryColor};stroke-width:100;fill:{color}"><path d="m874 2669c-9-18-26-49-37-68-11-20-30-55-43-78-13-24-36-64-51-90-14-27-38-69-52-95l-26-48-142 0c-84 0-144-4-148-10-3-5-17-10-30-10-25 0-118-46-154-76-91-76-136-142-175-254-13-38-16-119-16-554 0-358 3-520 12-545 40-125 106-219 195-278 127-84 116-83 646-83l467 0 0-42c0-46 11-87 45-163 54-121 169-220 306-264 46-14 232-14 278 0 165 53 284 175 340 350 19 61 14 204-10 273-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-3 6-28 10-56 10l-49 0 0 462c0 446-1 464-21 522-32 91-94 178-169 240-38 31-130 76-155 76-13 0-27 5-30 10-4 6-65 10-149 10-138 0-143 1-154 23-12 23-62 114-112 202-16 28-44 79-63 115-42 77-67 88-93 39z"/></g><text x="1650" y="900" style="font-size:1000px;fill:#fff">+</text><text x="1000" y="1800" style="font-size:1000px;fill:#fff;text-anchor:middle">{text}</text></svg>',flag:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(23.5 * {scale})" height="calc(40 * {scale})" viewBox="34 28 198 308"><path style="stroke:{secondaryColor};stroke-width:15;stroke-linecap:round;" d="M42 327l0 -291"/><path style="fill:{color};stroke:{secondaryColor};stroke-width:10;stroke-linejoin:round;" d="M49 50c70 30 104 28 178 2-21 42-21 74 0 116-72 25-101 25-178 0l0-118z"/><text x="130" y="165" style="font-size:100px;fill:#fff;text-anchor:middle">{text}</text></svg>',"flag-triangle":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(27 * {scale})" height="calc(35.33 * {scale})" viewBox="0 0 40.5 53"><g transform="translate(-31 -20)"><path fill="{secondaryColor}" d="M34.7,73.3V48.4l34.6-10.1c0.7-0.2,1.2-0.8,1.2-1.5s-0.4-1.4-1-1.7L33.7,20.5c-0.5-0.2-1.1-0.2-1.6,0.2 c-0.5,0.3-0.7,0.8-0.7,1.4v51.2H34.7z"/><polygon points="34.7,24.5 66,36.5 34.7,45 34.7,10" fill="{color}"/></g><text x="11" y="21" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(34 * {scale})" height="calc(34 * {scale})" viewBox="0 0 34 34"><g transform="translate(2 2)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17" y="22" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"rounded-square-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(38 * {scale})" height="calc(38 * {scale})" viewBox="0 0 38 38"><g transform="translate(4 4)"><rect x="0" y="0" rx="8" ry="8" width="30" height="30" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19" y="24" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',triangle:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(36 * {scale})" height="calc(36 * {scale})" viewBox="0 0 36 36"><g transform="translate(2 2)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="30" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><g transform="translate(4 4)"><polygon points="16,0 32,32 0,32 16,0" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="32" style="font-size:12px;fill:#fff;text-anchor:middle">{text}</text></svg>',hexagon:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(35 * {scale})" height="calc(40 * {scale})" viewBox="0 0 35 40"><g transform="translate(2 2)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:2;fill:{color}"/></g><text x="17.5" y="25" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(39 * {scale})" height="calc(44 * {scale})" viewBox="0 0 39 44"><g transform="translate(4 4)"><path d="M31 9 15.5 0 0 9 0 27 15.5 36 31 27 31 9Z" style="stroke:{secondaryColor};stroke-width:4;fill:{color}"/></g><text x="19.5" y="27" style="font-size:14px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1100 1100"><g transform="translate(50 50)"><path style="stroke:{secondaryColor};stroke-width:50;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="550" y="700" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"hexagon-rounded-thick":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 1200 1200"><g transform="translate(100 100)"><path style="stroke:{secondaryColor};stroke-width:100;fill:{color}" d="M881 210 561 25c-33-19-88-19-121 0L119 210c-33 19-61 67-61 105v370c0 39 27 86 61 105l321 185c33 19 88 19 122 0l321-185c33-19 61-67 61-105V315C942 276 915 229 881 210z"/></g><text x="600" y="750" style="font-size:400px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="12,0 0,24 12,17 24,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="17" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"triangle-arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(28 * {scale})" height="calc(28 * {scale})" viewBox="0 0 28 28"><g transform="translate(2 2)"><polygon points="24,12 0,0 7,12 0,24" stroke-width="2" stroke="{secondaryColor}" fill="{color}"/></g><text x="14" y="16.5" style="font-size:8px;fill:#fff;text-anchor:middle">{text}</text></svg>',"arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(12.16 * {scale})" height="calc(30.1 * {scale})" viewBox="0 0 902 364"><g fill="{color}" transform="matrix(0,2.4,-2.4,0,897,-930)"><polygon points="902,222 233,222 233,364 0,182 233,0 233,141 902,141 902,222"/></g><text x="450" y="700" style="font-size:900px;fill:#000;text-anchor:middle">{text}</text></svg>',"arrow-up-thin":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(33.33 * {scale})" viewBox="0 0 12 25"><g transform="translate(-136.91823 -751.91998)"><path fill="{color}" d="m148.271 760.71c-1.641-.547-3.186-1.47-4.633-2.769l0 18.07-1.675 0 0-18.07c-1.447 1.299-2.986 2.222-4.616 2.769l0-1.231c2.325-1.596 4.006-3.812 5.043-6.65l.838 0c1.037 2.838 2.718 5.055 5.043 6.65l0 1.231z"/></g><text x="6" y="20" style="font-size:10px;fill:#000;text-anchor:middle">{text}</text></svg>',car:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(21.93 * {scale})" height="calc(40.9 * {scale})" viewBox="0 0 6580 12270"><g transform="translate(0 12270) rotate(-90)"><path fill="{secondaryColor}" d="M7045 6566c-42-13-105-44-105-51 0-2 23-105 50-228 28-123 50-230 50-236 0-8-241-11-907-11-855 0-1145 6-1513 30-85 6-189 13-230 15-41 3-133 10-205 15-286 21-430 32-705 50-953 63-1459 18-2335-205-304-77-746-209-799-238-131-72-221-408-285-1062-34-345-42-532-48-1130-16-1557 108-2532 336-2649 32-17 469-149 676-205 409-110 819-191 1205-238 116-14 224-18 540-18 395 1 494 5 1140 50 1124 79 1224 82 2496 78l641-3-53-237c-29-131-52-238-51-239 1-1 31-14 66-29 56-23 76-26 142-23 67 3 83 7 120 33 23 17 50 41 61 55 10 14 51 117 91 230l73 205 674 3 675 2 90-39c98-43 198-72 315-93 122-21 829-18 990 5 321 45 626 143 849 270 293 168 516 378 704 662 266 402 416 893 467 1527 15 174 8 882-9 998-6 41-18 127-27 190-69 502-253 969-523 1325-79 105-262 284-381 374-189 142-355 229-574 300-336 110-526 139-952 148-457 9-685-23-887-124l-47-24-678-6-678-6-64 179c-79 224-92 253-121 284-67 70-177 97-274 66zm-2752-5073c-23-2-64-2-90 0-26 2-7 3 42 3 50 0 71-1 48-3zm395 0c-21-2-55-2-75 0-21 2-4 4 37 4 41 0 58-2 38-4z"/><path fill="{color}" d="M7043 6498c-13-6-23-19-23-28 0-9 23-117 50-240 28-123 50-230 50-237 0-22-2126-13-2465 10-132 10-400 28-595 42-661 47-824 55-1160 62-435 7-656-8-1040-73-415-70-865-183-1447-365-168-53-272-556-325-1569-16-319-16-1311 0-1630 45-872 129-1366 257-1518 22-26 51-39 172-77 557-177 1122-310 1563-369 271-36 351-40 690-40 361 1 463 6 1165 54 1122 78 1288 83 2337 79 460-2 840-7 843-11 4-4-17-117-47-252l-55-245 39-16c76-30 180-8 224 47 10 13 54 124 98 246l79 222 709 0 709 0 47-24c74-37 219-83 322-101 122-22 606-32 802-16 374 29 658 102 933 238 124 62 271 155 361 230l61 51 6 100c19 278 103 497 247 643 88 89 173 136 278 152l70 11 41 131c116 369 159 673 168 1170 10 584-38 984-167 1397l-40 126-70 12c-193 33-348 175-441 405-56 139-89 302-89 445 0 43-3 47-58 91-290 235-644 384-1068 450-191 29-796 39-974 16-135-18-263-54-368-102l-75-35-701 0-701 0-79 223c-82 232-102 267-163 293-38 16-138 17-170 2zm-2023-820c332-15 1155-12 1835 6 308 8 563 12 566 8 4-4 10-21 13-38 7-30 6-31-92-77-518-244-1197-396-2112-474-295-25-1282-25-1579 0-231 20-473 46-479 51-6 7 49 110 93 171 160 226 416 335 855 365 142 10 539 5 900-12zm3304-263c525-111 899-887 934-1935 19-557-37-1023-172-1435-186-563-521-900-896-899-81 0-158 14-525 92-426 91-431 92-540 146-195 96-287 207-306 368-12 104-11 2985 1 3078 22 170 135 291 365 389 49 21 191 55 480 115 226 47 419 87 430 89 45 10 164 6 229-8zm-5570-485c112-43 197-156 216-291 12-83 13-2623 1-2706-23-158-125-273-270-304-44-9-100-1-542 75-272 47-514 91-539 98-266 68-487 424-594 958-56 280-70 548-40 800 56 484 207 878 414 1081 115 114 122 116 702 218 277 49 524 90 550 90 26 1 72-8 102-19zm2111-3440c1023-44 1884-213 2462-486l113-53-7-33c-3-18-8-35-10-37-2-3-236 1-521 7-993 24-1271 26-1708 11-541-18-1128-18-1249-1-377 56-588 181-734 437-32 55-41 79-32 84 12 8 246 32 491 51 356 28 815 36 1195 20z"/></g><text x="3250" y="8250" style="font-size:3000px;fill:#fff;text-anchor:middle">{text}</text></svg>',checker:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 16 16"><pattern id="p" x="0" y="0" width="16" height="16" patternUnits="userSpaceOnUse"><rect fill="{color}" x="0" width="8" height="8" y="0"/><rect fill="{color}" x="8" width="8" height="8" y="8"/></pattern><rect x="0" y="0" width="16" height="16" fill="{secondaryColor}"/><rect x="0" y="0" width="16" height="16" fill="url(#p)"/></svg>',"checker-rotated":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(16 * {scale})" height="calc(16 * {scale})" viewBox="0 0 60 60"><rect width="60" height="60" fill="{secondaryColor}"/><rect width="42.42" height="42.42" transform="translate(30 0) rotate(45)" fill="{color}"/></svg>',"zig-zag":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 120 60 120 90 90 120 60 120 0 120 0 60 60 0 0 0 60 30 90 60 120 120 120"/></svg>',"zig-zag-vertical":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(15 * {scale})" height="calc(15 * {scale})" viewBox="0 0 120 120"><rect x="0" y="0" width="120" height="120" fill="{secondaryColor}"/><polygon fill="{color}" points="120 0 120 60 90 30 60 0 0 0 0 0 60 60 0 120 60 120 90 90 120 60 120 0"/></svg>',"circles-spaced":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',circles:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(7 * {scale})" height="calc(7 * {scale})" viewBox="0 0 20 20"><defs><pattern id="p" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="6" stroke="none" fill="{color}"/></pattern></defs><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><rect x="0" y="0" width="100" height="100" fill="url(#p)"/></svg>',"diagonal-lines-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-lines-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"diagonal-stripes-up":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"diagonal-stripes-down":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(14 * {scale})" height="calc(14 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(45 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}" transform="rotate(-45 3 3)"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-lines":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(18 * {scale})" height="calc(18 * {scale})" viewBox="0 0 6 6"><rect x="0" y="0" width="6" height="6" fill="{secondaryColor}"/><g transform="rotate(90 3 3)" fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g><g fill="{color}"><path d="M5 0h1L0 6V5zM6 5v1H5z"/></g></svg>',"rotated-grid-stripes":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(20 * {scale})" height="calc(20 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="40" height="40" fill="{secondaryColor}"/><g transform="rotate(90 20 20)" fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g><g fill="{color}"><path d="M0 40L40 0H20L0 20M40 40V20L20 40"/></g></svg>',"x-fill":'<svg xmlns="http://www.w3.org/2000/svg" width="calc(40 * {scale})" height="calc(40 * {scale})" viewBox="0 0 40 40"><rect x="0" y="0" width="45.3" height="45.3" fill="{secondaryColor}"/><g fill="{color}"><path d="M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z"/></g></svg>',dots:'<svg xmlns="http://www.w3.org/2000/svg" width="calc(13 * {scale})" height="calc(13 * {scale})" viewBox="0 0 20 20"><rect x="0" y="0" width="20" height="20" fill="{secondaryColor}"/><g fill="{color}"><circle cx="3" cy="3" r="3"/><circle cx="13" cy="13" r="3"/></g></svg>'},qc=(Gc.getHighContrastMode=function(){return matchMedia("(-ms-high-contrast: white-on-black)").matches?"dark":matchMedia("(-ms-high-contrast: black-on-white)").matches?"light":matchMedia("(-ms-high-contrast: active)").matches?"dark":matchMedia("(inverted-colors: inverted)").matches?"invert":null},Gc);function Gc(){}var Zc,Hc,Kc=((window&&window.__extends||(Zc=function(t,e){return(Zc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Zc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Wc,Hc=k),Wc);function Wc(){var t=null!==Hc&&Hc.apply(this,arguments)||this;return t.copyrightMessage=void 0,t.copyrightContent=void 0,t.customAttribution=void 0,t.showFeedbackLink=!0,t.showLogo=!0,t}var Vc,Yc,Qc=((window&&window.__extends||(Vc=function(t,e){return(Vc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Vc(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Jc,Yc=nt),Jc.prototype.onAdd=function(t){return this.container=this.buildContainer(t,u.ControlStyle.auto),this.container.className="map-copyright",this.copyrightDiv=this.buildCopyrightDiv(),this.copyrightDiv.className="azure-map-copyright",this.container.appendChild(this.copyrightDiv),this.options.showLogo&&this.addRemoveLogo(!0),this.options.showFeedbackLink&&this.addRemoveFeedbackDiv(!0),this.container},Jc.prototype.onRemove=function(){Yc.prototype.onRemove.call(this),delete this.container},Jc.prototype.setOptions=function(t){var e=this,o=(new Kc).merge(this.options,t);o.copyrightMessage===this.options.copyrightMessage&&o.customAttribution===this.options.customAttribution||(this.copyrightDiv.innerText=this.textAttribution(o)),o.copyrightContent!==this.options.copyrightContent&&(this.options.copyrightContent&&(t=Array.from(this.copyrightDiv.children).find(function(t){return t===e.options.copyrightContent}),this.copyrightDiv.removeChild(t)),0<this.copyrightDiv.childNodes.length?this.copyrightDiv.insertBefore(o.copyrightContent,this.copyrightDiv.childNodes[0]):this.copyrightDiv.appendChild(o.copyrightContent),this.options.copyrightContent=o.copyrightContent),!o.showLogo&&this.logoAnchor?this.addRemoveLogo(!1):o.showLogo&&!this.logoAnchor&&this.addRemoveLogo(!0),!o.showFeedbackLink&&this.feedbackAnchor?this.addRemoveFeedbackDiv(!1):o.showFeedbackLink&&!this.feedbackAnchor&&this.addRemoveFeedbackDiv(!0),this.options=o},Jc.prototype.getDefaultAttributions=function(){var t=(new Date).getFullYear(),e=["©"+t+" TomTom"];return this.options.showLogo||e.push("©"+t+" Microsoft"),e},Jc.prototype.buildCopyrightDiv=function(){var t=document.createElement("div");return t.innerText=this.textAttribution(this.options)||"",t},Jc.prototype.buildFeedbackLink=function(){var t=document.createElement("a");return t.setAttribute("alt","Give Feedback"),t.setAttribute("aria-label","Give Feedback"),t.href="https://feedback.azuremaps.com",t.target="_blank",t.rel="noopener",t.className="azure-map-feedback",t},Jc.prototype.addRemoveFeedbackDiv=function(t){t?(this.feedbackAnchor=this.buildFeedbackLink(),this.tooltip=q("Give Feedback"),this.container.appendChild(this.feedbackAnchor),this.container.appendChild(this.tooltip),G(this.tooltip,this.feedbackAnchor)):(this.feedbackAnchor.remove(),this.tooltip.remove(),delete this.tooltip,delete this.feedbackAnchor)},Jc.prototype.addRemoveLogo=function(t){t?(this.logoAnchor=document.createElement("a"),this.logoAnchor.className="azure-map-logo",this.logoAnchor.href="https://microsoft.com",this.logoAnchor.setAttribute("aria-label","Microsoft"),this.container.appendChild(this.logoAnchor),this.logoTooltip=q("Visit microsoft.com"),this.container.appendChild(this.logoTooltip),G(this.logoTooltip,this.logoAnchor)):(this.logoAnchor.remove(),this.logoTooltip.remove(),delete this.logoAnchor)},Jc);function Jc(t){var e=Yc.call(this)||this;return e.textAttribution=function(t){return[e.options.copyrightMessage,e.options.customAttribution].filter(function(t){return t}).join("")},e.options=(new Kc).merge(t),e}var Xc=($c.throwOnError=function(t,e){function o(t){throw n.off("error",o),t.error}var n=t instanceof md?t._getMap():t;n.on("error",o);e=e();return n.off("error",o),e},$c.tryCatch=function(t,e,o,n){try{return this.throwOnError(t,e)}catch(t){return o(t)}finally{"function"==typeof n&&n()}},$c.tryFinally=function(t,e,o){try{return this.throwOnError(t,e)}finally{o()}},$c);function $c(){}var tu=window&&window.__assign||function(){return(tu=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eu=(ou.prototype.request=function(t){var e={domain:this.map.getServiceOptions().domain,path:"search/address/reverse/json",queryParams:tu({"api-version":"1.0",language:t.style.language,limit:1,query:Jr(t.position[1])+","+Xr(t.position[0])},t.style.view&&{view:t.style.view})};return new D((null===(t=this.map.authentication)||void 0===t?void 0:t.signRequest(e))||e).get()},ou);function ou(t){this.map=t}var nu=(ru.prototype.cache=function(t,e,o,n){n=t+"_"+o[0]+"_"+o[1]+"_"+n;this._labelIdx[e.labelType]||(this._labelIdx[e.labelType]=[],this._labelCache[e.labelType]=[]),-1===this._labelIdx[e.labelType].indexOf(n)&&(this._labelCache[e.labelType].push({name:t,radius:e.radius,minZoom:e.minZoom,maxZoom:e.maxZoom||24,position:o}),this._labelIdx[e.labelType].push(n))},ru.prototype.getNearestLabel=function(t,e,o){var n=null,r=this._labelCache[t];if(r)for(var i,s=1/0,a=0,l=r.length;a<l;a++)o>=r[a].minZoom&&o<=r[a].maxZoom&&((i=Fr(r[a].position,e))<=r[a].radius&&i<=s&&(s=i,n=r[a]));return n},ru.prototype._preloadCache=function(t){if(!this._preloadedCache.has(t)){this._preloadedCache.add(t);var e={source:[],labelType:"water",minZoom:0,radius:395e4,polygonSources:[]},o=t,n=o.indexOf("-");switch(o=-1!==n?o.substr(0,n):o){case"fr":this.cache("Océan Pacifique",e,[-170,32],t),this.cache("Océan Pacifique",e,[-138,-27],t),this.cache("Océan Atlantique",e,[-40,32],t),this.cache("Océan Atlantique",e,[-17,-29],t);break;case"es":this.cache("Océan Pacifique",e,[-170,32],t),this.cache("Océan Pacifique",e,[-138,-27],t),this.cache("Océano Atlántico",e,[-40,32],t),this.cache("Océano Atlántico",e,[-17,-29],t);break;case"pt":this.cache("Oceano Pacífico",e,[-170,32],t),this.cache("Oceano Pacífico",e,[-138,-27],t),this.cache("Oceano Atlântico",e,[-40,32],t),this.cache("Oceano Atlântico",e,[-17,-29],t);break;case"ja":this.cache("太平洋",e,[-170,32],t),this.cache("太平洋",e,[-138,-27],t);break;case"en":this.cache("Pacific Ocean",e,[-170,32],t),this.cache("Pacific Ocean",e,[-138,-27],t),this.cache("Atlantic Ocean",e,[-40,32],t),this.cache("Atlantic Ocean",e,[-17,-29],t),this.cache("Indian Ocean",e,[77,-26],t)}}},ru);function ru(){this._labelCache={},this._labelIdx={},this._preloadedCache=new Set}var iu=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},su=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},au=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},lu=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},cu=(uu.prototype.dispose=function(){this._disposed=!0;var t=this._map._getMap();t.off("move",this._onMove),t.off("moveend",this._onMoveEnd),t.off("styledata",this._onStyleData),t.off("rotate",this._onRotate);t=this._map.getCanvas();t.removeEventListener("mousedown",this._onPointerDown),t.removeEventListener("touchstart",this._onPointerDown),this._map.getMapContainer().removeEventListener("keydown",this._shortcutListener)},uu.prototype._getEventPos=function(t){if("touches"in t){var e=t.touches[0],o=t.target.getBoundingClientRect();return[e.pageX-o.left,e.pageY-o.top]}return[t.offsetX,t.offsetY]},uu.prototype._checkThresholds=function(t,e){return this._checkZoomThreshold(t.zoom,e.zoom)||this._checkPitchThreshold(t.pitch,e.pitch)||this._checkLocThreshold(t.center,e.center)||this._checkHeadingThreshold(t.bearing,e.bearing)},uu.prototype._checkZoomThreshold=function(t,e){return this._round(t)!==this._round(e)},uu.prototype._checkPitchThreshold=function(t,e){return Math.abs(t-e)>=this._pitchThreshold},uu.prototype._checkLocThreshold=function(t,e){e=au(this._map.positionsToPixels([e,t]),2),t=e[0],e=e[1];return lr.getDistance(t,e)>=this._moveThreshold},uu.prototype._checkHeadingThreshold=function(t,e){t<0&&(t+=360),e<0&&(e+=360);e=Math.abs(t-e);return(e=180<e?360-e:e)>=this._headingThreshold},uu.prototype._getLocDesc=function(p,h,d){return iu(this,void 0,void 0,function(){var e,o,n,r,i,s,a,l,c,u=this;return su(this,function(t){switch(t.label){case 0:return"blank"===d?[3,3]:this._map._getMap().loaded()?[3,2]:[4,new Promise(function(t){return u._map._getMap().once("idle",t)})];case 1:t.sent(),t.label=2;case 2:for(e={},o=this._map.positionsToPixels([p.center])[0],Xc.tryCatch(this._map,function(){var e=u._map._getMap();n=e.queryRenderedFeatures(o,{layers:u._polygonStyleLayer.filter(function(t){return e.getLayer(t)}),filter:["==",["geometry-type"],"Polygon"]})},function(){}),r=null,n&&0<n.length&&(r=n[0]),i=null,s=0,a=this._labelConfig.length;s<a;s++)l=this._labelConfig[s],p.zoom>=l.minZoom?l.polygonSources?r&&-1!==l.polygonSources.indexOf(r.layer["source-layer"])?(i=l.labelType,this._getClosestLabel(l,p,h,e,!1)):this._getClosestLabel(l,p,h,e,!0):this._getClosestLabel(l,p,h,e,!1):this._getClosestLabel(l,p,h,e,!0);return 8<=p.zoom&&this._processRoads(e,p,h),this._labelCache.forEach(function(t){e[t]||(c=null,(c="water"!==t&&"majorPoi"!==t||t===i?uu._labelCache.getNearestLabel(t,p.center,p.zoom):c)&&(e[t]=c.name))}),[2,this._processLocInfo(p,i,e,!0,this._restFallback)];case 3:return[2,this._processLocInfo(p,null,null,!1,!1)]}})})},uu.prototype._getHeadingDesc=function(t){var e=t.bearing;switch(e<0&&(e+=360),e=this._round(e,this._headingThreshold)){case 0:case 360:return"north";case 45:return"north east";case 90:return"east";case 135:return"south east";case 180:return"south";case 225:return"south west";case 270:return"west";case 315:return"north west";default:return e+" degrees"}},uu.prototype._getClosestLabel=function(t,e,o,n,r){for(var i=t.radius,s=0,a=t.source.length;s<a;s++){var l={sourceLayer:t.source[s],filter:["has","name"]},c=this._map._getMap().querySourceFeatures(this._baseVectorTileSourceId,l),u=null,p=1/0,h=this._labelCache.has(t.labelType);if(!r||h)for(var d=0,f=c.length;d<f;d++){var y,m="Point"===c[d].geometry.type?c[d]:di(e.center,c[d].geometry);r||(y="Point"===c[d].geometry.type?Fr(e.center,m.geometry.coordinates):m.properties.distance)<p&&(p=y,u=c[d]),h&&uu._labelCache.cache(c[d].properties.name,t,m.geometry.coordinates,o)}r||(l=t.labelType+"Dis",u&&p<=i&&("number"!=typeof n[l]||p<=n[l])&&(n[t.labelType]=u.properties.name,n[l]=p))}},uu.prototype._processRoads=function(t,e,o,n){var r=this._map._getMap().queryRenderedFeatures(n,{filter:["==",["geometry-type"],"LineString"]});if(r){for(var i,s=void 0,a=void 0,l=void 0,c=void 0,u=0,p=r.length;u<p;u++)this._roadLayers.has(r[u].layer["source-layer"])&&r[u].properties.name&&""!==r[u].properties.name&&(i=di(e.center,r[u]),(!l||i.properties.distance<l.properties.distance)&&(s&&r[u].properties.name===s.properties.name?l=i:s&&r[u].properties.name===s.properties.name?(!c||i.properties.distance<c.properties.distance)&&(c=i,a=r[u]):(c=l,a=s,l=i,s=r[u])));s&&(!t.country&&s.properties.country_code&&(t.country=s.properties.country_code,t.countryDis=0,uu._labelCache.cache(t.country,{source:[],labelType:"country",radius:5e3,minZoom:0},l.geometry.coordinates,o)),!t.state&&s.properties.country_subdivision&&(t.state=s.properties.country_subdivision,t.stateDis=0,uu._labelCache.cache(t.state,{source:[],labelType:"state",radius:5e3,minZoom:4},l.geometry.coordinates,o)),15<=e.zoom&&(n=this._map.positionsToPixels([e.center,l.geometry.coordinates]),(lr.getDistance(n[0],n[1])<this._roadPixelRadius||l.properties.distance<this._minRoadDistance)&&(t.road=s.properties.name),a&&(o=this._map.positionsToPixels([c.geometry.coordinates]),(lr.getDistance(n[0],o[0])<this._minIntersectionPixelDistance||c.properties.distance<this._minRoadDistance)&&(t.secondRoad=a.properties.name,t.secondRoadDis=c.properties.distance))))}},uu.prototype._getActionDesc=function(t){if(this._lastCam){var e,o,n=[];return this._checkLocThreshold(t.center,this._lastCam.center)&&(o=["panned"],0===(e=Math.round(Hr(this._lastCam.center,t.center)))||360===e?o.push("north"):e<90?o.push("north east"):90===e?o.push("east"):e<180?o.push("south east"):180===e?o.push("south"):e<270?o.push("south west"):270===e?o.push("west"):e<360&&o.push("north west"),e=Fr(this._lastCam.center,t.center,dr.meters),o.push(1e3<e?Dr(e/1e3,2)+" kilometers":Dr(e,2)+" meters"),n.push(o.join(" "))),this._checkZoomThreshold(t.zoom,this._lastCam.zoom)&&((o=["zoomed"]).push(this._lastCam.zoom<t.zoom?"in":"out"),1<=(e=Math.abs(this._lastCam.zoom-t.zoom))&&(e=Math.ceil(e),o.push(1<e?e+" levels":e+" level")),this._getCanonicalZoom(this._lastCam.zoom)!==this._getCanonicalZoom(t.zoom)&&o.push("to "+this._getCanonicalZoom(t.zoom)+" level"),t.zoom>=t.maxZoom&&o.push("Zoom In button disabled, maximum zoom level reached"),e=Pi.getSouth(t.bounds)<=-xr&&Pi.getNorth(t.bounds)>=xr,(t.zoom<=t.minZoom||e)&&o.push("Zoom Out button disabled, minimum zoom level reached"),n.push(o.join(" "))),this._checkPitchThreshold(t.pitch,this._lastCam.pitch)&&(o=this._round(t.pitch,this._pitchThreshold),n.push("pitched to "+o+" degrees"),60!==t.pitch&&0!==t.pitch||(o=60===t.pitch?"maximum":"minimum",n.push("reached "+o+" of "+t.pitch+" degrees"))),this._checkHeadingThreshold(this._lastCam.bearing,t.bearing)&&n.push("rotated to "+this._getHeadingDesc(t)),n.join(" and ")||null}return null},uu.prototype._getCanonicalZoom=function(t){return(t=this._round(t))<2?"world":t<5?"country":t<11?"state province":t<15?"city":"street"},uu.prototype._processLocInfo=function(r,i,s,a,l){var c=this;return new Promise(function(e,t){var o=[];if(a){var n=[];if(s&&(i&&("water"===i&&s.water?n.push(s.water):"majorPoi"===i&&s.majorPoi&&n.push(s.majorPoi)),0===n.length&&(s.majorPoi&&8<=r.zoom?n.push(s.majorPoi):(s.poi&&14<=r.zoom?n.push(s.poi):s.road&&15<=r.zoom&&(s.secondRoad?n.push(s.road+" & "+s.secondRoad):n.push(s.road)),s.neighbourhood&&12<=r.zoom&&n.push(s.neighbourhood),s.city&&6<=r.zoom&&n.push(s.city)),s.state&&4<=r.zoom&&n.push(s.state),0===n.length?s.water?n.push(s.water):s.country&&n.push(s.country):1===n.length&&s.state&&4<=r.zoom&&s.country&&n.push(s.country))),0<n.length)o.push("<p>Location: ",n.join(", "),".</p>");else if(l&&"water"!==i)return void c._reverseGeocodeDescription(r).then(function(t){e(t)},function(){t("<p>Location: unknown</p>")})}c._returnDetailedDescriptions&&(o.push("<p>Zoom: ",Dr(r.zoom,2),".</p>"),o.push("<p>Latitude: ",Dr(r.center[1],5),".</p>"),o.push("<p>Longitude: ",Dr(r.center[0],5),".</p>")),e(o.join(""))})},uu.prototype._reverseGeocodeDescription=function(r){var i=this;return new Promise(function(o){var n=i._map.getStyle();i._reverseSearch.request({position:r.center,style:n}).then(function(t){var e={};t&&t.addresses&&0<t.addresses.length&&t.addresses[0].address&&((t=t.addresses[0].address).country&&(e.country=t.country,uu._labelCache.cache(e.country,{source:[],labelType:"country",radius:5e3,minZoom:0},r.center,n.language)),t.countrySubdivision&&(e.state=t.countrySubdivision,uu._labelCache.cache(e.state,{source:[],labelType:"state",radius:5e3,minZoom:4},r.center,n.language)),t.municipality&&(e.city=t.municipality,uu._labelCache.cache(e.state,{source:[],labelType:"city",radius:1e3,minZoom:10},r.center,n.language)),t.streetNameAndNumber?e.road=t.streetNameAndNumber:t.street&&(e.road=t.street)),i._processLocInfo(r,null,e,!0,!1).then(function(t){o(t)})},function(t){i._processLocInfo(r,null,null,!0,!1).then(function(t){o(t)})}).catch(function(t){i._processLocInfo(r,null,null,!0,!1).then(function(t){o(t)})})})},uu.prototype._round=function(t,e){return void 0===e&&(e=1),Math.round(t/e)*e},uu._baseVectorTileSourceIds=["microsoft.base","vectorTiles","bing-mvt"],uu._labelConfigBing=[{source:["water_feature"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["generic_water_fill"]},{source:["water_feature"],labelType:"water",minZoom:3,radius:1e6,polygonSources:["generic_water_fill"]},{source:["country_region"],labelType:"country",minZoom:0,maxZoom:5,radius:3e5},{source:["admin_division1"],labelType:"state",minZoom:4,maxZoom:7,radius:3e5},{source:["populated_place"],labelType:"city",minZoom:8,radius:4e4},{source:["neighborhood"],labelType:"neighbourhood",minZoom:12,radius:6e3},{source:["amusement_park"],labelType:"poi",minZoom:14,radius:2e3,polygonSources:["amusement_park_fill"]},{source:["hospital"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["hospital_fill"]},{source:["shopping_center"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["shopping_center_fill"]},{source:["stadium"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["stadium_fill"]},{source:["higher_education_facility","school"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["higher_education_facility_fill","school_fill"]},{source:["zoo"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["zoo_fill"]},{source:["airport","airport_terminal"],labelType:"majorPoi",minZoom:11,radius:3e3,polygonSources:["airport_terminal_fill","airport_fill-merged7","airport_runway_fill"]},{source:["reserve"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["generic_reserve_fill","land_cover_forest_fill"]}],uu._roadLayersBing=new Set(["road"]),uu);function uu(t,e){var i=this;this._disposed=!1,this._lastHeadingTime=0,this._actionQueue=[],this._pointerUpdateDelay=3e3,this._camUpdateDelay=1e3,this._headUpdateLimit=1e3,this._controlEventDelay=500,this._moveThreshold=25,this._headingThreshold=5,this._pitchThreshold=5,this._roadPixelRadius=120,this._minRoadDistance=25,this._minIntersectionPixelDistance=50,this._labelConfig=[{source:["Ocean label","Ocean name"],labelType:"water",minZoom:0,radius:395e4,polygonSources:["Ocean","Ocean or sea"]},{source:["Sea label"],labelType:"water",minZoom:3,radius:1e6,polygonSources:["Sea","Ocean or sea"]},{source:["Country name"],labelType:"country",minZoom:0,maxZoom:5,radius:3e5},{source:["State name","State name short"],labelType:"state",minZoom:4,maxZoom:7,radius:3e5},{source:["Capital city","Large city"],labelType:"city",minZoom:8,radius:4e4},{source:["Medium city"],labelType:"city",minZoom:8,radius:3e4},{source:["Small city"],labelType:"city",minZoom:8,radius:2e4},{source:["Island label"],labelType:"city",minZoom:8,radius:1e4},{source:["Town"],labelType:"city",minZoom:10,radius:1e4},{source:["Village"],labelType:"neighbourhood",minZoom:12,radius:6e3},{source:["Amusement area label"],labelType:"poi",minZoom:14,radius:2e3,polygonSources:["Amusement park"]},{source:["Hospital label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Hospital"]},{source:["Shopping centre label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Shopping"]},{source:["Stadium label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Stadium"]},{source:["University/School label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["University"]},{source:["Zoo label"],labelType:"poi",minZoom:14,radius:1e3,polygonSources:["Zoo"]},{source:["Airport Label","Airport name","Airport POI"],labelType:"majorPoi",minZoom:11,radius:3e3,polygonSources:["Airport","Runway"]},{source:["National park label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["National or state park","National park","Forest"]},{source:["Reservation label"],labelType:"majorPoi",minZoom:7,radius:15e3,polygonSources:["Reservation"]}],this._labelCache=new Set(["city","state","country","water","majorPoi"]),this._roadLayers=new Set(["Connecting road","Connecting road tunnel","International road","International road tunnel","Local road","Local road tunnel","Major local road","Major local road tunnel","Major road","Major road tunnel","Minor local road","Minor local road tunnel","Motorway","Motorway tunnel","Secondary road","Secondary road tunnel","Toll connecting road","Toll connecting road tunnel","Toll international road","Toll international road tunnel","Toll local road","Toll local road tunnel","Toll major local road","Toll major local road tunnel","Toll major road","Toll major road tunnel","Toll minor local road","Toll minor local road tunnel","Toll motorway","Toll motorway tunnel","Toll secondary road","Toll secondary road tunnel"]),this._returnDetailedDescriptions=!1,this._shortcutListener=function(r){return iu(i,void 0,void 0,function(){var e,o,n;return su(this,function(t){switch(t.label){case 0:return r.altKey&&r.ctrlKey&&68===r.keyCode?(this._returnDetailedDescriptions=!this._returnDetailedDescriptions,e=this._map.getCamera(),n=this._map.getStyle(),o=n.language.toLowerCase(),n=n.style.toLowerCase(),[4,this._getLocDesc(e,o,n)]):[3,2];case 1:n=t.sent(),this._descCallback(n),t.label=2;case 2:return[2]}})})},this._onRotate=function(){i._rotateTimeout||(Date.now()-i._lastHeadingTime>=i._headUpdateLimit?i._rotateTimeout=setTimeout(i._updateHeading,pt.RotationDuration+25):i._rotateTimeout=setTimeout(i._updateHeading,i._headUpdateLimit-(Date.now()-i._lastHeadingTime)))},this._onMove=function(){i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._controlTimeout&&(clearTimeout(i._controlTimeout),delete i._controlTimeout)},this._onMoveEnd=function(t){t.fromControl?i._controlTimeout=setTimeout(i._updateCam,i._controlEventDelay):i._updateCam()},this._onStyleData=function(){setTimeout(i._updateStyle)},this._onPointerDown=function(t){i._lastPointerPos=i._getEventPos(t),i._pointerTimeout=setTimeout(function(){return iu(i,void 0,void 0,function(){var e,o,n;return su(this,function(t){switch(t.label){case 0:return o=this._map.getStyle(),e=o.language.toLowerCase(),n=o.style.toLowerCase(),(o=this._map.getCamera()).center=this._map.pixelsToPositions([this._lastPointerPos])[0],[4,this._getLocDesc(o,e,n)];case 1:return n=t.sent(),this._descCallback(n),this._onPointerUp(),[2]}})})},i._pointerUpdateDelay),i._map.getCanvas().addEventListener("mousemove",i._onPointerMove),i._map.getCanvas().addEventListener("touchmove",i._onPointerMove),i._map.getCanvas().addEventListener("mouseup",i._onPointerUp),i._map.getCanvas().addEventListener("touchend",i._onPointerUp)},this._onPointerMove=function(t){var e=i._getEventPos(t),t=i._lastPointerPos[0]-e[0],e=i._lastPointerPos[1]-e[1];Math.sqrt(t*t+e*e)>i._moveThreshold&&i._onPointerUp()},this._onPointerUp=function(){clearTimeout(i._pointerTimeout),delete i._pointerTimeout,i._map.getCanvas().removeEventListener("mousemove",i._onPointerMove),i._map.getCanvas().removeEventListener("touchmove",i._onPointerMove),i._map.getCanvas().removeEventListener("mouseup",i._onPointerUp),i._map.getCanvas().removeEventListener("touchend",i._onPointerUp)},this._updateHeading=function(){var t,e=i._map.getCamera();i._lastHead&&!i._checkHeadingThreshold(e.bearing,i._lastHead)||(t=i._getHeadingDesc(e),i._lastHead=e.bearing,i._descCallback("<p>Map heading "+t+".</p>"),i._lastHeadingTime=Date.now()),delete i._rotateTimeout},this._updateStyle=function(){return iu(i,void 0,void 0,function(){var e,o,n,r;return su(this,function(t){switch(t.label){case 0:return(e=this._map.getCamera(),n=this._map.getStyle(),o=n.language.toLowerCase(),n=n.style.toLowerCase(),this._lastLang===o)?[3,2]:(uu._labelCache._preloadCache(o),[4,this._getLocDesc(e,o,n)]);case 1:return r=t.sent(),[3,4];case 2:return this._lastStyle===n||"blank"!==this._lastStyle?[3,4]:[4,this._getLocDesc(e,o,n)];case 3:r=t.sent(),t.label=4;case 4:return this._lastLang=o,this._lastStyle=n,r&&this._descCallback(r),[2]}})})},this._updateCam=function(t){void 0===t&&(t=!1);var o,n,e,r=i._map.getCamera();(!i._lastCam||0<i._actionQueue.length||i._checkThresholds(r,i._lastCam))&&(e=i._map.getStyle(),o=e.language.toLowerCase(),n=e.style.toLowerCase(),(e=i._getActionDesc(r))&&i._actionQueue.push(e),i._lastCam=r,i._moveTimeout&&(clearTimeout(i._moveTimeout),delete i._moveTimeout),i._moveTimeout=setTimeout(function(){return iu(i,void 0,void 0,function(){var e;return su(this,function(t){switch(t.label){case 0:return clearTimeout(this._rotateTimeout),delete this._rotateTimeout,[4,this._getLocDesc(r,o,n)];case 1:return e=t.sent(),0<this._actionQueue.length?(this._descCallback("<p>Map "+this._actionQueue.join(", then ")+".</p>"+e),this._actionQueue=[]):this._descCallback(e),[2]}})})},t?0:i._camUpdateDelay))},this._map=t,this._restFallback=t.getServiceOptions().enableAccessibilityLocationFallback,this._descCallback=e,this._reverseSearch=new eu(t),uu._labelCache||(uu._labelCache=new nu),this._lastLang=this._map.getStyle().language.toLowerCase(),uu._labelCache._preloadCache(this._lastLang),this._map.events.addOnce("idle",function(){var t;i._disposed||(i._updateCam(!0),i._baseVectorTileSourceId=uu._baseVectorTileSourceIds.find(function(t){return i._map.sources.getById(t)}),"bing-mvt"===i._baseVectorTileSourceId&&(i._labelConfig=uu._labelConfigBing,i._roadLayers=uu._roadLayersBing),i._polygonStyleLayer=i._labelConfig.reduce(function(t,e){return e.polygonSources&&t.push.apply(t,lu([],au(e.polygonSources))),t},[]),(t=i._map._getMap()).on("move",i._onMove),t.on("moveend",i._onMoveEnd),t.on("styledata",i._onStyleData),t.on("rotate",i._onRotate),(t=i._map.getCanvas()).addEventListener("mousedown",i._onPointerDown),t.addEventListener("touchstart",i._onPointerDown))}),this._map.getMapContainer().addEventListener("keydown",this._shortcutListener)}var pu,hu,du,fu=function(t){var o=this;this.addToMap=function(){o.initializeMapLiveStateInfo(),o.initializeMapStyleInfo(),o.createMapKeyBindingInfo(),o.map.getMapContainer().setAttribute("role","application"),o.map.getMapContainer().setAttribute("aria-label","Map Application"),o.map.getCanvasContainer().setAttribute("aria-live","polite"),o.map.getCanvasContainer().setAttribute("aria-describedby","atlas-map-state atlas-map-style"),o.map.getCanvas().setAttribute("aria-label","Interactive Map"),o.map.getCanvas().setAttribute("aria-describedby","atlas-map-shortcuts"),o.map.getCanvas().setAttribute("alt","Interactive Map")},this.removeFromMap=function(){null!=o.mapViewDesc&&o.mapViewDesc.dispose(),delete o.mapViewDesc,null!=o.atlasMapKeyBindings&&o.map.getCanvasContainer().removeChild(o.atlasMapKeyBindings),delete o.atlasMapKeyBindings,null!=o.atlasMapLiveStateInfo&&o.map.getCanvasContainer().removeChild(o.atlasMapLiveStateInfo),delete o.atlasMapLiveStateInfo,null!=o.atlasMapStyleInfo&&o.map.getCanvasContainer().removeChild(o.atlasMapStyleInfo),delete o.atlasMapStyleInfo,o.map.getMapContainer().removeAttribute("role"),o.map.getMapContainer().removeAttribute("aria-label"),o.map.getCanvasContainer().removeAttribute("aria-live"),o.map.getCanvasContainer().removeAttribute("aria-describedby"),o.map.getCanvas().removeAttribute("aria-label"),o.map.getCanvas().removeAttribute("aria-describedby"),o.map.getCanvas().removeAttribute("alt"),o.map.events.remove("stylechanged",o.updateMapStyle)},this.createMapKeyBindingInfo=function(){o.atlasMapKeyBindings=document.createElement("div"),o.atlasMapKeyBindings.setAttribute("tabindex","-1"),o.atlasMapKeyBindings.setAttribute("aria-hidden","true"),o.atlasMapKeyBindings.id="atlas-map-shortcuts",o.atlasMapKeyBindings.classList.add("hidden-accessible-element"),o.atlasMapKeyBindings.innerHTML=["Map shortcuts:","Zoom out: hyphen.","Zoom in: plus.","Pan right 100 pixels: right arrow.","Pan left 100 pixels: left arrow.","Pan up 100 pixels: up arrow.","Pan down 100 pixels: down arrow.","Rotate 15 degrees clockwise: shift + right arrow.","Rotate 15 degrees counter clockwise: shift + left arrow.","Increase pitch 10 degrees: shift + up arrow.","Decrease pitch 10 degrees: shift + down arrow.","Jump focus to the map: Escape."].join("\n"),o.map.getCanvasContainer().appendChild(o.atlasMapKeyBindings);var t=[189,187,38,37,39,40],e=o.map._getMap()._canvas;null!=e&&e.addEventListener("keyup",function(e){t.find(function(t){return e.keyCode===t})&&(o.atlasMapKeyBindings.innerHTML="")})},this.initializeMapLiveStateInfo=function(){o.mapViewDesc=new cu(o.map,o.updateMapState),o.atlasMapLiveStateInfo=document.createElement("div"),o.atlasMapLiveStateInfo.setAttribute("tabindex","-1"),o.atlasMapLiveStateInfo.setAttribute("aria-hidden","true"),o.atlasMapLiveStateInfo.id="atlas-map-state",o.atlasMapLiveStateInfo.classList.add("hidden-accessible-element"),o.map.getCanvasContainer().appendChild(o.atlasMapLiveStateInfo)},this.initializeMapStyleInfo=function(){o.atlasMapStyleInfo=document.createElement("div"),o.atlasMapStyleInfo.setAttribute("tabindex","-1"),o.atlasMapStyleInfo.setAttribute("aria-hidden","true"),o.atlasMapStyleInfo.id="atlas-map-style",o.atlasMapStyleInfo.classList.add("hidden-accessible-element"),o.map.events.add("stylechanged",o.updateMapStyle),o.map.getCanvasContainer().appendChild(o.atlasMapStyleInfo)},this.updateMapStyle=function(){o.atlasMapStyleInfo.innerHTML="<p>Map style: "+o.map.getStyle().style+".</p>"},this.updateMapState=function(t){o.atlasMapLiveStateInfo.innerHTML=t},this.map=t},yu=function(t){var o=this;this.listenerEnabled=!1,this.lastFlowMode="none",this.addToMap=function(){if(!o.map._isReady())throw new Error("Traffic flow could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before enabling traffic flow.");o.listenerEnabled||(o.map.events.add("styledata",o.addToMap),o.listenerEnabled=!0);var t,e=o.map.getTraffic();"none"===e.flow||(t=o.map.layers.getLayerById("traffic_"+e.flow))&&(o.lastFlowMode=e.flow,t._updateLayoutProperty("visibility","visible","none"))},this.removeFromMap=function(){var t;o.map.getTraffic();"none"!=o.lastFlowMode&&((t=o.map.layers.getLayerById("traffic_"+o.lastFlowMode))&&t._updateLayoutProperty("visibility","none","visible"),o.lastFlowMode="none"),o.listenerEnabled&&(o.map.events.remove("styledata",o.addToMap),o.listenerEnabled=!1)},this.map=t},mu=((window&&window.__extends||(pu=function(t,e){return(pu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}pu(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(gu,hu=rr),gu.getIncidentTypeName=function(t,e){switch(t){case 0:return e.Unknown;case 1:return e.Accident;case 2:return e.Fog;case 3:return e.Danger;case 4:return e.Rain;case 5:return e.Ice;case 6:return e.Jam;case 7:return e.LaneClosed;case 8:return e.RoadClosed;case 9:return e.RoadWorks;case 10:return e.Wind;case 11:return e.Flood;case 12:return e.Detour;default:return e.Unknown}},gu.getIncidentTypeIconName=function(t){switch(t){case 0:return"unknown";case 1:return"accident";case 2:return"fog";case 3:return"danger";case 4:return"rain";case 5:return"ice";case 6:return"jam";case 7:return"lane-closed";case 8:return"road-closed";case 9:return"road-work";case 10:return"wind";case 11:return"flood";case 12:return"detour";default:return"unknown"}},gu.getSeverityColorName=function(t){switch(t){case 0:return"grey";case 1:return"yellow";case 2:return"orange";case 3:return"red";default:return"grey"}},gu.getSeverityColorHexCode=function(t){switch(t){case 0:return"#B5B6B7";case 1:return"#F4C951";case 2:return"#F4873F";case 3:return"#F04F4E";default:return"#B5B6B7"}},gu);function gu(t,e,o){var n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=null!==(n=null!==(r=t.icon_category_12)&&void 0!==r?r:t.icon_category_11)&&void 0!==n?n:t.icon_category_10)&&void 0!==r?r:t.icon_category_9)&&void 0!==n?n:t.icon_category_8)&&void 0!==r?r:t.icon_category_7)&&void 0!==n?n:t.icon_category_6)&&void 0!==r?r:t.icon_category_5)&&void 0!==n?n:t.icon_category_4)&&void 0!==r?r:t.icon_category_3)&&void 0!==n?n:t.icon_category_2)&&void 0!==r?r:t.icon_category_1)&&void 0!==n?n:t.icon_category_0)&&void 0!==r?r:t.icon_category,r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=null!==(r=t.description_12)&&void 0!==r?r:t.description_11)&&void 0!==r?r:t.description_10)&&void 0!==r?r:t.description_9)&&void 0!==r?r:t.description_8)&&void 0!==r?r:t.description_7)&&void 0!==r?r:t.description_6)&&void 0!==r?r:t.description_5)&&void 0!==r?r:t.description_4)&&void 0!==r?r:t.description_3)&&void 0!==r?r:t.description_2)&&void 0!==r?r:t.description_1)&&void 0!==r?r:t.description_0)&&void 0!==r?r:t.description,t={icon:gu.getSeverityColorName(t.magnitude)+"-"+gu.getIncidentTypeIconName(n),incidentType:gu.getIncidentTypeName(n,o),description:r,delay:t.delay,color:gu.getSeverityColorHexCode(t.magnitude),id:t.id};return hu.call(this,e,t)||this}(b=du=du||{}).DELAY="delay",b.LENGTH="length",b.FROM="from",b.TO="to";var vu=(_u.build=function(t,e){void 0===e&&(e="en-US");var o=document.createElement("div");o.classList.add("incident-popup-title"),o.classList.add("font-segoeui-b"),o.innerText=t.properties.incidentType,o.setAttribute("aria-label","Incident Type "+t.properties.incidentType);var n=document.createElement("div");n.classList.add("incident-popup-subtitle"),n.classList.add("font-segoeui-b"),n.setAttribute("aria-label","Incident Description "+t.properties.description),n.innerText=t.properties.description;var r=document.createElement("div");r.classList.add("incident-popup-header"),r.style.backgroundColor=t.properties.color,r.appendChild(o),r.appendChild(n);var i,s,a,n=document.createElement("div");n.classList.add("incident-popup-body"),t.properties.delay&&(i=Math.floor(t.properties.delay/60)+" min",i=this.createInfoSection(i,du.DELAY),n.appendChild(i)),t.properties.length&&(i=new Intl.NumberFormat([e,"en-US"],{maximumFractionDigits:2}),a=void 0,a="en-US"===e?(s=zr(t.properties.length,"meters","miles"),i.format(s)+" miles"):(s=zr(t.properties.length,"meters","kilometers"),i.format(s)+" km"),a=this.createInfoSection(a,du.LENGTH),n.appendChild(a)),t.properties.from&&(a=this.createInfoSection(t.properties.from,du.FROM),n.appendChild(a)),t.properties.to&&(l=this.createInfoSection(t.properties.to,du.TO),n.appendChild(l));var l=document.createElement("div");return l.classList.add("incident-popup-content"),l.appendChild(r),l.appendChild(n),new Sl({content:l,position:t.geometry.coordinates})},_u.createInfoSection=function(t,e){var o=document.createElement("div");o.classList.add("incident-popup-info");var n=document.createElement("div");n.classList.add("icon"),n.classList.add(e);var r=document.createElement("span");return r.classList.add("message"),r.classList.add("font-segoeui"),r.setAttribute("aria-label","Incident "+e+" "+t),r.innerText=t,o.appendChild(n),o.appendChild(r),o},_u);function _u(){}var wu=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},bu=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},Su=(xu.prototype.getIncidentIconImageExpression=function(){return["concat",["let","magnitude",["get","magnitude"],["case",["==",["var","magnitude"],0],"grey",["==",["var","magnitude"],1],"yellow",["==",["var","magnitude"],2],"orange",["==",["var","magnitude"],3],"red",["==",["var","magnitude"],4],"grey","grey"]],"-",["let","category",["coalesce",["get","icon_category_12"],["get","icon_category_11"],["get","icon_category_10"],["get","icon_category_9"],["get","icon_category_8"],["get","icon_category_7"],["get","icon_category_6"],["get","icon_category_5"],["get","icon_category_4"],["get","icon_category_3"],["get","icon_category_2"],["get","icon_category_0"],["get","icon_category"],0],["case",["==",["var","category"],0],"unknown",["==",["var","category"],1],"accident",["==",["var","category"],2],"fog",["==",["var","category"],3],"danger",["==",["var","category"],4],"rain",["==",["var","category"],5],"ice",["==",["var","category"],6],"jam",["==",["var","category"],7],"lane-closed",["==",["var","category"],8],"road-closed",["==",["var","category"],9],"road-work",["==",["var","category"],10],"wind",["==",["var","category"],11],"flood",["==",["var","category"],12],"detour","unknown"]]]},xu);function xu(t){var r=this;this.incidentLayerName="incidents",this.incidentSourceName="mapcontrol_traffic_incident",this.addToMap=function(){r.map.sources.getById(r.incidentSourceName)||r.map.sources.add(r.vectorTileSource),r.map.layers.getLayerById(r.incidentLayerName)||r.map.layers.add(r.incidentLayer,"labels"),r.clickPopup=new Sl({position:[0,0],pixelOffset:[0,-18]}),r.map.addEventListener("mouseover",r.incidentLayerName,r.cursorToPointer),r.map.addEventListener("mouseleave",r.incidentLayerName,r.cursorToDefault),r.map.addEventListener("click",r.incidentLayerName,r.openIncidentPopup),r.map.events.addOnce("idle",r.setAccessiblePopups),r.map.events.add("moveend",r.setAccessiblePopups)},this.accessiblePopups=[],this.setAccessiblePopups=function(){return wu(r,void 0,void 0,function(){var e,i,s,a,l,c,u=this;return bu(this,function(t){switch(t.label){case 0:return this.accessiblePopups.forEach(function(t){return t.remove()}),this.accessiblePopups=[],e=this.map.layers.getRenderedShapes(this.map.getCamera().bounds,this.incidentLayer),[4,this.map._getLocalizedStrings()];case 1:return i=t.sent(),s=function(e,o){var t=e[o],n=t.geometry.coordinates,n=new ur(new mi(n[0],n[1])),n=new mu(t.properties,n,i),r=vu.build(n,u.incidentLanguage),n=r.getPopupContainer();return n.addEventListener("focusin",function(t){u.clickPopup.remove(),u.accessiblePopups.filter(function(t){return t!==r}).forEach(function(t){return t.remove()}),0<=o-1&&a(r,s(e,o-1)),o+1<e.length&&c(s(e,o+1)),2<=o&&o==e.length-1&&l(s(e,0)),0==o&&2<=e.length&&c(s(e,e.length-1))}),o==e.length-1&&n.addEventListener("focusout",function(t){null===t.relatedTarget&&r.close()}),u.accessiblePopups.push(r),r},a=function(t,e){e.open(u.map),e.close();e=e.getPopupContainer(),t=t.getPopupContainer();t.parentElement.insertBefore(e,t)},l=function(t){t.open(u.map),t.close();var e=t.getPopupContainer(),t=e.parentElement;t.insertBefore(e,t.firstElementChild)},c=function(t){t.open(u.map),t.close()},0<e.length&&c(s(e,0)),1<e.length&&c(s(e,e.length-1)),[2]}})})},this.removeFromMap=function(){var t;r.map.removeEventListener("mouseover",r.incidentLayerName,r.cursorToPointer),r.map.removeEventListener("mouseleave",r.incidentLayerName,r.cursorToDefault),r.map.removeEventListener("click",r.incidentLayerName,r.openIncidentPopup),r.map.events.remove("idle",r.setAccessiblePopups),r.map.events.remove("moveend",r.setAccessiblePopups),r.accessiblePopups.forEach(function(t){return t.remove()}),r.accessiblePopups=[],null!==(t=r.clickPopup)&&void 0!==t&&t.remove(),null!=r.map.layers.getLayerById(r.incidentLayerName)&&r.map.layers.remove(r.incidentLayerName),null!=r.map.sources.getById(r.incidentSourceName)&&r.map.sources.remove(r.incidentSourceName)},this.cursorToPointer=function(t){r.map.getCanvas().style.cursor="pointer"},this.cursorToDefault=function(t){r.map.getCanvas().style.cursor=""},this.openIncidentPopup=function(t){r.clickPopup.remove(),r.accessiblePopups.forEach(function(t){return t.close()});var o=t.position,n=t.features[0];r.map._getLocalizedStrings().then(function(t){var e=new ur(new mi(o[0],o[1])),t=new mu(n.properties,e,t);r.clickPopup=vu.build(t,r.incidentLanguage),r.clickPopup.open(r.map),r.clickPopup.getPopupContainer().addEventListener("focusout",function(t){null===t.relatedTarget&&r.clickPopup.close()})})},this.map=t,this.vectorTileSource=new _s(this.incidentSourceName,{maxZoom:22,tiles:["https://"+h+"/traffic/incident/tile/pbf?api-version=1.0&zoom={z}&x={x}&y={y}"]});t=this.getIncidentIconImageExpression();this.incidentLayer=new Ka(this.incidentSourceName,this.incidentLayerName,{sourceLayer:"Traffic incident POI",iconOptions:{ignorePlacement:!0,allowOverlap:!0,image:t,size:.75}})}var Ou,Tu,Eu=((window&&window.__extends||(Ou=function(t,e){return(Ou=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ou(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Cu,Tu=k),Cu);function Cu(){var t=null!==Tu&&Tu.apply(this,arguments)||this;return t.interactive=!0,t.scrollZoomInteraction=!0,t.boxZoomInteraction=!0,t.dragRotateInteraction=!0,t.dragPanInteraction=!0,t.keyboardInteraction=!0,t.dblClickZoomInteraction=!0,t.touchInteraction=!0,t.touchRotate=!0,t.wheelZoomRate=1/450,t}var Pu=(ku.prototype.enable=function(){this.map.getMapContainer().addEventListener("keydown",this._onKeyDown)},ku.prototype.disable=function(){this.map.getMapContainer().removeEventListener("keydown",this._onKeyDown)},ku);function ku(t){var e=this;this._onKeyDown=function(t){27===t.keyCode&&e.map.getCanvas().focus()},this.map=t}var Au=(Iu.prototype.enable=function(){this.map.getCanvasContainer().addEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().addEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().addEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().addEventListener("touchend",this._onTouchEnd)},Iu.prototype.disable=function(){this.map.getCanvasContainer().removeEventListener("gesturestart",this._onGestureStart),this.map.getCanvasContainer().removeEventListener("gesturechange",this._onGestureChange),this.map.getCanvasContainer().removeEventListener("touchstart",this._onTouchStart),this.map.getCanvasContainer().removeEventListener("touchend",this._onTouchEnd)},Iu);function Iu(t){var e=this;this._onGestureStart=function(t){e.hasTouch||(t.preventDefault(),e.initZoom=e.map.getCamera().zoom)},this._onGestureChange=function(t){e.hasTouch||(t.preventDefault(),e.map.setCamera({zoom:e.initZoom+t.scale-1}))},this._onTouchStart=function(t){e.hasTouch=!0},this._onTouchEnd=function(t){0===t.touches.length&&(e.hasTouch=!1)},this.map=t}var Lu=(Ru.prototype.addToMap=function(){this.added||(this.added=!0,this._setInteractions(this.options))},Ru.prototype.removeFromMap=function(){this.added&&(this.added=!1,this._setInteractions({interactive:!1}))},Ru.prototype.setOptions=function(t){this.options=(new Eu).merge(this.options,t),this.added&&this._setInteractions(this.options)},Ru.prototype.getOptions=function(){return Object.assign({},this.options)},Ru.prototype._setInteractions=function(t){var e;t.interactive?(t.boxZoomInteraction?this.map._getMap().boxZoom.enable():this.map._getMap().boxZoom.disable(),t.dblClickZoomInteraction?this.map._getMap().doubleClickZoom.enable():this.map._getMap().doubleClickZoom.disable(),t.dragPanInteraction?this.map._getMap().dragPan.enable():this.map._getMap().dragPan.disable(),t.dragRotateInteraction?this.map._getMap().dragRotate.enable():this.map._getMap().dragRotate.disable(),t.keyboardInteraction?(this.map._getMap().keyboard.enable(),this.focusShortcut.enable()):(this.map._getMap().keyboard.disable(),this.focusShortcut.disable()),t.scrollZoomInteraction?(this.map._getMap().scrollZoom.enable(),this.map._getMap().scrollZoom.setWheelZoomRate(t.wheelZoomRate)):this.map._getMap().scrollZoom.disable(),e=this.map._getMap().touchZoomRotate,t.touchInteraction?(e.enable(),t.touchRotate?e.enableRotation():e.disableRotation()):e.disable(),this.pinchZoom.enable()):(this.map._getMap().boxZoom.disable(),this.map._getMap().doubleClickZoom.disable(),this.map._getMap().dragPan.disable(),this.map._getMap().dragRotate.disable(),this.map._getMap().keyboard.disable(),this.focusShortcut.disable(),this.map._getMap().scrollZoom.disable(),this.map._getMap().touchZoomRotate.disable(),this.pinchZoom.disable())},Ru);function Ru(t,e){this.added=!1,this.map=t,this.focusShortcut=new Pu(t),this.pinchZoom=new Au(t),this.options=(new Eu).merge(e)}function Nu(t,e,o){var n={type:"Feature"};return 0!==(o=void 0===o?{}:o).id&&!o.id||(n.id=o.id),o.bbox&&(n.bbox=o.bbox),n.properties=e||{},n.geometry=t,n}function Mu(t){return"Feature"===t.type?t.geometry:t}var ju=Rt(function(t,e){t.exports=function(){function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(t,n.key,n)}}function s(t,e,o){if(e)n(t.prototype,e);if(o)n(t,o);return t}var u=function(){function t(t,e){this.next=null;this.key=t;this.data=e;this.left=null;this.right=null}return t}();function e(t,e){return t>e?1:t<e?-1:0}function a(t,e,o){var n=new u(null,null);var r=n;var i=n;while(true){var s=o(t,e.key);if(s<0){if(e.left===null)break;if(o(t,e.left.key)<0){var a=e.left;e.left=a.right;a.right=e;e=a;if(e.left===null)break}i.left=e;i=e;e=e.left}else if(s>0){if(e.right===null)break;if(o(t,e.right.key)>0){var a=e.right;e.right=a.left;a.left=e;e=a;if(e.right===null)break}r.right=e;r=e;e=e.right}else break}r.right=e.left;i.left=e.right;e.left=n.right;e.right=n.left;return e}function l(t,e,o,n){var r=new u(t,e);if(o===null){r.left=r.right=null;return r}o=a(t,o,n);var i=n(t,o.key);if(i<0){r.left=o.left;r.right=o;o.left=null}else if(i>=0){r.right=o.right;r.left=o;o.right=null}return r}function p(t,e,o){var n=null;var r=null;if(e){e=a(t,e,o);var i=o(e.key,t);if(i===0){n=e.left;r=e.right}else if(i<0){r=e.right;e.right=null;n=e}else{n=e.left;e.left=null;r=e}}return{left:n,right:r}}function h(t,e,o){if(e===null)return t;if(t===null)return e;e=a(t.key,e,o);e.left=t;return e}function d(t,e,o,n,r){if(t){n(""+e+(o?"└── ":"├── ")+r(t)+"\n");var i=e+(o?" ":"│ ");if(t.left)d(t.left,i,false,n,r);if(t.right)d(t.right,i,true,n,r)}}var I=function(){function t(t){if(t===void 0)t=e;this._root=null;this._size=0;this._comparator=t}t.prototype.insert=function(t,e){this._size++;return this._root=l(t,e,this._root,this._comparator)};t.prototype.add=function(t,e){var o=new u(t,e);if(this._root===null){o.left=o.right=null;this._size++;this._root=o}var n=this._comparator;var r=a(t,this._root,n);var i=n(t,r.key);if(i===0)this._root=r;else{if(i<0){o.left=r.left;o.right=r;r.left=null}else if(i>0){o.right=r.right;o.left=r;r.right=null}this._size++;this._root=o}return this._root};t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)};t.prototype._remove=function(t,e,o){var n;if(e===null)return null;e=a(t,e,o);var r=o(t,e.key);if(r===0){if(e.left===null)n=e.right;else{n=a(t,e.left,o);n.right=e.right}this._size--;return n}return e};t.prototype.pop=function(){var t=this._root;if(t){while(t.left)t=t.left;this._root=a(t.key,this._root,this._comparator);this._root=this._remove(t.key,this._root,this._comparator);return{key:t.key,data:t.data}}return null};t.prototype.findStatic=function(t){var e=this._root;var o=this._comparator;while(e){var n=o(t,e.key);if(n===0)return e;else if(n<0)e=e.left;else e=e.right}return null};t.prototype.find=function(t){if(this._root){this._root=a(t,this._root,this._comparator);if(this._comparator(t,this._root.key)!==0)return null}return this._root};t.prototype.contains=function(t){var e=this._root;var o=this._comparator;while(e){var n=o(t,e.key);if(n===0)return true;else if(n<0)e=e.left;else e=e.right}return false};t.prototype.forEach=function(t,e){var o=this._root;var n=[];var r=false;while(!r)if(o!==null){n.push(o);o=o.left}else if(n.length!==0){o=n.pop();t.call(e,o);o=o.right}else r=true;return this};t.prototype.range=function(t,e,o,n){var r=[];var i=this._comparator;var s=this._root;var a;while(r.length!==0||s)if(s){r.push(s);s=s.left}else{s=r.pop();a=i(s.key,e);if(a>0)break;else if(i(s.key,t)>=0)if(o.call(n,s))return this;s=s.right}return this};t.prototype.keys=function(){var o=[];this.forEach(function(t){var e=t.key;return o.push(e)});return o};t.prototype.values=function(){var o=[];this.forEach(function(t){var e=t.data;return o.push(e)});return o};t.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};t.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};t.prototype.minNode=function(t){if(t===void 0)t=this._root;if(t)while(t.left)t=t.left;return t};t.prototype.maxNode=function(t){if(t===void 0)t=this._root;if(t)while(t.right)t=t.right;return t};t.prototype.at=function(t){var e=this._root;var o=false;var n=0;var r=[];while(!o)if(e){r.push(e);e=e.left}else if(r.length>0){e=r.pop();if(n===t)return e;n++;e=e.right}else o=true;return null};t.prototype.next=function(t){var e=this._root;var o=null;if(t.right){o=t.right;while(o.left)o=o.left;return o}var n=this._comparator;while(e){var r=n(t.key,e.key);if(r===0)break;else if(r<0){o=e;e=e.left}else e=e.right}return o};t.prototype.prev=function(t){var e=this._root;var o=null;if(t.left!==null){o=t.left;while(o.right)o=o.right;return o}var n=this._comparator;while(e){var r=n(t.key,e.key);if(r===0)break;else if(r<0)e=e.left;else{o=e;e=e.right}}return o};t.prototype.clear=function(){this._root=null;this._size=0;return this};t.prototype.toList=function(){return o(this._root)};t.prototype.load=function(t,e,o){if(e===void 0)e=[];if(o===void 0)o=false;var n=t.length;var r=this._comparator;if(o)v(t,e,0,n-1,r);if(this._root===null){this._root=f(t,e,0,n);this._size=n}else{var i=g(this.toList(),y(t,e),r);n=this._size+n;this._root=m({head:i},0,n)}return this};t.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(t.prototype,"size",{get:function t(){return this._size},enumerable:true,configurable:true});Object.defineProperty(t.prototype,"root",{get:function t(){return this._root},enumerable:true,configurable:true});t.prototype.toString=function(t){if(t===void 0)t=function t(e){return String(e.key)};var e=[];d(this._root,"",true,function(t){return e.push(t)},t);return e.join("")};t.prototype.update=function(t,e,o){var n=this._comparator;var r=p(t,this._root,n),i=r.left,s=r.right;if(n(t,e)<0)s=l(e,o,s,n);else i=l(e,o,i,n);this._root=h(i,s,n)};t.prototype.split=function(t){return p(t,this._root,this._comparator)};return t}();function f(t,e,o,n){var r=n-o;if(r>0){var i=o+Math.floor(r/2);var s=t[i];var a=e[i];var l=new u(s,a);l.left=f(t,e,o,i);l.right=f(t,e,i+1,n);return l}return null}function y(t,e){var o=new u(null,null);var n=o;for(var r=0;r<t.length;r++)n=n.next=new u(t[r],e[r]);n.next=null;return o.next}function o(t){var e=t;var o=[];var n=false;var r=new u(null,null);var i=r;while(!n)if(e){o.push(e);e=e.left}else if(o.length>0){e=i=i.next=o.pop();e=e.right}else n=true;i.next=null;return r.next}function m(t,e,o){var n=o-e;if(n>0){var r=e+Math.floor(n/2);var i=m(t,e,r);var s=t.head;s.left=i;t.head=t.head.next;s.right=m(t,r+1,o);return s}return null}function g(t,e,o){var n=new u(null,null);var r=n;var i=t;var s=e;while(i!==null&&s!==null){if(o(i.key,s.key)<0){r.next=i;i=i.next}else{r.next=s;s=s.next}r=r.next}if(i!==null)r.next=i;else if(s!==null)r.next=s;return n.next}function v(t,e,o,n,r){if(o>=n)return;var i=t[o+n>>1];var s=o-1;var a=n+1;while(true){do{s++}while(r(t[s],i)<0);do{a--}while(r(t[a],i)>0);if(s>=a)break;var l=t[s];t[s]=t[a];t[a]=l;l=e[s];e[s]=e[a];e[a]=l}v(t,e,o,a,r);v(t,e,a+1,n,r)}var _=function t(e,o){return e.ll.x<=o.x&&o.x<=e.ur.x&&e.ll.y<=o.y&&o.y<=e.ur.y},L=function t(e,o){if(o.ur.x<e.ll.x||e.ur.x<o.ll.x||o.ur.y<e.ll.y||e.ur.y<o.ll.y)return null;var n=e.ll.x<o.ll.x?o.ll.x:e.ll.x;var r=e.ur.x<o.ur.x?e.ur.x:o.ur.x;var i=e.ll.y<o.ll.y?o.ll.y:e.ll.y;var s=e.ur.y<o.ur.y?e.ur.y:o.ur.y;return{ll:{x:n,y:i},ur:{x:r,y:s}}},r=Number.EPSILON;if(r===undefined)r=Math.pow(2,-52);var i=r*r,w=function t(e,o){if(-r<e&&e<r)if(-r<o&&o<r)return 0;var n=e-o;if(n*n<i*e*o)return 0;return e<o?-1:1},t=function(){function t(){c(this,t);this.reset()}s(t,[{key:"reset",value:function t(){this.xRounder=new b;this.yRounder=new b}},{key:"round",value:function t(e,o){return{x:this.xRounder.round(e),y:this.yRounder.round(o)}}}]);return t}(),b=function(){function t(){c(this,t);this.tree=new I;this.round(0)}s(t,[{key:"round",value:function t(e){var o=this.tree.add(e);var n=this.tree.prev(o);if(n!==null&&w(o.key,n.key)===0){this.tree.remove(e);return n.key}var r=this.tree.next(o);if(r!==null&&w(o.key,r.key)===0){this.tree.remove(e);return r.key}return e}}]);return t}(),R=new t,S=function t(e,o){return e.x*o.y-e.y*o.x},x=function t(e,o){return e.x*o.x+e.y*o.y},O=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};var s=S(r,i);return w(s,0)},T=function t(e){return Math.sqrt(x(e,e))},E=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};return S(i,r)/T(i)/T(r)},C=function t(e,o,n){var r={x:o.x-e.x,y:o.y-e.y};var i={x:n.x-e.x,y:n.y-e.y};return x(i,r)/T(i)/T(r)},P=function t(e,o,n){if(o.y===0)return null;return{x:e.x+o.x/o.y*(n-e.y),y:n}},k=function t(e,o,n){if(o.x===0)return null;return{x:n,y:e.y+o.y/o.x*(n-e.x)}},A=function t(e,o,n,r){if(o.x===0)return k(n,r,e.x);if(r.x===0)return k(e,o,n.x);if(o.y===0)return P(n,r,e.y);if(r.y===0)return P(e,o,n.y);var i=S(o,r);if(i==0)return null;var s={x:n.x-e.x,y:n.y-e.y};var a=S(s,o)/i;var l=S(s,r)/i;var c=e.x+l*o.x,u=n.x+a*r.x;var p=e.y+l*o.y,h=n.y+a*r.y;var d=(c+u)/2;var f=(p+h)/2;return{x:d,y:f}},N=function(){s(r,null,[{key:"compare",value:function t(e,o){var n=r.comparePoints(e.point,o.point);if(n!==0)return n;if(e.point!==o.point)e.link(o);if(e.isLeft!==o.isLeft)return e.isLeft?1:-1;return j.compare(e.segment,o.segment)}},{key:"comparePoints",value:function t(e,o){if(e.x<o.x)return-1;if(e.x>o.x)return 1;if(e.y<o.y)return-1;if(e.y>o.y)return 1;return 0}}]);function r(t,e){c(this,r);if(t.events===undefined)t.events=[this];else t.events.push(this);this.point=t;this.isLeft=e}s(r,[{key:"link",value:function t(e){if(e.point===this.point)throw new Error("Tried to link already linked events");var o=e.point.events;for(var n=0,r=o.length;n<r;n++){var i=o[n];this.point.events.push(i);i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function t(){var e=this.point.events.length;for(var o=0;o<e;o++){var n=this.point.events[o];if(n.segment.consumedBy!==undefined)continue;for(var r=o+1;r<e;r++){var i=this.point.events[r];if(i.consumedBy!==undefined)continue;if(n.otherSE.point.events!==i.otherSE.point.events)continue;n.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function t(){var e=[];for(var o=0,n=this.point.events.length;o<n;o++){var r=this.point.events[o];if(r!==this&&!r.segment.ringOut&&r.segment.isInResult())e.push(r)}return e}},{key:"getLeftmostComparator",value:function t(n){var r=this;var l=new Map;var c=function t(e){var o=e.otherSE;l.set(e,{sine:E(r.point,n.point,o.point),cosine:C(r.point,n.point,o.point)})};return function(t,e){if(!l.has(t))c(t);if(!l.has(e))c(e);var o=l.get(t),n=o.sine,r=o.cosine;var i=l.get(e),s=i.sine,a=i.cosine;if(n>=0&&s>=0){if(r<a)return 1;if(r>a)return-1;return 0}if(n<0&&s<0){if(r<a)return-1;if(r>a)return 1;return 0}if(s<n)return-1;if(s>n)return 1;return 0}}}]);return r}(),M=0,j=function(){s(h,null,[{key:"compare",value:function t(e,o){var n=e.leftSE.point.x;var r=o.leftSE.point.x;var i=e.rightSE.point.x;var s=o.rightSE.point.x;if(s<n)return 1;if(i<r)return-1;var a=e.leftSE.point.y;var l=o.leftSE.point.y;var c=e.rightSE.point.y;var u=o.rightSE.point.y;if(n<r){if(l<a&&l<c)return 1;if(l>a&&l>c)return-1;var p=e.comparePoint(o.leftSE.point);if(p<0)return 1;if(p>0)return-1;var h=o.comparePoint(e.rightSE.point);if(h!==0)return h;return-1}if(n>r){if(a<l&&a<u)return-1;if(a>l&&a>u)return 1;var d=o.comparePoint(e.leftSE.point);if(d!==0)return d;var f=e.comparePoint(o.rightSE.point);if(f<0)return 1;if(f>0)return-1;return 1}if(a<l)return-1;if(a>l)return 1;if(i<s){var y=o.comparePoint(e.rightSE.point);if(y!==0)return y}if(i>s){var m=e.comparePoint(o.rightSE.point);if(m<0)return 1;if(m>0)return-1}if(i!==s){var g=c-a;var v=i-n;var _=u-l;var w=s-r;if(g>v&&_<w)return 1;if(g<v&&_>w)return-1}if(i>s)return 1;if(i<s)return-1;if(c<u)return-1;if(c>u)return 1;if(e.id<o.id)return-1;if(e.id>o.id)return 1;return 0}}]);function h(t,e,o,n){c(this,h);this.id=++M;this.leftSE=t;t.segment=this;t.otherSE=e;this.rightSE=e;e.segment=this;e.otherSE=t;this.rings=o;this.windings=n}s(h,[{key:"replaceRightSE",value:function t(e){this.rightSE=e;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function t(){var e=this.leftSE.point.y;var o=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<o?e:o},ur:{x:this.rightSE.point.x,y:e>o?e:o}}}},{key:"vector",value:function t(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function t(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function t(e){if(this.isAnEndpoint(e))return 0;var o=this.leftSE.point;var n=this.rightSE.point;var r=this.vector();if(o.x===n.x){if(e.x===o.x)return 0;return e.x<o.x?1:-1}var i=(e.y-o.y)/r.y;var s=o.x+i*r.x;if(e.x===s)return 0;var a=(e.x-o.x)/r.x;var l=o.y+a*r.y;if(e.y===l)return 0;return e.y<l?-1:1}},{key:"getIntersection",value:function t(e){var o=this.bbox();var n=e.bbox();var r=L(o,n);if(r===null)return null;var i=this.leftSE.point;var s=this.rightSE.point;var a=e.leftSE.point;var l=e.rightSE.point;var c=_(o,a)&&this.comparePoint(a)===0;var u=_(n,i)&&e.comparePoint(i)===0;var p=_(o,l)&&this.comparePoint(l)===0;var h=_(n,s)&&e.comparePoint(s)===0;if(u&&c){if(h&&!p)return s;if(!h&&p)return l;return null}if(u){if(p)if(i.x===l.x&&i.y===l.y)return null;return i}if(c){if(h)if(s.x===a.x&&s.y===a.y)return null;return a}if(h&&p)return null;if(h)return s;if(p)return l;var d=A(i,this.vector(),a,e.vector());if(d===null)return null;if(!_(r,d))return null;return R.round(d.x,d.y)}},{key:"split",value:function t(e){var o=[];var n=e.events!==undefined;var r=new N(e,true);var i=new N(e,false);var s=this.rightSE;this.replaceRightSE(i);o.push(i);o.push(r);var a=new h(r,s,this.rings.slice(),this.windings.slice());if(N.comparePoints(a.leftSE.point,a.rightSE.point)>0)a.swapEvents();if(N.comparePoints(this.leftSE.point,this.rightSE.point)>0)this.swapEvents();if(n){r.checkForConsuming();i.checkForConsuming()}return o}},{key:"swapEvents",value:function t(){var e=this.rightSE;this.rightSE=this.leftSE;this.leftSE=e;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var o=0,n=this.windings.length;o<n;o++)this.windings[o]*=-1}},{key:"consume",value:function t(e){var o=this;var n=e;while(o.consumedBy)o=o.consumedBy;while(n.consumedBy)n=n.consumedBy;var r=h.compare(o,n);if(r===0)return;if(r>0){var i=o;o=n;n=i}if(o.prev===n){var s=o;o=n;n=s}for(var a=0,l=n.rings.length;a<l;a++){var c=n.rings[a];var u=n.windings[a];var p=o.rings.indexOf(c);if(p===-1){o.rings.push(c);o.windings.push(u)}else o.windings[p]+=u}n.rings=null;n.windings=null;n.consumedBy=o;n.leftSE.consumedBy=o.leftSE;n.rightSE.consumedBy=o.rightSE}},{key:"prevInResult",value:function t(){if(this._prevInResult!==undefined)return this._prevInResult;if(!this.prev)this._prevInResult=null;else if(this.prev.isInResult())this._prevInResult=this.prev;else this._prevInResult=this.prev.prevInResult();return this._prevInResult}},{key:"beforeState",value:function t(){if(this._beforeState!==undefined)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}},{key:"afterState",value:function t(){if(this._afterState!==undefined)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};var o=this._afterState.rings;var n=this._afterState.windings;var r=this._afterState.multiPolys;for(var i=0,s=this.rings.length;i<s;i++){var a=this.rings[i];var l=this.windings[i];var c=o.indexOf(a);if(c===-1){o.push(a);n.push(l)}else n[c]+=l}var u=[];var p=[];for(var h=0,d=o.length;h<d;h++){if(n[h]===0)continue;var f=o[h];var y=f.poly;if(p.indexOf(y)!==-1)continue;if(f.isExterior)u.push(y);else{if(p.indexOf(y)===-1)p.push(y);var m=u.indexOf(f.poly);if(m!==-1)u.splice(m,1)}}for(var g=0,v=u.length;g<v;g++){var _=u[g].multiPoly;if(r.indexOf(_)===-1)r.push(_)}return this._afterState}},{key:"isInResult",value:function t(){if(this.consumedBy)return false;if(this._isInResult!==undefined)return this._isInResult;var e=this.beforeState().multiPolys;var o=this.afterState().multiPolys;switch(W.type){case"union":{var n=e.length===0;var r=o.length===0;this._isInResult=n!==r;break}case"intersection":{var i;var s;if(e.length<o.length){i=e.length;s=o.length}else{i=o.length;s=e.length}this._isInResult=s===W.numMultiPolys&&i<s;break}case"xor":{var a=Math.abs(e.length-o.length);this._isInResult=a%2===1;break}case"difference":{var l=function t(e){return e.length===1&&e[0].isSubject};this._isInResult=l(e)!==l(o);break}default:throw new Error("Unrecognized operation type found ".concat(W.type))}return this._isInResult}}],[{key:"fromRing",value:function t(e,o,n){var r,i,s;var a=N.comparePoints(e,o);if(a<0){r=e;i=o;s=1}else if(a>0){r=o;i=e;s=-1}else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var l=new N(r,true);var c=new N(i,false);return new h(l,c,[n],[s])}}]);return h}(),D=function(){function l(t,e,o){c(this,l);if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=e;this.isExterior=o;this.segments=[];if(typeof t[0][0]!=="number"||typeof t[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var n=R.round(t[0][0],t[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};var r=n;for(var i=1,s=t.length;i<s;i++){if(typeof t[i][0]!=="number"||typeof t[i][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var a=R.round(t[i][0],t[i][1]);if(a.x===r.x&&a.y===r.y)continue;this.segments.push(j.fromRing(r,a,this));if(a.x<this.bbox.ll.x)this.bbox.ll.x=a.x;if(a.y<this.bbox.ll.y)this.bbox.ll.y=a.y;if(a.x>this.bbox.ur.x)this.bbox.ur.x=a.x;if(a.y>this.bbox.ur.y)this.bbox.ur.y=a.y;r=a}if(n.x!==r.x||n.y!==r.y)this.segments.push(j.fromRing(r,n,this))}s(l,[{key:"getSweepEvents",value:function t(){var e=[];for(var o=0,n=this.segments.length;o<n;o++){var r=this.segments[o];e.push(r.leftSE);e.push(r.rightSE)}return e}}]);return l}(),z=function(){function i(t,e){c(this,i);if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new D(t[0],this,true);this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}};this.interiorRings=[];for(var o=1,n=t.length;o<n;o++){var r=new D(t[o],this,false);if(r.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=r.bbox.ll.x;if(r.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=r.bbox.ll.y;if(r.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=r.bbox.ur.x;if(r.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=r.bbox.ur.y;this.interiorRings.push(r)}this.multiPoly=e}s(i,[{key:"getSweepEvents",value:function t(){var e=this.exteriorRing.getSweepEvents();for(var o=0,n=this.interiorRings.length;o<n;o++){var r=this.interiorRings[o].getSweepEvents();for(var i=0,s=r.length;i<s;i++)e.push(r[i])}return e}}]);return i}(),B=function(){function i(t,e){c(this,i);if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{if(typeof t[0][0][0]==="number")t=[t]}catch(t){}this.polys=[];this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=t.length;o<n;o++){var r=new z(t[o],this);if(r.bbox.ll.x<this.bbox.ll.x)this.bbox.ll.x=r.bbox.ll.x;if(r.bbox.ll.y<this.bbox.ll.y)this.bbox.ll.y=r.bbox.ll.y;if(r.bbox.ur.x>this.bbox.ur.x)this.bbox.ur.x=r.bbox.ur.x;if(r.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=r.bbox.ur.y;this.polys.push(r)}this.isSubject=e}s(i,[{key:"getSweepEvents",value:function t(){var e=[];for(var o=0,n=this.polys.length;o<n;o++){var r=this.polys[o].getSweepEvents();for(var i=0,s=r.length;i<s;i++)e.push(r[i])}return e}}]);return i}(),F=function(){s(b,null,[{key:"factory",value:function t(e){var o=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(!i.isInResult()||i.ringOut)continue;var s=null;var a=i.leftSE;var l=i.rightSE;var c=[a];var u=a.point;var p=[];while(true){s=a;a=l;c.push(a);if(a.point===u)break;while(true){var h=a.getAvailableLinkedEvents();if(h.length===0){var d=c[0].point;var f=c[c.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(h.length===1){l=h[0].otherSE;break}var y=null;for(var m=0,g=p.length;m<g;m++)if(p[m].point===a.point){y=m;break}if(y!==null){var v=p.splice(y)[0];var _=c.splice(v.index);_.unshift(_[0].otherSE);o.push(new b(_.reverse()));continue}p.push({index:c.length,point:a.point});var w=a.getLeftmostComparator(s);l=h.sort(w)[0].otherSE;break}}o.push(new b(c))}return o}}]);function b(t){c(this,b);this.events=t;for(var e=0,o=t.length;e<o;e++)t[e].segment.ringOut=this;this.poly=null}s(b,[{key:"getGeom",value:function t(){var e=this.events[0].point;var o=[e];for(var n=1,r=this.events.length-1;n<r;n++){var i=this.events[n].point;var s=this.events[n+1].point;if(O(i,e,s)===0)continue;o.push(i);e=i}if(o.length===1)return null;var a=o[0];var l=o[1];if(O(a,e,l)===0)o.shift();o.push(o[0]);var c=this.isExteriorRing()?1:-1;var u=this.isExteriorRing()?0:o.length-1;var p=this.isExteriorRing()?o.length:-1;var h=[];for(var d=u;d!=p;d+=c)h.push([o[d].x,o[d].y]);return h}},{key:"isExteriorRing",value:function t(){if(this._isExteriorRing===undefined){var e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():true}return this._isExteriorRing}},{key:"enclosingRing",value:function t(){if(this._enclosingRing===undefined)this._enclosingRing=this._calcEnclosingRing();return this._enclosingRing}},{key:"_calcEnclosingRing",value:function t(){var e=this.events[0];for(var o=1,n=this.events.length;o<n;o++){var r=this.events[o];if(N.compare(e,r)>0)e=r}var i=e.segment.prevInResult();var s=i?i.prevInResult():null;while(true){if(!i)return null;if(!s)return i.ringOut;if(s.ringOut!==i.ringOut)if(s.ringOut.enclosingRing()!==i.ringOut)return i.ringOut;else return i.ringOut.enclosingRing();i=s.prevInResult();s=i?i.prevInResult():null}}}]);return b}(),U=function(){function e(t){c(this,e);this.exteriorRing=t;t.poly=this;this.interiorRings=[]}s(e,[{key:"addInterior",value:function t(e){this.interiorRings.push(e);e.poly=this}},{key:"getGeom",value:function t(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var o=0,n=this.interiorRings.length;o<n;o++){var r=this.interiorRings[o].getGeom();if(r===null)continue;e.push(r)}return e}}]);return e}(),q=function(){function e(t){c(this,e);this.rings=t;this.polys=this._composePolys(t)}s(e,[{key:"getGeom",value:function t(){var e=[];for(var o=0,n=this.polys.length;o<n;o++){var r=this.polys[o].getGeom();if(r===null)continue;e.push(r)}return e}},{key:"_composePolys",value:function t(e){var o=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.poly)continue;if(i.isExteriorRing())o.push(new U(i));else{var s=i.enclosingRing();if(!s.poly)o.push(new U(s));s.poly.addInterior(i)}}return o}}]);return e}(),G=function(){function o(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:j.compare;c(this,o);this.queue=t;this.tree=new I(e);this.segments=[]}s(o,[{key:"process",value:function t(e){var o=e.segment;var n=[];if(e.consumedBy){if(e.isLeft)this.queue.remove(e.otherSE);else this.tree.remove(o);return n}var r=e.isLeft?this.tree.insert(o):this.tree.find(o);if(!r)throw new Error("Unable to find segment #".concat(o.id," ")+"[".concat(o.leftSE.point.x,", ").concat(o.leftSE.point.y,"] -> ")+"[".concat(o.rightSE.point.x,", ").concat(o.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");var i=r;var s=r;var a=undefined;var l=undefined;while(a===undefined){i=this.tree.prev(i);if(i===null)a=null;else if(i.key.consumedBy===undefined)a=i.key}while(l===undefined){s=this.tree.next(s);if(s===null)l=null;else if(s.key.consumedBy===undefined)l=s.key}if(e.isLeft){var c=null;if(a){var u=a.getIntersection(o);if(u!==null){if(!o.isAnEndpoint(u))c=u;if(!a.isAnEndpoint(u)){var p=this._splitSafely(a,u);for(var h=0,d=p.length;h<d;h++)n.push(p[h])}}}var f=null;if(l){var y=l.getIntersection(o);if(y!==null){if(!o.isAnEndpoint(y))f=y;if(!l.isAnEndpoint(y)){var m=this._splitSafely(l,y);for(var g=0,v=m.length;g<v;g++)n.push(m[g])}}}if(c!==null||f!==null){var _=null;if(c===null)_=f;else if(f===null)_=c;else{var w=N.comparePoints(c,f);_=w<=0?c:f}this.queue.remove(o.rightSE);n.push(o.rightSE);var b=o.split(_);for(var S=0,x=b.length;S<x;S++)n.push(b[S])}if(n.length>0){this.tree.remove(o);n.push(e)}else{this.segments.push(o);o.prev=a}}else{if(a&&l){var O=a.getIntersection(l);if(O!==null){if(!a.isAnEndpoint(O)){var T=this._splitSafely(a,O);for(var E=0,C=T.length;E<C;E++)n.push(T[E])}if(!l.isAnEndpoint(O)){var P=this._splitSafely(l,O);for(var k=0,A=P.length;k<A;k++)n.push(P[k])}}}this.tree.remove(o)}return n}},{key:"_splitSafely",value:function t(e,o){this.tree.remove(e);var n=e.rightSE;this.queue.remove(n);var r=e.split(o);r.push(n);if(e.consumedBy===undefined)this.tree.insert(e);return r}}]);return o}(),Z=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,H=typeof process!=="undefined"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,K,W=new(function(){function t(){c(this,t)}s(t,[{key:"run",value:function t(e,o,n){W.type=e;R.reset();var r=[new B(o,true)];for(var i=0,s=n.length;i<s;i++)r.push(new B(n[i],false));W.numMultiPolys=r.length;if(W.type==="difference"){var a=r[0];var l=1;while(l<r.length)if(L(r[l].bbox,a.bbox)!==null)l++;else r.splice(l,1)}if(W.type==="intersection")for(var c=0,u=r.length;c<u;c++){var p=r[c];for(var h=c+1,d=r.length;h<d;h++)if(L(p.bbox,r[h].bbox)===null)return[]}var f=new I(N.compare);for(var y=0,m=r.length;y<m;y++){var g=r[y].getSweepEvents();for(var v=0,_=g.length;v<_;v++){f.insert(g[v]);if(f.size>Z)throw new Error("Infinite loop when putting segment endpoints in a priority queue "+"(queue size too big). Please file a bug report.")}}var w=new G(f);var b=f.size;var S=f.pop();while(S){var x=S.key;if(f.size===b){var O=x.segment;throw new Error("Unable to pop() ".concat(x.isLeft?"left":"right"," SweepEvent ")+"[".concat(x.point.x,", ").concat(x.point.y,"] from segment #").concat(O.id," ")+"[".concat(O.leftSE.point.x,", ").concat(O.leftSE.point.y,"] -> ")+"[".concat(O.rightSE.point.x,", ").concat(O.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(f.size>Z)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(w.segments.length>H)throw new Error("Infinite loop when passing sweep line over endpoints "+"(too many sweep line segments). Please file a bug report.");var T=w.process(x);for(var E=0,C=T.length;E<C;E++){var P=T[E];if(P.consumedBy===undefined)f.insert(P)}b=f.size;S=f.pop()}R.reset();var k=F.factory(w.segments);var A=new q(k);return A.getGeom()}}]);return t}()),V,Y,Q,J,X;return{union:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("union",e,n)},intersection:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("intersection",e,n)},xor:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("xor",e,n)},difference:function t(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return W.run("difference",e,n)}}}()});function Du(t,e,o){void 0===o&&(o={});var n,t=Mu(t),e=Mu(e),e=ju.intersection(t.coordinates,e.coordinates);return 0===e.length?null:1===e.length?function(t,e,o){void 0===o&&(o={});for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<i[i.length-1].length;s++)if(i[i.length-1][s]!==i[0][s])throw new Error("First and last Position are not equivalent.")}return Nu({type:"Polygon",coordinates:t},e,o)}(e[0],o.properties):(o=o.properties,Nu({type:"MultiPolygon",coordinates:e},o,n=void 0===n?{}:n))}var zu,b=window&&window.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;0<=a;a--)(r=t[a])&&(s=(i<3?r(s):3<i?r(e,o,s):r(e,o))||s);return 3<i&&s&&Object.defineProperty(e,o,s),s},Bu=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Fu=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Uu=["DIV","SPAN","A"],qu=["data-azure-maps-attribution-minzoom","data-azure-maps-attribution-maxzoom","data-azure-maps-attribution-geometry","data-azure-maps-attribution-tileset","data-azure-maps-attribution-order","data-azure-maps-attribution-dynamic"],Gu=Fu(["href"],Bu(qu)),Zu=(Hu.prototype.equals=function(t){return this.stringRepresentation===t.stringRepresentation},Object.defineProperty(Hu.prototype,"stringRepresentation",{get:function(){return[void 0!==this.minZoom?"minzoom="+this.minZoom:"",void 0!==this.maxZoom?"maxzoom="+this.maxZoom:"",void 0!==this.geometry?this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry").value:"",void 0!==this.tilesetId?"tilesetId="+this.tilesetId:"",this.dynamic?"dynamic":""].filter(function(t){return 0<t.length}).join(";")},enumerable:!1,configurable:!0}),Hu.applicable=function(t){return Array.from(t.attributes).map(function(t){return qu.includes(t.name)}).reduce(function(t,e){return t||e},!1)},Object.defineProperty(Hu.prototype,"minZoom",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-minzoom");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Hu.prototype,"maxZoom",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-maxzoom");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Hu.prototype,"geometry",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-geometry");if(t&&t.value)try{return JSON.parse(t.value)}catch(t){return}},enumerable:!1,configurable:!0}),Object.defineProperty(Hu.prototype,"tilesetId",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-tileset");return t&&t.value?t.value:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Hu.prototype,"order",{get:function(){var t=this.element.attributes.getNamedItem("data-azure-maps-attribution-order");return t&&!isNaN(t.value)?parseInt(t.value):void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Hu.prototype,"dynamic",{get:function(){return null!==this.element.attributes.getNamedItem("data-azure-maps-attribution-dynamic")},enumerable:!1,configurable:!0}),Object.defineProperty(Hu.prototype,"hidesElement",{get:function(){return"none"==this.element.style.display},enumerable:!1,configurable:!0}),Hu.prototype.forceHide=function(){this.element.style.display="none"},Hu.prototype.satisfied=function(t){var e=!this.minZoom||!t.zoom||t.zoom>=this.minZoom,o=!this.maxZoom||!t.zoom||t.zoom<=this.maxZoom,n=!0;return this.geometry&&t.bounds&&(n=null!==Du({type:"Feature",geometry:this.geometry,properties:{}},{type:"Feature",geometry:{type:"Polygon",coordinates:[[Pi.getNorthWest(t.bounds),Pi.getNorthEast(t.bounds),Pi.getSouthEast(t.bounds),Pi.getSouthWest(t.bounds),Pi.getNorthWest(t.bounds)]]},properties:{}})),e&&o&&n},Hu.prototype.apply=function(e,t){var o=this;void 0===t&&(t=null);var n=this.satisfied(e.getCamera()),r=this.dynamic&&this.tilesetId,i=this.hidesElement,t=t&&["dragend","zoomend","pitchend"].includes(t.type);return n||i?n&&(i||r)&&(n&&i&&this.element.style.removeProperty("display"),r&&(t?e.events.addOnce("idle",function(t){return o.fetchAndApplyDynamicAttribution(e)}):this.fetchAndApplyDynamicAttribution(e))):this.element.style.display="none",n===i},Hu.prototype.fetchAndApplyDynamicAttribution=function(n){var e,o,t,r=this,i=n.getCamera();this.lastFetchState&&Pi.containsBoundingBox(this.lastFetchState.bounds,i.bounds)&&Math.floor(this.lastFetchState.zoom)==Math.floor(i.zoom)||(e=Qr(i.center,Pi.getSouthWest(i.bounds),Hu.viewportBufferExpansionRatio),t=((o=Qr(i.center,Pi.getNorthEast(i.bounds),Hu.viewportBufferExpansionRatio))[0]<e[0]?[[e[0],e[1],180,o[1]],[-180,e[1],o[0],o[1]]]:[[e[0],e[1],o[0],o[1]]]).map(function(t){var e=new URLSearchParams({"api-version":"2.1",tilesetId:r.tilesetId,zoom:void 0!==i.zoom?""+Math.floor(i.zoom):void 0,bounds:t.join(",")}),o="https://{{azMapsDomain}}/map/attribution",t={url:o,headers:{}};n._substituteDomainLanguageViewAndSignInRequest(o,t);e=t.url+(t.url.includes("?")?"&":"?")+e.toString();return n._sendRequest(e,"Attribution",t.headers).then(function(t){return t.json()})}),Promise.all(t).then(function(t){r.applyAttributionResponse(t),r.lastFetchState={bounds:new Pi([e[0],e[1],o[0],o[1]]),zoom:i.zoom}}).catch(function(t){return console.error(t)}))},Hu.prototype.applyAttributionResponse=function(t){var e,o,n=this,r=t.map(function(t){return t.copyrights||[]}).reduce(function(t,e){return Fu(Fu([],Bu(t)),Bu(e))},[]);0!=r.length&&(null!==(t=hl.parseWithFilter(r.join(""),function(t){return!0},function(t){return t},function(){return n.element.innerHTML="",n.element}))?(t="string"==typeof t?((r=document.createElement("span")).innerHTML=t,r):t,o=t===this.element?(e=document.createElement("span"),Array.from(this.element.childNodes).forEach(function(t){return e.appendChild(t)}),e):t,Array.from(this.element.attributes).filter(function(t){return qu.includes(t.name)}).forEach(function(t){return o.attributes.setNamedItem(t.cloneNode())}),o.style.display=this.element.style.display,t=this.element.parentElement,this.element.remove(),t.append(o),this.element=o,this.attributionChangeCallback(this)):console.warn("Dynamic attribution is empty after filtering"))},Hu.viewportBufferExpansionRatio=2,b([(zu=1e3,function(t,e,o){var n=o.value,r=new Map;return o.value=function(){var t=this,e=arguments;r.get(t)||!1||(n.apply(t,e),r.set(t,!0),setTimeout(function(){return r.delete(t)},zu))},o})],Hu.prototype,"fetchAndApplyDynamicAttribution",null),Hu);function Hu(t,e){var o=this;this.lastFetchState={bounds:null,zoom:null},this.getElement=function(){return o.element},this.element=t,this.attributionChangeCallback=e}var Ku=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Wu=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Vu=[/all rights reserved/gi],Yu=(Qu.prototype.addToMap=function(){this.map.events.add("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.add("dragend",this.applyRules),this.map.events.add("zoomend",this.applyRules),this.map.events.add("pitchend",this.applyRules)},Qu.prototype.removeFromMap=function(){this.map.events.remove("stylechanged",this.loadAttributionOnceSourcesLoaded),this.map.events.remove("dragend",this.applyRules),this.map.events.remove("zoomend",this.applyRules),this.map.events.remove("pitchend",this.applyRules)},Qu.prototype.getDefaultAttribution=function(){return this.copyrightControl.getDefaultAttributions().map(function(t){return e=t,(t=document.createElement("a")).textContent=e,t;var e})},Qu);function Qu(t,e,o){var n,a=this;this.rules=[],this.virtualContext=((n=document.createElement("span")).className="azure-map-copyright-context",n),this.renderContext=this.virtualContext.cloneNode(!1),this.addAttributionFromSource=function(t){},this.removeAttributionFromSource=function(t){},this.getMapStyleVisibleSources=function(){var e=a.map._getMap(),o=e.getStyle();return Object.entries(o.sources).filter(function(t){var e=Ku(t,1)[0];return o.layers.filter(function(t){return t&&t.source==e}).reduce(function(t,e){return!(e.layout&&"none"===e.layout.visibility||e.paint&&0===e.paint["icon-opacity"]&&0===e.paint["text-opacity"])||t},!1)}).map(function(t){t=Ku(t,1)[0];return e.getSource(t)})},this.loadAttributionOnceSourcesLoaded=function(){var t=a.getMapStyleVisibleSources();Promise.all(t.map(function(r){return new Promise(function(o,n){"tiles"in r?o(r):(r.load(),r.on("data",function t(e){"metadata"==e.sourceDataType&&(r.off("data",t),o(r))}),r.on("error",function t(e){r.off("error",t),n(e)}))}).then(function(t){return{status:"fulfilled",value:t}}).catch(function(t){return{status:"rejected",reason:t}})})).then(function(t){a.reloadAttribution()})},this.reloadAttribution=function(){var t=a.getMapStyleVisibleSources(),n=new Set,r={},e=Object.values(t).filter(function(t){return"attribution"in t&&t.attribution&&"tiles"in t&&0<t.tiles.length}).map(function(t){return t}).map(function(t){t=t.attribution;return hl.parseWithFilter(t,function(t){return Uu.includes(t.tagName)&&Array.from(t.attributes).map(function(t){return Gu.includes(t.name)}).reduce(function(t,e){return t&&e},!0)},function(t){var e,o=null;return t instanceof HTMLElement&&Zu.applicable(t)&&(o=new Zu(t,function(){return a.renderAttribution()}),n.add(o),void 0!==o.order&&(t.style.order=""+o.order)),o&&t instanceof HTMLElement&&((!((e=o.stringRepresentation)in r)||void 0!==o.order&&void 0!==r[e].order&&o.order<r[e].order||void 0!==o.order&&void 0===r[e].order)&&(r[e]=o)),t},function(){return document.createElement("span")})}),o=new Set(Object.values(r)),t=new Set(Wu([],Ku(n)).filter(function(t){return!o.has(t)})),i=new Set(Wu([],Ku(t)).map(function(t){return t.getElement()}));Wu([],Ku(i)).filter(function(t){return null!==t.parentElement}).forEach(function(t){return t.parentElement.removeChild(t)}),a.rules=Object.values(r);var e=e.filter(function(t){return"string"==typeof t||!i.has(t)}).map(function(t){return"string"==typeof t?new Text(t):t}),s=document.createElement("span");0<e.length?e.forEach(function(t){return s.appendChild(t)}):a.getDefaultAttribution().forEach(function(t){return s.appendChild(t)}),a.virtualContext=s,a.copyrightControl.setOptions({copyrightContent:a.renderContext}),a.applyRules(),a.renderAttribution()},this.applyRules=function(o){void 0===o&&(o=null),a.rules.reduce(function(t,e){e=e.apply(a.map,o);return t||e},!1)&&a.renderAttribution()},this.renderAttribution=function(){var e=function(t){return Array.from("none"!=t.style.display?t.children:[]).map(function(t){return e(t)}).reduce(function(t,e){return Wu(Wu([],Ku(t)),Ku(e))},Array.from("none"!=t.style.display?t.childNodes:[]).filter(function(t){return t.nodeType==t.TEXT_NODE}))},t=a.virtualContext.cloneNode(!0),o=e(t);o.forEach(function(t){return t.textContent=Wu([],Ku(Vu)).reduce(function(t,e){return t.replace(e,"").trim()},t.textContent)}),o.reduce(function(t,e){return t.has(e.textContent)?(e.textContent="",e.parentElement&&e.parentElement.removeChild(e)):t.add(e.textContent),t},new Set),a.renderContext.innerHTML="",Array.from(t.childNodes).forEach(function(t){return a.renderContext.appendChild(t)})},this.map=t,this.copyrightControl=e,this.options=o}var Ju=Rt(function(t){var e=(e=function(t){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},e.prototype._singletonInstance)return e.prototype._singletonInstance;if((e.prototype._singletonInstance=this).instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,t.displayCall&&"function"!=typeof t.displayCall)throw new Error("displayCall is not a function");if(!t.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(t),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(t){}}),e.prototype.login=function(){var t,e;this._loginInProgress?this.info("Login in progress"):(this._loginInProgress=!0,t=this._guid(),this.config.state=t,this._idTokenNonce=this._guid(),(e=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST))&&""!==e?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):e=window.location.href,this.verbose("Expected state: "+t+" startPage:"+e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,t,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),e=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce),this.config.displayCall?this.config.displayCall(e):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(t),this.registerCallback(t,this.config.clientId,this.callback),this._loginPopup(e)):this.promptUser(e))},e.prototype._openPopup=function(t,e,o,n){try{var r=window.screenLeft||window.screenX,i=window.screenTop||window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,l=s/2-o/2+r,c=a/2-n/2+i,u=window.open(t,e,"width="+o+", height="+n+", top="+c+", left="+l);return u.focus&&u.focus(),u}catch(t){return this.warn("Error opening popup, "+t.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},e.prototype._handlePopupError=function(t,e,o,n,r){this.warn(n),this._saveItem(this.CONSTANTS.STORAGE.ERROR,o),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,n),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,r),e&&this._activeRenewals[e]&&(this._activeRenewals[e]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,t&&t(n,null,o)},e.prototype._loginPopup=function(t,n,e){var r,i,s,a=this._openPopup(t,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),l=e||this.callback;null!=a?(this._openedWindows.push(a),r=-1!=this.config.redirectUri.indexOf("#")?this.config.redirectUri.split("#")[0]:this.config.redirectUri,i=this,s=window.setInterval(function(){if(!a||a.closed||void 0===a.closed){var t="Popup Window closed",e="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return i.isAngular&&i._broadcast("adal:popUpClosed",e+i.CONSTANTS.RESOURCE_DELIMETER+t),i._handlePopupError(l,n,t,e,e),void window.clearInterval(s)}try{var o=a.location;if(-1!=encodeURI(o.href).indexOf(encodeURI(r)))return i.isAngular?i._broadcast("adal:popUpHashChanged",o.hash):i.handleWindowCallback(o.hash),window.clearInterval(s),i._loginInProgress=!1,i._acquireTokenInProgress=!1,i.info("Closing popup window"),i._openedWindows=[],void a.close()}catch(t){}},1)):this._handlePopupError(l,n,"Error opening popup",e="Popup Window is null. This can happen if you are using IE",e)},e.prototype._broadcast=function(t,e){function o(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var o=document.createEvent("CustomEvent");return o.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),o}"function"!=typeof window.CustomEvent&&(o.prototype=window.Event.prototype,window.CustomEvent=o);e=new CustomEvent(t,{detail:e});window.dispatchEvent(e)},e.prototype.loginInProgress=function(){return this._loginInProgress},e.prototype._hasResource=function(t){var e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return e&&!this._isEmpty(e)&&-1<e.indexOf(t+this.CONSTANTS.RESOURCE_DELIMETER)},e.prototype.getCachedToken=function(t){if(!this._hasResource(t))return null;var e=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t),o=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t),n=this.config.expireOffsetSeconds||300;return o&&o>this._now()+n?e:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,0),null)},e.prototype.getCachedUser=function(){if(this._user)return this._user;var t=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(t),this._user},e.prototype.registerCallback=function(i,s,t){this._activeRenewals[s]=i,this._callBacksMappedToRenewStates[i]||(this._callBacksMappedToRenewStates[i]=[]);var a=this;this._callBacksMappedToRenewStates[i].push(t),this._callBackMappedToRenewStates[i]||(this._callBackMappedToRenewStates[i]=function(t,e,o,n){a._activeRenewals[s]=null;for(var r=0;r<a._callBacksMappedToRenewStates[i].length;++r)try{a._callBacksMappedToRenewStates[i][r](t,e,o,n)}catch(o){a.warn(o)}a._callBacksMappedToRenewStates[i]=null,a._callBackMappedToRenewStates[i]=null})},e.prototype._renewToken=function(t,e,o){this.info("renewToken is called for resource:"+t);var n=this._addAdalFrame("adalRenewFrame"+t),r=this._guid()+"|"+t;this.config.state=r,this._renewStates.push(r),this.verbose("Renew token Expected state: "+r);var i=this._urlRemoveQueryStringParameter(this._getNavigateUrl(o=o||"token",t),"prompt");o===this.RESPONSE_TYPE.ID_TOKEN_TOKEN&&(this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),i+="&nonce="+encodeURIComponent(this._idTokenNonce)),i=this._addHintParameters(i+="&prompt=none"),this.registerCallback(r,t,e),this.verbosePii("Navigate to:"+i),n.src="about:blank",this._loadFrameTimeout(i,"adalRenewFrame"+t,t)},e.prototype._renewIdToken=function(t,e){this.info("renewIdToken is called");var o=this._addAdalFrame("adalIdTokenFrame"),n=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=n,this._renewStates.push(n),this.verbose("Renew Idtoken Expected state: "+n);var r=null==e?null:this.config.clientId,e=e||"id_token",r=this._urlRemoveQueryStringParameter(this._getNavigateUrl(e,r),"prompt"),r=this._addHintParameters(r+="&prompt=none");r+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(n,this.config.clientId,t),this.verbosePii("Navigate to:"+r),o.src="about:blank",this._loadFrameTimeout(r,"adalIdTokenFrame",this.config.clientId)},e.prototype._urlContainsQueryStringParameter=function(t,e){return new RegExp("[\\?&]"+t+"=").test(e)},e.prototype._urlRemoveQueryStringParameter=function(t,e){var o=new RegExp("(\\&"+e+"=)[^&]+");return t=t.replace(o,""),o=new RegExp("("+e+"=)[^&]+&"),t=t.replace(o,""),o=new RegExp("("+e+"=)[^&]+"),t=t.replace(o,"")},e.prototype._loadFrameTimeout=function(t,e,o){this.verbose("Set loading state to pending for: "+o),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+o,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(t,e);var n=this;setTimeout(function(){var t;n._getItem(n.CONSTANTS.STORAGE.RENEW_STATUS+o)===n.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS&&(n.verbose("Loading frame has timed out after: "+n.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+o),(t=n._activeRenewals[o])&&n._callBackMappedToRenewStates[t]&&n._callBackMappedToRenewStates[t]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),n._saveItem(n.CONSTANTS.STORAGE.RENEW_STATUS+o,n.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED))},n.CONSTANTS.LOADFRAME_TIMEOUT)},e.prototype._loadFrame=function(e,t){var o=this;o.info("LoadFrame: "+t);var n=t;setTimeout(function(){var t=o._addAdalFrame(n);""!==t.src&&"about:blank"!==t.src||(t.src=e,o._loadFrame(e,n))},500)},e.prototype.acquireToken=function(t,e){if(this._isEmpty(t))return this.warn("resource is required"),void e("resource is required",null,"resource is required");var o=this.getCachedToken(t);return o?(this.info("Token is already in cache for resource:"+t),void e(null,o,null)):this._user||this.config.extraQueryParameter&&-1!==this.config.extraQueryParameter.indexOf("login_hint")?void(this._activeRenewals[t]?this.registerCallback(this._activeRenewals[t],t,e):(this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,t===this.config.clientId?this._user?(this.verbose("renewing idtoken"),this._renewIdToken(e)):(this.verbose("renewing idtoken and access_token"),this._renewIdToken(e,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)):this._user?(this.verbose("renewing access_token"),this._renewToken(t,e)):(this.verbose("renewing idtoken and access_token"),this._renewToken(t,e,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)))):(this.warn("User login is required"),void e("User login is required",null,"login required"))},e.prototype.acquireTokenPopup=function(t,e,o,n){if(this._isEmpty(t))return this.warn("resource is required"),void n("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+t;this.config.state=r,this._renewStates.push(r),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+r);var i=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",t),"prompt");if(i+="&prompt=select_account",e&&(i+=e),o&&-1===i.indexOf("&claims"))i+="&claims="+encodeURIComponent(o);else if(o&&-1!==i.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");i=this._addHintParameters(i),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+t),this.registerCallback(r,t,n),this._loginPopup(i,t,n)},e.prototype.acquireTokenRedirect=function(t,e,o){if(this._isEmpty(t))return this.warn("resource is required"),void n("resource is required",null,"resource is required");var n=this.callback;if(!this._user)return this.warn("User login is required"),void n("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void n("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var r=this._guid()+"|"+t;this.config.state=r,this.verbose("Renew token Expected state: "+r);n=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",t),"prompt");if(n+="&prompt=select_account",e&&(n+=e),o&&-1===n.indexOf("&claims"))n+="&claims="+encodeURIComponent(o);else if(o&&-1!==n.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");n=this._addHintParameters(n),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,window.location.href),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,r,!0),this.promptUser(n)},e.prototype.promptUser=function(t){t?(this.infoPii("Navigate to:"+t),window.location.replace(t)):this.info("Navigate url is empty")},e.prototype.clearCache=function(){this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._renewStates=[],this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"");var t=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);if(!this._isEmpty(t))for(var t=t.split(this.CONSTANTS.RESOURCE_DELIMETER),e=0;e<t.length&&""!==t[e];e++)this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t[e],""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t[e],0);this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,"")},e.prototype.clearCacheForResource=function(t){this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._hasResource(t)&&(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,0))},e.prototype.logOut=function(){var t,e;this.clearCache(),this._user=null,e=this.config.logOutUri||(t="common",e="",this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(e="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),this.instance+t+"/oauth2/logout?"+e),this.infoPii("Logout navigate to: "+e),this.promptUser(e)},e.prototype._isEmpty=function(t){return void 0===t||!t||0===t.length},e.prototype.getUser=function(t){if("function"!=typeof t)throw new Error("callback is not a function");var e;this._user?t(null,this._user):(e=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN),this._isEmpty(e)?(this.warn("User information is not available"),t("User information is not available",null)):(this.info("User exists in cache: "),this._user=this._createUser(e),t(null,this._user)))},e.prototype._addHintParameters=function(t){var e;return this._user&&this._user.profile&&(this._user.profile.sid&&-1!==t.indexOf("&prompt=none")?this._urlContainsQueryStringParameter("sid",t)||(t+="&sid="+encodeURIComponent(this._user.profile.sid)):this._user.profile.upn&&(this._urlContainsQueryStringParameter("login_hint",t)||(t+="&login_hint="+encodeURIComponent(this._user.profile.upn)),!this._urlContainsQueryStringParameter("domain_hint",t)&&-1<this._user.profile.upn.indexOf("@")&&(e=this._user.profile.upn.split("@"),t+="&domain_hint="+encodeURIComponent(e[e.length-1])))),t},e.prototype._createUser=function(t){var e=null,t=this._extractIdToken(t);return t&&t.hasOwnProperty("aud")&&(t.aud.toLowerCase()===this.config.clientId.toLowerCase()?(e={userName:"",profile:t},t.hasOwnProperty("upn")?e.userName=t.upn:t.hasOwnProperty("email")&&(e.userName=t.email)):this.warn("IdToken has invalid aud field")),e},e.prototype._getHash=function(t){return-1<t.indexOf("#/")?t=t.substring(t.indexOf("#/")+2):-1<t.indexOf("#")&&(t=t.substring(1)),t},e.prototype.isCallback=function(t){t=this._getHash(t);t=this._deserialize(t);return t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},e.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},e.prototype.getRequestInfo=function(t){t=this._getHash(t);var e=this._deserialize(t),o={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(e&&((o.parameters=e).hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||e.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||e.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){o.valid=!0;t="";if(!e.hasOwnProperty("state"))return this.warn("No state returned"),o;if(this.verbose("State: "+e.state),t=e.state,o.stateResponse=t,this._matchState(o))return o;if(!o.stateMatch&&window.parent){o.requestType=this._requestType;for(var n=this._renewStates,r=0;r<n.length;r++)if(n[r]===o.stateResponse){o.stateMatch=!0;break}}}return o},e.prototype._matchNonce=function(t){if(e=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN))for(var e=e.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<e.length;o++)if(e[o]&&e[o]===t.profile.nonce)return!0;return!1},e.prototype._matchState=function(t){if(e=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN))for(var e=e.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<e.length;o++)if(e[o]&&e[o]===t.stateResponse)return t.requestType=this.REQUEST_TYPE.LOGIN,t.stateMatch=!0;if(n=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW))for(var n=n.split(this.CONSTANTS.CACHE_DELIMETER),o=0;o<n.length;o++)if(n[o]&&n[o]===t.stateResponse)return t.requestType=this.REQUEST_TYPE.RENEW_TOKEN,t.stateMatch=!0;return!1},e.prototype._getResourceFromState=function(t){if(t){var e=t.indexOf("|");if(-1<e&&e+1<t.length)return t.substring(e+1)}return""},e.prototype.saveTokenFromHash=function(t){this.info("State status:"+t.stateMatch+"; Request type:"+t.requestType),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var e,o=this._getResourceFromState(t.stateResponse);t.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)?(this.infoPii("Error :"+t.parameters.error+"; Error description:"+t.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),this._saveItem(this.CONSTANTS.STORAGE.ERROR,t.parameters.error),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,t.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),t.requestType===this.REQUEST_TYPE.LOGIN&&(this._loginInProgress=!1,this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,t.parameters.error_description))):t.stateMatch?(this.info("State is right"),t.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)&&this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,t.parameters[this.CONSTANTS.SESSION_STATE]),t.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(o)||(e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,e+o+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+o,t.parameters[this.CONSTANTS.ACCESS_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+o,this._expiresIn(t.parameters[this.CONSTANTS.EXPIRES_IN]))),t.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)&&(this.info("Fragment has id token"),this._loginInProgress=!1,this._user=this._createUser(t.parameters[this.CONSTANTS.ID_TOKEN]),this._user&&this._user.profile?this._matchNonce(this._user)?(this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,t.parameters[this.CONSTANTS.ID_TOKEN]),o=this.config.loginResource||this.config.clientId,this._hasResource(o)||(e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,e+o+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+o,t.parameters[this.CONSTANTS.ID_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+o,this._user.profile.exp)):(this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"Nonce received: "+this._user.profile.nonce+" is not same as requested: "+this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN)),this._user=null):(t.parameters.error="invalid id_token",t.parameters.error_description="Invalid id_token. id_token: "+t.parameters[this.CONSTANTS.ID_TOKEN],this._saveItem(this.CONSTANTS.STORAGE.ERROR,"invalid id_token"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid id_token. id_token: "+t.parameters[this.CONSTANTS.ID_TOKEN])))):(t.parameters.error="Invalid_state",t.parameters.error_description="Invalid_state. state: "+t.stateResponse,this._saveItem(this.CONSTANTS.STORAGE.ERROR,"Invalid_state"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid_state. state: "+t.stateResponse)),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+o,this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED)},e.prototype.getResourceForEndpoint=function(t){if(this.config&&this.config.anonymousEndpoints)for(var e=0;e<this.config.anonymousEndpoints.length;e++)if(-1<t.indexOf(this.config.anonymousEndpoints[e]))return null;if(this.config&&this.config.endpoints)for(var o in this.config.endpoints)if(-1<t.indexOf(o))return this.config.endpoints[o];return!(-1<t.indexOf("http://")||-1<t.indexOf("https://"))||this._getHostFromUri(t)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null},e.prototype._getHostFromUri=function(t){return String(t).replace(/^(https?:)\/\//,"").split("/")[0]},e.prototype.handleWindowCallback=function(t){if(null==t&&(t=window.location.hash),this.isCallback(t)){var e=null,o=!1;0<this._openedWindows.length&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(e=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,o=!0):window.parent&&window.parent._adalInstance&&(e=window.parent._adalInstance);var n,r=e.getRequestInfo(t),i=null,s=o||window.parent!==window?e._callBackMappedToRenewStates[r.stateResponse]:e.callback;e.info("Returned from redirect url"),e.saveTokenFromHash(r),r.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?e.verbose("Window is in iframe, acquiring token silently"):e.verbose("acquiring token interactive in progress"),n=r.parameters[e.CONSTANTS.ACCESS_TOKEN]||r.parameters[e.CONSTANTS.ID_TOKEN],i=e.CONSTANTS.ACCESS_TOKEN):r.requestType===this.REQUEST_TYPE.LOGIN&&(n=r.parameters[e.CONSTANTS.ID_TOKEN],i=e.CONSTANTS.ID_TOKEN);t=r.parameters[e.CONSTANTS.ERROR_DESCRIPTION],r=r.parameters[e.CONSTANTS.ERROR];try{s&&s(t,n,r,i)}catch(t){e.error("Error occurred in user defined callback function: "+t)}window.parent!==window||o||(e.config.navigateToLoginRequestUrl?window.location.href=e._getItem(e.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},e.prototype._getNavigateUrl=function(t,e){var o="common";this.config.tenant&&(o=this.config.tenant);e=this.instance+o+"/oauth2/authorize"+this._serialize(t,this.config,e)+this._addLibMetadata();return this.info("Navigate url:"+e),e},e.prototype._extractIdToken=function(t){t=this._decodeJwt(t);if(!t)return null;try{var e=t.JWSPayload,o=this._base64DecodeStringUrlSafe(e);return o?JSON.parse(o):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(t){this.error("The returned id_token could not be decoded",t)}return null},e.prototype._base64DecodeStringUrlSafe=function(t){return t=t.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(t))):decodeURIComponent(escape(this._decode(t)))},e.prototype._decode=function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=(t=String(t).replace(/=+$/,"")).length;if(o%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var n,r,i,s,a,l,c,u="",p=0;p<o;p+=4){if(n=e.indexOf(t.charAt(p)),r=e.indexOf(t.charAt(p+1)),i=e.indexOf(t.charAt(p+2)),s=e.indexOf(t.charAt(p+3)),p+2===o-1){l=(a=n<<18|r<<12|i<<6)>>16&255,c=a>>8&255,u+=String.fromCharCode(l,c);break}if(p+1===o-1){l=(a=n<<18|r<<12)>>16&255,u+=String.fromCharCode(l);break}l=(a=n<<18|r<<12|i<<6|s)>>16&255,c=a>>8&255,u+=String.fromCharCode(l,c,255&a)}return u},e.prototype._decodeJwt=function(t){if(this._isEmpty(t))return null;t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);return!t||t.length<4?(this.warn("The returned id_token is not parseable."),null):{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},e.prototype._convertUrlSafeToRegularBase64EncodedString=function(t){return t.replace("-","+").replace("_","/")},e.prototype._serialize=function(t,e,o){var n=[];return null!==e&&(n.push("?response_type="+t),n.push("client_id="+encodeURIComponent(e.clientId)),o&&n.push("resource="+encodeURIComponent(o)),n.push("redirect_uri="+encodeURIComponent(e.redirectUri)),n.push("state="+encodeURIComponent(e.state)),e.hasOwnProperty("slice")&&n.push("slice="+encodeURIComponent(e.slice)),e.hasOwnProperty("extraQueryParameter")&&n.push(e.extraQueryParameter),e=e.correlationId||this._guid(),n.push("client-request-id="+encodeURIComponent(e))),n.join("&")},e.prototype._deserialize=function(t){for(var e=/\+/g,o=/([^&=]+)=([^&]*)/g,n=function(t){return decodeURIComponent(t.replace(e," "))},r={},i=o.exec(t);i;)r[n(i[1])]=n(i[2]),i=o.exec(t);return r},e.prototype._decimalToHex=function(t){for(var e=t.toString(16);e.length<2;)e="0"+e;return e},e.prototype._guid=function(){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues){var e=new Uint8Array(16);return t.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,this._decimalToHex(e[0])+this._decimalToHex(e[1])+this._decimalToHex(e[2])+this._decimalToHex(e[3])+"-"+this._decimalToHex(e[4])+this._decimalToHex(e[5])+"-"+this._decimalToHex(e[6])+this._decimalToHex(e[7])+"-"+this._decimalToHex(e[8])+this._decimalToHex(e[9])+"-"+this._decimalToHex(e[10])+this._decimalToHex(e[11])+this._decimalToHex(e[12])+this._decimalToHex(e[13])+this._decimalToHex(e[14])+this._decimalToHex(e[15])}for(var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",r=0,i="",s=0;s<36;s++)"-"!==o[s]&&"4"!==o[s]&&(r=16*Math.random()|0),"x"===o[s]?i+=n[r]:"y"===o[s]?(r&=3,i+=n[r|=8]):i+=o[s];return i},e.prototype._expiresIn=function(t){return t=t||3599,this._now()+parseInt(t,10)},e.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},e.prototype._addAdalFrame=function(t){if(void 0!==t){this.info("Add adal frame to document:"+t);var e,o=document.getElementById(t);return o||(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))?((e=document.createElement("iframe")).setAttribute("id",t),e.setAttribute("aria-hidden","true"),e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height=e.borderWidth="0px",o=document.getElementsByTagName("body")[0].appendChild(e)):document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+t+'" id="'+t+'" style="display:none"></iframe>'),window.frames&&window.frames[t]&&(o=window.frames[t])),o}},e.prototype._saveItem=function(t,e,o){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?(o?(o=this._getItem(t)||"",localStorage.setItem(t,o+e+this.CONSTANTS.CACHE_DELIMETER)):localStorage.setItem(t,e),!0):(this.info("Local storage is not supported"),!1):this._supportsSessionStorage()?(sessionStorage.setItem(t,e),!0):(this.info("Session storage is not supported"),!1)},e.prototype._getItem=function(t){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(t):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(t):(this.info("Session storage is not supported"),null)},e.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest"))):!1}catch(t){return!1}},e.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest"))):!1}catch(t){return!1}},e.prototype._cloneConfig=function(t){if(null===t||"object"!=typeof t)return t;var e,o={};for(e in t)t.hasOwnProperty(e)&&(o[e]=t[e]);return o},e.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},e.prototype.log=function(t,e,o,n){var r;t<=Logging.level&&(!Logging.piiLoggingEnabled&&n||(r=(new Date).toUTCString(),n="",n=this.config.correlationId?r+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[t]+" "+e:r+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[t]+" "+e,o&&(n+="\nstack:\n"+o.stack),Logging.log(n)))},e.prototype.error=function(t,e){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,t,e)},e.prototype.warn=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,t,null)},e.prototype.info=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,t,null)},e.prototype.verbose=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,t,null)},e.prototype.errorPii=function(t,e){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,t,e,!0)},e.prototype.warnPii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,t,null,!0)},e.prototype.infoPii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,t,null,!0)},e.prototype.verbosePii=function(t){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,t,null,!0)},e.prototype._libVersion=function(){return"1.0.18"},t.exports&&(t.exports=e,t.exports.inject=function(t){return new e(t)}),e)});Ju.inject;function Xu(t){this.message=t}(Xu.prototype=new Error).name="InvalidCharacterError";var $u="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Xu("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,n,r=0,i=0,s="";n=e.charAt(i++);~n&&(o=r%4?64*o+n:n,r++%4)&&(s+=String.fromCharCode(255&o>>(-2*r&6))))n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return s};function tp(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent($u(e).replace(/(.)/g,function(t,e){e=e.charCodeAt(0).toString(16).toUpperCase();return"%"+(e=e.length<2?"0"+e:e)}))}catch(t){return $u(e)}}function ep(t){this.message=t}(ep.prototype=new Error).name="InvalidTokenError";function op(t,e){if("string"!=typeof t)throw new ep("Invalid token specified");e=!0===(e=e||{}).header?0:1;try{return JSON.parse(tp(t.split(".")[e]))}catch(t){throw new ep("Invalid token specified: "+t.message)}}op.InvalidTokenError=ep;var np=(rp.prototype.initialize=function(){var n=this;return this.initPromise||(this.initPromise=new Promise(function(t,e){if(n.options.authType===u.AuthenticationType.subscriptionKey)t();else if(n.options.authType===u.AuthenticationType.aad)n.options.authContext=n.options.authContext||rp.getDefaultAuthContext(n.options),n.options.authContext.handleWindowCallback(),n.options.authContext.getLoginError()?e(new Error("Error logging in the AAD users: "+n.options.authContext.getLoginError())):n.options.authContext.isCallback(window.location.hash)?n.map.dispose():setTimeout(function(){return n._loginAndAcquire(t,e)});else if(n.options.authType===u.AuthenticationType.anonymous)t(n._triggerTokenFetch(!0));else if(n.options.authType===u.AuthenticationType.sas){if(n.options.sasToken){var o=-1;try{o=n._getTokenExpiry(n.options.sasToken)}catch(t){return void e(new Error("An invalid sasToken was provided."))}if(o>rp.constants.tokenRefreshClockSkew)return n._storeToken(n.options.sasToken),n._setTimeoutTokenFetch(o-rp.constants.tokenRefreshClockSkew),void t()}t(n._triggerTokenFetch())}else e(new Error("An invalid authentication type was specified."))})),this.initPromise},rp.prototype.dispose=function(){this.tokenTimeOutHandle&&(clearTimeout(this.tokenTimeOutHandle),this.tokenTimeOutHandle=null)},rp.getDefaultAuthContext=function(t){if(!t.aadAppId)throw new Error("No AAD app ID was specified.");if(!t.aadTenant)throw new Error("No AAD tenant was specified.");return this.defaultAuthContext||(this.defaultAuthContext=new Ju({instance:t.aadInstance||i,tenant:t.aadTenant,clientId:t.aadAppId,cacheLocation:this.constants.preferredCacheLocation})),this.defaultAuthContext},rp.prototype._loginAndAcquire=function(e,o){function t(){r.options.authContext.acquireToken(E,function(t){t?o(new Error(t)):(t={map:r.map,type:rp.constants.events.tokenAcquired},r.map.events.invoke(rp.constants.events.tokenAcquired,t),e())})}var n,r=this,i=this.options.authContext.getCachedToken(this.options.aadAppId),s=this.options.authContext.getCachedUser();i&&s?t():(this.options.authContext.loginInProgress()||this.options.authContext.login(),n=setInterval(function(){r.options.authContext.loginInProgress()||(clearInterval(n),r.options.authContext.getCachedToken(r.options.aadAppId)?t():o(new Error(r.options.authContext.getLoginError()||"The AAD authentication context is not logged-in for the specified app ID: "+r.options.aadAppId)))},25))},rp.prototype.getAuthType=function(){return this.options.authType},rp.prototype.getClientId=function(){return this.options.clientId},rp.prototype.getToken=function(){var o=this;if(this.options.authType===u.AuthenticationType.aad){var n=this.options.authContext.getCachedToken(E);return n||(this.options.authContext.getCachedUser()||this.options.authContext.login(),this.options.authContext.acquireToken(E,function(t,e){t||(n=e,e={map:o.map,type:rp.constants.events.tokenAcquired},o.map.events.invoke(rp.constants.events.tokenAcquired,e))})),n}if(this.options.authType===u.AuthenticationType.anonymous||this.options.authType===u.AuthenticationType.sas){var t=this._getItem(rp.constants.storage.tokenKey);if(t){var e=this._getTokenExpiry(t);if(e<300&&0<e)this._triggerTokenFetch();else if(e<=0)throw this._saveItem(rp.constants.storage.tokenKey,""),new Error(rp.constants.errors.tokenExpired)}else this._triggerTokenFetch();return t}if(this.options.authType===u.AuthenticationType.subscriptionKey)return this.options.subscriptionKey},rp.prototype._getTokenExpiry=function(t){var e=op(t).exp,t=this._getCurrentTime();return 0<e-t?e-t:-1},rp.prototype._storeToken=function(t){this._saveItem(rp.constants.storage.tokenKey,t);t={map:this.map,type:rp.constants.events.tokenAcquired};this.map.events.invoke(rp.constants.events.tokenAcquired,t)},rp.prototype._saveItem=function(t,e){return this._supportsLocalStorage()?localStorage.setItem(t,e):this._supportsSessionStorage()?sessionStorage.setItem(t,e):this.fallbackStorage[t]=e,!0},rp.prototype._getItem=function(t){return this._supportsLocalStorage()?localStorage.getItem(t):this._supportsSessionStorage()?sessionStorage.getItem(t):t in this.fallbackStorage?this.fallbackStorage[t]:null},rp.prototype._supportsLocalStorage=function(){try{return window.localStorage?(window.localStorage.setItem(rp.constants.storage.testStorageKey,"A"),"A"===window.localStorage.getItem(rp.constants.storage.testStorageKey)&&(window.localStorage.removeItem(rp.constants.storage.testStorageKey),!window.localStorage.getItem(rp.constants.storage.testStorageKey))):!1}catch(t){return!1}},rp.prototype._supportsSessionStorage=function(){try{return window.sessionStorage?(window.sessionStorage.setItem(rp.constants.storage.testStorageKey,"A"),"A"===window.sessionStorage.getItem(rp.constants.storage.testStorageKey)&&(window.sessionStorage.removeItem(rp.constants.storage.testStorageKey),!window.sessionStorage.getItem(rp.constants.storage.testStorageKey))):!1}catch(t){return!1}},rp.prototype._getCurrentTime=function(){return Math.round((new Date).getTime()/1e3)},rp.prototype.signRequest=function(t){t.headers=t.headers||{},t.headers[C]=this.sessionId,t.headers[O]=T,t.headers[S]="MapControl/2.2.4 (Web)";var e=this.getToken();switch(this.options.authType){case u.AuthenticationType.aad:case u.AuthenticationType.anonymous:t.headers[x]=this.options.clientId,t.headers[s]=a+e;break;case u.AuthenticationType.sas:t.headers[s]=c+e;break;case u.AuthenticationType.subscriptionKey:t.headers["subscription-key"]=e;break;default:throw new Error("An invalid authentication type was specified")}return t},rp.constants={preferredCacheLocation:"localStorage",storage:{tokenKey:"access.token.key",testStorageKey:"testStorage"},events:{tokenAcquired:"tokenacquired"},tokenExpiresIn:3599,tokenRefreshClockSkew:300,errors:{tokenExpired:"Token Expired, Try again"}},rp);function rp(t){var r=this;this.fallbackStorage={},this._triggerTokenFetch=function(t){return void 0===t&&(t=!1),new Promise(function(o,n){"function"==typeof r.options.getToken?r.options.getToken(function(t){try{var e=r._getTokenExpiry(t)-rp.constants.tokenRefreshClockSkew;r._storeToken(t),r._setTimeoutTokenFetch(e),o()}catch(t){n(new Error("Invalid token returned by getToken function"))}},function(t){n(t)},r.map):n(new Error("Token cannot be "+(t?"fetched":"renewed")+" because getToken was not set or is not a function."))})},this._setTimeoutTokenFetch=function(t){clearTimeout(r.tokenTimeOutHandle),r.tokenTimeOutHandle=setTimeout(r._triggerTokenFetch,Math.min(1e3*t,2147483647))};var e=t.getServiceOptions();this.options=e.authOptions,this.sessionId=e.sessionId,this.map=t}var ip=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},sp=(ap.prototype.add=function(t,e){var o,n;if(Array.isArray(t))try{for(var r=ip(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._add(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._add(t,e)},ap.prototype.getControls=function(){return Array.from(this.controls)},ap.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=ip(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._remove(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._remove(t)},ap.prototype._add=function(t,e){this.controls.add(t);var o=(new W).merge(e),t=t.onAdd(this.map,e),e=this.controlContainer.getElementsByClassName(o.position);if(!(0<e.length))throw new Error("Control position "+o.position+" does not exist.");e.item(0).appendChild(t)},ap.prototype._remove=function(t){t.onRemove(),this.controls.delete(t)},ap);function ap(t){for(var e in this.map=t,this.controlContainer=document.createElement("div"),this.controlContainer.classList.add("atlas-control-container"),u.ControlPosition){var o;u.ControlPosition.hasOwnProperty(e)&&((o=document.createElement("div")).classList.add(u.ControlPosition[e]),o.classList.add("subcontrol-container"),this.controlContainer.appendChild(o))}this.map.getMapContainer().appendChild(this.controlContainer),this.controls=new Set}var lp=window&&window.__assign||function(){return(lp=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},cp=(up.prototype.addCallback=function(s,a,l,t,c){var e,u,p=this;if(t)e=function(t){var e=t.lngLat?new mi(t.lngLat.lng,t.lngLat.lat):void 0,o=t.point?[t.point.x,t.point.y]:void 0,n=t.features?t.features.map(function(t){return new rr(t.geometry,t.properties,t.id)}):[],n={type:t.type,originalEvent:t.originalEvent,position:e,coordinate:o,features:n};l(n)};else switch(s){case"data":case"sourcedata":case"styledata":e=function(t){t=lp(lp({dataType:t.dataType},"source"===t.dataType&&lp(lp(lp({isSourceLoaded:t.isSourceLoaded},t.sourceDataType&&{sourceDataType:t.sourceDataType}),{source:p.map.sources.getById(t.sourceId)}),t.tile&&{tile:{id:{x:t.tile.tileID.canonical.x,y:t.tile.tileID.canonical.y,z:t.tile.tileID.canonical.z},size:t.tile.tileSize,state:t.tile.state}})),{map:p.map,type:t.type});c&&p.map.events._removeListener(s,a,l),l(t)};break;case"error":e=function(t){t={error:t.error,map:p.map,type:t.type};c&&p.map.events._removeListener(s,a,l),l(t)};break;case"touchstart":case"touchend":case"touchmove":case"touchcancel":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e=t.point?new lr(t.point.x,t.point.y):void 0,o=t.points?t.points.map(function(t){return new lr(t.x,t.y)}):[],n=t.lngLat?new mi(t.lngLat.lng,t.lngLat.lat):void 0,r=t.lngLats?t.lngLats.map(function(t){return new mi(t.lng,t.lat)}):[],i=n?p.map.layers.getRenderedShapes(new ur(n),a?[a]:void 0):[],i={map:p.map,originalEvent:t.originalEvent,pixel:e,pixels:o,position:n,positions:r,shapes:i,layerId:a||void 0,preventDefault:function(){return t.preventDefault()},type:t.type};c&&p.map.events._removeListener(s,a,l),l(i)};break;case"mousedown":case"mouseup":case"mouseover":case"mousemove":case"click":case"dblclick":case"mouseout":case"mouseenter":case"mouseleave":case"contextmenu":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e=t.lngLat?new mi(t.lngLat.lng,t.lngLat.lat):void 0,o=t.point?new lr(t.point.x,t.point.y):void 0,n=e?p.map.layers.getRenderedShapes(new ur(e),a?[a]:void 0):[],n={map:p.map,originalEvent:t.originalEvent,position:e,pixel:o,preventDefault:function(){return t.preventDefault()},shapes:n,layerId:a||void 0,type:t.type};c&&p.map.events._removeListener(s,a,l),l(n)};break;case"styleimagemissing":e=function(t){c&&p.map.events._removeListener(s,a,l),l(t.id)};break;case"wheel":e=function(t){if(t.originalEvent){if(t.originalEvent===u)return;u=t.originalEvent}var e={map:p.map,originalEvent:t.originalEvent,preventDefault:function(){return t.preventDefault()},type:t.type};c&&p.map.events._removeListener(s,a,l),l(e)};break;case"resize":e=function(t){var e,o={map:p.map,type:t.type};for(e in t)"type"!==e&&"target"!==e&&(o[e]=t[e]);c&&p.map.events._removeListener(s,a,l),l(o)};break;default:e=function(t){var e={map:p.map,type:t.type};t.originalEvent&&(e.originalEvent=t.originalEvent),c&&p.map.events._removeListener(s,a,l),l(e)}}this.callbacks.has(a)||this.callbacks.set(a,new J),this.callbacks.get(a).has(s)||this.callbacks.get(a).set(s,new Map),this.callbacks.get(a).get(s).set(l,[e,c])},up.prototype.removeCallback=function(t,e,o){this.callbacks.has(e)&&this.callbacks.get(e).has(t)&&this.callbacks.get(e).get(t).has(o)&&this.callbacks.get(e).get(t).delete(o)},up.prototype.getModifiedCallback=function(t,e,o){if(this.callbacks.has(e)&&this.callbacks.get(e).has(t)&&this.callbacks.get(e).get(t).has(o))return this.callbacks.get(e).get(t).get(o)[0]},up.prototype.getLayerCallbacks=function(t){if(this.callbacks.has(t))return this.callbacks.get(t)},up.prototype.getEventCallbacks=function(t,e){if(this.callbacks.has(e)){e=this.callbacks.get(e);if(e.has(t))return e.get(t)}},up);function up(t){this.callbacks=new J,this.map=t}var pp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hp=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},dp=["maxzoomchanged","minzoomchanged","mapconfigurationchanged"],fp=(yp.prototype.add=function(t,e,o){var n,r;if("function"==typeof e)this._addGlobalListener(t,e,!1,!1);else{e=Array.isArray(e)?e:[e];try{for(var i=pp(e),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof xs&&xs._isMBoxEvent(t)?this._addLayerListener(t,a,o,!1,!1):a._addEventListener(t,o,!1)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}},yp.prototype.addOnce=function(t,e,o){"function"==typeof e?this._addGlobalListener(t,e,!1,!0):e instanceof xs&&xs._isMBoxEvent(t)?this._addLayerListener(t,e,o,!1,!0):e._addEventListener(t,o,!0)},yp.prototype._addLegacy=function(t,e,o){"function"==typeof e?this._addGlobalListener(t,e,!0,!1):this._addLayerListener(t,e,o,!0,!1)},yp.prototype._addLayerListener=function(t,e,o,n,r){var i,s,a,l,c=e instanceof xs?e.getId():e,e=this.map.layers.getLayerById(c),u=this.mapCallbackHandler.getModifiedCallback(t,c,o);if(u&&e)try{for(var p=pp(e._getLayerIds()),h=p.next();!h.done;h=p.next()){var d=h.value;this.map._getMap().off(t,d,u)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}if(this.mapCallbackHandler.addCallback(t,c,o,n,r),e){u=this.mapCallbackHandler.getModifiedCallback(t,c,o);try{for(var f=pp(e._getLayerIds()),y=f.next();!y.done;y=f.next()){d=y.value;this.map._getMap().on(t,d,u)}}catch(t){a={error:t}}finally{try{y&&!y.done&&(l=f.return)&&l.call(f)}finally{if(a)throw a.error}}}},yp.prototype._addGlobalListener=function(t,e,o,n){var r,i,s,a;dp.includes(t)?this.map._addEventListener(t,e,n):(r=this.mapCallbackHandler.getModifiedCallback(t,"",e),this.mapCallbackHandler.addCallback(t,"",e,o,n),i=this.mapCallbackHandler.getModifiedCallback(t,"",e),"load"===t&&this.map._isLoaded()?(s={type:"load",map:this.map},setTimeout(function(){return i(s)})):"ready"===t?this.map._isReady()&&(a={type:"ready",map:this.map},setTimeout(function(){return i(a)})):(r&&this.map._getMap().off(t,r),this.map._getMap().on(t,i)))},yp.prototype.invoke=function(t,e,o){if(void 0===o)this._invokeListeners(t,"",e);else if(e instanceof xs&&xs._isMBoxEvent(t))this._invokeListeners(t,e.getId(),o);else{if(!(e instanceof X))throw new Error("The invoke target is invalid.");e._invokeEvent(t,o)}},yp.prototype._invokeListeners=function(o,n,r){var i=this,t=new J(this.mapCallbackHandler.getEventCallbacks(o,n));t?t.forEach(function(t,e){t=hp(t,2),t[0];t[1]&&i._removeListener(o,n,e),e(r)}):"error"===o&&console.error("error"in r?r.error:r)},yp.prototype.remove=function(t,e,o){var n,r;if("function"==typeof e)this._removeListener(t,"",e);else{e=Array.isArray(e)?e:[e];try{for(var i=pp(e),s=i.next();!s.done;s=i.next()){var a=s.value;a instanceof xs&&xs._isMBoxEvent(t)?this._removeListener(t,a,o):a._removeEventListener(t,o)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}},yp.prototype._removeLegacy=function(t,e,o){"function"==typeof e?this._removeListener(t,"",e):this._removeListener(t,e,o)},yp.prototype._removeListener=function(t,e,o){var n,r;if(dp.includes(t))this.map._removeEventListener(t,o);else{var i=e instanceof xs?e.getId():e,s=this.mapCallbackHandler.getModifiedCallback(t,i,o);if(s)if(i){e=this.map.layers.getLayerById(i);if(e)try{for(var a=pp(e._getLayerIds()),l=a.next();!l.done;l=a.next()){var c=l.value;this.map._getMap().off(t,c,s)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}else this.map._getMap().off(t,s);this.mapCallbackHandler.removeCallback(t,i,o)}},yp.prototype._enableLayerEvents=function(l){var c=this,t=this.mapCallbackHandler.getLayerCallbacks(l.getId());t&&t.forEach(function(t,a){t.forEach(function(t){var e,o,n=hp(t,1)[0];try{for(var r=pp(l._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;c.map._getMap().on(a,s,n)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},yp.prototype._disableLayerEvents=function(l){var c=this,t=this.mapCallbackHandler.getLayerCallbacks(l.getId());t&&t.forEach(function(t,a){t.forEach(function(t){var e,o,n=hp(t,1)[0];try{for(var r=pp(l._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;c.map._getMap().off(a,s,n)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},yp);function yp(t){this.map=t,this.mapCallbackHandler=new cp(this.map)}var mp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},gp=(vp.prototype.add=function(t,e){var o,n;if(Array.isArray(t))try{for(var r=mp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._addMarker(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._addMarker(t,e)},vp.prototype._addMarker=function(t,e){t._addToMap(this.map,e),this.markers.add(t)},vp.prototype.getMarkers=function(){return Array.from(this.markers)},vp.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=mp(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeMarker(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._removeMarker(t)},vp.prototype._removeMarker=function(e){var o=this;e instanceof Al?(e._removeFromMap(),this.markers.delete(e)):this.markers.forEach(function(t){t._getId()===e&&(t._removeFromMap(),o.markers.delete(t))})},vp.prototype.clear=function(){var e=this;this.markers.forEach(function(t){t._removeFromMap(),e.markers.delete(t)})},vp);function vp(t){this.markers=new Set,this.map=t}var _p=(wp.prototype.add=function(s,e,a){var l=this;return new Promise(function(o,n){var r,t,i;l.userImages.has(s)?o():e instanceof HTMLImageElement||e instanceof ImageData?(l.map._getMap().addImage(s,e,a),l.userImages.set(s,{image:e,meta:a}),o()):"string"==typeof e&&(t=void 0,t=/<svg/i.test(e)&&!/^data:/i.test(e)?"data:image/svg+xml;base64,"+window.btoa(e):e,i=!1,l.map._sendRequest(t,"Image").then(function(t){return i?void 0:t.blob()}).then(function(t){var e;!i&&t&&(clearTimeout(r),(e=new Image).onload=function(){l.map._getMap().addImage(s,e,a),l.userImages.set(s,{image:e,meta:a}),o()},e.onerror=e.onabort=function(){n("Failed to load image into HTML element.")},e.src=URL.createObjectURL(t))}).catch(function(){i||(clearTimeout(r),n("Failed to load image into HTML element."))}),r=setTimeout(function(){i=!0,n("Failed to load image within specified timeout: "+l.imageLoadTimeout+" ms.")},l.imageLoadTimeout))})},wp.prototype.clear=function(){var o=this;this.userImages.forEach(function(t,e){o.map._getMap().removeImage(e)}),this.userImages.clear()},wp.prototype.getImageIds=function(){var o=[];return this.userImages.forEach(function(t,e){o.push(e)}),o},wp.prototype.createFromTemplate=function(t,e,o,n,r){o=o||"#1A73AA",n=n||"#fff";r=(r=Lc(e,r)).replace(/{color}/g,o).replace(/{secondaryColor}/g,n).replace(/{text}/g,"");return this.add(t,r)},wp.prototype.hasImage=function(t){return this.userImages.has(t)},wp.prototype.remove=function(t){this.map._getMap().removeImage(t),this.userImages.delete(t)},wp.prototype._restoreImages=function(){var o=this;this.userImages.forEach(function(t,e){o.map._getMap().hasImage(e)||o.map._getMap().addImage(e,t.image,t.meta)})},wp);function wp(t){this.userImages=new J,this.imageLoadTimeout=5e3,this.map=t}var bp,Sp,b=window&&window.__extends||(bp=function(t,e){return(bp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}bp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),xp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Op=(b(Tp,Sp=xs),Tp.prototype._buildLayers=function(){return this.layers},Tp.prototype._getLayerIds=function(){return this.layers.map(function(t){return t.id})},Tp.prototype._getSourceIds=function(){var e,t,o=new Set;try{for(var n=xp(this.layers),r=n.next();!r.done;r=n.next()){var i=r.value;"string"==typeof i.source?o.add(i.source):i.source&&o.add(i.id)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o},Tp.prototype._updateLayoutProperty=function(e,o,n,r){var i=this;this.layers.forEach(function(t){er(o,n)||i.map._getMap().setLayoutProperty(t.id,e,r||o)})},Tp);function Tp(t,e){e=Sp.call(this,e)||this;return e.layers=t,e}var Ep=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Cp=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Pp=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},kp=(Ap.prototype.add=function(t,e){var o,n,r=e instanceof xs?e.getId():e;if(Array.isArray(t))try{for(var i=Ep(t),s=i.next();!s.done;s=i.next()){var a=s.value;this._addLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}else this._addLayer(t,r)},Ap.prototype._addLayer=function(e,o){if(!(this.map._isReady()||e instanceof Op))throw new Error("The layer '"+e.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a layer to it.");var t,n,r,i;o!==e.getId()&&this.layerIndex.find(function(t){return o===t.getId()})?this._getMapboxLayerExists(e)?(n=this.layerIndex.findIndex(function(t){return t.getId()===e.getId()}),r=this.userLayers.findIndex(function(t){return t.layer.getId()===e.getId()}),i=this.layerIndex[n],this._removeMapboxLayers(e),this._addMapboxLayers(e,o),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(e),this.layerIndex.splice(n,1),t=this.layerIndex.findIndex(function(t){return t.getId()===o}),this.layerIndex.splice(t,0,e),e instanceof Op||(this.userLayers[r]={layer:e,before:o}),i.onRemove()):(this._addMapboxLayers(e,o),this.map.events._enableLayerEvents(e),t=this.layerIndex.findIndex(function(t){return t.getId()===o}),this.layerIndex.splice(t,0,e),e instanceof Op||this.userLayers.push({layer:e,before:o})):(n=this.layerIndex.findIndex(function(t){return t.getId()===e.getId()}),r=this.userLayers.findIndex(function(t){return t.layer.getId()===e.getId()}),0<=n&&0<=r?(i=this.layerIndex[n],this._removeMapboxLayers(i),this._addMapboxLayers(e,n+1),this.map.events._disableLayerEvents(i),this.map.events._enableLayerEvents(e),(this.layerIndex[n]=e)instanceof Op||(this.userLayers[r]={layer:e,before:void 0}),i.onRemove()):(this._addMapboxLayers(e),this.map.events._enableLayerEvents(e),this.layerIndex.push(e),e instanceof Op||this.userLayers.push({layer:e,before:o}))),e.onAdd(this.map)},Ap.prototype._addMapboxLayers=function(t,e){var o,n;if(!(t instanceof ol)||t.getOptions().tileUrl)if(t instanceof Op)this.map.events._enableLayerEvents(t);else{t instanceof Xs&&this.map._getMap().addSource(t._getSourceId(),t._buildSource());var r=this._getMapboxBefore(e);try{for(var i=Ep(t._buildLayers()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().addLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}this.map.events._enableLayerEvents(t)}},Ap.prototype._removeMapboxLayers=function(t,e){var o,n;if(t instanceof Op&&!e)this.map.events._disableLayerEvents(t);else{try{for(var r=Ep(t._getLayerIds()),i=r.next();!i.done;i=r.next()){var s=i.value;this.map._getMap().getLayer(s)&&this.map._getMap().removeLayer(s)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}this.map.events._disableLayerEvents(t),t instanceof Xs&&this.map._getMap().getSource(t._getSourceId())&&this.map._getMap().removeSource(t._getSourceId())}},Ap.prototype._getMapboxLayerExists=function(e){var o=this,n=!1;return"string"==typeof e?!!(e=this.layerIndex.find(function(t){return t.getId()===e})):(e._getLayerIds().forEach(function(t){o.map._getMap().getLayer(t)&&(n=!0)}),n)},Ap.prototype._getMapboxBefore=function(e){var o,t,n,r;if("string"==typeof e){var i=this.layerIndex.find(function(t){return t.getId()===e});if(!i)return;try{for(var s=Ep(i._getLayerIds()),a=s.next();!a.done;a=s.next()){var l=a.value;if(this.map._getMap().getLayer(l))return l}}catch(t){o={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(o)throw o.error}}e=this.layerIndex.findIndex(function(t){return t.getId()===e})+1}for(var c=e;c<this.layerIndex.length;c++)try{for(var u=(n=void 0,Ep(this.layerIndex[c]._getLayerIds())),p=u.next();!p.done;p=u.next()){l=p.value;if(this.map._getMap().getLayer(l))return l}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}},Ap.prototype.clear=function(){for(var t=this.layerIndex.length-1;0<=t;t--){var e=this.layerIndex[t];this._removeMapboxLayers(e,!0),this.layerIndex.splice(t,1),e.onRemove()}this.userLayers=[]},Ap.prototype.getLayerById=function(e){var t=this.layerIndex.find(function(t){return t.getId()===e});if(t)return t},Ap.prototype.getLayers=function(){return this.layerIndex.slice(0)},Ap.prototype._getSourceIds=function(){var e,t,o=new Set;try{for(var n=Ep(this.layerIndex),r=n.next();!r.done;r=n.next())r.value._getSourceIds().forEach(function(t){return o.add(t)})}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return o},Ap.prototype._getUserLayers=function(){return Array.from(this.userLayers)},Ap.prototype.move=function(t,e){var o=t instanceof xs?t.getId():t,n=e instanceof xs?e.getId():e;if(!this.layerIndex.find(function(t){return t.getId()===o}))throw new Error("The layer '"+o+"' has not been added to the map and cannot be moved.");e=this.layerIndex.findIndex(function(t){return t.getId()===o});this._moveMapboxLayers(this.layerIndex[e],n),t=this.layerIndex[e],this.layerIndex.splice(e,1);e=this.layerIndex.findIndex(function(t){return t.getId()===n});-1<e?this.layerIndex.splice(e,0,t):this.layerIndex.push(t);t=this.userLayers.find(function(t){return t.layer.getId()===o});t&&(t.before=n)},Ap.prototype._moveMapboxLayers=function(t,e){var o,n,r=this._getMapboxBefore(e);try{for(var i=Ep(t._getLayerIds()),s=i.next();!s.done;s=i.next()){var a=s.value;this.map._getMap().moveLayer(a,r)}}catch(t){o={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}},Ap.prototype.getRenderedShapes=function(t,e,o){var n,r,i,s=this;if(t=t||[-180,-85.0511,180,85.0511],Array.isArray(t)?4===t.length||6===t.length?i=this.map.positionsToPixels([Pi.getSouthWest(t),Pi.getNorthEast(t)]):2!==t.length&&3!==t.length||(i=this.map.positionsToPixels([t])[0]):i=this.map.positionsToPixels([t.coordinates])[0],e){e=Array.isArray(e)?e:[e];var a=[],l=this;try{for(var c=Ep(e),u=c.next();!u.done;u=c.next())!function(t){var e=t instanceof xs?t.getId():t,t=l.layerIndex.findIndex(function(t){return t.getId()===e});if(!(-1<t))throw new Error("The layer '"+e+"' has not been added to the map and its rendered features cannot be retrieved.");a.push.apply(a,Pp([],Cp(l.layerIndex[t]._getLayerIds().filter(function(t){return!!s.map._getMap().getLayer(t)}))))}(u.value)}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}o=this.map._getMap().queryRenderedFeatures(i,{layers:a,filter:o});return this.map.sources._mapFeaturesToShapes(o)},Ap.prototype.remove=function(t){var e,o;if(Array.isArray(t))try{for(var n=Ep(t),r=n.next();!r.done;r=n.next()){var i=r.value;this._removeLayer(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}else this._removeLayer(t)},Ap.prototype._removeLayer=function(t){var e=t instanceof xs?t.getId():t,o=this.layerIndex.findIndex(function(t){return t.getId()===e});if(-1==o)throw new Error("The layer '"+e+"' has not been added to the map and cannot be removed.");t=this.layerIndex[o];this._removeMapboxLayers(t),this.layerIndex.splice(o,1);o=this.userLayers.findIndex(function(t){return t.layer.getId()===e});-1!=o&&this.userLayers.splice(o,1),t.onRemove()},Ap);function Ap(t){this.layerIndex=[],this.userLayers=[],this.map=t}var Ip=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Lp=(Rp.prototype.add=function(t){var e,o;t=Array.isArray(t)?t:[t];try{for(var n=Ip(t),r=n.next();!r.done;r=n.next()){var i=r.value;this.popups.has(i)||(this.popups.add(i),i.attach(this.map))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},Rp.prototype.clear=function(){var e=this;this.popups.forEach(function(t){e.popups.delete(t),t.remove()})},Rp.prototype.remove=function(t){var e,o;t=Array.isArray(t)?t:[t];try{for(var n=Ip(t),r=n.next();!r.done;r=n.next()){var i=r.value;this.popups.has(i)&&(this.popups.delete(i),i.remove())}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},Rp.prototype.getPopups=function(){return Array.from(this.popups)},Rp.prototype._getCollectionDiv=function(){var t=this.map.getMapContainer().querySelector("."+Rp.Css.collection);return t||((t=document.createElement("div")).classList.add(Rp.Css.collection),t.setAttribute("aria-label","Map Information"),this.map.getMapContainer().appendChild(t)),t},Rp.prototype._addDraggedPopup=function(t){0===this.draggedPopups.size&&(this.map.getMapContainer().addEventListener("mousemove",this._onDrag),this.map.getMapContainer().addEventListener("touchmove",this._onDrag),this.map.getMapContainer().addEventListener("mouseup",this._onUp),this.map.getMapContainer().addEventListener("touchend",this._onUp)),this.draggedPopups.add(t)},Rp.Css={collection:"popup-collection-container"},Rp);function Rp(t){var n=this;this._onDrag=function(t){var e,o;"mousemove"===t.type?(e=t.clientX,o=t.clientY):"touchmove"===t.type&&(e=t.touches[0].clientX,o=t.touches[0].clientY),n.draggedPopups.forEach(function(t){t._dragToPixel([e,o])})},this._onUp=function(){n.map.getMapContainer().removeEventListener("mousemove",n._onDrag),n.map.getMapContainer().removeEventListener("touchmove",n._onDrag),n.map.getMapContainer().removeEventListener("mouseup",n._onUp),n.map.getMapContainer().removeEventListener("touchend",n._onUp),n.draggedPopups.forEach(function(t){n.draggedPopups.delete(t),t._onUp()})},this.map=t,this.popups=new Set,this.draggedPopups=new Set}var Np,Mp,b=window&&window.__extends||(Np=function(t,e){return(Np=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Np(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),jp=window&&window.__assign||function(){return(jp=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Dp=(b(zp,Mp=ss),zp.prototype._buildSource=function(){return this.source},zp.prototype._modifySource=function(t,e){if(t.tiles){var o=t.tiles.map(function(t){return"string"==typeof t?t:new D({domain:h,path:t.path,queryParams:jp(jp({},e),t.queryParams)}).toString()});t.tiles=o}else{if(!t.url)throw new Error("Source definition must define a TileJSON 'url' or a 'tiles' array.");t.url="string"==typeof t.url?t.url:new D({domain:h,path:t.url.path,queryParams:jp(jp({},e),t.url.queryParams)}).toString()}return t},zp);function zp(t,e,o){t=Mp.call(this,t)||this;return t.source=t._modifySource(e,o),t}var Bp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fp=(Up.prototype.add=function(t,e){var o,n;if(void 0===e&&(e=!0),Array.isArray(t))try{for(var r=Bp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._addSource(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._addSource(t,e)},Up.prototype.getRenderedShapes=function(t,e,o){t="string"==typeof t?t:t.getId(),e=this.map._getMap().querySourceFeatures(t,{sourceLayer:o,filter:e});return this.map.sources._mapFeaturesToShapes(e,!0,this.sources.get(t))},Up.prototype._buildSources=function(){var e={};return this.sources.forEach(function(t){e[t.getId()]=t._buildSource()}),e},Up.prototype.clear=function(){var e=this;this.sources.forEach(function(t){e.remove(t)})},Up.prototype.getById=function(t){return this.sources.get(t)},Up.prototype.getSources=function(){return Array.from(this.sources.values())},Up.prototype.isSourceLoaded=function(t){t=t instanceof ss?t.getId():t;return this.map._getMap().isSourceLoaded(t)},Up.prototype.remove=function(t,e){var o,n;if(void 0===e&&(e=!0),Array.isArray(t))try{for(var r=Bp(t),i=r.next();!i.done;i=r.next()){var s=i.value;this._removeSource(s,e)}}catch(t){o={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}else this._removeSource(t,e)},Up.prototype._removeSource=function(t,e){t=t instanceof ss?t.getId():t;if(this.sources.has(t)){if(this.map._getMap().getSource(t)&&e&&this.map._getMap().removeSource(t),this.map._getMap().getSource(t)&&e)throw new Error("One or more layers have a dependency on the source '"+t+"'");return this.sources.get(t)._setMap(null),void this.sources.delete(t)}throw new Error("'"+t+"' is not added to the map")},Up.prototype._addSource=function(t,e){if(this.sources.has(t.getId())){if(e)throw new Error("'"+t.getId()+"' is already added to the map");this.sources.get(t.getId())._setMap(null),this.sources.delete(t.getId())}if(e){if(!this.map._isReady())throw new Error("The source '"+t.getId()+"' could not be added to the map because the map is not ready. Please use a ready event listener to guarantee the map is ready before adding a source to it.");this.map._getMap().addSource(t.getId(),t._buildSource())}this.sources.set(t.getId(),t),t._setMap(this.map)},Up.prototype._mapFeaturesToShapes=function(t,e,o){var n,r,i=[];try{for(var s=Bp(t),a=s.next();!a.done;a=s.next()){var l=a.value;if((o||"string"==typeof l.source)&&"string"==typeof l.properties[xi._shapeIdPropName]){var c=o||this.sources.get(l.source);if(c instanceof ps){var u=c.getShapeById(l.properties[xi._shapeIdPropName]);if(u instanceof xi){i.push(u);continue}}}e||i.push(l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return i},Up.prototype._syncSources=function(n){var r=this;n&&(Object.keys(n).forEach(function(t){if(!r.sources.has(t)){var e=n[t];if("vector"===e.type){var o=new Dp(t,{name:t,tiles:e.tiles,type:"vector",url:e.url});r.sources.set(t,o),o._setMap(r.map)}else{if("raster"!==e.type)throw new Error("Unable to construct source with ID "+t+".");o=new Dp(t,{name:t,tiles:e.tiles,type:"raster",url:e.url});r.sources.set(t,o),o._setMap(r.map)}}}),Object.keys(this.sources).forEach(function(t){n.hasOwnProperty(t)||(r.sources.get(t)._setMap(null),r.sources.delete(t))}))},Up);function Up(t){this.map=t,this.sources=new J}var qp,Gp,Zp=((window&&window.__extends||(qp=function(t,e){return(qp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}qp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Hp,Gp=k),Hp);function Hp(){var t=null!==Gp&&Gp.apply(this,arguments)||this;return t.duration=1e3,t.type="jump",t}var Kp,Wp,Vp=((window&&window.__extends||(Kp=function(t,e){return(Kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Kp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Yp,Wp=k),Yp);function Yp(){var t=null!==Wp&&Wp.apply(this,arguments)||this;return t.bottom=0,t.left=0,t.right=0,t.top=0,t}var Qp,Jp,b=window&&window.__extends||(Qp=function(t,e){return(Qp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Qp(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Xp=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$p=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},th=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},eh=(b(oh,Jp=k),oh.prototype.merge=function(){for(var e,t,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var r=Xp(o),i=r.next();!i.done;i=r.next()){var s=i.value;s&&"number"==typeof s.padding&&(s.padding={top:s.padding,bottom:s.padding,left:s.padding,right:s.padding})}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return Jp.prototype.merge.apply(this,th([],$p(o)))},oh);function oh(){var t=null!==Jp&&Jp.apply(this,arguments)||this;return t.bounds=[-180,-89,180,90],t.maxBounds=void 0,t.maxZoom=20,t.offset=new lr(0,0),t.padding=new Vp,t}var nh,rh,ih=((window&&window.__extends||(nh=function(t,e){return(nh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}nh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(sh,rh=k),sh);function sh(){var t=null!==rh&&rh.apply(this,arguments)||this;return t.zoom=1,t.center=new mi(0,0),t.centerOffset=new lr(0,0),t.bearing=0,t.pitch=0,t.minZoom=1,t.maxZoom=20,t.maxBounds=void 0,t}var ah,lh,b=((window&&window.__extends||(ah=function(t,e){return(ah=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ah(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(ch,lh=k),ch);function ch(){var t=null!==lh&&lh.apply(this,arguments)||this;return t.name=void 0,t.before=void 0,t.minZoom=1,t.maxZoom=20,t.overwrite=!1,t.opacity=1,t}var uh,ph,hh=((window&&window.__extends||(uh=function(t,e){return(uh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}uh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(dh,ph=b),dh);function dh(){var t=null!==ph&&ph.apply(this,arguments)||this;return t.color="rgba(0,0,0,.5)",t.outlineColor="#000",t.radius=1,t.outlineWidth=5,t.name="default-circles",t}var fh,yh,mh=((window&&window.__extends||(fh=function(t,e){return(fh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}fh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(gh,yh=b),gh);function gh(){var t=null!==yh&&yh.apply(this,arguments)||this;return t.cap="butt",t.join="miter",t.name="default-linestrings",t.color="#000",t.width=1,t}var vh,_h,wh=((window&&window.__extends||(vh=function(t,e){return(vh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}vh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(bh,_h=b),bh);function bh(){var t=null!==_h&&_h.apply(this,arguments)||this;return t.iconSize=1,t.fontSize=14,t.fontColor="#000",t.textFont="SegoeUi-Regular",t.cluster=!0,t.clusterIcon=void 0,t.textOffset=[0,0],t.name="default-pins",t.icon="pin-darkblue",t.title="",t}var Sh,xh,Oh=((window&&window.__extends||(Sh=function(t,e){return(Sh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Sh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Th,xh=b),Th);function Th(){var t=null!==xh&&xh.apply(this,arguments)||this;return t.color="rgba(0,0,0,.5)",t.outlineColor="#000",t.name="default-polygons",t}var Eh,Ch,Ph=((window&&window.__extends||(Eh=function(t,e){return(Eh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Eh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(kh,Ch=b),kh);function kh(){var t=null!==Ch&&Ch.apply(this,arguments)||this;return t.name="default-raster",t}var Ah,Ih,Lh=((window&&window.__extends||(Ah=function(t,e){return(Ah=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Ah(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}))(Rh,Ih=k),Rh);function Rh(){var t=null!==Ih&&Ih.apply(this,arguments)||this;return t.anchor="map",t.color="#FFFFFF",t.intensity=.5,t.position=[1.15,210,30],t}var Nh,Mh,b=window&&window.__extends||(Nh=function(t,e){return(Nh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}Nh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),jh=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Dh=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},zh=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Bh=(b(Fh,Mh=k),Fh.prototype.merge=function(){for(var e,t,o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];try{for(var r=jh(o),i=r.next();!i.done;i=r.next()){var s=i.value;s&&(s.hasOwnProperty("view")?s.userRegion=s.view:s.hasOwnProperty("userRegion")&&(s.view=s.userRegion),"string"==typeof s.language&&(s.language=jl.getCode(s.language)))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return Mh.prototype.merge.apply(this,zh([],Dh(o)))},Fh);function Fh(){var t=null!==Mh&&Mh.apply(this,arguments)||this;return t.antialias=void 0,t.autoResize=!0,t.language=Wl,t.light=new Lh,t.preserveDrawingBuffer=!1,t.progressiveLoading=!1,t.progressiveLoadingInitialLayerGroups=["base"],t.renderWorldCopies=!0,t.showBuildingModels=!1,t.showFeedbackLink=!0,t.showLogo=!0,t.showLabels=!0,t.customAttribution=void 0,t.showTileBoundaries=!1,t.style=void 0,t.view=Zl,t.userRegion=t.view,t}function Uh(t){return 0==t.length?void 0:t.slice(1).reduce(function(o,n){return function(t,e){t=o(t,e);return Zh(Zh({},t),n(t.url,e))}},t[0])}var qh,Gh,b=window&&window.__extends||(qh=function(t,e){return(qh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}qh(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),Zh=window&&window.__assign||function(){return(Zh=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},Hh=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kh=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},Wh=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},Vh=(b(Yh,Gh=k),Yh.prototype.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{for(var o=Hh(t),n=o.next();!n.done;n=o.next()){var r=n.value;r&&(r.authOptions?"string"==typeof r.authOptions.subscriptionKey&&(r.subscriptionKey=r["subscription-key"]=r.authOptions.subscriptionKey):"string"==typeof r.subscriptionKey?(r["subscription-key"]=r.subscriptionKey,r.authOptions={authType:u.AuthenticationType.subscriptionKey,subscriptionKey:r.subscriptionKey}):"string"==typeof r["subscription-key"]&&(r.subscriptionKey=r["subscription-key"],r.authOptions={authType:u.AuthenticationType.subscriptionKey,subscriptionKey:r["subscription-key"]}),"string"==typeof r.sessionId?r["session-id"]=r.sessionId:"string"==typeof r["session-id"]&&(r.sessionId=r["session-id"]),"boolean"==typeof r.disableTelemetry?r["disable-telemetry"]=r.disableTelemetry:"boolean"==typeof r["disable-telemetry"]&&(r.disableTelemetry=r["disable-telemetry"]),"boolean"==typeof r.enableAccessibility?r["enable-accessibility"]=r.enableAccessibility:"boolean"==typeof r["enable-accessibility"]&&(r.enableAccessibility=r["enable-accessibility"]))}}catch(t){a={error:t}}finally{try{n&&!n.done&&(s=o.return)&&s.call(o)}finally{if(a)throw a.error}}var i=this._transformers,s=t?t.filter(function(t){return void 0!==t}).reduce(function(t,e){return Wh(Wh([],Kh(t)),Kh(e._transformers||[]))},[]):[],a=Gh.prototype.merge.apply(this,Wh([],Kh(t)));return a.authOptions.authType!==u.AuthenticationType.subscriptionKey&&(a["subscription-key"]=a.subscriptionKey=void 0),void 0!==a.styleSet&&void 0===a.mapConfiguration&&(a.mapConfiguration=a.styleSet),a.mapConfiguration&&"string"!=typeof a.mapConfiguration&&(a.mapConfiguration=Zh(Zh({},a.mapConfiguration),{defaultConfiguration:a.mapConfiguration.defaultConfiguration||a.mapConfiguration.defaultStyle,configurations:a.mapConfiguration.configurations||a.mapConfiguration.styles})),this._transformers=Wh(Wh([],Kh(i||[])),Kh(s.filter(function(t){return!i.includes(t)}))),this.transformRequest&&!this._transformers.includes(this.transformRequest)&&this._transformers.push(this.transformRequest),this.transformRequest=Uh(this._transformers),a},Yh.prototype.addTransformer=function(t){this._transformers||(this._transformers=[]),this._transformers.push(t),this.transformRequest=Uh(this._transformers)},Yh.prototype.removeTransformer=function(e){this._transformers&&(this._transformers=this._transformers.filter(function(t){return e!==t}),this.transformRequest=Uh(this._transformers))},Yh._cloneCustomizer=function(t){if("object"==typeof t)return Object.assign({},t)},Yh);function Yh(){var t=null!==Gh&&Gh.apply(this,arguments)||this;return t.authOptions=uc(),t.disableTelemetry=!1,t["disable-telemetry"]=t.disableTelemetry,t.domain=Yl,t.staticAssetsDomain=Ql,t.styleDefinitionsPath=Jl,t.styleDefinitionsVersion=Xl,t.styleAPIVersion=$l,t.mapConfiguration=void 0,t.styleSet=void 0,t.enableAccessibility=!0,t["enable-accessibility"]=t.enableAccessibility,t.enableAccessibilityLocationFallback=!0,t.maxParallelImageRequests=gc(),t.refreshExpiredTiles=!0,t.subscriptionKey=wc(),t["subscription-key"]=t.subscriptionKey,t.sessionId=Vl,t["session-id"]=t.sessionId,t._transformers=[],t.transformRequest=void 0,t.workerCount=mc(),t.fadeDuration=300,t.localIdeographFontFamily="sans-serif",t.validateStyle=!0,t}var Qh=(Jh.getLayerGroup=function(t){var e;if(null!=t&&t.metadata&&t.metadata["microsoft.maps:layerGroup"])return t.metadata["microsoft.maps:layerGroup"];t=null!==(e=null==t?void 0:t.id)&&void 0!==e?e:t;if(t.startsWith("microsoft.")){t=t.split(".");return 4<=t.length?t[3]:void 0}},Jh);function Jh(){}var Xh=($h.resolve=function(t){return new $h(Promise.resolve(t))},$h.reject=function(t){return new $h(Promise.reject(t))},$h.prototype.then=function(t,e){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).then(t,e)},$h.prototype.catch=function(t){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).catch(t)},$h.prototype.finally=function(t){var o=this;return new Promise(function(t,e){o._resolve=t,o._reject=e,o._thenResolver(t,e)}).finally(t)},$h.prototype.hijackAndResolve=function(t){this._hijackedToResolve=t,this._resolve&&this._resolve(t)},$h.prototype.hijackAndReject=function(t){this._hijackedToReject=t,this._reject&&this._reject(t)},$h.prototype.switchWith=function(t){this.origin=t,this._toResolve=void 0,this._toReject=void 0},$h);function $h(t){var r=this;this.isHijacked=function(){return void 0!==r._hijackedToResolve||void 0!==r._hijackedToReject},this.isResolved=function(){return void 0!==r._hijackedToResolve||void 0!==r._toResolve},this.isRejected=function(){return void 0!==r._hijackedToReject||void 0!==r._toReject},this.resultIfResolved=function(){return r._hijackedToResolve||r._toResolve},this.errorIfRejected=function(){return r._hijackedToReject||r._toReject},this._thenResolver=function(e,o){var n;r._hijackedToResolve?e(r._hijackedToResolve):r._hijackedToReject?o(r._hijackedToReject):(n=r.origin,r.origin.then(function(t){r.isHijacked()||(n!==r.origin?r._thenResolver(e,o):(r._toResolve=t,e(t)))}).catch(function(t){r.isHijacked()||(n!==r.origin?r._thenResolver(e,o):(r._toReject=t,o(t)))}))},this.origin=t,this[Symbol.toStringTag]=this.origin[Symbol.toStringTag]}var td={road:"Road",satellite:"Satellite",satellite_road_labels:"Hybrid",grayscale_dark:"Grayscale (Dark)",grayscale_light:"Grayscale (Light)",night:"Night",road_shaded_relief:"Terra",blank:"Blank",blank_accessible:"Blank (Accessible)",high_contrast_dark:"High contrast (Dark)",high_contrast_light:"High contrast (Light)"},ed=window&&window.__assign||function(){return(ed=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},od=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},nd=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},rd=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},id=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},sd=(ad.prototype.updateIndoorState=function(t,e){var o,n,r=this,i=this.map.styles.getMapConfiguration();i?(this.preservedPreindoorMapConfiguration=i,o=this.map.getStyle().style?this.map.getStyle().style+"_indoor"+("dark"===t?"_dark":"")+"_tileset_"+e:void 0,this.map.styles.setMapConfiguration("defaultIndoor_"+e,"microsoft-maps:default"===i?o:void 0)):(n=(null===(o=this.indoorState)||void 0===o?void 0:o.tilesetId)!==e,this.indoorState={tilesetId:e,theme:t},this.initStyleset(),this.definitions().then(function(t){var e=(r.map.getStyle().style||t.defaultConfiguration).replace("_indoor_dark","").replace("_indoor","")+"_indoor",t=t.configurations.find(function(t){return t.name.startsWith(e)});t&&r.map.setStyle({style:t.name},!n)}))},ad.prototype.unsetIndoorState=function(){var o=this,t=this.preservedPreindoorMapConfiguration;t?this.map.styles.setMapConfiguration(t):(this.indoorState=void 0,this.initStyleset(),this.definitions().then(function(t){var e=o.map.getStyle().style;e.includes("_indoor")&&e.split("_indoor")[0]?o.map.setStyle({style:e.split("_indoor")[0]}):o.map.setStyle({style:void 0})}))},ad.prototype.initStyleset=function(){var o=this,t=this.serviceOptions.mapConfiguration?"string"==typeof this.serviceOptions.mapConfiguration?new Xh(this._request(this.serviceOptions.domain,w+"/mapconfigurations/metadata/"+this.serviceOptions.mapConfiguration,"StyleDefinitions").then(function(t){return ed(ed({},t),{defaultConfiguration:t.defaultConfiguration||t.defaultStyle,configurations:t.configurations||t.styles})})):Xh.resolve(this.serviceOptions.mapConfiguration):new Xh(this._request(this.serviceOptions.staticAssetsDomain,_+"/"+w,"StyleDefinitions",{version:this.serviceOptions.styleDefinitionsVersion}).then(function(e){return{version:isNaN(e.version)?0:parseFloat(e.version),defaultConfiguration:e.defaultStyle,configurations:e.styles.filter(function(t){return o.indoorState?"auto"===o.indoorState.theme?t.name.endsWith("dark"===t.theme?"_indoor_dark":"_indoor"):t.name.endsWith("dark"===o.indoorState.theme?"_indoor_dark":"_indoor"):!t.name.includes("indoor")}).map(function(t){return{copyright:t.copyright.join(" "),name:t.name,displayName:function(t){t=o.indoorState&&t.includes("_indoor")?t.split("_indoor")[0]:t;return t in td?td[t]:t}(t.name),theme:t.theme,thumbnail:new D({domain:o.serviceOptions.staticAssetsDomain,path:t.thumbnail,protocol:"https"}).toString(),url:new D({domain:o.serviceOptions.staticAssetsDomain,path:_+"/"+w+"/"+t.name,queryParams:{styleVersion:void 0!==e.version&&null!==e.version?e.version:o.serviceOptions.styleDefinitionsVersion},protocol:"https"}).toString()}})}}));return this.initPromise&&this.initPromise.switchWith(t),this.initPromise=t,this.initPromise.then(function(t){return o.map._invokeEvent("mapconfigurationchanged",t)}),this.initPromise},ad.prototype.getStyle=function(t){t=this._lookUp(t);if(!t)throw Error("Style definition is not available.");if(t.url)return t.url;if(t.style)return t.style;throw Error("Style definition does not contain neither URL nor style object.")},ad.prototype.setStyle=function(t,e){void 0===e&&(e=!0);try{this.map._getMap().setStyle(this.getStyle(t),{diff:e,stylePatch:this._stylePatch.bind(this),validate:this.serviceOptions.validateStyle})}catch(t){throw t}},ad.prototype.getTheme=function(t){t=this._lookUp(t);if(t)return t.theme.toLowerCase()},ad.prototype.getThemeAsync=function(e){return od(this,void 0,void 0,function(){return nd(this,function(t){switch(t.label){case 0:return[4,this._lookUpAsync(e)];case 1:return[2,t.sent().theme]}})})},ad.prototype.setMapConfiguration=function(t,o){var n=this;"string"==typeof(this.serviceOptions.mapConfiguration=t)?this.initStyleset():this.initPromise?this.initPromise.hijackAndResolve(t):this.initPromise=Xh.resolve(t),this.definitions().then(function(t){var e=t.defaultConfiguration;t.configurations.find(function(t){return t.name===o})&&(e=o),n.map.setStyle({style:e})})},ad.prototype.getMapConfiguration=function(){return this.serviceOptions.mapConfiguration},ad.prototype.setStyleSet=function(t){this.updateIndoorState("indoor_dark"===t?"dark":"light",null)},ad.prototype.getStyleSet=function(){return void 0!==this.indoorState?"dark"===this.indoorState.theme?"indoor_dark":"indoor":"base"},ad.prototype.clearStyleSet=function(){this.unsetIndoorState()},ad.prototype._stylePatch=function(t,e,n,o,r,i){function s(t,e){var o;u||r(t.id,"visibility",e),t.layout=null!==(o=t.layout)&&void 0!==o?o:{},t.layout.visibility=e}var a=this,l=this.map.getStyle(),c=this.map.getTraffic(),u=l.progressiveLoading&&!this.map._isLoaded(),p={};e.layers.forEach(function(t){var e,o=Qh.getLayerGroup(t);o&&("fill-extrusion"===t.type&&s(t,l.showBuildingModels?"visible":"none"),"none"!==c.flow&&o==="traffic_"+c.flow&&"line"==t.type&&s(t,"visible"),"labels"!==o&&"labels_places"!==o&&"labels_indoor"!==o||"symbol"!==t.type||(e="none"!==(null===(e=t.layout)||void 0===e?void 0:e.visibility),s(t,e&&l.showLabels?"visible":"none")),p[o]?p[o].push(t):p[o]=[t])}),u&&(y=l.progressiveLoadingInitialLayerGroups,Array.isArray(y)&&0<y.length&&this._deferLayerGroupVisibilities(p,y));var h=this.map.layers.getLayers(),d=Object.entries(p).map(function(t){var e=rd(t,2),t=e[0],e=e[1];return a._buildFundamentalLayerFrom(e,t)}),f=this.map.layers._getUserLayers(),y=h.filter(function(e){return d.findIndex(function(t){return e.getId()===t.getId()})<0&&f.findIndex(function(t){return e.getId()===t.layer.getId()})<0}),m=d.filter(function(e){return h.find(function(t){return t.getId()===e.getId()})}).entries(),g=m.next();d.forEach(function(e){var t;g.value&&g.value[1].getId()===e.getId()?(t=h.findIndex(function(t){return t.getId()===e.getId()}),a.map.layers.remove(e.getId()),a.map.layers.add(e,h[t].getId()),g=m.next()):g.value?a.map.layers.add(e,g.value[1]):a.map.layers.add(e)}),y.forEach(function(t){a.map.layers.remove(t)}),f.forEach(function(t){var e,o;t.layer instanceof ul||(o=void 0,a.map.layers.getLayerById(t.before)&&(o=0<(e=a.map.layers.getLayerById(t.before)._buildLayers()).length?e[0]:void 0),n(t.layer.getId(),null==o?void 0:o.id),a.map.layers.move(t.layer,t.before))}),this.map.sources._syncSources(e.sources),this.map.events.remove("styledata",this._onStyleData),this.map.events.addOnce("styledata",this._onStyleData)},ad.prototype._buildFundamentalLayerFrom=function(t,e){if(t&&0<t.length){t=new Op(t,e);return t.onAdd(this.map),t}throw new Error("Unable to construct fundamental map layer for ID: "+e+".")},ad.prototype._transformStyleRequest=function(t,e){t.includes(h)&&(e.url=e.url.replace(h,this.serviceOptions.domain)),t.includes(g)&&(e.url=e.url.replace(g,_)),t.includes(v)&&(e.url=e.url.replace(v,w)),(e.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||e.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&((t=new URL(e.url)).searchParams.get(l)||(t.searchParams.set(l,this.serviceOptions.styleAPIVersion),e.url=t.href),null!==(t=this.map.authentication)&&void 0!==t&&t.signRequest(e))},ad.prototype._request=function(n,r,i,s){var a;return void 0===s&&(s={}),od(this,void 0,void 0,function(){var e,o;return nd(this,function(t){switch(t.label){case 0:return e={url:new D({protocol:"https",domain:n,path:r,queryParams:ed(((o={})[l]=this.serviceOptions.styleAPIVersion,o.hash=ad._hashCode(null===(a=this.map.authentication)||void 0===a?void 0:a.getToken()),o),s)}).toString()},"function"==typeof this.serviceOptions.transformRequest&&i&&(e=this.serviceOptions.transformRequest(e.url,i)),null!==(a=this.map.authentication)&&void 0!==a&&a.signRequest(e),o={method:"GET",mode:"cors"},e.credentials&&(o.credentials=e.credentials),e.headers&&(o.headers=e.headers),[4,fetch(e.url,o).then(function(t){if(t.ok)return t.json();throw new Error("HTTP "+t.status+": "+t.statusText+" ")})];case 1:return[2,t.sent()]}})})},ad._hashCode=function(t){var e=0;if(!(t=void 0===t?"":t))return e;for(var o=0;o<t.length;o++)e=(e<<5)-e+t.charCodeAt(o),e|=0;return e},ad);function ad(t,e){var a=this;this.definitions=function(){return a.initPromise||a.initStyleset()},this.indoorState=void 0,this.preservedPreindoorMapConfiguration=void 0,this._progressiveLoadingState={mapStyle:void 0,pendingVisibilityChange:void 0},this._deferLayerGroupVisibilities=function(e,t){var o,r,n,i,s=t.filter(function(t){return t in e});0!==s.length&&(o=a.map._getMap(),r=o.getZoom(),n=a.map.getStyle().style,a._progressiveLoadingState.pendingVisibilityChange&&(a.map.events.remove("load",a._progressiveLoadingState.pendingVisibilityChange),a._progressiveLoadingState.pendingVisibilityChange=null),a._progressiveLoadingState.mapStyle=n,(i=Object.entries(e).reduce(function(t,e){var o=rd(e,2),e=o[0],o=o[1],n=s.includes(e);return id(id([],rd(t)),rd(o.filter(function(t){if("custom"===t.type)return!1;if(n)if("number"==typeof t.maxzoom&&"number"==typeof t.minzoom){if(r<=t.maxzoom&&r>=t.minzoom)return!1}else if("number"==typeof t.minzoom){if(r>=t.minzoom)return!1}else{if("number"!=typeof t.maxzoom)return!1;if(r<=t.maxzoom)return!1}return"none"!==(null===(t=t.layout)||void 0===t?void 0:t.visibility)})))},[])).forEach(function(t){t.layout=t.layout||{},t.layout.visibility="none"}),a._progressiveLoadingState.pendingVisibilityChange=function(){a._progressiveLoadingState.pendingVisibilityChange=null;var t=a.map.getStyle().style;n===t&&i.forEach(function(t){t.layout.visibility="visible",o.setLayoutProperty(t.id,"visibility","visible")})},a.map.events.addOnce("load",a._progressiveLoadingState.pendingVisibilityChange))},this._onStyleData=function(){a._lookUpAsync(a.map.getStyle()).then(function(t){a.map.events.invoke("stylechanged",{style:t.name,map:a.map,type:"stylechanged"})})},this._lookUp=function(e){var t=a.definitions().errorIfRejected(),o=a.definitions().resultIfResolved();return t||void 0===o?null:o.configurations.find(function(t){return t.name===(e.style||o.defaultConfiguration)})||o.configurations.find(function(t){return t.name===o.defaultConfiguration})||o.configurations[0]},this._lookUpAsync=function(o){return od(a,void 0,void 0,function(){var e;return nd(this,function(t){switch(t.label){case 0:return[4,this.definitions()];case 1:return e=t.sent(),[2,e.configurations.find(function(t){return t.name===(o.style||e.defaultConfiguration)})||e.configurations.find(function(t){return t.name===e.defaultConfiguration})||e.configurations[0]]}})})},this.map=t,this.serviceOptions=e}var ld,cd,b=window&&window.__extends||(ld=function(t,e){return(ld=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}ld(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),ud=window&&window.__assign||function(){return(ud=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},pd=window&&window.__awaiter||function(t,s,a,l){return new(a=a||Promise)(function(o,e){function n(t){try{i(l.next(t))}catch(t){e(t)}}function r(t){try{i(l.throw(t))}catch(t){e(t)}}function i(t){var e;t.done?o(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(n,r)}i((l=l.apply(t,s||[])).next())})},hd=window&&window.__generator||function(o,n){var r,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(s=2&e[0]?i.return:e[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,e[1])).done)return s;switch(i=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,i=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(o,a)}catch(t){e=[6,t],i=0}finally{r=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}},dd=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},fd=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},yd=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,o=e&&t[e],n=0;if(o)return o.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},md=(b(gd,cd=X),gd.prototype.getCanvas=function(){return this.map.getCanvas()},gd.prototype.getCanvasContainer=function(){return this.map.getCanvasContainer()},gd.prototype.getMapContainer=function(){return this.map.getContainer()},gd.prototype.getServiceOptions=function(){return es(this.serviceOptions,Vh._cloneCustomizer)},gd.prototype.setServiceOptions=function(t){this.serviceOptions=(new Vh).merge(this.serviceOptions,t),this.serviceOptions["enable-accessibility"]?this.accessibleMapDelegate.addToMap():this.accessibleMapDelegate.removeFromMap()},gd.prototype.addRequestTransformer=function(t){this.serviceOptions.addTransformer(t)},gd.prototype.removeRequestTransformer=function(t){this.serviceOptions.removeTransformer(t)},gd.prototype.setCamera=function(t,e){if(void 0===e&&(e=!1),"padding"in t||"offset"in t||"bounds"in t){var o,n=(new eh).merge({maxZoom:this.getCamera().maxZoom},t),r=this._generateSafeBounds(n.bounds);if(!(o=this.map.cameraForBounds(r,{padding:n.padding,offset:n.offset,maxZoom:n.maxZoom})))throw new Error("The map cannot be fit to the current canvas with the given CameraBoundsOptions.");"pitch"in t&&(o.pitch=t.pitch),"bearing"in t&&(o.bearing=t.bearing),this.map.setMaxZoom(n.maxZoom),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),s=this._generateSafeBounds(n.maxBounds)}else{var i=(new ih).merge(this.getCamera(),t);i.centerOffset&&2<=i.centerOffset.length&&(r=i.centerOffset,(n=ei([i.center],i.zoom))[0][0]+=r[0],n[0][1]+=r[1],i.center=ti(n,i.zoom)[0]),o={center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,around:void 0},this.map.setMinZoom(i.minZoom),this.map.setMaxZoom(i.maxZoom),this._invokeEvent("minzoomchanged",this.map.getMinZoom()),this._invokeEvent("maxzoomchanged",this.map.getMaxZoom()),s=this._generateSafeBounds(i.maxBounds)}s?this.map.setMaxBounds(s):this.map.setMaxBounds(null);var s=(new Zp).merge(t),t={duration:s.duration,easing:function(t){return t},offset:[0,0],animate:!0},e={fromControl:e};"jump"===s.type?this.map.jumpTo(o,e):"ease"===s.type?this.map.easeTo(ud(ud({},o),t),e):"fly"===s.type&&this.map.flyTo(ud(ud({},o),t),e)},gd.prototype.setCameraBounds=function(t){this.setCamera(t)},gd.prototype.getCamera=function(){var t=this.map.getBounds().getSouthWest().toArray(),e=this.map.getBounds().getNorthEast().toArray();return{zoom:this.map.getZoom(),center:this.map.getCenter().toArray(),bearing:this.map.getBearing(),pitch:this.map.getPitch(),bounds:new Pi(t,e),minZoom:this.map.getMinZoom(),maxZoom:this.map.getMaxZoom()}},gd.prototype.setStyle=function(t,e){void 0===e&&(e=!0),delete t.preserveDrawingBuffer;t=(new Bh).merge(this.styleOptions,t);t.autoResize!==this.styleOptions.autoResize&&this._setAutoResize(t.autoResize),t.language!==this.styleOptions.language&&(this.localizedStringsPromise=jl.getStrings(t.language)),t.renderWorldCopies!==this.styleOptions.renderWorldCopies&&this.map.setRenderWorldCopies(t.renderWorldCopies),t.showFeedbackLink!==this.styleOptions.showFeedbackLink&&this.copyrightControl.setOptions({showFeedbackLink:t.showFeedbackLink}),t.customAttribution!==this.styleOptions.customAttribution&&this.copyrightControl.setOptions({customAttribution:t.customAttribution}),t.showLogo!==this.styleOptions.showLogo&&this.copyrightControl.setOptions({showLogo:t.showLogo}),t.showTileBoundaries!==this.styleOptions.showTileBoundaries&&(this.map.showTileBoundaries=t.showTileBoundaries);e=e&&this.styleOptions.language===t.language&&this.styleOptions.view===t.view;this.styleOptions=t,this._setStyleComponents(t,e)},gd.prototype.getStyle=function(){return qo(this.styleOptions)},gd.prototype.addIcon=function(t,e){this.imageSprite.add(t,e)},gd.prototype.addPins=function(t,e){var o,n=(new wh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new Ka(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,iconOptions:{anchor:"center",size:n.iconSize,image:["case",["has","icon"],["get","icon"],n.icon],ignorePlacement:!n.cluster,opacity:n.opacity},textOptions:{anchor:"center",textField:["case",["has","point_count"],["to-string",["get","point_count"]],["has","title"],["to-string",["get","title"]],n.title],font:["case",["has","point_count"],["literal",["StandardFontCondensed-Bold"]],["literal",[n.textFont]]],size:["case",["has","point_count"],20,n.fontSize],ignorePlacement:!n.cluster,opacity:n.opacity,offset:["case",["has","point_count"],["literal",[.5,-.45]],["literal",[n.textOffset[0]/16,n.textOffset[1]/16]]],color:n.fontColor}})),!(r instanceof Ka))throw new Error("A layer with name '"+n.name+"' already exists but it is not a SymbolLayer.A SymbolLayer should be used for rendering pins.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o,{cluster:n.cluster})),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},gd.prototype.addCircles=function(t,e){var o,n=(new hh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new Ns(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,opacity:n.opacity,radius:["case",["has","radius"],["get","radius"],n.radius],color:["case",["has","color"],["get","color"],n.color],strokeColor:["case",["has","outlineColor"],["get","outlineColor"],n.outlineColor],strokeWidth:["case",["has","outlineWidth"],["get","outlineWidth"],n.outlineWidth]})),!(r instanceof Ns))throw new Error("A layer with name '"+n.name+"' already exists but it is not a BubbleLayer.A BubbleLayer should be used for rendering circles.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o)),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},gd.prototype.addLinestrings=function(t,e){var o,n=(new mh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new ua(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,lineCap:n.cap,lineJoin:n.join,strokeOpacity:n.opacity,strokeColor:["case",["has","color"],["get","color"],n.color],strokeWidth:["case",["has","width"],["get","width"],n.width]})),!(r instanceof ua))throw new Error("A layer with name '"+n.name+"' already exists but it is not a LineLayer.A LineLayer should be used for rendering linestrings.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o)),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},gd.prototype.addPolygons=function(t,e){var o,n=(new Oh).merge(e),r=this.layers.getLayerById(n.name),i=!1;if(r||(i=!0,r=new ka(n.name+"-source",n.name,{source:n.name+"-source",minZoom:n.minZoom,maxZoom:n.maxZoom,fillOpacity:n.opacity,fillColor:["case",["has","color"],["get","color"],n.color]})),!(r instanceof ka))throw new Error("A layer with name '"+n.name+"' already exists but it is not a PolygonLayer.A PolygonLayer should be used for rendering linestrings.");var s=r.getSource();"string"==typeof s?(o=s,s=this.sources.getById(o)):o=s.getId();e=!1;if(s||(e=!0,s=new ps(o)),!(s instanceof ps))throw new Error("The source with name '"+o+"' already exists but it is not a DataSource.New data can only be added to a DataSource.");e&&this.sources.add(s),i&&this.layers.add(r,n.before);t=new Ai(t);n.overwrite?s.setShapes(t):s.add(t)},gd.prototype.addRaster=function(t,e){var o=(new Ph).merge(e),n=this.layers.getLayerById(o.name);if(!((n=n||new ol({maxZoom:o.maxZoom,minZoom:o.minZoom,opacity:o.opacity,tileSize:256,tileUrl:"{subdomain}"},o.name))instanceof ol))throw new Error("A layer with name '"+o.name+"' already exists but it is not a TileLayer.A TileLayer should be used for rendering raster images.");if("{subdomain}"!==n.getOptions().tileUrl)throw new Error("A TileLayer with name '"+o.name+"' already exists but was configured for a single tile url [default for new TileLayer(...)].");(e=!o.overwrite&&n.getOptions().subdomains||[]).push.apply(e,fd([],dd(t))),n._setOptionsNoUpdate({subdomains:e}),this.layers.add(n,o.before)},gd.prototype.getLayers=function(){return this.layers.getLayers().map(function(t){return t.getId()})},gd.prototype.removeLayers=function(t){var e,o;try{for(var n=yd(t),r=n.next();!r.done;r=n.next()){var i,s=r.value;this.layers.getLayerById(s)&&(this.layers.remove(s),i=s+"-source",this.sources.getById(i)&&this.sources.remove(i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(e)throw e.error}}},gd.prototype.addHtml=function(t,e){t.id||(t.id="marker_"+nr());var o=new Al({htmlContent:t});return this.markers.add(o,e),t.id},gd.prototype.removeHtml=function(t){this.markers.remove(t)},gd.prototype.addEventListener=function(t,e,o){this.events._addLegacy(t,e,o)},gd.prototype.removeEventListener=function(t,e,o){this.events._removeLegacy(t,e,o)},gd.prototype.setUserInteraction=function(t){this.userInteractionDelegate.setOptions(t)},gd.prototype.getUserInteraction=function(){return this.userInteractionDelegate.getOptions()},gd.prototype.addControl=function(t,e){this.controls.add(t,e)},gd.prototype.removeControl=function(t){this.controls.remove(t)},gd.prototype.setTraffic=function(t){var e=this.trafficOptions.incidents,o=this.trafficOptions.flow;if(this.trafficOptions=(new xn).merge(this.trafficOptions,t),this.controls.getControls().filter(function(t){return t instanceof In}).forEach(function(t){return t.updateButtonState()}),this.incidentDelegate&&(this.trafficOptions.incidents?e||this.incidentDelegate.addToMap():this.incidentDelegate.removeFromMap()),this.trafficOptions.flow&&"none"!==this.trafficOptions.flow)try{this.trafficOptions.flow!==o&&this.flowDelegate.addToMap()}catch(t){throw this.trafficOptions.flow=o,t}else this.flowDelegate.removeFromMap()},gd.prototype.getTraffic=function(){return qo(this.trafficOptions)},gd.prototype.remove=function(){this.dispose()},gd.prototype.clear=function(){this.popups.clear(),this.layers.clear(),this.sources.clear(),this.markers.clear()},gd.prototype.dispose=function(){var t;for(this.clear(),this.map.remove(),null!==(t=this.authentication)&&void 0!==t&&t.dispose(),this.removed=!0,window.removeEventListener("resize",this._windowResizeCallback);this.getMapContainer().firstChild;){var e=this.getMapContainer().firstChild;this.getMapContainer().removeChild(e)}},gd.prototype.resize=function(t,e,o){"number"!=typeof t&&"string"!=typeof t||"number"!=typeof e&&"string"!=typeof e?o=t:(t=t,this.getMapContainer().style.height="number"==typeof t?t+"px":t,this.getMapContainer().style.width="number"==typeof e?e+"px":e);e=this.getMapContainer().style.overflow;this.getMapContainer().style.overflow="hidden",this.map.resize(o),this.getMapContainer().style.overflow=e},gd.prototype.pixelsToPositions=function(t){var e,o,n=[];try{for(var r=yd(t),i=r.next();!i.done;i=r.next()){var s=i.value,a=this.map.unproject(s);n.push(new mi(a.lng,a.lat))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n},gd.prototype.positionsToPixels=function(t){var e,o,n=[];try{for(var r=yd(t),i=r.next();!i.done;i=r.next()){var s=i.value,a=this.map.project(s);n.push(new lr(a.x,a.y))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}return n},gd.prototype.areTilesLoaded=function(){return this.map.areTilesLoaded()},gd.prototype.stop=function(){this.map.stop()},gd.prototype.triggerRepaint=function(){this.map.triggerRepaint()},gd.prototype._getMap=function(){return this.map},gd.prototype._rebuildStyle=function(e){return void 0===e&&(e=!0),pd(this,void 0,void 0,function(){return hd(this,function(t){return this.styles.setStyle(this.styleOptions,e),this.imageSprite._restoreImages(),[2]})})},gd.prototype._isLoaded=function(){return this.loaded},gd.prototype._isReady=function(){return this.ready},gd.prototype._getLocalizedStrings=function(){return this.localizedStringsPromise},gd.prototype._sendRequest=function(t,e,o){var n;return(n="function"==typeof this.serviceOptions.transformRequest?this.serviceOptions.transformRequest(t,e):n)?fetch(n.url||t,{credentials:n.credentials,headers:ud(ud({},o),n.headers),method:"GET",mode:"cors"}):fetch(t,{headers:o,method:"GET",mode:"cors"})},gd.prototype._substituteDomainLanguageViewAndSignInRequest=function(t,e){var o,n;(t.includes(d)||t.includes(h))&&(n=new RegExp("[^{]"+d+"[^}]"),t.match(n)&&(e.url=e.url.replace(d,h)),D.protoRegEx.test(this.serviceOptions.domain)?(n=e.url.indexOf(h),e.url=this.serviceOptions.domain+e.url.substring(n+h.length)):e.url=e.url.replace(h,this.serviceOptions.domain)),(e.url.toLocaleLowerCase().includes(this.serviceOptions.domain.toLocaleLowerCase())||e.url.toLocaleLowerCase().includes(this.serviceOptions.staticAssetsDomain.toLocaleLowerCase()))&&null!==(o=this.authentication)&&void 0!==o&&o.signRequest(e),t.includes(m)&&(e.url=e.url.replace(m,this.styleOptions.language)),t.includes(f)&&(e.url=this.styleOptions.view?e.url.replace(f,this.styleOptions.view):e.url.replace(f,"").replace("&"+y+"=",""))},gd.prototype._setAutoResize=function(t){t?window.addEventListener("resize",this._windowResizeCallback):window.removeEventListener("resize",this._windowResizeCallback)},gd.prototype._setStyleComponents=function(e,o){var n=this;void 0===o&&(o=!0),this.removed||this.styles.definitions().then(function(t){n.styleOptions.style&&t.configurations.map(function(t){return t.name}).includes(n.styleOptions.style)||(n.styleOptions.style=t.defaultConfiguration),n.styleOptions=e,n._rebuildStyle(o)})},gd.prototype._updateGlobalDefaults=function(t){t&&(t.authOptions&&!cc&&xc(t.authOptions),t.domain&&!oc&&Oc(t.domain),t.styleDefinitionsPath&&!nc&&Tc(t.styleDefinitionsPath),t.workerCount&&!ic&&Ec(t.workerCount),t.maxParallelImageRequests&&!sc&&Cc(t.maxParallelImageRequests),!t.subscriptionKey&&!t["subscription-key"]||cc||Ac(t.subscriptionKey||t["subscription-key"]),!t.sessionId&&!t["session-id"]||lc||kc(t.sessionId||t["session-id"]),t.language&&!ac&&Pc(t.language),!t.userRegion&&!t.view||ec||Ic(t.userRegion||t.view))},gd.prototype._generateSafeBounds=function(t){if(t){var e=Pi.getSouth(t),o=Pi.getWest(t),n=Pi.getNorth(t),r=Pi.getEast(t);if(!(isFinite(e)&&isFinite(o)&&isFinite(n)&&isFinite(r)))throw new Error("The bounds specified are invalid: ["+t+"]");for(;r<o;)r+=360;return new Pi([o,e,r,n])}return t},gd.prototype._detectHighContrast=function(){var t,e;switch(qc.getHighContrastMode()){case"invert":case"light":t=gd.Css.hcLight,e="high_contrast_light";break;case"dark":t=gd.Css.hcDark,e="high_contrast_dark"}t&&this.map.getContainer().classList.add(t),e&&"road"===this.styleOptions.style&&(this.styleOptions.style=e)},gd.Css={canvasContainer:"atlas-map-canvas-container",canvas:"atlas-map-canvas",container:"atlas-map",hcDark:"high-contrast-dark",hcLight:"high-contrast-light"},gd);function gd(t,e){var n=cd.call(this)||this;n.removed=!1,n.loaded=!1,n.ready=!1,n._windowResizeCallback=function(){return n.resize()};var o,r,i=!0;n._updateGlobalDefaults(e),n.serviceOptions=(new Vh).merge(e),n.styleOptions=(new Bh).merge(e),n.trafficOptions=new xn,n.styles=new sd(n,n.serviceOptions),n.serviceOptions.authOptions.subscriptionKey&&(n.serviceOptions.authOptions.subscriptionKey=encodeURIComponent(n.serviceOptions.authOptions.subscriptionKey)),o=n.serviceOptions.authOptions.clientId||(n.serviceOptions.authOptions.subscriptionKey?n.serviceOptions.authOptions.subscriptionKey.replace(/.(?=.{3,}$)/g,"*"):"invalid-setting"),n.insights&&n.insights.setAuthenticatedUserContext(n.serviceOptions.sessionId,o),arguments[2]&&"ENVIRONMENT"in window&&window.ENVIRONMENT.hmr?(r=arguments[2],n.ready=!0,n.loaded=!0):(t={antialias:n.styleOptions.antialias,attributionControl:!1,container:t,fadeDuration:n.serviceOptions.fadeDuration,localIdeographFontFamily:n.serviceOptions.localIdeographFontFamily,preserveDrawingBuffer:n.styleOptions.preserveDrawingBuffer,refreshExpiredTiles:n.serviceOptions.refreshExpiredTiles,renderWorldCopies:n.styleOptions.renderWorldCopies,trackResize:!1,transformRequest:function(t,e){var o={url:t};return"Tile"===e||"Source"===e?(t.includes(d)&&n.insights&&n.insights.trackEvent({name:"TileLoad"}),n._substituteDomainLanguageViewAndSignInRequest(t,o)):"Style"!==e&&"SpriteJSON"!==e&&"SpriteImage"!==e&&"Glyphs"!==e||n.styles._transformStyleRequest(t,o),n.serviceOptions.transformRequest&&hn(o,n.serviceOptions.transformRequest(o.url,e)),o}},r=new p.Map(t));try{n.map=r,n.authentication=new np(n),n.controls=new sp(n),n.events=new fp(n),n.imageSprite=new _p(n),n.layers=new kp(n),n.markers=new gp(n),n.sources=new Fp(n),n.popups=new Lp(n),n.map.getContainer().classList.add(gd.Css.container),n.map.getCanvasContainer().classList.add(gd.Css.canvasContainer),n.map.getCanvas().classList.add(gd.Css.canvas),n._detectHighContrast(),n.copyrightControl=new Qc({showFeedbackLink:n.styleOptions.showFeedbackLink,showLogo:n.styleOptions.showLogo,customAttribution:n.styleOptions.customAttribution}),n.controls.add(n.copyrightControl,{position:u.ControlPosition.NonFixed});var s=n.authentication?n.authentication.initialize():Promise.resolve();if(n.removed)return n;var a=function(){n.loaded=!0,n.map.off("load",a)};n.map.on("load",a);var l=function(){n.ready=!0,n.map.off("styledata",l),n.events.invoke("ready",{map:n,type:"ready"})};n.map.on("styledata",l),n._setAutoResize(n.styleOptions.autoResize),n.map.showTileBoundaries=n.styleOptions.showTileBoundaries,n.localizedStringsPromise=jl.getStrings(n.styleOptions.language);var c=n.styles.initStyleset();Promise.all([s,c]).then(function(t){t=dd(t,2),t[0],t[1];if(!n.removed){if(n.authentication&&!n.authentication.getToken())throw new Error("AuthenticationManager finished initializing, but no token is available");n.serviceOptions["enable-accessibility"]&&n.accessibleMapDelegate.addToMap(),n._setStyleComponents(n.styleOptions),n.copyrightDelegate&&n.copyrightDelegate.addToMap()}}).catch(function(t){t=t instanceof Error?t:new Error(t);n.insights&&n.insights.trackException({error:t}),n.events.invoke("error",{map:n,type:"error",error:t})}),n.setCamera(ud(ud({minZoom:1},e),{type:"jump",duration:0})),n.incidentDelegate=new Su(n),n.flowDelegate=new yu(n),n.accessibleMapDelegate=new fu(n),n.userInteractionDelegate=new Lu(n,e),n.userInteractionDelegate.addToMap(),n.copyrightDelegate=new Yu(n,n.copyrightControl,n.styleOptions)}catch(t){throw i=!1,n.insights&&n.insights.trackException({error:t instanceof Error?t:new Error(t)}),t}finally{n.insights&&(n.insights.trackEvent({name:"MapLoad"},{success:i,supported:Sc(!1),supportedWithPerformance:Sc(!0)}),n.insights.flush())}return n}var vd=window&&window.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},_d=window&&window.__spreadArray||function(t,e){for(var o=0,n=e.length,r=t.length;o<n;o++,r++)t[r]=e[o];return t},k=(wd.applyTemplate=function(e,o){var n,r,t,i=this,s=document.createElement("div");return s.classList.add(wd.Css.template),e&&("boolean"!=typeof(o=o||{}).singleDescription&&(o.singleDescription=!0),o.sandboxContent="boolean"!=typeof o.sandboxContent||o.sandboxContent,o.title&&"string"==typeof o.content&&(o.content.includes("{title}")||o.content.includes("{name}"))||(e.title?o.title="{title}":e.name&&(o.title="{name}")),"boolean"!=typeof o.detectHyperlinks&&(o.detectHyperlinks=!0),"boolean"!=typeof o.parsePropertyPaths&&(o.parsePropertyPaths=!0),o.textColor&&(s.style.color=o.textColor),o.fillColor&&(s.style.backgroundColor=o.fillColor),o.title&&((t=this._applyStringTemplate(e,o.title,o)).innerText=t.textContent||t.innerText||"",this._appendChild(s,t,wd.Css.title)),(n=document.createElement("div")).classList.add(wd.Css.content),Array.isArray(o.content)?0<o.content.length&&o.content[0].propertyPath?this._appendChild(n,this._generateContent(e,o.content,o),wd.Css.item):o.content.forEach(function(t){i._appendChild(n,i._generateContent(e,t,o),wd.Css.item)}):(r=0,e.description&&Object.keys(e).forEach(function(t){i._ignoreProperty(t,e[t])||r++}),t=void 0,1===r||o.singleDescription&&e.description||2===r&&e.Snippet?(t=document.createElement("div")).innerHTML=e.description:t=this._generateContent(e,o.content,o),this._appendChild(n,t,wd.Css.item)),""!==n.innerHTML&&(o.sandboxContent?s.appendChild(wd._createSandboxedIframe(n,o)):s.appendChild(n))),s},wd._createSandboxedIframe=function(t,e){var o=document.createElement("iframe");o.sandbox.add("allow-popups");var n=t.innerHTML,r=!1,i=100,s=550,a=10,l=0;document.body.scrollWidth<=340&&(s=300,i=50);var c=n.split(/<(tr|div|br|li|h[0-9]|p>)/),l=Math.max.apply(Math,_d([],vd(c.map(function(t){return t.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length}))))-1,t=Math.ceil(3.5*l);t<s&&(s=t,i=l),n.includes("<img")||n.includes("<video")?(r=!0,o.width="550px"):(l=-1<n.indexOf(wd.Css.table)?25:20,a+=Math.max(.5*c.length*l,Math.ceil(n.replace(/<[a-zA-Z0-9\s=\/]+>/g,"").length/i)*l)),o.width=s+"px",o.height=r||280<a?"280px":a+"px";a=e.textColor?"color:"+e.textColor+";":"",e=e.fillColor?"background-color:"+e.fillColor+";":"",n='<html><head><title></title><meta charset="utf-8" /><meta http-equiv="x-ua-compatible" content="IE=Edge" /><link rel="stylesheet" href="'+wd._cssUrl+'" type="text/css"/><style>html, body{margin:0;padding:0;'+a+e+'}</style></head><body><div class="'+wd.Css.template+'" style="padding:0;width:'+(s-20)+'px">'+n+"</div></body></html>";return void 0===o.srcdoc?o.src="data:text/html;charset=utf-8,"+encodeURI(n):o.srcdoc=n,o},wd._appendChild=function(t,e,o){e&&(o&&(e.className=(e.className?e.className+" ":"")+o),t.appendChild(e))},wd._generateContent=function(t,e,o){if(e)return Array.isArray(e)?this._generatePropertyInfoTable(t,e,o):this._applyStringTemplate(t,e,o);t=this._generateDynamicTableHtml(t,null,o);if(t){o=document.createElement("div");return o.innerHTML=t,o}return null},wd._applyStringTemplate=function(t,e,o){if(e){for(var n,r=e,i=this._placeholderRx.exec(e);i;)2<=i.length&&(n=this._getPropertyValue(t,i[1],o),r=r.replace(i[0],n)),i=this._placeholderRx.exec(e);if(r){(r=r.trim()).includes("<")&&(r=r.replace(/[\r\n]+/g,"<br/>"));var s=document.createElement("div");return s.innerHTML=r,s}}return null},wd._getPropertyValue=function(t,e,o,n){var r=o.parsePropertyPaths?e.split("/"):[e],i=r.length;if(0<i&&t){var s=r[0],a=t[s];if(o.detectHyperlinks&&"link"===e&&(!n||n.hyperlinkFormat)){var l,c=[];if(Array.isArray(a)?a.forEach(function(t){t.href?c.push(t):"string"==typeof t&&c.push({href:t})}):a.href&&c.push(a),0<c.length){n&&n.hyperlinkFormat?l=n.hyperlinkFormat:o&&o.hyperlinkFormat&&(l=o.hyperlinkFormat);var u=l&&l.target?l.target:"_blank",p=[];return c.forEach(function(t){t.title||l&&l.label||!t.rel||p.push(t.rel," - "),p.push('<a href="',t.href,'" target="',u,'">'),t.title?p.push(t.title):l&&l.label?p.push(l.label):p.push(t.href),p.push("</a>","<br/>")}),p.pop(),p.join("")}}if(null!=a){for(var h=void 0,h=1;h<i&&(a=a[r[h]],s=r[h],null!=a);h++);if(h===i&&null!=a){var d=void 0;if((d=void 0!==a.value?a.value:a)instanceof Date)return n&&n.dateFormat?d.toLocaleString(void 0,n.dateFormat):o.dateFormat?d.toLocaleString(void 0,o.dateFormat):d.toISOString();if("object"==typeof d)return(y=this._generateDynamicTableHtml(d,r.slice(1),o))||"";if("number"==typeof d){if(n){if(n.dateFormat)return new Date(d).toLocaleString(void 0,n.dateFormat);if(n.numberFormat)return d.toLocaleString(void 0,n.numberFormat)}else if(/(timestamp|date)/gi.test(s))return new Date(d).toISOString();return d.toLocaleString(void 0,o.numberFormat)}if("string"==typeof d&&""!==d&&!/[\n\r<>\s]/g.test(d)&&(o.detectHyperlinks||n&&n.hyperlinkFormat)){var d=d.trim(),f=this._isUrlRx.test(d)||n&&n.hyperlinkFormat,t=this._isImageUrlRx.test(d)&&(f||d.startsWith("data:image")),e=this._emailRx.test(d);if(f||t||e){f=void 0;n&&n.hyperlinkFormat?f=n.hyperlinkFormat:o&&o.hyperlinkFormat&&(f=o.hyperlinkFormat);var y=void 0;y=f&&f.target?' target="'+f.target+'"':' target="_blank"';o=""+(f&&f.label?f.label:d);f&&f.scheme?d=f.scheme+d:e&&(d="mailto:"+d);e=f&&f.label?' alt="'+f.label+'"':"";return'<a href="'+d+'"'+y+">"+(o=f&&f.isImage||t?'<img src="'+d+'" style="max-width:100%"'+e+'"/>':o)+"</a>"}}return d.toString()}}}return""},wd._generatePropertyInfoTable=function(o,t,n){if(o&&t&&0<t.length){var r=[],i=this;r.push('<table class="'+i.Css.table+'">'),t.forEach(function(t){var e=i._getPropertyValue(o,t.propertyPath,n,t);t.hideLabel?r.push('<tr><td colspan="2">',e,"</td></tr>"):(t=t.label||t.propertyPath.split("/")[0],r.push("<tr><th>",t,"</th><td>",e,"</td></tr>"))}),r.push("</table>");t=document.createElement("div");return t.innerHTML=r.join(""),t}return null},wd._generateDynamicTableHtml=function(e,t,o){var n=this;if(e){var r=[],i=this;r.push('<table class="'+i.Css.table+'">');var s=t&&0<t.length?t.join("/")+"/":"",a=0;return(Object.keys(e).forEach(function(t){n._ignoreProperty(t,e[t])||(r.push("<tr><th>",t,"</th><td>",i._getPropertyValue(e,s+t,o),"</td></tr>"),a++)}),0===a)?null:(r.push("</table>"),r.join(""))}return null},wd._ignoreProperty=function(t,e){switch(t){case"title":case"name":case"base":case"popupTemplate":case"anchor":case"icon":case"image":case"imageUrl":case"rotation":case"color":case"size":case"offset":case"strokeColor":case"strokeWidth":case"strokeOpacity":case"subType":case"fillColor":case"fillOpacity":case"visibility":case"visible":return!0;default:if(0===t.indexOf("_")||null==e||""===e)return!0}return!1},wd._placeholderRx=/\{([a-zA-Z0-9_\/\s]+)\}/gi,wd._isUrlRx=/^(http|https|ftp|tel|mailto):\/\//i,wd._isImageUrlRx=/(^data:image|.png$|.jpg$|.jpeg$|.gif$|.bmp$|.svg|.tif|.tiff$)/i,wd._emailRx=/^[^\.\s@:](?:[^\s@:]*[^\s@:\.])?@[^\.\s@]+(?:\.[^\.\s@]+)*$/,wd._cssUrl=new D({domain:e,path:"sdk/javascript/mapcontrol/"+F.getEndpointVersion()+"/atlas.min.css"}).toString(),wd.Css={template:"azure-maps-control-popup-template",title:"azure-maps-control-popup-template-title",content:"azure-maps-control-popup-template-content",item:"azure-maps-control-popup-template-content-item",table:"azure-maps-control-popup-template-table"},wd);function wd(){this.detectHyperlinks=!0,this.parsePropertyPaths=!0}b=new D({domain:e,path:"sdk/javascript/mapcontrol/"+F.getEndpointVersion()+"/mapbox-gl-rtl-text.min.js"});n.setRTLTextPlugin(b.toString(),function(t){t&&console.warn(t)},!0),u.HtmlMarker=Al,u.Map=md,u.Pixel=lr,u.Popup=Sl,u.PopupTemplate=k,u.Shape=xi,u._getAssetDomain=function(){return t},u._getDomain=function(){return Yl},u._hasMaxParallelImageRequests=Dc,u._hasSetAuthenticationOptions=Rc,u._hasSetDomain=Nc,u._hasSetLanguage=zc,u._hasSetSessionId=Bc,u._hasSetStyleDefinitionsPath=Mc,u._hasSetStyleDefinitionsVersion=function(){return rc},u._hasSetView=Fc,u._hasWorkerCount=jc,u.addImageTemplate=function(t,e,o){!o&&Uc[t.toLowerCase()]||(Uc[t.toLowerCase()]=e)},u.clearPrewarmedResources=function(){p.clearPrewarmedResources()},u.control=Tt,u.data=Lt,u.getAllImageTemplateNames=function(){return Object.keys(Uc)},u.getAuthenticationOptions=uc,u.getDomain=hc,u.getImageTemplate=Lc,u.getLanguage=vc,u.getMaxParallelImageRequests=gc,u.getSessionId=_c,u.getStaticAssetsDomain=pc,u.getStyleAPIVersion=yc,u.getStyleDefinitionsPath=dc,u.getStyleDefinitionsVersion=fc,u.getSubscriptionKey=wc,u.getUserRegion=function(){return Zl},u.getVersion=function(){return F.getFullVersion()},u.getView=bc,u.getWorkerCount=mc,u.internal=ot,u.isSupported=Sc,u.layer=At,u.math=It,u.prewarm=function(){p.prewarm()},u.setAuthenticationOptions=xc,u.setDomain=Oc,u.setLanguage=Pc,u.setMaxParallelImageRequests=Cc,u.setSessionId=kc,u.setStyleAPIVersion=function(t){$l=t},u.setStyleDefinitionsPath=Tc,u.setStyleDefinitionsVersion=function(t){Xl=t,rc=!0},u.setSubscriptionKey=Ac,u.setUserRegion=Ic,u.setView=function(t){Zl=t,ec=!0},u.setWorkerCount=Ec,u.source=R,Object.defineProperty(u,"__esModule",{value:!0})});